/*! (c) 2010-2014 shimizu masayuki */!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.nChart=e():t.nChart=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([/*!*************************!*\ !*** ./src/js/entry.js ***! \*************************/ function(t,e,n){e.createAxis=n(/*! ./src/js/charts/createAxis.js */1),e.createVBarChart=n(/*! ./src/js/charts/createVBarChart.js */2),e.createHBarChart=n(/*! ./src/js/charts/createHBarChart.js */3),e.createVGroupBarChart=n(/*! ./src/js/charts/createVGroupBarChart.js */4),e.createHGroupBarChart=n(/*! ./src/js/charts/createHGroupBarChart.js */5),e.createVStackBarChart=n(/*! ./src/js/charts/createVStackBarChart.js */6),e.createHStackBarChart=n(/*! ./src/js/charts/createHStackBarChart.js */7),e.createLineChart=n(/*! ./src/js/charts/createLineChart.js */8),e.createPieChart=n(/*! ./src/js/charts/createPieChart.js */9),e.createSemicircleChart=n(/*! ./src/js/charts/createSemicircleChart.js */10),e.createScatterChart=n(/*! ./src/js/charts/createScatterChart.js */11),e.createSlopeChart=n(/*! ./src/js/charts/createSlopeChart.js */12),e.hover=n(/*! ./src/js/events/hover.js */13),e.drag=n(/*! ./src/js/events/drag.js */14),e.download=n(/*! ./src/js/utility/download.js */15),e.annotation=n(/*! ./src/js/utility/annotation.js */17),e.legend=n(/*! ./src/js/utility/legend.js */18)},/*!*************************************!*\ !*** ./src/js/charts/createAxis.js ***! \*************************************/ function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(d){function D(e){v=t._x,b=t._y,a=t._xScale,s=t._yScale,m=t._baseMargin,y=t._plotMargin,O(),z(t),a.range([0,r]),s.range([i,0]),k&&W(),A&&H(),x&&I(),P&&j(),w&&F(),E&&N(),_(),X(),G(t)}function R(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){D(d)},e)})}function O(t){$=q.clientWidth,Y=q.clientHeight,e=$-(m.left+m.right),n=Y-(m.top+m.bottom),r=e-(y.left+y.right),i=n-(y.top+y.bottom),Q.attr("width",$).attr("height",Y),Z.attr("width",e).attr("height",n).attr("transform","translate("+[m.left,m.top]+")"),et.attr("width",e).attr("height",n).attr("transform","translate("+[m.left,m.top]+")")}function z(t){a=t._xScale,s=t._yScale}function F(){var t=d3.axisRight(s).tickSizeOuter(0).tickFormat(T);u&&t.ticks(u),c&&t.tickValues(c),"number"==typeof p&&t.tickPadding(p);var e=Z.selectAll(".axis.right").data(["dummy"]),n=e.enter().append("g");n.merge(e).attr("transform","translate("+[r+y.left,y.top]+")").attr("class","axis right y").call(t),C?isNaN(a(0))||n.merge(e).each(function(){d3.select(this).select(".domain").attr("transform","translate("+[-(r-a(0)),0]+")")}):n.merge(e).selectAll(".domain").remove()}function I(){var t=d3.axisLeft(s).tickSizeOuter(0).ticks(u).tickFormat(T);u&&t.ticks(u),c&&t.tickValues(c),p&&t.tickPadding(p);var e=Z.selectAll(".axis.left").data(["dummy"]),n=e.enter().append("g");n.merge(e).attr("transform","translate("+[y.left,y.top]+")").attr("class","axis left y").call(t),C?isNaN(a(0))||n.merge(e).each(function(){d3.select(this).select(".domain").attr("transform","translate("+[a(0),0]+")")}):n.merge(e).selectAll(".domain").remove()}function N(){var t=d3.axisTop(a).tickSizeOuter(0).tickFormat(V);h&&t.ticks(h),f&&t.tickValues(f),"number"==typeof g&&t.tickPadding(g);var e=Z.selectAll(".axis.top").data(["dummy"]),n=e.enter().append("g");n.merge(e).attr("transform","translate("+[y.left,y.top]+")").attr("class","axis top x").call(t),S?isNaN(s(0))||n.merge(e).each(function(){d3.select(this).select(".domain").attr("transform","translate("+[0,-(i-s(0))]+")")}):n.merge(e).selectAll(".domain").remove()}function j(){var t=d3.axisBottom(a).tickSizeOuter(0).tickFormat(V);h&&t.ticks(h),f&&t.tickValues(f),"number"==typeof g&&t.tickPadding(g);var e=Z.selectAll(".axis.bottom").data(["dummy"]),n=e.enter().append("g");n.merge(e).attr("transform","translate("+[y.left,i+y.top]+")").attr("class","axis bottom x").call(t),S?isNaN(s(0))||n.merge(e).each(function(){d3.select(this).select(".domain").attr("transform","translate("+[0,-(i-s(0))]+")")}):n.merge(e).selectAll(".domain").remove()}function _(){var t=Z.selectAll(".label.y").data(["dummy"]),e=t.enter().append("text").attr("class","label y");t.merge(e).text(function(t){return l}).attr("x",B.x).attr("y",B.y).attr("text-anchor",B["text-anchor"]).attr("dominant-baseline",B["dominant-baseline"]).attr("transform","translate("+[y.left,y.top]+")")}function X(){var t=Z.selectAll(".label.x").data(["dummy"]),e=t.enter().append("text").attr("class","label x");t.merge(e).text(function(t){return o}).attr("x",M.x).attr("y",M.y).attr("text-anchor",M["text-anchor"]).attr("dominant-baseline",M["dominant-baseline"]).attr("transform","translate("+[r+y.left,i+y.top]+")")}function W(){var t=d3.axisLeft(s).tickSizeOuter(0).tickSizeInner(-r).tickFormat(function(t){return null});u&&t.ticks(u);var e=et.selectAll(".grid.y").data(["dummy"]),n=e.enter().append("g").attr("class","grid y");n.merge(e).attr("transform","translate("+[y.left,y.top]+")").call(t),n.merge(e).selectAll(".domain").remove(),n.merge(e).selectAll(".tick line").attr("stroke",null)}function H(){var t=d3.axisBottom(a).tickSizeOuter(0).tickSizeInner(-i).tickFormat(function(t){return null});h&&t.ticks(h);var e=et.selectAll(".grid.x").data(["dummy"]),n=e.enter().append("g");n.merge(e).attr("transform","translate("+[y.left,i+y.top]+")").attr("class","grid x").call(t),n.merge(e).selectAll(".domain").remove(),n.merge(e).selectAll(".tick line").attr("stroke",null)}function G(t){t._enableBindAxis=!0,t._xScale=a,t._yScale=s,t._plotMargin=y,t._x=v,t._y=b}function U(t){t.updateFanctions||(t.updateFanctions=[]),t.updateFanctions.push(D),t.update=function(e){t.updateFanctions.forEach(function(t){t(e)})}}if(!t._enableBindAxis)throw new Error("このセレクターにはAxisをバインドすることができません");var $,Y,q=(Array.isArray||function(t){return"[object Array]"===t.toString()},t.node()),Q=t.selectAll("svg"),Z=Q.selectAll(".axisLayer"),J=Q.selectAll(".backgroundLayer"),K=J.selectAll(".gridLayer").data(["dummy"]),tt=K.enter().append("g").attr("class","gridLayer"),et=K.merge(tt);D(d),L&&R(),U(t)})}var e,n,r,i,a,s,o,l,u,h,c,f,p,g,m={top:0,left:0,bottom:0,right:0},y=null,v=function(){return d},b=function(){return d},x=!0,w=!1,E=!1,P=!0,A=!1,k=!1,S=!0,C=!0,B={x:0,y:0,"text-anchor":"middle","dominant-baseline":"auto"},M={x:"-20",y:0,"text-anchor":"start","dominant-baseline":"auto"},T=function(t){return t},V=function(t){return t},L=!0;return t.getChartWidth=function(t){if(!arguments.length)return r;throw new Error("このメソッドは取得専用です")},t.getChartHeight=function(t){if(!arguments.length)return i;throw new Error("このメソッドは取得専用です")},t.leftAxis=function(t){return arguments.length?(x=t,this):x},t.rightAxis=function(t){return arguments.length?(w=t,this):w},t.topAxis=function(t){return arguments.length?(E=t,this):E},t.bottomAxis=function(t){return arguments.length?(P=t,this):P},t.xTicks=function(t){return arguments.length?(h=t,this):h},t.yTicks=function(t){return arguments.length?(u=t,this):u},t.xTickValues=function(t){return arguments.length?(f=t,this):f},t.yTickValues=function(t){return arguments.length?(c=t,this):c},t.yTickFormat=function(t){return arguments.length?(T=t,this):T},t.xTickFormat=function(t){return arguments.length?(V=t,this):V},t.xTickPadding=function(t){return arguments.length?(g=t,this):g},t.yTickPadding=function(t){return arguments.length?(p=t,this):p},t.xAxisDomainLineVisible=function(t){return arguments.length?(S=t,this):S},t.yAxisDomainLineVisible=function(t){return arguments.length?(C=t,this):C},t.xAxisGridVisible=function(t){return arguments.length?(A=t,this):A},t.yAxisGridVisible=function(t){return arguments.length?(k=t,this):k},t.xAxisLabel=function(t){return arguments.length?(o=t,this):o},t.yAxisLabel=function(t){return arguments.length?(l=t,this):l},t.bottomXAxisLabelOption=function(t){return arguments.length?(Object.keys(t).forEach(function(e){M[e]=t[e]}),this):M},t.leftYAxisLabelOption=function(t){return arguments.length?(Object.keys(t).forEach(function(e){B[e]=t[e]}),this):B},t.responsive=function(t){return arguments.length?(L=t,this):L},t}},/*!******************************************!*\ !*** ./src/js/charts/createVBarChart.js ***! \******************************************/ function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(d){function w(e){if(P(),T(e)){var n=[];Object.keys(e).forEach(function(t){n.push(e[t])}),A(Array.prototype.concat.apply([],n))}else V(e)&&A(e);k(e),S(t)}function E(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){w(d)},e)})}function P(t){B=L.clientWidth,M=L.clientHeight,e=B-(c.left+c.right),n=M-(c.top+c.bottom),r=e-(f.left+f.right),i=n-(f.top+f.bottom),O.attr("width",B).attr("height",M),F.select(".bg").attr("width",B).attr("height",M),_.attr("width",r).attr("height",i).attr("transform","translate("+[c.left+f.left,c.top+f.top]+")")}function A(t){var e=t.map(function(t){return p(t).toString()}),n=d3.max(t,function(t){return g(t)}),c=d3.min(t,function(t){return g(t)});if(c<0)var f=[c,n];else var f=[0,n];a=u?u:e,s=h?h:f,o=[0,r],l=[i,0],v.domain(a),b.domain(s),v.range(o),b.range(l).clamp(!0),v.paddingInner(m).paddingOuter(y)}function k(t){var e=_.selectAll(".bar").data(t);e.exit().remove();var n=e.enter().append("rect").attr("class",function(t){return"bar "+p(t)});e.merge(n).attr("width",v.bandwidth()).attr("height",function(t){var e=Math.abs(b(g(t))-b(0));return e}).attr("transform",function(t){var e=b(Math.max(0,g(t)));return"translate("+[v(p(t)),e]+")"})}function S(t){t._enableBindAxis=!0,t._xScale=v,t._yScale=b,t._baseMargin=c,t._plotMargin=f,t._x=p,t._y=g}function C(t){t.updateFanctions||(t.updateFanctions=[]),t.updateFanctions.push(w),t.update=function(e){t.updateFanctions.forEach(function(t){t(e)})}}var B,M,T=function(t){return"[object Object]"===t.toString()},V=Array.isArray||function(t){return"[object Array]"===t.toString()},L=t.node(),D=t.selectAll("svg").data(["dummy"]),R=D.enter().append("svg").attr("class","vBarChart"),O=D.merge(R),z=R.append("g").classed("backgroundLayer",!0);z.append("rect").classed("bg",!0).attr("fill","white");var F=O.selectAll(".backgroundLayer").merge(z),I=R.append("g").classed("chartLayer",!0),N=O.selectAll(".chartLayer").merge(I),j=I.append("g").classed("plotLayer",!0),_=N.selectAll(".plotLayer").merge(j),X=I.append("g").classed("axisLayer",!0);N.selectAll(".axisLayer").merge(X);w(d),x&&E(),C(t)})}var e,n,r,i,a,s,o,l,u,h,c={top:0,left:0,bottom:0,right:0},f={top:0,left:0,bottom:0,right:0},p=function(){return d},g=function(){return d},m=.1,y=.5,v=d3.scaleBand(),b=d3.scaleLinear(),x=!0;d3.dispatch("mouseover","mousemove","mouseout","click");return t.getChartWidth=function(t){if(!arguments.length)return r;throw new Error("このメソッドは取得専用です")},t.getChartHeight=function(t){if(!arguments.length)return i;throw new Error("このメソッドは取得専用です")},t.baseMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){c[e]=t[e]}),this):c},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){f[e]=t[e]}),this):f},t.x=function(t){return arguments.length?(p=t,this):p},t.y=function(t){return arguments.length?(g=t,this):g},t.xScale=function(t){return arguments.length?(v=t,this):v},t.yScale=function(t){return arguments.length?(b=t,this):b},t.xScaleDomain=function(t){return arguments.length?(u=t,this):a},t.yScaleDomain=function(t){return arguments.length?(h=t,this):s},t.xScalePaddingInner=function(t){return arguments.length?(m=t,this):m},t.xScalePaddingOuter=function(t){return arguments.length?(y=t,this):y},t.responsive=function(t){return arguments.length?(x=t,this):x},t}},/*!******************************************!*\ !*** ./src/js/charts/createHBarChart.js ***! \******************************************/ function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(d){function w(t){if(P(),T(t)){var e=[];Object.keys(t).forEach(function(n){e.push(t[n])}),A(Array.prototype.concat.apply([],e))}else V(t)&&A(t);k(t)}function E(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){w(d)},e)})}function P(){B=L.clientWidth,M=L.clientHeight,e=B-(c.left+c.right),n=M-(c.top+c.bottom),r=e-(f.left+f.right),i=n-(f.top+f.bottom),O.attr("width",B).attr("height",M),F.select(".bg").attr("width",B).attr("height",M),_.attr("width",r).attr("height",i).attr("transform","translate("+[c.left+f.left,c.top+f.top]+")")}function A(e){var n=e.map(function(t){return g(t).toString()}),c=d3.max(e,function(t){return p(t)}),f=d3.min(e,function(t){return p(t)});if(f<0)var d=[f,c];else var d=[0,c];a=u?u:d,s=h?h:n,o=[0,r],l=[i,0],m.domain(a),y.domain(s),m.range(o).clamp(!0),y.rangeRound(l),S(t),y.paddingInner(v).paddingOuter(b)}function k(t){var e=_.selectAll(".bar").data(t);e.exit().remove();var n=e.enter().append("rect").attr("class",function(t){return"bar "+g(t)});e.merge(n).attr("height",y.bandwidth()).attr("width",function(t){var e=Math.abs(m(p(t))-m(0));return e}).attr("transform",function(t){var e=m(Math.min(0,p(t)));return"translate("+[e,y(g(t))]+")"})}function S(t){t._enableBindAxis=!0,t._xScale=m,t._yScale=y,t._baseMargin=c,t._plotMargin=f,t._x=p,t._y=g}function C(t){t.updateFanctions||(t.updateFanctions=[]),t.updateFanctions.push(w),t.update=function(e){t.updateFanctions.forEach(function(t){t(e)})}}var B,M,T=function(t){return"[object Object]"===t.toString()},V=Array.isArray||function(t){return"[object Array]"===t.toString()},L=t.node(),D=t.selectAll("svg").data(["dummy"]),R=D.enter().append("svg").attr("class","hBarChart"),O=D.merge(R),z=R.append("g").classed("backgroundLayer",!0);z.append("rect").classed("bg",!0).attr("fill","white");var F=O.selectAll(".backgroundLayer").merge(z),I=R.append("g").classed("chartLayer",!0),N=O.selectAll(".chartLayer").merge(I),j=I.append("g").classed("plotLayer",!0),_=N.selectAll(".plotLayer").merge(j),X=I.append("g").classed("axisLayer",!0);N.selectAll(".axisLayer").merge(X);w(d),x&&E(),C(t)})}var e,n,r,i,a,s,o,l,u,h,c={top:0,left:0,bottom:0,right:0},f={top:0,left:0,bottom:0,right:0},p=function(){return d},g=function(){return d},m=d3.scaleLinear().nice(),y=d3.scaleBand(),v=.1,b=.2,x=!0;return t.getChartWidth=function(t){if(!arguments.length)return r;throw new Error("このメソッドは取得専用です")},t.getChartHeight=function(t){if(!arguments.length)return i;throw new Error("このメソッドは取得専用です")},t.baseMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){c[e]=t[e]}),this):c},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){f[e]=t[e]}),this):f},t.x=function(t){return arguments.length?(p=t,this):p},t.y=function(t){return arguments.length?(g=t,this):g},t.xScale=function(t){return arguments.length?(m=t,this):m},t.yScale=function(t){return arguments.length?(y=t,this):y},t.xScaleDomain=function(t){return arguments.length?(u=t,this):a},t.yScaleDomain=function(t){return arguments.length?(h=t,this):s},t.xScalePaddingInner=function(t){return arguments.length?(v=t,this):v},t.xScalePaddingOuter=function(t){return arguments.length?(b=t,this):b},t.responsive=function(t){return arguments.length?(x=t,this):x},t}},/*!***********************************************!*\ !*** ./src/js/charts/createVGroupBarChart.js ***! \***********************************************/ function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(d){function P(t){k();var e=d3.nest().key(function(t){return p(t)}).entries(t);S(e),C(e)}function A(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){P(d)},e)})}function k(t){T=L.clientWidth,V=L.clientHeight,e=T-(c.left+c.right),n=V-(c.top+c.bottom),r=e-(f.left+f.right),i=n-(f.top+f.bottom),O.attr("width",T).attr("height",V),F.select(".bg").attr("width",T).attr("height",V),_.attr("width",r).attr("height",i).attr("transform","translate("+[c.left+f.left,c.top+f.top]+")")}function S(e){var n=e.map(function(t){return t.key}),c=d3.max(e.map(function(t){return d3.max(t.values,function(t){return m(t)})})),f=d3.min(e.map(function(t){return d3.min(t.values,function(t){return m(t)})}));if(f<0)var d=[f,c];else var d=[0,c];a=u?u:n,s=h?h:d,o=[0,r],l=[i,0],b.domain(a),w.domain(s),b.range(o),w.range(l).clamp(!0),b.paddingInner(y).paddingOuter(v);var p=d3.set(Array.prototype.concat.apply([],e.map(function(t){return t.values.map(function(t){return g(t)})}))).values();x.domain(p).range([0,b.bandwidth()]),B(t)}function C(t){var e=_.selectAll(".group").data(t,function(t){return t.key}),n=e.enter().append("g").attr("class",function(t,e){return"group group"+e});e.merge(n).attr("transform",function(t){return"translate("+[b(t.key),0]+")"});var r=e.merge(n).selectAll(".bar").data(function(t){return t.values}),i=r.enter().append("rect").attr("class",function(t,e){return"bar bar"+e+" "+p(t)});r.merge(i).attr("width",x.bandwidth()).attr("height",function(t){var e=Math.abs(w(m(t))-w(0));return e}).attr("transform",function(t){var e=w(Math.max(0,m(t)));return"translate("+[x(g(t)),e]+")"})}function B(t){t._enableBindAxis=!0,t._xScale=b,t._yScale=w,t._baseMargin=c,t._plotMargin=f,t._x=p,t._y=m}function M(t){t.updateFanctions||(t.updateFanctions=[]),t.updateFanctions.push(P),t.update=function(e){t.updateFanctions.forEach(function(t){t(e)})}}var T,V,L=(Array.isArray||function(t){return"[object Array]"===t.toString()},t.node()),D=t.selectAll("svg").data(["dummy"]),R=D.enter().append("svg").attr("class","vGroupBarChart"),O=D.merge(R),z=R.append("g").classed("backgroundLayer",!0);z.append("rect").classed("bg",!0).attr("fill","white");var F=O.selectAll(".backgroundLayer").merge(z),I=R.append("g").classed("chartLayer",!0),N=O.selectAll(".chartLayer").merge(I),j=I.append("g").classed("plotLayer",!0),_=N.selectAll(".plotLayer").merge(j),X=I.append("g").classed("axisLayer",!0);N.selectAll(".axisLayer").merge(X);P(d),E&&A(),M(t)})}var e,n,r,i,a,s,o,l,u,h,c={top:0,left:0,bottom:0,right:0},f={top:0,left:0,bottom:0,right:0},p=function(){return d},g=function(t){return t},m=function(){return d},y=.5,v=.5,b=d3.scaleBand(),x=d3.scaleBand(),w=d3.scaleLinear(),E=!0;return t.getChartWidth=function(t){if(!arguments.length)return r;throw new Error("このメソッドは取得専用です")},t.getChartHeight=function(t){if(!arguments.length)return i;throw new Error("このメソッドは取得専用です")},t.baseMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){c[e]=t[e]}),this):c},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){f[e]=t[e]}),this):f},t.x=function(t){return arguments.length?(p=t,this):p},t.y=function(t){return arguments.length?(m=t,this):m},t.xIn=function(t){return arguments.length?(g=t,this):g},t.xScale=function(t){return arguments.length?(b=t,this):b},t.yScale=function(t){return arguments.length?(w=t,this):w},t.xScaleDomain=function(t){return arguments.length?(u=t,this):a},t.yScaleDomain=function(t){return arguments.length?(h=t,this):s},t.xScalePaddingInner=function(t){return arguments.length?(y=t,this):y},t.xScalePaddingOuter=function(t){return arguments.length?(v=t,this):v},t.responsive=function(t){return arguments.length?(E=t,this):E},t}},/*!***********************************************!*\ !*** ./src/js/charts/createHGroupBarChart.js ***! \***********************************************/ function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(d){function P(t){k();var e=d3.nest().key(function(t){return g(t)}).entries(t);S(e),C(e)}function A(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){P(d)},e)})}function k(t){T=L.clientWidth,V=L.clientHeight,e=T-(c.left+c.right),n=V-(c.top+c.bottom),r=e-(f.left+f.right),i=n-(f.top+f.bottom),O.attr("width",T).attr("height",V),F.select(".bg").attr("width",T).attr("height",V),_.attr("width",r).attr("height",i).attr("transform","translate("+[c.left+f.left,c.top+f.top]+")")}function S(e){var n=e.map(function(t){return t.key}),c=d3.max(e.map(function(t){return d3.max(t.values,function(t){return p(t)})})),f=d3.min(e.map(function(t){return d3.min(t.values,function(t){return p(t)})}));if(f<0)var d=[f,c];else var d=[0,c];a=u?u:d,s=h?h:n,o=[0,r],l=[i,0],b.domain(a),w.domain(s),b.range(o).clamp(!0),w.range(l),w.paddingInner(y).paddingOuter(v);var g=d3.set(Array.prototype.concat.apply([],e.map(function(t){return t.values.map(function(t){return m(t)})}))).values();x.domain(g).range([0,w.bandwidth()]),B(t)}function C(t){var e=_.selectAll(".group").data(t,function(t){return t.key}),n=e.enter().append("g").attr("class",function(t,e){return"group group"+e});e.merge(n).attr("transform",function(t){return"translate("+[0,w(t.key)]+")"});var r=e.merge(n).selectAll(".bar").data(function(t){return t.values}),i=r.enter().append("rect").attr("class",function(t,e){return"bar bar"+e+" "+g(t)});r.merge(i).attr("height",x.bandwidth()).attr("width",function(t){var e=Math.abs(b(p(t))-b(0));return e}).attr("transform",function(t){var e=b(p(t)<0?p(t):0);return"translate("+[e,x(m(t))]+")"})}function B(t){t._enableBindAxis=!0,t._xScale=b,t._yScale=w,t._baseMargin=c,t._plotMargin=f,t._x=p,t._y=g}function M(t){t.updateFanctions||(t.updateFanctions=[]),t.updateFanctions.push(P),t.update=function(e){t.updateFanctions.forEach(function(t){t(e)})}}var T,V,L=(Array.isArray||function(t){return"[object Array]"===t.toString()},t.node()),D=t.selectAll("svg").data(["dummy"]),R=D.enter().append("svg").attr("class","hGroupBarChart"),O=D.merge(R),z=R.append("g").classed("backgroundLayer",!0);z.append("rect").classed("bg",!0).attr("fill","white");var F=O.selectAll(".backgroundLayer").merge(z),I=R.append("g").classed("chartLayer",!0),N=O.selectAll(".chartLayer").merge(I),j=I.append("g").classed("plotLayer",!0),_=N.selectAll(".plotLayer").merge(j),X=I.append("g").classed("axisLayer",!0);N.selectAll(".axisLayer").merge(X);P(d),E&&A(),M(t)})}var e,n,r,i,a,s,o,l,u,h,c={top:0,left:0,bottom:0,right:0},f={top:0,left:0,bottom:0,right:0},p=function(){return d},g=function(){return d},m=function(t){return t},y=.5,v=.5,b=d3.scaleLinear(),x=d3.scaleBand(),w=d3.scaleBand(),E=!0;return t.getChartWidth=function(t){if(!arguments.length)return r;throw new Error("このメソッドは取得専用です")},t.getChartHeight=function(t){if(!arguments.length)return i;throw new Error("このメソッドは取得専用です")},t.baseMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){c[e]=t[e]}),this):c},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){f[e]=t[e]}),this):f},t.x=function(t){return arguments.length?(p=t,this):p},t.y=function(t){return arguments.length?(g=t,this):g},t.yIn=function(t){return arguments.length?(m=t,this):m},t.xScale=function(t){return arguments.length?(b=t,this):b},t.yScale=function(t){return arguments.length?(w=t,this):w},t.xScaleDomain=function(t){return arguments.length?(u=t,this):a},t.yScaleDomain=function(t){return arguments.length?(h=t,this):s},t.xScalePaddingInner=function(t){return arguments.length?(y=t,this):y},t.xScalePaddingOuter=function(t){return arguments.length?(v=t,this):v},t.responsive=function(t){return arguments.length?(E=t,this):E},t}},/*!***********************************************!*\ !*** ./src/js/charts/createVStackBarChart.js ***! \***********************************************/ function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(d){function E(t){var e=d3.nest().rollup(function(t){return t.forEach(function(e,n){var r=0==n?0:g(t[n-1])+t[n-1].stackValue;e.stackValue=r}),t}).key(function(t){return p(t)}).entries(t);A(),k(e),S(e)}function P(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){E(d)},e)})}function A(t){M=V.clientWidth,T=V.clientHeight,e=M-(c.left+c.right),n=T-(c.top+c.bottom),r=e-(f.left+f.right),i=n-(f.top+f.bottom),R.attr("width",M).attr("height",T),z.select(".bg").attr("width",M).attr("height",T),j.attr("width",r).attr("height",i).attr("transform","translate("+[c.left+f.left,c.top+f.top]+")")}function k(e){var n=e.map(function(t){return t.key}),c=d3.max(Object.keys(e).map(function(t){var n=d3.sum(e[t].value,function(t){return g(t)});return n})),f=[0,c];a=u?u:n,s=h?h:f,o=[0,r],l=[i,0],y.domain(a),v.domain(s),y.rangeRound(o).paddingInner(b).paddingOuter(x),v.range(l).clamp(!0),C(t)}function S(t){var e=j.selectAll(".group").data(t,function(t){return t.key}),n=e.enter().append("g").attr("class","group");e.merge(n).attr("transform",function(t){var e=(d3.sum(t.value,function(t){return g(t)}),d3.sum(t.value,function(t){return g(t)}));return"translate("+[y(t.key),v(e)]+")"});var r=e.merge(n).selectAll(".bar").data(function(t){return t.value}),a=r.enter().append("rect").attr("class",function(t,e){return"bar bar"+e+" "+m(t)});r.merge(a).attr("stroke","white").attr("width",y.bandwidth()).attr("height",function(t){var e=Math.abs(v(g(t))-v(0));return e}).attr("transform",function(t){return"translate("+[0,i-v(t.stackValue)]+")"})}function C(t){t._enableBindAxis=!0,t._xScale=y,t._yScale=v,t._baseMargin=c,t._plotMargin=f,t._x=p,t._y=g}function B(t){t.updateFanctions||(t.updateFanctions=[]),t.updateFanctions.push(E),t.update=function(e){t.updateFanctions.forEach(function(t){t(e)})}}var M,T,V=(Array.isArray||function(t){return"[object Array]"===t.toString()},t.node()),L=t.selectAll("svg").data(["dummy"]),D=L.enter().append("svg").attr("class","vStackBarChart"),R=L.merge(D),O=D.append("g").classed("backgroundLayer",!0);O.append("rect").classed("bg",!0).attr("fill","white");var z=R.selectAll(".backgroundLayer").merge(O),F=D.append("g").classed("chartLayer",!0),I=R.selectAll(".chartLayer").merge(F),N=F.append("g").classed("plotLayer",!0),j=I.selectAll(".plotLayer").merge(N),_=F.append("g").classed("axisLayer",!0);I.selectAll(".axisLayer").merge(_);E(d),w&&P(),B(t)})}var e,n,r,i,a,s,o,l,u,h,c={top:0,left:0,bottom:0,right:0},f={top:0,left:0,bottom:0,right:0},p=function(){return d},g=function(){return d},m=function(){return d},y=d3.scaleBand(),v=d3.scaleLinear().nice(),b=.1,x=.2,w=!0;return t.getChartWidth=function(t){if(!arguments.length)return r;throw new Error("このメソッドは取得専用です")},t.getChartHeight=function(t){if(!arguments.length)return i;throw new Error("このメソッドは取得専用です")},t.baseMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){c[e]=t[e]}),this):c},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){f[e]=t[e]}),this):f},t.x=function(t){return arguments.length?(p=t,this):p},t.y=function(t){return arguments.length?(g=t,this):g},t.s=function(t){return arguments.length?(m=t,this):m},t.xScale=function(t){return arguments.length?(y=t,this):y},t.yScale=function(t){return arguments.length?(v=t,this):v},t.xScaleDomain=function(t){return arguments.length?(u=t,this):a},t.yScaleDomain=function(t){return arguments.length?(h=t,this):s},t.xScalePaddingInner=function(t){return arguments.length?(b=t,this):b},t.xScalePaddingOuter=function(t){return arguments.length?(x=t,this):x},t.responsive=function(t){return arguments.length?(w=t,this):w},t}},/*!***********************************************!*\ !*** ./src/js/charts/createHStackBarChart.js ***! \***********************************************/ function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(d){function E(t){var e=d3.nest().rollup(function(t){return t.forEach(function(e,n){var r=0==n?0:p(t[n-1])+t[n-1].stackValue;e.stackValue=r}),t}).key(function(t){return g(t)}).entries(t);A(),k(e),S(e)}function P(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){E(d)},e)})}function A(t){M=V.clientWidth,T=V.clientHeight,e=M-(c.left+c.right),n=T-(c.top+c.bottom),r=e-(f.left+f.right),i=n-(f.top+f.bottom),R.attr("width",M).attr("height",T),z.select(".bg").attr("width",M).attr("height",T),_.attr("width",r).attr("height",i).attr("transform","translate("+[c.left+f.left,c.top+f.top]+")")}function k(e){var n=e.map(function(t){return t.key}),c=d3.max(Object.keys(e).map(function(t){var n=d3.sum(e[t].value,function(t){return p(t)});return n})),f=[0,c];a=u?u:f,s=h?h:n,o=[0,r],l=[i,0],y.domain(a),v.domain(s).paddingInner(b).paddingOuter(x),y.range(o).clamp(!0),v.rangeRound(l),C(t)}function S(t){var e=_.selectAll(".group").data(t,function(t){return t.key}),n=e.enter().append("g").attr("class","group");e.merge(n).attr("transform",function(t){return"translate("+[0,v(t.key)]+")"});var r=e.merge(n).selectAll(".bar").data(function(t){return t.value}),i=r.enter().append("rect").attr("class",function(t,e){return"bar bar"+e+" "+m(t)});r.merge(i).attr("stroke","white").attr("height",v.bandwidth()).attr("width",function(t){return y(p(t))}).attr("transform",function(t){return"translate("+[y(t.stackValue),0]+")"})}function C(t){t._enableBindAxis=!0,t._xScale=y,t._yScale=v,t._baseMargin=c,t._plotMargin=f,t._x=p,t._y=g}function B(t){t.updateFanctions||(t.updateFanctions=[]),t.updateFanctions.push(E),t.update=function(e){t.updateFanctions.forEach(function(t){t(e)})}}var M,T,V=(Array.isArray||function(t){return"[object Array]"===t.toString()},t.node()),L=t.selectAll("svg").data(["dummy"]),D=L.enter().append("svg").attr("class","hStackBarChart"),R=L.merge(D),O=D.append("g").classed("backgroundLayer",!0);O.append("rect").classed("bg",!0).attr("fill","white");var z=R.selectAll(".backgroundLayer").merge(O),F=D.append("g").classed("chartLayer",!0),I=R.selectAll(".chartLayer").merge(F),N=F.append("g").classed("axisLayer",!0),j=(I.selectAll(".axisLayer").merge(N),F.append("g").classed("plotLayer",!0)),_=I.selectAll(".plotLayer").merge(j);E(d),w&&P(),B(t)})}var e,n,r,i,a,s,o,l,u,h,c={top:0,left:0,bottom:0,right:0},f={top:0,left:0,bottom:0,right:0},p=function(){return d},g=function(){return d},m=function(){return d},y=d3.scaleLinear().nice(),v=d3.scaleBand(),b=.1,x=.2,w=!0;return t.getChartWidth=function(t){if(!arguments.length)return r;throw new Error("このメソッドは取得専用です")},t.getChartHeight=function(t){if(!arguments.length)return i;throw new Error("このメソッドは取得専用です")},t.baseMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){c[e]=t[e]}),this):c},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){f[e]=t[e]}),this):f},t.x=function(t){return arguments.length?(p=t,this):p},t.y=function(t){return arguments.length?(g=t,this):g},t.s=function(t){return arguments.length?(m=t,this):m},t.xScale=function(t){return arguments.length?(y=t,this):y},t.xScaleDomain=function(t){return arguments.length?(u=t,this):a},t.yScaleDomain=function(t){return arguments.length?(h=t,this):s},t.xScalePaddingInner=function(t){return arguments.length?(b=t,this):b},t.xScalePaddingOuter=function(t){return arguments.length?(x=t,this):x},t.responsive=function(t){return arguments.length?(w=t,this):w},t}},/*!******************************************!*\ !*** ./src/js/charts/createLineChart.js ***! \******************************************/ function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(d){function A(t){if(S(),R(t)){var e=[];Object.keys(t).forEach(function(n){e.push(t[n])}),C(Array.prototype.concat.apply([],e))}else O(t)&&C(t);R(t)?Object.keys(t).forEach(function(e){M(t[e],e)}):O(t)&&M(t,"line1"),P&&B()}function k(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){A(d)},e)})}function S(t){L=z.clientWidth,D=z.clientHeight,e=L-(c.left+c.right),n=D-(c.top+c.bottom),r=e-(f.left+f.right),i=n-(f.top+f.bottom),N.attr("width",L).attr("height",D),X.select(".bg").attr("width",L).attr("height",D),$.attr("width",r).attr("height",i).attr("transform","translate("+[c.left+f.left,c.top+f.top]+")")}function C(e){var n=e.map(function(t){return p(t).toString()}),c=d3.max(e,function(t){return g(t)}),f=d3.min(e,function(t){return g(t)});if(f<0)var d=[f,c];else var d=[0,c];a=u?u:n,s=h?h:d,o=[0,r],l=[i,0],m.domain(a),y.domain(s),m.range(o),y.range(l).clamp(!0),T(t)}function B(){j.select("#lineClip").remove(),$.selectAll(".dashedLine").style("display","inline");var t=j.append("clipPath").attr("id","lineClip");t.append("rect").attr("width",r-m(P)).attr("height",i).attr("fill","black").attr("transform","translate("+[m(P),0]+")")}function M(t,e){var n=$.selectAll("."+e).data([t]),r=n.enter().append("g").attr("class","line "+e);if(r.append("path").attr("class","solidLine").attr("fill","none"),n.merge(r).select(".solidLine").attr("d",Y),r.append("path").attr("class","dashedLine").attr("fill","none").attr("clip-path","url(#lineClip)").style("display","none"),n.merge(r).select(".dashedLine").attr("d",Y),b){var i=n.merge(r).selectAll(".point").data(function(t){return t}),a=i.enter().append("circle").attr("class","point");i.merge(a).each(function(t){g(t)||d3.select(this).remove()}).attr("transform",function(t){return"translate("+[m(p(t)),y(g(t))]+")"}).attr("r",v)}if(x&&w){var s=n.merge(r).selectAll(".label").data(function(t){return t}),o=s.enter().append("text").attr("class","label").attr("text-anchor","start").attr("dominant-baseline","middle").attr("x","0.5em");s.merge(o).each(function(t){g(t)||d3.select(this).remove()}).attr("transform",function(t){return"translate("+[m(p(t)),y(g(t))]+")"}).text(function(t){return w(t)})}}function T(t){t._enableBindAxis=!0,t._xScale=m,t._yScale=y,t._baseMargin=c,t._plotMargin=f,t._x=p,t._y=g}function V(t){t.updateFanctions||(t.updateFanctions=[]),t.updateFanctions.push(A),t.update=function(e){t.updateFanctions.forEach(function(t){t(e)})}}var L,D,R=function(t){return"[object Object]"===t.toString()},O=Array.isArray||function(t){return"[object Array]"===t.toString()},z=t.node(),F=t.selectAll("svg").data(["dummy"]),I=F.enter().append("svg").attr("class","lineChart"),N=F.merge(I),j=I.append("defs"),_=I.append("g").classed("backgroundLayer",!0);_.append("rect").classed("bg",!0).attr("fill","white");var X=N.selectAll(".backgroundLayer").merge(_),W=I.append("g").classed("chartLayer",!0),H=N.selectAll(".chartLayer").merge(W),G=W.append("g").classed("axisLayer",!0),U=(H.selectAll(".axisLayer").merge(G),W.append("g").classed("plotLayer",!0)),$=H.selectAll(".plotLayer").merge(U),Y=d3.line().x(function(t){return m(p(t))}).y(function(t){return y(g(t))}).defined(function(t){return g(t)});A(d),E&&k(),V(t)})}var e,n,r,i,a,s,o,l,u,h,c={top:0,left:0,bottom:0,right:0},f={top:0,left:0,bottom:0,right:0},p=function(){return d},g=function(){return d},m=d3.scalePoint(),y=d3.scaleLinear(),v=4,b=!0,x=!0,w=null,E=!0,P=null;return t.getChartWidth=function(t){if(!arguments.length)return r;throw new Error("このメソッドは取得専用です")},t.getChartHeight=function(t){if(!arguments.length)return i;throw new Error("このメソッドは取得専用です")},t.estimateValueThreshold=function(t){return arguments.length?(P=t,this):P},t.baseMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){c[e]=t[e]}),this):c},t.plotMargin=function(t){return arguments.length?(f=t,this):f},t.x=function(t){return arguments.length?(p=t,this):p},t.y=function(t){return arguments.length?(g=t,this):g},t.xScale=function(t){return arguments.length?(m=t,this):m},t.yScale=function(t){return arguments.length?(y=t,this):y},t.xScaleDomain=function(t){return arguments.length?(u=t,this):a},t.yScaleDomain=function(t){return arguments.length?(h=t,this):s},t.pointRadius=function(t){return arguments.length?(v=t,this):v},t.pointVisible=function(t){return arguments.length?(b=t,this):b},t.pointLabelVisible=function(t){return arguments.length?(x=t,this):x},t.pointLabel=function(t){return arguments.length?(w=t,this):w},t.responsive=function(t){return arguments.length?(E=t,this):E},t}},/*!*****************************************!*\ !*** ./src/js/charts/createPieChart.js ***! \*****************************************/ function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(h){function g(t){y(),v(t)}function m(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){g(h)},e)})}function y(t){b=w.clientWidth,x=w.clientHeight,e=b-(l.left+l.right),n=x-(l.top+l.bottom),r=e-(u.left+u.right),i=n-(u.top+u.bottom);var h=0;Object.keys(u).forEach(function(t){h=u[t]>h?u[t]:h}),a||(a=rh?u[t]:h}),a||(a=rt?u[e]:t}),a=r0)window.navigator.msSaveBlob(a,r);else{var s=window.URL.createObjectURL(a),o=d3.select("body").append("a");o.attr("class","downloadLink").attr("download","chart.svg").attr("href",s).text("test").style("display","none"),o.node().click(),setTimeout(function(){window.URL.revokeObjectURL(s),o.remove()},10)}}function u(t){var e="chart.png",i=d3.select(t).select("svg").attr("xmlns",n.svg).attr("version","1.1").node(),a="data:image/svg+xml;utf8,"+encodeURIComponent((new XMLSerializer).serializeToString(i)),s=d3.select("body").append("canvas").attr("id","drawingArea").attr("width",i.clientWidth).attr("height",i.clientHeight);r||s.style("display","none");var o=s.node().getContext("2d"),l=function(){if(navigator.appVersion.toString().indexOf(".NET")>0){canvg(document.getElementById("drawingArea"),(new XMLSerializer).serializeToString(i));var t=function(t,e){for(var n=atob(t.split(",")[1]),r=[],i=0;i0?d3.select(u).attr("onload",l):u.addEventListener("load",l,!1)}var h,c,f,d=t.node();t.downloadSVG=function(){i(),a();for(var t=s(f),e=t.length;e--;)o(t[e]);l(f),r||(d3.select(f).remove(),d3.select(h).remove())},t.downloadPNG=function(){i(),a();for(var t=s(f),e=t.length;e--;)o(t[e]);u(f),r||(d3.select(f).remove(),d3.select(h).remove())}}var e='',n={xmlns:"http://www.w3.org/2000/xmlns/",xlink:"http://www.w3.org/1999/xlink",svg:"http://www.w3.org/2000/svg"},r=!1;return t.debug=function(t){return arguments.length?(r=t,this):r},t}},/*!************************************!*\ !*** ./src/js/thirdparty/canvg.js ***! \************************************/ function(t,e){!function(){function t(t){var e=[0,0,0],n=function(n,r){var i=t.match(n);null!=i&&(e[r]+=i.length,t=t.replace(n," "))};return t=t.replace(/:not\(([^\)]*)\)/g," $1 "),t=t.replace(/{[^]*/gm," "),n(r,1),n(a,0),n(s,1),n(o,2),n(l,1),n(u,1),t=t.replace(/[\*\s\+>~]/g," "),t=t.replace(/[#\.]/g," "),n(h,2),e.join("")}function e(e){var r={opts:e};r.FRAMERATE=30,r.MAX_VIRTUAL_PIXELS=3e4,r.log=function(t){},1==r.opts.log&&"undefined"!=typeof console&&(r.log=function(t){console.log(t)}),r.init=function(t){var e=0;r.UniqueId=function(){return e++,"canvg"+e},r.Definitions={},r.Styles={},r.StylesSpecificity={},r.Animations=[],r.Images=[],r.ctx=t,r.ViewPort=new function(){this.viewPorts=[],this.Clear=function(){this.viewPorts=[]},this.SetCurrent=function(t,e){this.viewPorts.push({width:t,height:e})},this.RemoveCurrent=function(){this.viewPorts.pop()},this.Current=function(){return this.viewPorts[this.viewPorts.length-1]},this.width=function(){return this.Current().width},this.height=function(){return this.Current().height},this.ComputeSize=function(t){return null!=t&&"number"==typeof t?t:"x"==t?this.width():"y"==t?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}},r.init(),r.ImagesLoaded=function(){for(var t=0;t]*>/,"");var e=new ActiveXObject("Microsoft.XMLDOM");return e.async="false",e.loadXML(t),e},r.Property=function(t,e){this.name=t,this.value=e},r.Property.prototype.getValue=function(){return this.value},r.Property.prototype.hasValue=function(){return null!=this.value&&""!==this.value},r.Property.prototype.numValue=function(){if(!this.hasValue())return 0;var t=parseFloat(this.value);return(this.value+"").match(/%$/)&&(t/=100),t},r.Property.prototype.valueOrDefault=function(t){return this.hasValue()?this.value:t},r.Property.prototype.numValueOrDefault=function(t){return this.hasValue()?this.numValue():t},r.Property.prototype.addOpacity=function(t){var e=this.value;if(null!=t.value&&""!=t.value&&"string"==typeof this.value){var n=new RGBColor(this.value);n.ok&&(e="rgba("+n.r+", "+n.g+", "+n.b+", "+t.numValue()+")")}return new r.Property(this.name,e)},r.Property.prototype.getDefinition=function(){var t=this.value.match(/#([^\)'"]+)/);return t&&(t=t[1]),t||(t=this.value),r.Definitions[t]},r.Property.prototype.isUrlDefinition=function(){return 0==this.value.indexOf("url(")},r.Property.prototype.getFillStyleDefinition=function(t,e){var n=this.getDefinition();if(null!=n&&n.createGradient)return n.createGradient(r.ctx,t,e);if(null!=n&&n.createPattern){if(n.getHrefAttribute().hasValue()){var i=n.attribute("patternTransform");n=n.getHrefAttribute().getDefinition(),i.hasValue()&&(n.attribute("patternTransform",!0).value=i.value)}return n.createPattern(r.ctx,t)}return null},r.Property.prototype.getDPI=function(t){return 96},r.Property.prototype.getEM=function(t){var e=12,n=new r.Property("fontSize",r.Font.Parse(r.ctx.font).fontSize);return n.hasValue()&&(e=n.toPixels(t)),e},r.Property.prototype.getUnits=function(){var t=this.value+"";return t.replace(/[0-9\.\-]/g,"")},r.Property.prototype.toPixels=function(t,e){if(!this.hasValue())return 0;var n=this.value+"";if(n.match(/em$/))return this.numValue()*this.getEM(t);if(n.match(/ex$/))return this.numValue()*this.getEM(t)/2;if(n.match(/px$/))return this.numValue();if(n.match(/pt$/))return this.numValue()*this.getDPI(t)*(1/72);if(n.match(/pc$/))return 15*this.numValue();if(n.match(/cm$/))return this.numValue()*this.getDPI(t)/2.54;if(n.match(/mm$/))return this.numValue()*this.getDPI(t)/25.4;if(n.match(/in$/))return this.numValue()*this.getDPI(t);if(n.match(/%$/))return this.numValue()*r.ViewPort.ComputeSize(t);var i=this.numValue();return e&&i<1?i*r.ViewPort.ComputeSize(t):i},r.Property.prototype.toMilliseconds=function(){if(!this.hasValue())return 0;var t=this.value+"";return t.match(/s$/)?1e3*this.numValue():t.match(/ms$/)?this.numValue():this.numValue()},r.Property.prototype.toRadians=function(){if(!this.hasValue())return 0;var t=this.value+"";return t.match(/deg$/)?this.numValue()*(Math.PI/180):t.match(/grad$/)?this.numValue()*(Math.PI/200):t.match(/rad$/)?this.numValue():this.numValue()*(Math.PI/180)};var a={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};return r.Property.prototype.toTextBaseline=function(){return this.hasValue()?a[this.value]:null},r.Font=new function(){this.Styles="normal|italic|oblique|inherit",this.Variants="normal|small-caps|inherit",this.Weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit",this.CreateFont=function(t,e,n,i,a,s){var o=null!=s?this.Parse(s):this.CreateFont("","","","","",r.ctx.font);return{fontFamily:a||o.fontFamily,fontSize:i||o.fontSize,fontStyle:t||o.fontStyle,fontWeight:n||o.fontWeight,fontVariant:e||o.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var t=this;this.Parse=function(e){for(var n={},i=r.trim(r.compressSpaces(e||"")).split(" "),a={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1},s="",o=0;othis.x2&&(this.x2=t)),null!=e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),ethis.y2&&(this.y2=e))},this.addX=function(t){this.addPoint(t,null)},this.addY=function(t){this.addPoint(null,t)},this.addBoundingBox=function(t){this.addPoint(t.x1,t.y1),this.addPoint(t.x2,t.y2)},this.addQuadraticCurve=function(t,e,n,r,i,a){var s=t+2/3*(n-t),o=e+2/3*(r-e),l=s+1/3*(i-t),u=o+1/3*(a-e);this.addBezierCurve(t,e,s,l,o,u,i,a)},this.addBezierCurve=function(t,e,n,r,a,s,o,l){var u=[t,e],h=[n,r],c=[a,s],f=[o,l];for(this.addPoint(u[0],u[1]),this.addPoint(f[0],f[1]),i=0;i<=1;i++){var d=function(t){return Math.pow(1-t,3)*u[i]+3*Math.pow(1-t,2)*t*h[i]+3*(1-t)*Math.pow(t,2)*c[i]+Math.pow(t,3)*f[i]},p=6*u[i]-12*h[i]+6*c[i],g=-3*u[i]+9*h[i]-9*c[i]+3*f[i],m=3*h[i]-3*u[i];if(0!=g){var y=Math.pow(p,2)-4*m*g;if(!(y<0)){var v=(-p+Math.sqrt(y))/(2*g);0=0;e--)this.transforms[e].unapply(t)},this.applyToPoint=function(t){for(var e=0;eo&&(this.styles[s]=i[s],this.stylesSpecificity[s]=a)}}},null!=t&&1==t.nodeType){for(var e=0;e=this.tokens.length-1},this.isCommandOrEnd=function(){return!!this.isEnd()||null!=this.tokens[this.i+1].match(/^[A-Za-z]$/)},this.isRelativeCommand=function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0}return!1},this.getToken=function(){return this.i++,this.tokens[this.i]},this.getScalar=function(){return parseFloat(this.getToken())},this.nextCommand=function(){this.previousCommand=this.command,this.command=this.getToken()},this.getPoint=function(){var t=new r.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(t)},this.getAsControlPoint=function(){var t=this.getPoint();return this.control=t,t},this.getAsCurrentPoint=function(){var t=this.getPoint();return this.current=t,t},this.getReflectedControlPoint=function(){if("c"!=this.previousCommand.toLowerCase()&&"s"!=this.previousCommand.toLowerCase()&&"q"!=this.previousCommand.toLowerCase()&&"t"!=this.previousCommand.toLowerCase())return this.current;var t=new r.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y);return t},this.makeAbsolute=function(t){return this.isRelativeCommand()&&(t.x+=this.current.x,t.y+=this.current.y),t},this.addMarker=function(t,e,n){null!=n&&this.angles.length>0&&null==this.angles[this.angles.length-1]&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(n)),this.addMarkerAngle(t,null==e?null:e.angleTo(t))},this.addMarkerAngle=function(t,e){this.points.push(t),this.angles.push(e)},this.getMarkerPoints=function(){return this.points},this.getMarkerAngles=function(){for(var t=0;t1&&(c*=Math.sqrt(y),f*=Math.sqrt(y));var v=(p==g?-1:1)*Math.sqrt((Math.pow(c,2)*Math.pow(f,2)-Math.pow(c,2)*Math.pow(m.y,2)-Math.pow(f,2)*Math.pow(m.x,2))/(Math.pow(c,2)*Math.pow(m.y,2)+Math.pow(f,2)*Math.pow(m.x,2)));isNaN(v)&&(v=0);var b=new r.Point(v*c*m.y/f,v*-f*m.x/c),x=new r.Point((o.x+h.x)/2+Math.cos(d)*b.x-Math.sin(d)*b.y,(o.y+h.y)/2+Math.sin(d)*b.x+Math.cos(d)*b.y),w=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))},E=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(w(t)*w(e))},P=function(t,e){return(t[0]*e[1]=1&&(C=0);var B=1-g?1:-1,M=A+B*(C/2),T=new r.Point(x.x+c*Math.cos(M),x.y+f*Math.sin(M));if(e.addMarkerAngle(T,M-B*Math.PI/2),e.addMarkerAngle(h,M-B*Math.PI),n.addPoint(h.x,h.y),null!=t){var E=c>f?c:f,V=c>f?1:c/f,L=c>f?f/c:1;t.translate(x.x,x.y),t.rotate(d),t.scale(V,L),t.arc(0,0,E,A,A+C,1-g),t.scale(1/V,1/L),t.rotate(-d),t.translate(-x.x,-x.y)}}break;case"Z":case"z":null!=t&&t.closePath(),e.current=e.start}return n},this.getMarkers=function(){for(var t=this.PathParser.getMarkerPoints(),e=this.PathParser.getMarkerAngles(),n=[],r=0;r1&&(this.offset=1);var e=this.style("stop-color",!0);""===e.value&&(e.value="#000"),this.style("stop-opacity").hasValue()&&(e=e.addOpacity(this.style("stop-opacity"))),this.color=e.value},r.Element.stop.prototype=new r.Element.ElementBase,r.Element.AnimateBase=function(t){this.base=r.Element.ElementBase,this.base(t),r.Animations.push(this),this.duration=0,this.begin=this.attribute("begin").toMilliseconds(),this.maxDuration=this.begin+this.attribute("dur").toMilliseconds(),this.getProperty=function(){var t=this.attribute("attributeType").value,e=this.attribute("attributeName").value;return"CSS"==t?this.parent.style(e,!0):this.parent.attribute(e,!0)},this.initialValue=null,this.initialUnits="",this.removed=!1,this.calcValue=function(){return""},this.update=function(t){if(null==this.initialValue&&(this.initialValue=this.getProperty().value,this.initialUnits=this.getProperty().getUnits()),this.duration>this.maxDuration){if("indefinite"==this.attribute("repeatCount").value||"indefinite"==this.attribute("repeatDur").value)this.duration=0;else if("freeze"!=this.attribute("fill").valueOrDefault("remove")||this.frozen){if("remove"==this.attribute("fill").valueOrDefault("remove")&&!this.removed)return this.removed=!0,this.getProperty().value=this.parent.animationFrozen?this.parent.animationFrozenValue:this.initialValue,!0}else this.frozen=!0,this.parent.animationFrozen=!0,this.parent.animationFrozenValue=this.getProperty().value;return!1}this.duration=this.duration+t;var e=!1;if(this.beginn&&s.attribute("x").hasValue())break;i+=s.measureTextRecursive(t)}return-1*("end"==r?i:i/2)}return 0},this.renderChild=function(t,e,n){var r=e.children[n];r.attribute("x").hasValue()?(r.x=r.attribute("x").toPixels("x")+e.getAnchorDelta(t,e,n),r.attribute("dx").hasValue()&&(r.x+=r.attribute("dx").toPixels("x"))):(r.attribute("dx").hasValue()&&(e.x+=r.attribute("dx").toPixels("x")),r.x=e.x),e.x=r.x+r.measureText(t),r.attribute("y").hasValue()?(r.y=r.attribute("y").toPixels("y"),r.attribute("dy").hasValue()&&(r.y+=r.attribute("dy").toPixels("y"))):(r.attribute("dy").hasValue()&&(e.y+=r.attribute("dy").toPixels("y")),r.y=e.y),e.y=r.y,r.render(t);for(var n=0;n0&&" "!=e[n-1]&&n0&&" "!=e[n-1]&&(n==e.length-1||" "==e[n+1])&&(a="initial"),"undefined"!=typeof t.glyphs[r]&&(i=t.glyphs[r][a],null==i&&"glyph"==t.glyphs[r].type&&(i=t.glyphs[r]))}else i=t.glyphs[r];return null==i&&(i=t.missingGlyph),i},this.renderChildren=function(t){var e=this.parent.style("font-family").getDefinition();if(null==e)""!=t.fillStyle&&t.fillText(r.compressSpaces(this.getText()),this.x,this.y),""!=t.strokeStyle&&t.strokeText(r.compressSpaces(this.getText()),this.x,this.y);else{var n=this.parent.style("font-size").numValueOrDefault(r.Font.Parse(r.ctx.font).fontSize),i=this.parent.style("font-style").valueOrDefault(r.Font.Parse(r.ctx.font).fontStyle),a=this.getText();e.isRTL&&(a=a.split("").reverse().join(""));for(var s=r.ToNumberArray(this.parent.attribute("dx").value),o=0;o0?"":this.text}},r.Element.tspan.prototype=new r.Element.TextElementBase,r.Element.tref=function(t){this.base=r.Element.TextElementBase,this.base(t),this.getText=function(){var t=this.getHrefAttribute().getDefinition();if(null!=t)return t.children[0].getText()}},r.Element.tref.prototype=new r.Element.TextElementBase,r.Element.a=function(t){this.base=r.Element.TextElementBase,this.base(t),this.hasText=t.childNodes.length>0;for(var e=0;e0){var n=new r.Element.g;n.children=this.children,n.parent=this,n.render(t)}},this.onclick=function(){window.open(this.getHrefAttribute().value)},this.onmousemove=function(){r.ctx.canvas.style.cursor="pointer"}},r.Element.a.prototype=new r.Element.TextElementBase,r.Element.image=function(t){this.base=r.Element.RenderedElementBase,this.base(t);var e=this.getHrefAttribute().value;if(""!=e){var n=e.match(/\.svg$/);if(r.Images.push(this),this.loaded=!1,n)this.img=r.ajax(e),this.loaded=!0;else{this.img=document.createElement("img"),1==r.opts.useCORS&&(this.img.crossOrigin="Anonymous");var i=this;this.img.onload=function(){i.loaded=!0},this.img.onerror=function(){r.log('ERROR: image "'+e+'" not found'),i.loaded=!0},this.img.src=e}this.renderChildren=function(t){var e=this.attribute("x").toPixels("x"),i=this.attribute("y").toPixels("y"),a=this.attribute("width").toPixels("x"),s=this.attribute("height").toPixels("y");0!=a&&0!=s&&(t.save(),n?t.drawSvg(this.img,e,i,a,s):(t.translate(e,i),r.AspectRatio(t,this.attribute("preserveAspectRatio").value,a,this.img.width,s,this.img.height,0,0),t.drawImage(this.img,0,0)),t.restore())},this.getBoundingBox=function(){var t=this.attribute("x").toPixels("x"),e=this.attribute("y").toPixels("y"),n=this.attribute("width").toPixels("x"),i=this.attribute("height").toPixels("y");return new r.BoundingBox(t,e,t+n,e+i)}}},r.Element.image.prototype=new r.Element.RenderedElementBase,r.Element.g=function(t){this.base=r.Element.RenderedElementBase,this.base(t),this.getBoundingBox=function(){for(var t=new r.BoundingBox,e=0;e0)for(var b=y[v].indexOf("url"),x=y[v].indexOf(")",b),w=y[v].substr(b+5,x-b-6),E=r.parseXml(r.ajax(w)),P=E.getElementsByTagName("font"),A=0;A~\.\[:]+)/g,s=/(\.[^\s\+>~\.\[:]+)/g,o=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,l=/(:[\w-]+\([^\)]*\))/gi,u=/(:[^\s\+>~\.\[:]+)/g,h=/([^\s\+>~\.\[:]+)/g}(),"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.drawSvg=function(t,e,n,r,i){canvg(this.canvas,t,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:e,offsetY:n,scaleWidth:r,scaleHeight:i})})},/*!**************************************!*\ !*** ./src/js/utility/annotation.js ***! \**************************************/ function(t,e){t.exports=function(t){function e(t){function e(){r()}function r(){var t=s.selectAll(".annotation").data(n),e=t.enter().append("text").attr("class",function(t,e){return"annotation anno"+e}),r=t.merge(e);r.attr("transform",function(t){return"translate("+[t.x,t.y]+")"}).attr("font-size",function(t){return t.fontSize?t.fontSize:null}).text(function(t){return t.text})}var i=t.select("svg").selectAll(".annotationLayer").data(["dummy"]),a=i.enter().append("g").classed("annotationLayer",!0),s=i.merge(a);e()}var n=[];return e.addAnnotation=function(t){return arguments.length?(n=t,this):n},e}},/*!**********************************!*\ !*** ./src/js/utility/legend.js ***! \**********************************/ function(t,e){t.exports=function(t){function e(t){function e(){var e=t.datum().map(function(t){return n(t)});switch(a(e),r){case"rect":s();break;case"circle":o()}l()}function a(t){f.selectAll(".legend").data(t).enter().append("g").attr("class","legend").attr("transform",function(t,e){return"translate("+[100*e,0]+")"})}function s(){var t=f.selectAll(".legend");t.append("rect").attr("width",i).attr("height",i)}function o(){var t=f.selectAll(".legend");t.append("circle").attr("cy",i/2).attr("r",i)}function l(){var t=f.selectAll(".legend");t.append("text").text(function(t){return t}).attr("x","0.75em").attr("y","0.4em").attr("dominant-baseline","middle")}var u=t._plotMargin,h=t.select("svg").selectAll(".legendLayer").data(["dummy"]),c=h.enter().append("g").classed("legendLayer",!0),f=h.merge(c);f.attr("transform","translate("+[u.left,u.top]+")"),e()}var n,r="rect",i=10;return e.legendType=function(t){return arguments.length?(r=t,this):r},e.category=function(t){return arguments.length?(n=t,this):n},e}}])}); //# sourceMappingURL=nChart.js.map