|
|
|
!function(a){"use strict";function b(a){return a||0===a}function c(a){return"undefined"==typeof a}function d(a){return"undefined"!=typeof a}var e={version:"0.1.28"},f={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",region:"c3-region",regions:"c3-regions",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",area:"c3-area",text:"c3-text",texts:"c3-texts",grid:"c3-grid",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};e.generate=function(e){function g(a,b){if(!(a in e))throw Error(b)}function h(a,b){var c,d,f,g=e;for(c=0;c<a.length;c++){if("object"==typeof g&&!(a[c]in g))return b;if(d=c===a.length-1,f=g[a[c]],!d&&"object"!=typeof f||d&&"object"!=typeof b&&"object"==typeof f&&null!==f)return b;g=f}return g}function i(a){return"url("+document.URL.split("#")[0]+"#"+a+")"}function j(){mi.attr("transform",Zh.main),mi.select("."+f.axisX).attr("transform",Zh.x),mi.select("."+f.axisY).attr("transform",Zh.y),mi.select("."+f.axisY2).attr("transform",Zh.y2),mi.select("."+f.chartArcs).attr("transform",Zh.arc)}function k(){og&&(ni.attr("transform",Zh.context),ni.select("."+f.axisX).attr("transform",Zh.subx))}function l(a){var b=a!==!1?250:0;rg&&oi.transition().duration(b).attr("transform",Zh.legend)}function m(a){j(a),k(a),l(a)}function n(){pf=r(),qf=s(),rf=Q(),sf=P(),hf={top:vg?w("y2"):ei,right:u(),bottom:w(vg?"y":"x")+(vg?0:pg)+($h?0:rf),left:(vg?pg+di:0)+t()},lf=pf-hf.left-hf.right,nf=qf-hf.top-hf.bottom,0>lf&&(lf=0),0>nf&&(nf=0),jf={top:vg?hf.top:qf-pg-($h?0:rf),right:0/0,bottom:20+($h?0:rf),left:vg?ci:hf.left},mf=vg?hf.left-ci-di:lf,of=vg?nf:qf-jf.top-jf.bottom,0>mf&&(mf=0),0>of&&(of=0),kf={top:$h?0:qf-rf,right:0/0,bottom:0,left:$h?pf-sf:0},p(),$h&&Kd(We.data.targets)&&(kf.left=lf/2+uf)}function o(){mi.select("line."+f.xgridFocus).attr("x1",vg?0:-10).attr("x2",vg?lf:-10).attr("y1",vg?-10:hf.top).attr("y2",vg?-10:nf)}function p(){uf=nf/2,tf=.95*uf,vf=Jd(We.data.targets)?.6*tf:0}function q(){var a=vg?f.axisX:f.axisY,b=Ve.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Ve.select(Ye).node().getBoundingClientRect(),e=c.right-d.left-t();return e>0?e:0}function r(){return Ze?Ze:x()}function s(){var a=$e?$e:y();return a>0?a:320}function t(){return Kd(We.data.targets)?0:_e?_e:vg||!Ig||Ng?1:v("y")}function u(){var a=1;return Kd(We.data.targets)?0:af?af:$h?sf+(Rg&&!vg?v("y2"):a):Rg?Wg||vg?a:v("y2"):a}function v(a){var b=gb(a);return b.isInner?20+zb(a):40+zb(a)}function w(a){return"y"!==a||Ig?"y2"!==a||Rg?(gb(a).isInner?30:40)+("y2"===a?-10:0):ei:rg&&!$h?10:1}function x(){return+Ve.select(Ye).style("width").replace("px","")}function y(){return+Ve.select(Ye).style("height").replace("px","")}function z(a){return a?-5:-(hf.left-1)}function A(a){return a?-20:-1}function B(){return z(!vg)}function C(){return A(!vg)}function D(){return z(vg)}function E(){return A(vg)}function F(a){return a?lf+2+4:hf.left+20}function G(a){return a?80:nf+2}function H(){return F(!vg)}function I(){return G(!vg)}function J(){return F(vg)}function K(){return G(vg)}function L(){var a=vg?nf:lf,b=tc(),c=Vb()*(Gd(We.data.targets
|
|
|
|
});if(Object.keys(Wf).length>0){d=[];for(var g in Wf)for(c=0;c<e.length;c++)if(e[c].id===g){d.push(e[c]),e.shift(c);break}e=d.concat(e)}hh&&ke(b),ne(b),mi.selectAll("."+f.shape+"-"+b).each(function(a){ig(a)})}}).on("mouseout",function(a,b){Kd(We.data.targets)||(wd(),ud(),le(b),oe(),mi.selectAll("."+f.shape+"-"+b).each(function(a){jg(a)}))}).on("mousemove",function(a,b){var c;Ph||Kd(We.data.targets)||(c=zc(We.data.targets).map(function(a){return jc(a.values[b])}),td(c,Ve.mouse(this)),vd(c),dg&&(eg||mi.selectAll("."+f.shape+"-"+b).filter(function(a){return fg(a)}).each(function(){var a=Ve.select(this).classed(f.EXPANDED,!0);"circle"===this.nodeName&&a.attr("r",ih),ki.select("."+f.eventRect+"-"+b).style("cursor",null)}).filter(function(){return"circle"===this.nodeName?Xd(this,jh):"path"===this.nodeName?Yd(this):void 0}).each(function(){var a=Ve.select(this);a.classed(f.EXPANDED)||(a.classed(f.EXPANDED,!0),"circle"===this.nodeName&&a.attr("r",jh)),ki.select("."+f.eventRect+"-"+b).style("cursor","pointer")})))}).on("click",function(a,b){return Kd(We.data.targets)?void 0:Qh?void(Qh=!1):void mi.selectAll("."+f.shape+"-"+b).each(function(a){ye(this,a,b)})}).call(Ve.behavior.drag().origin(Object).on("drag",function(){ze(Ve.mouse(this))}).on("dragstart",function(){Ae(Ve.mouse(this))}).on("dragend",function(){Be()})).call(ji).on("dblclick.zoom",null)}function xe(a){a.append("rect").attr("x",0).attr("y",0).attr("width",lf).attr("height",nf).attr("class",f.eventRect).on("mouseout",function(){Kd(We.data.targets)||(wd(),ud(),le())}).on("mousemove",function(){var a,b,c,d;Ph||Kd(We.data.targets)||(a=Ve.mouse(this),b=md(We.data.targets,a),c=od(We.data.targets,b.x),d=c.map(function(a){return jc(a)}),td(d,a),hh&&(le(),ke(b.index,b.id)),vd(d),ae(b,a)<100?(ki.select("."+f.eventRect).style("cursor","pointer"),Rh||(ig(b),Rh=!0)):(ki.select("."+f.eventRect).style("cursor",null),jg(b),Rh=!1))}).on("click",function(){var a,b;Kd(We.data.targets)||(a=Ve.mouse(this),b=md(We.data.targets,a),ae(b,a)<100&&mi.select("."+f.circles+"-"+Xc(b.id)).select("."+f.circle+"-"+b.index).each(function(){ye(this,b,b.index)}))}).call(Ve.behavior.drag().origin(Object).on("drag",function(){ze(Ve.mouse(this))}).on("dragstart",function(){Ae(Ve.mouse(this))}).on("dragend",function(){Be()})).call(ji).on("dblclick.zoom",null)}function ye(a,b,c){var d,e=Ve.select(a),g=e.classed(f.SELECTED),h=!1;"circle"===a.nodeName?(h=Xd(a,1.5*jh),d=ee):"path"===a.nodeName&&(h=Yd(a),d=he),(eg||h)&&(dg&&fg(b)&&(gg||mi.selectAll("."+f.shapes+(eg?Xc(b.id):"")).selectAll("."+f.shape).each(function(a,b){var c=Ve.select(this);c.classed(f.SELECTED)&&d(!1,c.classed(f.SELECTED,!1),a,b)}),e.classed(f.SELECTED,!g),d(!g,e,b,c)),hg(b,a))}function ze(a){var b,c,d,e,g,h,i,j;Kd(We.data.targets)||dg&&(!bf||ji.altDomain)&&gg&&(b=Oh[0],c=Oh[1],d=a[0],e=a[1],g=Math.min(b,d),h=Math.max(b,d),i=eg?hf.top:Math.min(c,e),j=eg?nf:Math.max(c,e),mi.select("."+f.dragarea).attr("x",g).attr("y",i).attr("width",h-g).attr("height",j-i),mi.selectAll("."+f.shapes).selectAll("."+f.shape).filter(function(a){return fg(a)}).each(function(a,b){var c,d,e,k,l,m,n=Ve.select(this),o=n.classed(f.SELECTED),p=n.classed(f.INCLUDED),q=!1;"circle"===this.nodeName?(c=1*n.attr("cx"),d=1*n.attr("cy"),l=ee,q=c>g&&h>c&&d>i&&j>d):"path"===this.nodeName&&(m=pd(this),c=m.x,d=m.y,e=m.width,k=m.height,l=he,q=!(c>h||g>c+e||d>j||i>d+k)),q^p&&(n.classed(f.INCLUDED,!p),n.classed(f.SELECTED,!o),l(!o,n,a,b))}))}function Ae(a){Kd(We.data.targets)||dg&&(Oh=a,mi.select("."+f.chart).append("rect").attr("class",f.dragarea).style("opacity",.1),Ph=!0,mg())}function Be(){Kd(We.data.targets)||dg&&(mi.select("."+f.dragarea).transition().duration(100).style("opacity",0).remove(),mi.selectAll("."+f.shape).classed(f.INCLUDED,!1),Ph=!1,ng())}function Ce(a){var c,e,g,h,i,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,M,N,O,P=zd(),Q=Kd(We.data.targets),R=zc(We.data.targets);if(0!==R.length){if(a=d(a)?a:{},v=d(a.withY)?a.withY:!0,w=d(a.withSubchart)?a.withSubchart:!0,x=d(a.withTransition)?a.withTransition:!0,A=d(a.withTransform)?a.withTransform:!1,B=d(a.withUpdateXD
|