|
|
|
!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.27"},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(){ki.attr("transform",Xh.main),ki.select("."+f.axisX).attr("transform",Xh.x),ki.select("."+f.axisY).attr("transform",Xh.y),ki.select("."+f.axisY2).attr("transform",Xh.y2),ki.select("."+f.chartArcs).attr("transform",Xh.arc)}function k(){mg&&(li.attr("transform",Xh.context),li.select("."+f.axisX).attr("transform",Xh.subx))}function l(a){var b=a!==!1?250:0;pg&&mi.transition().duration(b).attr("transform",Xh.legend)}function m(a){j(a),k(a),l(a)}function n(){nf=q(),of=r(),pf=P(),qf=O(),ff={top:tg?v("y2"):ci,right:t(),bottom:v(tg?"y":"x")+(tg?0:ng)+(Yh?0:pf),left:(tg?ng+bi:0)+s()},jf=nf-ff.left-ff.right,lf=of-ff.top-ff.bottom,0>jf&&(jf=0),0>lf&&(lf=0),gf={top:tg?ff.top:of-ng-(Yh?0:pf),right:0/0,bottom:20+(Yh?0:pf),left:tg?ai:ff.left},kf=tg?ff.left-ai-bi:jf,mf=tg?lf:of-gf.top-gf.bottom,0>kf&&(kf=0),0>mf&&(mf=0),hf={top:Yh?0:of-pf,right:0/0,bottom:0,left:Yh?nf-qf:0},o(),Yh&&Id(Ue.data.targets)&&(hf.left=jf/2+sf)}function o(){sf=lf/2,rf=.95*sf,tf=Hd(Ue.data.targets)?.6*rf:0}function p(){var a=tg?f.axisX:f.axisY,b=Te.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Te.select(We).node().getBoundingClientRect(),e=c.right-d.left-s();return e>0?e:0}function q(){return Xe?Xe:w()}function r(){var a=Ye?Ye:x();return a>0?a:320}function s(){return Id(Ue.data.targets)?0:Ze?Ze:tg||!Gg||Lg?1:u("y")}function t(){var a=1;return Id(Ue.data.targets)?0:$e?$e:Yh?qf+(Pg&&!tg?u("y2"):a):Pg?Ug||tg?a:u("y2"):a}function u(a){var b=fb(a);return b.isInner?20+yb(a):40+yb(a)}function v(a){return"y"!==a||Gg?"y2"!==a||Pg?(fb(a).isInner?30:40)+("y2"===a?-10:0):ci:pg&&!Yh?10:1}function w(){return+Te.select(We).style("width").replace("px","")}function x(){return+Te.select(We).style("height").replace("px","")}function y(a){return a?-5:-(ff.left-1)}function z(a){return a?-20:-1}function A(){return y(!tg)}function B(){return z(!tg)}function C(){return y(tg)}function D(){return z(tg)}function E(a){return a?jf+2+4:ff.left+20}function F(a){return a?80:lf+2}function G(){return E(!tg)}function H(){return F(!tg)}function I(){return E(tg)}function J(){return F(tg)}function K(){var a=tg?lf:jf,b=sc(),c=Ub()*(Ed(Ue.data.targets)?(b-(Kh?.25:1))/b:.98);return b>1?a*c/(b-1):a}function L(a){Zh=a}function M(a){$h=a}function N(a){_h=a}function O(){return pg?Yh?$h
|
|
|
|
}e=d.concat(e)}fh&&ie(b),le(b),ki.selectAll("."+f.shape+"-"+b).each(function(a){gg(a)})}}).on("mouseout",function(a,b){Id(Ue.data.targets)||(ud(),sd(),je(b),me(),ki.selectAll("."+f.shape+"-"+b).each(function(a){hg(a)}))}).on("mousemove",function(a,b){var c;Nh||Id(Ue.data.targets)||(c=yc(Ue.data.targets).map(function(a){return ic(a.values[b])}),rd(c,Te.mouse(this)),td(c),bg&&(cg||ki.selectAll("."+f.shape+"-"+b).filter(function(a){return dg(a)}).each(function(){var a=Te.select(this).classed(f.EXPANDED,!0);"circle"===this.nodeName&&a.attr("r",gh),ii.select("."+f.eventRect+"-"+b).style("cursor",null)}).filter(function(){return"circle"===this.nodeName?Vd(this,hh):"path"===this.nodeName?Wd(this):void 0}).each(function(){var a=Te.select(this);a.classed(f.EXPANDED)||(a.classed(f.EXPANDED,!0),"circle"===this.nodeName&&a.attr("r",hh)),ii.select("."+f.eventRect+"-"+b).style("cursor","pointer")})))}).on("click",function(a,b){return Id(Ue.data.targets)?void 0:Oh?void(Oh=!1):void ki.selectAll("."+f.shape+"-"+b).each(function(a){we(this,a,b)})}).call(Te.behavior.drag().origin(Object).on("drag",function(){xe(Te.mouse(this))}).on("dragstart",function(){ye(Te.mouse(this))}).on("dragend",function(){ze()})).call(hi).on("dblclick.zoom",null)}function ve(a){a.append("rect").attr("x",0).attr("y",0).attr("width",jf).attr("height",lf).attr("class",f.eventRect).on("mouseout",function(){Id(Ue.data.targets)||(ud(),sd(),je())}).on("mousemove",function(){var a,b,c;Nh||Id(Ue.data.targets)||(a=Te.mouse(this),b=ld(Ue.data.targets,a),c=[ic(b)],rd(c,a),fh&&(je(),ie(b.index,b.id)),td(c),$d(b,a)<100?(ii.select("."+f.eventRect).style("cursor","pointer"),Ph||(gg(b),Ph=!0)):(ii.select("."+f.eventRect).style("cursor",null),hg(b),Ph=!1))}).on("click",function(){var a,b;Id(Ue.data.targets)||(a=Te.mouse(this),b=ld(Ue.data.targets,a),$d(b,a)<100&&ki.select("."+f.circles+"-"+Wc(b.id)).select("."+f.circle+"-"+b.index).each(function(){we(this,b,b.index)}))}).call(Te.behavior.drag().origin(Object).on("drag",function(){xe(Te.mouse(this))}).on("dragstart",function(){ye(Te.mouse(this))}).on("dragend",function(){ze()})).call(hi).on("dblclick.zoom",null)}function we(a,b,c){var d,e=Te.select(a),g=e.classed(f.SELECTED),h=!1;"circle"===a.nodeName?(h=Vd(a,1.5*hh),d=ce):"path"===a.nodeName&&(h=Wd(a),d=fe),(cg||h)&&(bg&&dg(b)&&(eg||ki.selectAll("."+f.shapes+(cg?Wc(b.id):"")).selectAll("."+f.shape).each(function(a,b){var c=Te.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)),fg(b,a))}function xe(a){var b,c,d,e,g,h,i,j;Id(Ue.data.targets)||bg&&(!_e||hi.altDomain)&&eg&&(b=Mh[0],c=Mh[1],d=a[0],e=a[1],g=Math.min(b,d),h=Math.max(b,d),i=cg?ff.top:Math.min(c,e),j=cg?lf:Math.max(c,e),ki.select("."+f.dragarea).attr("x",g).attr("y",i).attr("width",h-g).attr("height",j-i),ki.selectAll("."+f.shapes).selectAll("."+f.shape).filter(function(a){return dg(a)}).each(function(a,b){var c,d,e,k,l,m,n=Te.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=ce,q=c>g&&h>c&&d>i&&j>d):"path"===this.nodeName&&(m=nd(this),c=m.x,d=m.y,e=m.width,k=m.height,l=fe,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 ye(a){Id(Ue.data.targets)||bg&&(Mh=a,ki.select("."+f.chart).append("rect").attr("class",f.dragarea).style("opacity",.1),Nh=!0,kg())}function ze(){Id(Ue.data.targets)||bg&&(ki.select("."+f.dragarea).transition().duration(100).style("opacity",0).remove(),ki.selectAll("."+f.shape).classed(f.INCLUDED,!1),Nh=!1,lg())}function Ae(a){var c,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,L,M,N,O=xd(),P=Id(Ue.data.targets),Q=yc(Ue.data.targets);if(0!==Q.length){if(a=d(a)?a:{},u=d(a.withY)?a.withY:!0,v=d(a.withSubchart)?a.withSubchart:!0,w=d(a.withTransition)?a.withTransition:!0,z=d(a.withTransform)?a.withTransform:!1,A=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,B=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,C=d(a.withLegend)?a.withLegend:!1,x=d(a.withTransitionForExit)?a.withTransitionForExit:w,y
|