Skip to content

Instantly share code, notes, and snippets.

@shimizu
Last active February 22, 2017 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shimizu/0b526eab82263c8443108c33e454d221 to your computer and use it in GitHub Desktop.
Save shimizu/0b526eab82263c8443108c33e454d221 to your computer and use it in GitHub Desktop.
module test
license: mit
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title></title>
<style>
html, body {
width: 100%;
height: 100%;
padding: 0px;
margin: 0px;
}
#chart {
width: 100%;
height: 100%;
max-width: 1200px;
max-height: 676px;
min-width: 600px;
min-height: 338px;
}
.bg {
fill:white;
}
.bar {
fill:skyblue;
}
.axisLayer .axis .domain {
stroke: #333333;
}
.axisLayer .tick line {
stroke: #333333;
stroke-width: 1px;
}
.axisLayer .tick text {
fill: #333333;
/*font-family: Oswald, sans-serif;*/
font-size: 14px;
letter-spacing: .05em;
}
.axisLayer .label {
font-size: 12px;
font-weight: normal;
letter-spacing: .05em;
}
.backgroundLayer .grid line {
stroke: #cccccc;
stroke-dasharray: 3,3;
}
.backgroundLayer .grid .domain {
stroke: none;
}
</style>
</head>
<body>
<button id="update">updarte</button>
<div id="chart"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/4.3.0/d3.min.js"></script>
<script src="nChart.js"></script>
<script>
!(function(){
"use strict"
var data = generateData()
var BarChart = nChart.createVGroupBarChart()
.baseMargin({top:100, left:0, bottom:100, right:0})
.plotMargin({top:20, left:100, bottom:20, right:100})
.x(function(d){ return d["年"] })
.xIn(function(d){ return d["国名"] })
.y(function(d){ return d["値"] })
var Axis = nChart.createAxis()
.yAxisGridVisible(true)
var selector = d3.selectAll("#chart")
.datum(data)
.call(BarChart)
.call(Axis)
d3.select("#update").on("click", function(){
selector.update(generateData())
})
}())
function generateData(){
return Array.prototype.concat.apply([], ["日本", "アメリカ", "フランス"].map(function(country){
var array = [2001,2002,2003,2004].map(function(year){
var value = ~~(Math.random() * 100)
return {"国名":country, "年":year, "値":value}
})
return array
}))
}
</script>
</body>
</html>
/*! (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=r<i?r/2:i/2),a-=h,f.outerRadius(a),f.innerRadius(d),s&&f.padAngle(s),o&&f.cornerRadius(o),A.attr("width",b).attr("height",x),S.select(".bg").attr("width",b).attr("height",x),V.attr("width",r).attr("height",i).attr("transform","translate("+[l.left+u.left,l.top+u.top]+")")}function v(t){var e=V.selectAll("g").data([t]),n=e.enter().append("g");e.merge(n).attr("transform","translate("+[r/2,i/2]+")");var a=e.merge(n).selectAll(".arc").data(c(t)),s=a.enter().append("g").classed("arc",!0),o=a.merge(s).selectAll(".cell").data(function(t){return[t]}),l=o.enter().append("path").attr("class","cell").attr("stroke","white");o.merge(l).attr("d",function(t){return f(t)})}var b,x,w=(Array.isArray||function(t){return"[object Array]"===t.toString()},t.node()),E=t.selectAll("svg").data(["dummy"]),P=E.enter().append("svg").attr("class","pieChart"),A=E.merge(P),k=P.append("g").classed("backgroundLayer",!0);k.append("rect").classed("bg",!0).attr("fill","white");var S=A.selectAll(".backgroundLayer").merge(k),C=P.append("g").classed("chartLayer",!0),B=A.selectAll(".chartLayer").merge(C),M=C.append("g").classed("axisLayer",!0),T=(B.selectAll(".axisLayer").merge(M),C.append("g").classed("plotLayer",!0)),V=B.selectAll(".plotLayer").merge(T);g(h),p&&m()})}var e,n,r,i,a,s,o,l={top:0,left:0,bottom:0,right:0},u={top:0,left:0,bottom:0,right:0},h=function(t){return t},c=d3.pie().value(h).sort(null),f=d3.arc(),d=0,p=!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){l[e]=t[e]}),this):l},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){u[e]=t[e]}),this):u},t.value=function(t){return arguments.length?(h=t,this):h},t.outerRaddius=function(t){return arguments.length?(a=t,this):a},t.innerRadius=function(t){return arguments.length?(d=t,this):d},t.padAngle=function(t){return arguments.length?(s=t,this):s},t.cornerRadius=function(t){return arguments.length?(o=t,this):o},t.responsive=function(t){return arguments.length?(p=t,this):p},t}},/*!************************************************!*\
!*** ./src/js/charts/createSemicircleChart.js ***!
\************************************************/
function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(h){function g(t){y(),v(),b(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){x=E.clientWidth,w=E.clientHeight,e=x-(l.left+l.right),n=w-(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=r<i?r/4:i/4),a-=h,f.outerRadius(a),f.innerRadius(d),s&&f.padAngle(s),o&&f.cornerRadius(o),k.attr("width",x).attr("height",w),C.select(".bg").attr("width",x).attr("height",w),M.attr("width",r).attr("height",i).attr("transform","translate("+[l.left+u.left,l.top+u.top]+")")}function v(){var t=0;Object.keys(u).forEach(function(e){t=u[e]>t?u[e]:t}),a=r<i?r:i,a-=t,f.outerRadius(a),f.innerRadius(d),s&&f.padAngle(s),o&&f.cornerRadius(o)}function b(t){var e=M.selectAll("g").data([t]),n=e.enter().append("g");e.merge(n).attr("transform","translate("+[r/2,i]+")");var a=e.merge(n).selectAll(".arc").data(c(t)),s=a.enter().append("g").classed("arc",!0),o=a.merge(s).selectAll(".cell").data(function(t){return console.log(t),[t]}),l=o.enter().append("path").attr("class","cell");o.merge(l).attr("d",function(t){return f(t)}),a.selectAll(".cell").attr("stroke","white")}var x,w,E=(Array.isArray||function(t){return"[object Array]"===t.toString()},t.node()),P=t.selectAll("svg").data(["dummy"]),A=P.enter().append("svg").attr("class","semicircleChart"),k=P.merge(A),S=A.append("g").classed("backgroundLayer",!0);S.append("rect").classed("bg",!0).attr("fill","white");var C=k.selectAll(".backgroundLayer").merge(S),B=A.append("g").classed("chartLayer",!0),M=k.selectAll(".chartLayer").merge(B),T=B.append("g").classed("axisLayer",!0),V=(M.selectAll(".axisLayer").merge(T),B.append("g").classed("plotLayer",!0));M.selectAll(".plotLayer").merge(V);g(h),p&&m()})}var e,n,r,i,a,s,o,l={top:0,left:0,bottom:0,right:0},u={top:0,left:0,bottom:0,right:0},h=function(t){return t},c=d3.pie().value(h).sort(null).startAngle(-Math.PI/2).endAngle(Math.PI/2),f=d3.arc(),d=0,p=!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){l[e]=t[e]}),this):l},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){u[e]=t[e]}),this):u},t.value=function(t){return arguments.length?(h=t,this):h},t.outerRaddius=function(t){return arguments.length?(a=t,this):a},t.innerRadius=function(t){return arguments.length?(d=t,this):d},t.padAngle=function(t){return arguments.length?(s=t,this):s},t.cornerRadius=function(t){return arguments.length?(o=t,this):o},t.responsive=function(t){return arguments.length?(p=t,this):p},t}},/*!*********************************************!*\
!*** ./src/js/charts/createScatterChart.js ***!
\*********************************************/
function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(d){function A(t){if(S(),D(t)){var e=[];Object.keys(t).forEach(function(n){e.push(t[n])}),C(Array.prototype.concat.apply([],e))}else R(t)&&C(t);B(t)}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){V=O.clientWidth,L=O.clientHeight,e=V-(g.left+g.right),n=L-(g.top+g.bottom),r=e-(m.left+m.right),i=n-(m.top+m.bottom),I.attr("width",V).attr("height",L),j.select(".bg").attr("width",V).attr("height",L),H.attr("width",r).attr("height",i).attr("transform","translate("+[g.left+m.left,g.top+m.top]+")")}function C(e){var n=d3.max(e,function(t){return y(t)}),d=d3.min(e,function(t){return y(t)}),g=d3.max(e,function(t){return v(t)}),m=d3.min(e,function(t){return v(t)});if(d<0)var P=[d,n];else var P=[0,n];if(m<0)var A=[m,g];else var A=[0,g];if(a=u?u:P,s=h?h:A,o=[0,r],l=[i,0],b.domain(a),x.domain(s),b.range(o),x.range(l),M(t),p){var k=d3.max(e,function(t){return p(t)}),S=d3.min(e,function(t){return p(t)});if(S<0)var C=[S,k];else var C=[0,k];c||(c=C),f=[1,w],E.domain(c),E.range(f)}}function B(t){var e=H.selectAll(".dot").data(t);e.exit().remove();var n=e.enter().append("circle").attr("class",function(t){return"dot"});p?e.merge(n).attr("r",function(t){return E(p(t))}):e.merge(n).attr("r",w),e.merge(n).attr("transform",function(t){return"translate("+[b(y(t)),x(v(t))]+")"})}function M(t){t._enableBindAxis=!0,t._xScale=b,t._yScale=x,t._baseMargin=g,t._plotMargin=m,t._x=y,t._y=v}function T(t){t.updateFanctions||(t.updateFanctions=[]),t.updateFanctions.push(A),t.update=function(e){t.updateFanctions.forEach(function(t){t(e)})}}var V,L,D=function(t){return"[object Object]"===t.toString()},R=Array.isArray||function(t){return"[object Array]"===t.toString()},O=t.node(),z=t.selectAll("svg").data(["dummy"]),F=z.enter().append("svg").attr("class","scatterChart"),I=z.merge(F),N=F.append("g").classed("backgroundLayer",!0);N.append("rect").classed("bg",!0).attr("fill","white");var j=I.selectAll(".backgroundLayer").merge(N),_=F.append("g").classed("chartLayer",!0),X=I.selectAll(".chartLayer").merge(_),W=_.append("g").classed("plotLayer",!0),H=X.selectAll(".plotLayer").merge(W),G=_.append("g").classed("axisLayer",!0);X.selectAll(".axisLayer").merge(G);A(d),P&&k(),T(t)})}var e,n,r,i,a,s,o,l,u,h,c,f,p,g={top:0,left:0,bottom:0,right:0},m={top:0,left:0,bottom:0,right:0},y=function(){return d},v=function(){return d},b=d3.scaleLinear().nice(),x=d3.scaleLinear().nice(),w=4,E=d3.scaleLinear().nice(),P=!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){g[e]=t[e]}),this):g},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){m[e]=t[e]}),this):m},t.x=function(t){return arguments.length?(y=t,this):y},t.y=function(t){return arguments.length?(v=t,this):v},t.xScale=function(t){return arguments.length?(b=t,this):b},t.yScale=function(t){return arguments.length?(x=t,this):x},t.yScaleDomain=function(t){return arguments.length?(h=t,this):s},t.yScaleDomain=function(t){return arguments.length?(s=t,this):s},t.r=function(t){return arguments.length?(p=t,this):p},t.rSize=function(t){return arguments.length?(w=t,this):w},t.rScale=function(t){return arguments.length?(E=t,this):E},t.rScaleDomain=function(t){return arguments.length?(c=t,this):c},t.responsive=function(t){return arguments.length?(P=t,this):P},t}},/*!*******************************************!*\
!*** ./src/js/charts/createSlopeChart.js ***!
\*******************************************/
function(t,e){t.exports=function(){"use strict";function t(t){t.each(function(E){function P(t){if(k(),L(t)){var e=[];Object.keys(t).forEach(function(n){e.push(t[n])}),S(Array.prototype.concat.apply([],e))}else D(t)&&S(t);C(),B(t)}function A(){var t,e=Math.floor(1e3/60*10);window.addEventListener("resize",function(n){t!==!1&&clearTimeout(t),t=setTimeout(function(){P(E)},e)})}function k(t){T=R.clientWidth,V=R.clientHeight,e=T-(d.left+d.right),n=V-(d.top+d.bottom),r=e-(p.left+p.right),i=n-(p.top+p.bottom),F.attr("width",T).attr("height",V),N.select(".bg").attr("width",T).attr("height",V),W.attr("width",r).attr("height",i).attr("transform","translate("+[d.left+p.left,d.top+p.top]+")"),G.attr("width",r).attr("height",i).attr("transform","translate("+[d.left+p.left,d.top+p.top]+")")}function S(t){var e=d3.extent(t,function(t){return g(t)}),n=d3.extent(t,function(t){return m(t)});y=h?h:y,a=c?c:e,s=f?f:n,o=[0,r],l=[i,0],u=[i,0],v.domain(y),v.range(o),b.domain(a),b.range(l).clamp(!0),x.domain(s),x.range(u).clamp(!0)}function C(){var t=v.domain(),e=W.selectAll(".slopeAxis").data(t),n=e.enter().append("line"),r=e.merge(n).attr("class","slopeAxis");r.attr("x1",function(t){return v(t)}).attr("y1",0).attr("x2",function(t){return v(t)}).attr("y2",i).attr("stroke","black");var a=W.selectAll(".slopeLabel").data(t),s=a.enter().append("text").attr("class","slopeLabel"),o=a.merge(s);o.attr("text-anchor","middle").attr("dominant-baseline","middle").attr("y","-1em").attr("transform",function(t){return"translate("+[v(t),0]+")"}).attr("stroke","black").text(function(t){return t})}function B(t){var e=v.domain(),n=d3.transition().duration(700),r=G.selectAll(".valueGroup").data(t,function(t){return t["市区町村"]});r.exit().remove();var i=r.enter().append("g").attr("class","valueGroup");i.append("line").attr("class","valueLine").attr("x1",function(t){return v(e[0])}).attr("x2",function(t){return v(e[1])}),i.append("text").attr("class","leftLabel").attr("transform",function(t){return"translate("+[v(e[0]),0]+")"}),i.append("text").attr("class","rightLabel").attr("transform",function(t){return"translate("+[v(e[1]),0]+")"});var a=r.merge(i);a.selectAll(".valueLine").transition(n).attr("y1",function(t){return b(g(t))}).attr("y2",function(t){return x(m(t))}).attr("stroke","black"),a.selectAll(".leftLabel").transition(n).attr("text-anchor","end").attr("dominant-baseline","middle").attr("x","-0.5em").attr("transform",function(t){return"translate("+[v(e[0]),b(g(t))]+")"}).text(function(t){return t["市区町村"]}),a.selectAll(".rightLabel").transition(n).attr("text-anchor","start").attr("dominant-baseline","middle").attr("x","0.5em").attr("transform",function(t){return"translate("+[v(e[1]),x(m(t))]+")"}).text(function(t){return t["市区町村"]})}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=function(t){return"[object Object]"===t.toString()},D=Array.isArray||function(t){return"[object Array]"===t.toString()},R=t.node(),O=t.selectAll("svg").data(["dummy"]),z=O.enter().append("svg").attr("class","slopeChart"),F=O.merge(z),I=z.append("g").classed("backgroundLayer",!0);I.append("rect").classed("bg",!0);var N=F.selectAll(".backgroundLayer").merge(I),j=z.append("g").classed("chartLayer",!0),_=F.selectAll(".chartLayer").merge(j),X=j.append("g").classed("axisLayer",!0),W=_.selectAll(".axisLayer").merge(X),H=j.append("g").classed("plotLayer",!0),G=_.selectAll(".plotLayer").merge(H);P(E),w&&A(),M(t)})}var e,n,r,i,a,s,o,l,u,h,c,f,d={top:0,left:0,bottom:0,right:0},p={top:0,left:0,bottom:0,right:0},g=function(t){return t},m=function(t){return t},y=["left","right"],v=d3.scalePoint(),b=d3.scaleLinear(),x=d3.scaleLinear(),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){d[e]=t[e]}),this):d},t.plotMargin=function(t){return arguments.length?(Object.keys(t).forEach(function(e){p[e]=t[e]}),this):p},t.l=function(t){return arguments.length?(g=t,this):g},t.r=function(t){return arguments.length?(m=t,this):m},t.lScale=function(t){return arguments.length?(b=t,this):b},t.rScale=function(t){return arguments.length?(x=t,this):x},t.xScaleDomain=function(t){return arguments.length?(h=t,this):y},t.lScaleDomain=function(t){return arguments.length?(c=t,this):a},t.rScaleDomain=function(t){return arguments.length?(f=t,this):s},t.responsive=function(t){return arguments.length?(w=t,this):w},t}},/*!********************************!*\
!*** ./src/js/events/hover.js ***!
\********************************/
function(t,e){t.exports=function(t){function e(e){e.selectAll(t).on("mouseover.hover",function(){d3.select(this).classed("hover",!0)}).on("mouseout.hover",function(){d3.select(this).classed("hover",!1)}).on("touchstart.hover",function(){d3.select(this).classed("hover",!0)}).on("touchend.hover",function(){d3.select(this).classed("hover",!1)})}return e}},/*!*******************************!*\
!*** ./src/js/events/drag.js ***!
\*******************************/
function(t,e){t.exports=function(t){function e(e){function r(t){d3.select(this).attr("transform","translate("+[d3.event.x,d3.event.y]+")")}var i=e.select(t).node().parentNode;n.container(i),e.selectAll(t).classed("dragEnable",!0).call(n.on("drag",r))}var n=d3.drag();return e}},/*!************************************!*\
!*** ./src/js/utility/download.js ***!
\************************************/
function(t,e,n){n(/*! ./src/js/utility/../../js/thirdparty/canvg.js */16),t.exports=function(){function t(t){function i(){h=window.document.createElementNS(n.svg,"svg"),window.document.body.appendChild(h),c=getComputedStyle(h)}function a(){f=d3.select("body").append("div").html(d.outerHTML).node()}function s(t){function e(t){if(t&&t.hasChildNodes())for(var r=t.firstChild;r;)1===r.nodeType&&"SCRIPT"!=r.nodeName&&(n.push(r),e(r)),r=r.nextSibling}var n=[];return n.push(t),e(t),n}function o(t){var e,n,r=getComputedStyle(t),i=Object.keys(t.attributes).map(function(e){return t.attributes[e].name}),a="";for(e=0,n=r.length;e<n;e++){var s=r[e],o=r.getPropertyValue(s);i.some(function(t){return t===s})||o===c.getPropertyValue(s)||(a+=s+":"+o+";")}t.setAttribute("style",a)}function l(t){var r="chart.svg",i=d3.select(t).select("svg").attr("xmlns",n.svg).attr("version","1.1").node(),a=new Blob([e+(new XMLSerializer).serializeToString(i)],{type:"text/xml"});if(navigator.appVersion.toString().indexOf(".NET")>0)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;i<n.length;i++)r.push(n.charCodeAt(i));return new Blob([new Uint8Array(r)],{type:e})},n=s.node().toDataURL("image/png"),a=t(n,"image/png");window.navigator.msSaveBlob(a,e)}else{o.drawImage(u,0,0);var l=s.node().toDataURL("image/png"),h=d3.select("body").append("a").attr("id","downloadLink");h.attr("class","downloadLink").attr("download",e).attr("href",l).text("test").style("display","none"),h.node().click(),r||setTimeout(function(){window.URL.revokeObjectURL(l),s.remove(),h.remove()},10)}},u=new Image;u.src=a,navigator.appVersion.toString().indexOf(".NET")>0?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='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',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<r.Images.length;t++)if(!r.Images[t].loaded)return!1;return!0},r.trim=function(t){return t.replace(/^\s+|\s+$/g,"")},r.compressSpaces=function(t){return t.replace(/[\s\r\t\n]+/gm," ")},r.ajax=function(t){var e;return e=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),e?(e.open("GET",t,!1),e.send(null),e.responseText):null},r.parseXml=function(t){if("undefined"!=typeof Windows&&"undefined"!=typeof Windows.Data&&"undefined"!=typeof Windows.Data.Xml){var e=new Windows.Data.Xml.Dom.XmlDocument,n=new Windows.Data.Xml.Dom.XmlLoadSettings;return n.prohibitDtd=!1,e.loadXml(t,n),e}if(window.DOMParser){var r=new DOMParser;return r.parseFromString(t,"text/xml")}t=t.replace(/<!DOCTYPE svg[^>]*>/,"");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;o<i.length;o++)a.fontStyle||t.Styles.indexOf(i[o])==-1?a.fontVariant||t.Variants.indexOf(i[o])==-1?a.fontWeight||t.Weights.indexOf(i[o])==-1?a.fontSize?"inherit"!=i[o]&&(s+=i[o]):("inherit"!=i[o]&&(n.fontSize=i[o].split("/")[0]),a.fontStyle=a.fontVariant=a.fontWeight=a.fontSize=!0):("inherit"!=i[o]&&(n.fontWeight=i[o]),a.fontStyle=a.fontVariant=a.fontWeight=!0):("inherit"!=i[o]&&(n.fontVariant=i[o]),a.fontStyle=a.fontVariant=!0):("inherit"!=i[o]&&(n.fontStyle=i[o]),a.fontStyle=!0);return""!=s&&(n.fontFamily=s),n}},r.ToNumberArray=function(t){for(var e=r.trim(r.compressSpaces((t||"").replace(/,/g," "))).split(" "),n=0;n<e.length;n++)e[n]=parseFloat(e[n]);return e},r.Point=function(t,e){this.x=t,this.y=e},r.Point.prototype.angleTo=function(t){return Math.atan2(t.y-this.y,t.x-this.x)},r.Point.prototype.applyTransform=function(t){var e=this.x*t[0]+this.y*t[2]+t[4],n=this.x*t[1]+this.y*t[3]+t[5];this.x=e,this.y=n},r.CreatePoint=function(t){var e=r.ToNumberArray(t);return new r.Point(e[0],e[1])},r.CreatePath=function(t){for(var e=r.ToNumberArray(t),n=[],i=0;i<e.length;i+=2)n.push(new r.Point(e[i],e[i+1]));return n},r.BoundingBox=function(t,e,n,r){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.x=function(){return this.x1},this.y=function(){return this.y1},this.width=function(){return this.x2-this.x1},this.height=function(){return this.y2-this.y1},this.addPoint=function(t,e){null!=t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),null!=e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.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<v&&v<1&&(0==i&&this.addX(d(v)),1==i&&this.addY(d(v)));var b=(-p-Math.sqrt(y))/(2*g);0<b&&b<1&&(0==i&&this.addX(d(b)),1==i&&this.addY(d(b)))}}else{if(0==p)continue;var x=-m/p;0<x&&x<1&&(0==i&&this.addX(d(x)),1==i&&this.addY(d(x)))}}},this.isPointInBox=function(t,e){return this.x1<=t&&t<=this.x2&&this.y1<=e&&e<=this.y2},this.addPoint(t,e),this.addPoint(n,r)},r.Transform=function(t){var e=this;this.Type={},this.Type.translate=function(t){this.p=r.CreatePoint(t),this.apply=function(t){t.translate(this.p.x||0,this.p.y||0)},this.unapply=function(t){t.translate(-1*this.p.x||0,-1*this.p.y||0)},this.applyToPoint=function(t){t.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0])}},this.Type.rotate=function(t){var e=r.ToNumberArray(t);this.angle=new r.Property("angle",e[0]),this.cx=e[1]||0,this.cy=e[2]||0,this.apply=function(t){t.translate(this.cx,this.cy),t.rotate(this.angle.toRadians()),t.translate(-this.cx,-this.cy)},this.unapply=function(t){t.translate(this.cx,this.cy),t.rotate(-1*this.angle.toRadians()),t.translate(-this.cx,-this.cy)},this.applyToPoint=function(t){var e=this.angle.toRadians();t.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]),t.applyTransform([Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]),t.applyTransform([1,0,0,1,-this.p.x||0,-this.p.y||0])}},this.Type.scale=function(t){this.p=r.CreatePoint(t),this.apply=function(t){t.scale(this.p.x||1,this.p.y||this.p.x||1)},this.unapply=function(t){t.scale(1/this.p.x||1,1/this.p.y||this.p.x||1)},this.applyToPoint=function(t){t.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}},this.Type.matrix=function(t){this.m=r.ToNumberArray(t),this.apply=function(t){t.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])},this.unapply=function(t){var e=this.m[0],n=this.m[2],r=this.m[4],i=this.m[1],a=this.m[3],s=this.m[5],o=0,l=0,u=1,h=1/(e*(a*u-s*l)-n*(i*u-s*o)+r*(i*l-a*o));t.transform(h*(a*u-s*l),h*(s*o-i*u),h*(r*l-n*u),h*(e*u-r*o),h*(n*s-r*a),h*(r*i-e*s))},this.applyToPoint=function(t){t.applyTransform(this.m)}},this.Type.SkewBase=function(t){this.base=e.Type.matrix,this.base(t),this.angle=new r.Property("angle",t)},this.Type.SkewBase.prototype=new this.Type.matrix,this.Type.skewX=function(t){this.base=e.Type.SkewBase,this.base(t),this.m=[1,0,Math.tan(this.angle.toRadians()),1,0,0]},this.Type.skewX.prototype=new this.Type.SkewBase,this.Type.skewY=function(t){this.base=e.Type.SkewBase,this.base(t),this.m=[1,Math.tan(this.angle.toRadians()),0,1,0,0]},this.Type.skewY.prototype=new this.Type.SkewBase,this.transforms=[],this.apply=function(t){for(var e=0;e<this.transforms.length;e++)this.transforms[e].apply(t)},this.unapply=function(t){for(var e=this.transforms.length-1;e>=0;e--)this.transforms[e].unapply(t)},this.applyToPoint=function(t){for(var e=0;e<this.transforms.length;e++)this.transforms[e].applyToPoint(t)};for(var n=r.trim(r.compressSpaces(t)).replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/),i=0;i<n.length;i++){var a=r.trim(n[i].split("(")[0]),s=n[i].split("(")[1].replace(")",""),o=new this.Type[a](s);o.type=a,this.transforms.push(o)}},r.AspectRatio=function(t,e,n,i,a,s,o,l,u,h){e=r.compressSpaces(e),e=e.replace(/^defer\s/,"");var c=e.split(" ")[0]||"xMidYMid",f=e.split(" ")[1]||"meet",d=n/i,p=a/s,g=Math.min(d,p),m=Math.max(d,p);"meet"==f&&(i*=g,s*=g),"slice"==f&&(i*=m,s*=m),u=new r.Property("refX",u),h=new r.Property("refY",h),u.hasValue()&&h.hasValue()?t.translate(-g*u.toPixels("x"),-g*h.toPixels("y")):(c.match(/^xMid/)&&("meet"==f&&g==p||"slice"==f&&m==p)&&t.translate(n/2-i/2,0),c.match(/YMid$/)&&("meet"==f&&g==d||"slice"==f&&m==d)&&t.translate(0,a/2-s/2),c.match(/^xMax/)&&("meet"==f&&g==p||"slice"==f&&m==p)&&t.translate(n-i,0),c.match(/YMax$/)&&("meet"==f&&g==d||"slice"==f&&m==d)&&t.translate(0,a-s)),"none"==c?t.scale(d,p):"meet"==f?t.scale(g,g):"slice"==f&&t.scale(m,m),t.translate(null==o?0:-o,null==l?0:-l)},r.Element={},r.EmptyProperty=new r.Property("EMPTY",""),r.Element.ElementBase=function(t){if(this.attributes={},this.styles={},this.stylesSpecificity={},this.children=[],this.attribute=function(t,e){var n=this.attributes[t];return null!=n?n:(1==e&&(n=new r.Property(t,""),this.attributes[t]=n),n||r.EmptyProperty)},this.getHrefAttribute=function(){for(var t in this.attributes)if("href"==t||t.match(/:href$/))return this.attributes[t];return r.EmptyProperty},this.style=function(t,e,n){var i=this.styles[t];if(null!=i)return i;var a=this.attribute(t);if(null!=a&&a.hasValue())return this.styles[t]=a,a;if(1!=n){var s=this.parent;if(null!=s){var o=s.style(t);if(null!=o&&o.hasValue())return o}}return 1==e&&(i=new r.Property(t,""),this.styles[t]=i),i||r.EmptyProperty},this.render=function(t){if("none"!=this.style("display").value&&"hidden"!=this.style("visibility").value){if(t.save(),this.attribute("mask").hasValue()){var e=this.attribute("mask").getDefinition();null!=e&&e.apply(t,this)}else if(this.style("filter").hasValue()){var n=this.style("filter").getDefinition();null!=n&&n.apply(t,this)}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}},this.setContext=function(t){},this.clearContext=function(t){},this.renderChildren=function(t){for(var e=0;e<this.children.length;e++)this.children[e].render(t)},this.addChild=function(t,e){var n=t;e&&(n=r.CreateElement(t)),n.parent=this,"title"!=n.type&&this.children.push(n)},this.addStylesFromStyleDefinition=function(){for(var e in r.Styles)if("@"!=e[0]&&n(t,e)){var i=r.Styles[e],a=r.StylesSpecificity[e];if(null!=i)for(var s in i){var o=this.stylesSpecificity[s];"undefined"==typeof o&&(o="000"),a>o&&(this.styles[s]=i[s],this.stylesSpecificity[s]=a)}}},null!=t&&1==t.nodeType){for(var e=0;e<t.attributes.length;e++){var i=t.attributes[e];this.attributes[i.nodeName]=new r.Property(i.nodeName,i.value)}if(this.addStylesFromStyleDefinition(),this.attribute("style").hasValue())for(var a=this.attribute("style").value.split(";"),e=0;e<a.length;e++)if(""!=r.trim(a[e])){var s=a[e].split(":"),o=r.trim(s[0]),l=r.trim(s[1]);this.styles[o]=new r.Property(o,l)}this.attribute("id").hasValue()&&null==r.Definitions[this.attribute("id").value]&&(r.Definitions[this.attribute("id").value]=this);for(var e=0;e<t.childNodes.length;e++){var u=t.childNodes[e];if(1==u.nodeType&&this.addChild(u,!0),this.captureTextNodes&&(3==u.nodeType||4==u.nodeType)){var h=u.value||u.text||u.textContent||"";""!=r.compressSpaces(h)&&this.addChild(new r.Element.tspan(u),!1)}}}},r.Element.RenderedElementBase=function(t){this.base=r.Element.ElementBase,this.base(t),this.setContext=function(t){if(this.style("fill").isUrlDefinition()){var e=this.style("fill").getFillStyleDefinition(this,this.style("fill-opacity"));null!=e&&(t.fillStyle=e)}else if(this.style("fill").hasValue()){var n=this.style("fill");"currentColor"==n.value&&(n.value=this.style("color").value),"inherit"!=n.value&&(t.fillStyle="none"==n.value?"rgba(0,0,0,0)":n.value)}if(this.style("fill-opacity").hasValue()){var n=new r.Property("fill",t.fillStyle);n=n.addOpacity(this.style("fill-opacity")),t.fillStyle=n.value}if(this.style("stroke").isUrlDefinition()){var e=this.style("stroke").getFillStyleDefinition(this,this.style("stroke-opacity"));null!=e&&(t.strokeStyle=e)}else if(this.style("stroke").hasValue()){var i=this.style("stroke");"currentColor"==i.value&&(i.value=this.style("color").value),"inherit"!=i.value&&(t.strokeStyle="none"==i.value?"rgba(0,0,0,0)":i.value)}if(this.style("stroke-opacity").hasValue()){var i=new r.Property("stroke",t.strokeStyle);i=i.addOpacity(this.style("stroke-opacity")),t.strokeStyle=i.value}if(this.style("stroke-width").hasValue()){var a=this.style("stroke-width").toPixels();t.lineWidth=0==a?.001:a}if(this.style("stroke-linecap").hasValue()&&(t.lineCap=this.style("stroke-linecap").value),this.style("stroke-linejoin").hasValue()&&(t.lineJoin=this.style("stroke-linejoin").value),this.style("stroke-miterlimit").hasValue()&&(t.miterLimit=this.style("stroke-miterlimit").value),this.style("stroke-dasharray").hasValue()&&"none"!=this.style("stroke-dasharray").value){var s=r.ToNumberArray(this.style("stroke-dasharray").value);"undefined"!=typeof t.setLineDash?t.setLineDash(s):"undefined"!=typeof t.webkitLineDash?t.webkitLineDash=s:"undefined"==typeof t.mozDash||1==s.length&&0==s[0]||(t.mozDash=s);var o=this.style("stroke-dashoffset").numValueOrDefault(1);"undefined"!=typeof t.lineDashOffset?t.lineDashOffset=o:"undefined"!=typeof t.webkitLineDashOffset?t.webkitLineDashOffset=o:"undefined"!=typeof t.mozDashOffset&&(t.mozDashOffset=o)}if("undefined"!=typeof t.font&&(t.font=r.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").toPixels()+"px":"",this.style("font-family").value).toString()),this.style("transform",!1,!0).hasValue()){var l=new r.Transform(this.style("transform",!1,!0).value);l.apply(t)}if(this.attribute("clip-path",!1,!0).hasValue()){var u=this.attribute("clip-path",!1,!0).getDefinition();null!=u&&u.apply(t)}this.style("opacity").hasValue()&&(t.globalAlpha=this.style("opacity").numValue())}},r.Element.RenderedElementBase.prototype=new r.Element.ElementBase,r.Element.PathElementBase=function(t){this.base=r.Element.RenderedElementBase,this.base(t),this.path=function(t){return null!=t&&t.beginPath(),new r.BoundingBox},this.renderChildren=function(t){this.path(t),r.Mouse.checkPath(this,t),""!=t.fillStyle&&("inherit"!=this.style("fill-rule").valueOrDefault("inherit")?t.fill(this.style("fill-rule").value):t.fill()),""!=t.strokeStyle&&t.stroke();var e=this.getMarkers();if(null!=e){if(this.style("marker-start").isUrlDefinition()){var n=this.style("marker-start").getDefinition();n.render(t,e[0][0],e[0][1])}if(this.style("marker-mid").isUrlDefinition())for(var n=this.style("marker-mid").getDefinition(),i=1;i<e.length-1;i++)n.render(t,e[i][0],e[i][1]);if(this.style("marker-end").isUrlDefinition()){var n=this.style("marker-end").getDefinition();n.render(t,e[e.length-1][0],e[e.length-1][1])}}},this.getBoundingBox=function(){return this.path()},this.getMarkers=function(){return null}},r.Element.PathElementBase.prototype=new r.Element.RenderedElementBase,r.Element.svg=function(t){this.base=r.Element.RenderedElementBase,this.base(t),this.baseClearContext=this.clearContext,this.clearContext=function(t){this.baseClearContext(t),r.ViewPort.RemoveCurrent()},this.baseSetContext=this.setContext,this.setContext=function(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4,"undefined"!=typeof t.font&&"undefined"!=typeof window.getComputedStyle&&(t.font=window.getComputedStyle(t.canvas).getPropertyValue("font")),this.baseSetContext(t),this.attribute("x").hasValue()||(this.attribute("x",!0).value=0),this.attribute("y").hasValue()||(this.attribute("y",!0).value=0),t.translate(this.attribute("x").toPixels("x"),this.attribute("y").toPixels("y"));var e=r.ViewPort.width(),n=r.ViewPort.height();if(this.attribute("width").hasValue()||(this.attribute("width",!0).value="100%"),this.attribute("height").hasValue()||(this.attribute("height",!0).value="100%"),"undefined"==typeof this.root){e=this.attribute("width").toPixels("x"),n=this.attribute("height").toPixels("y");var i=0,a=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(i=-this.attribute("refX").toPixels("x"),a=-this.attribute("refY").toPixels("y")),"visible"!=this.attribute("overflow").valueOrDefault("hidden")&&(t.beginPath(),t.moveTo(i,a),t.lineTo(e,a),t.lineTo(e,n),t.lineTo(i,n),t.closePath(),t.clip())}if(r.ViewPort.SetCurrent(e,n),this.attribute("viewBox").hasValue()){var s=r.ToNumberArray(this.attribute("viewBox").value),o=s[0],l=s[1];e=s[2],n=s[3],r.AspectRatio(t,this.attribute("preserveAspectRatio").value,r.ViewPort.width(),e,r.ViewPort.height(),n,o,l,this.attribute("refX").value,this.attribute("refY").value),r.ViewPort.RemoveCurrent(),r.ViewPort.SetCurrent(s[2],s[3])}}},r.Element.svg.prototype=new r.Element.RenderedElementBase,r.Element.rect=function(t){this.base=r.Element.PathElementBase,this.base(t),this.path=function(t){var e=this.attribute("x").toPixels("x"),n=this.attribute("y").toPixels("y"),i=this.attribute("width").toPixels("x"),a=this.attribute("height").toPixels("y"),s=this.attribute("rx").toPixels("x"),o=this.attribute("ry").toPixels("y");return this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(o=s),this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(s=o),s=Math.min(s,i/2),o=Math.min(o,a/2),null!=t&&(t.beginPath(),t.moveTo(e+s,n),t.lineTo(e+i-s,n),t.quadraticCurveTo(e+i,n,e+i,n+o),t.lineTo(e+i,n+a-o),t.quadraticCurveTo(e+i,n+a,e+i-s,n+a),t.lineTo(e+s,n+a),t.quadraticCurveTo(e,n+a,e,n+a-o),t.lineTo(e,n+o),t.quadraticCurveTo(e,n,e+s,n),t.closePath()),new r.BoundingBox(e,n,e+i,n+a)}},r.Element.rect.prototype=new r.Element.PathElementBase,r.Element.circle=function(t){this.base=r.Element.PathElementBase,this.base(t),this.path=function(t){var e=this.attribute("cx").toPixels("x"),n=this.attribute("cy").toPixels("y"),i=this.attribute("r").toPixels();return null!=t&&(t.beginPath(),t.arc(e,n,i,0,2*Math.PI,!0),t.closePath()),new r.BoundingBox(e-i,n-i,e+i,n+i)}},r.Element.circle.prototype=new r.Element.PathElementBase,r.Element.ellipse=function(t){this.base=r.Element.PathElementBase,this.base(t),this.path=function(t){var e=4*((Math.sqrt(2)-1)/3),n=this.attribute("rx").toPixels("x"),i=this.attribute("ry").toPixels("y"),a=this.attribute("cx").toPixels("x"),s=this.attribute("cy").toPixels("y");return null!=t&&(t.beginPath(),t.moveTo(a,s-i),t.bezierCurveTo(a+e*n,s-i,a+n,s-e*i,a+n,s),t.bezierCurveTo(a+n,s+e*i,a+e*n,s+i,a,s+i),t.bezierCurveTo(a-e*n,s+i,a-n,s+e*i,a-n,s),t.bezierCurveTo(a-n,s-e*i,a-e*n,s-i,a,s-i),t.closePath()),new r.BoundingBox(a-n,s-i,a+n,s+i)}},r.Element.ellipse.prototype=new r.Element.PathElementBase,r.Element.line=function(t){this.base=r.Element.PathElementBase,this.base(t),this.getPoints=function(){return[new r.Point(this.attribute("x1").toPixels("x"),this.attribute("y1").toPixels("y")),new r.Point(this.attribute("x2").toPixels("x"),this.attribute("y2").toPixels("y"))]},this.path=function(t){var e=this.getPoints();return null!=t&&(t.beginPath(),t.moveTo(e[0].x,e[0].y),t.lineTo(e[1].x,e[1].y)),new r.BoundingBox(e[0].x,e[0].y,e[1].x,e[1].y)},this.getMarkers=function(){var t=this.getPoints(),e=t[0].angleTo(t[1]);return[[t[0],e],[t[1],e]]}},r.Element.line.prototype=new r.Element.PathElementBase,r.Element.polyline=function(t){this.base=r.Element.PathElementBase,this.base(t),this.points=r.CreatePath(this.attribute("points").value),this.path=function(t){var e=new r.BoundingBox(this.points[0].x,this.points[0].y);null!=t&&(t.beginPath(),t.moveTo(this.points[0].x,this.points[0].y));for(var n=1;n<this.points.length;n++)e.addPoint(this.points[n].x,this.points[n].y),null!=t&&t.lineTo(this.points[n].x,this.points[n].y);return e},this.getMarkers=function(){for(var t=[],e=0;e<this.points.length-1;e++)t.push([this.points[e],this.points[e].angleTo(this.points[e+1])]);return t.push([this.points[this.points.length-1],t[t.length-1][1]]),t}},r.Element.polyline.prototype=new r.Element.PathElementBase,r.Element.polygon=function(t){this.base=r.Element.polyline,this.base(t),this.basePath=this.path,this.path=function(t){var e=this.basePath(t);return null!=t&&(t.lineTo(this.points[0].x,this.points[0].y),t.closePath()),e}},r.Element.polygon.prototype=new r.Element.polyline,r.Element.path=function(t){this.base=r.Element.PathElementBase,this.base(t);var e=this.attribute("d").value;e=e.replace(/,/gm," ");for(var n=0;n<2;n++)e=e.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");e=e.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2"),e=e.replace(/([0-9])([+\-])/gm,"$1 $2");for(var n=0;n<2;n++)e=e.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");e=e.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 "),e=r.compressSpaces(e),e=r.trim(e),this.PathParser=new function(t){this.tokens=t.split(" "),this.reset=function(){this.i=-1,this.command="",this.previousCommand="",this.start=new r.Point(0,0),this.control=new r.Point(0,0),this.current=new r.Point(0,0),this.points=[],this.angles=[]},this.isEnd=function(){return this.i>=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;t<this.angles.length;t++)if(null==this.angles[t])for(var e=t+1;e<this.angles.length;e++)if(null!=this.angles[e]){this.angles[t]=this.angles[e];break}return this.angles}}(e),this.path=function(t){var e=this.PathParser;e.reset();var n=new r.BoundingBox;for(null!=t&&t.beginPath();!e.isEnd();)switch(e.nextCommand(),e.command){case"M":case"m":var i=e.getAsCurrentPoint();for(e.addMarker(i),n.addPoint(i.x,i.y),null!=t&&t.moveTo(i.x,i.y),e.start=e.current;!e.isCommandOrEnd();){var i=e.getAsCurrentPoint();e.addMarker(i,e.start),n.addPoint(i.x,i.y),null!=t&&t.lineTo(i.x,i.y)}break;case"L":case"l":for(;!e.isCommandOrEnd();){var a=e.current,i=e.getAsCurrentPoint();e.addMarker(i,a),n.addPoint(i.x,i.y),null!=t&&t.lineTo(i.x,i.y)}break;case"H":case"h":for(;!e.isCommandOrEnd();){var s=new r.Point((e.isRelativeCommand()?e.current.x:0)+e.getScalar(),e.current.y);e.addMarker(s,e.current),e.current=s,n.addPoint(e.current.x,e.current.y),null!=t&&t.lineTo(e.current.x,e.current.y)}break;case"V":case"v":for(;!e.isCommandOrEnd();){var s=new r.Point(e.current.x,(e.isRelativeCommand()?e.current.y:0)+e.getScalar());e.addMarker(s,e.current),e.current=s,n.addPoint(e.current.x,e.current.y),null!=t&&t.lineTo(e.current.x,e.current.y)}break;case"C":case"c":for(;!e.isCommandOrEnd();){var o=e.current,l=e.getPoint(),u=e.getAsControlPoint(),h=e.getAsCurrentPoint();e.addMarker(h,u,l),n.addBezierCurve(o.x,o.y,l.x,l.y,u.x,u.y,h.x,h.y),null!=t&&t.bezierCurveTo(l.x,l.y,u.x,u.y,h.x,h.y)}break;case"S":case"s":for(;!e.isCommandOrEnd();){var o=e.current,l=e.getReflectedControlPoint(),u=e.getAsControlPoint(),h=e.getAsCurrentPoint();e.addMarker(h,u,l),n.addBezierCurve(o.x,o.y,l.x,l.y,u.x,u.y,h.x,h.y),null!=t&&t.bezierCurveTo(l.x,l.y,u.x,u.y,h.x,h.y)}break;case"Q":case"q":for(;!e.isCommandOrEnd();){var o=e.current,u=e.getAsControlPoint(),h=e.getAsCurrentPoint();e.addMarker(h,u,u),n.addQuadraticCurve(o.x,o.y,u.x,u.y,h.x,h.y),null!=t&&t.quadraticCurveTo(u.x,u.y,h.x,h.y)}break;case"T":case"t":for(;!e.isCommandOrEnd();){var o=e.current,u=e.getReflectedControlPoint();e.control=u;var h=e.getAsCurrentPoint();e.addMarker(h,u,u),n.addQuadraticCurve(o.x,o.y,u.x,u.y,h.x,h.y),null!=t&&t.quadraticCurveTo(u.x,u.y,h.x,h.y)}break;case"A":case"a":for(;!e.isCommandOrEnd();){var o=e.current,c=e.getScalar(),f=e.getScalar(),d=e.getScalar()*(Math.PI/180),p=e.getScalar(),g=e.getScalar(),h=e.getAsCurrentPoint(),m=new r.Point(Math.cos(d)*(o.x-h.x)/2+Math.sin(d)*(o.y-h.y)/2,-Math.sin(d)*(o.x-h.x)/2+Math.cos(d)*(o.y-h.y)/2),y=Math.pow(m.x,2)/Math.pow(c,2)+Math.pow(m.y,2)/Math.pow(f,2);y>1&&(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]<t[1]*e[0]?-1:1)*Math.acos(E(t,e))},A=P([1,0],[(m.x-b.x)/c,(m.y-b.y)/f]),k=[(m.x-b.x)/c,(m.y-b.y)/f],S=[(-m.x-b.x)/c,(-m.y-b.y)/f],C=P(k,S);E(k,S)<=-1&&(C=Math.PI),E(k,S)>=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;r<t.length;r++)n.push([t[r],e[r]]);return n}},r.Element.path.prototype=new r.Element.PathElementBase,r.Element.pattern=function(t){this.base=r.Element.ElementBase,this.base(t),this.createPattern=function(t,e){var n=this.attribute("width").toPixels("x",!0),i=this.attribute("height").toPixels("y",!0),a=new r.Element.svg;a.attributes.viewBox=new r.Property("viewBox",this.attribute("viewBox").value),a.attributes.width=new r.Property("width",n+"px"),a.attributes.height=new r.Property("height",i+"px"),a.attributes.transform=new r.Property("transform",this.attribute("patternTransform").value),a.children=this.children;var s=document.createElement("canvas");s.width=n,s.height=i;var o=s.getContext("2d");this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&o.translate(this.attribute("x").toPixels("x",!0),this.attribute("y").toPixels("y",!0));for(var l=-1;l<=1;l++)for(var u=-1;u<=1;u++)o.save(),a.attributes.x=new r.Property("x",l*s.width),a.attributes.y=new r.Property("y",u*s.height),a.render(o),o.restore();var h=t.createPattern(s,"repeat");return h}},r.Element.pattern.prototype=new r.Element.ElementBase,r.Element.marker=function(t){this.base=r.Element.ElementBase,this.base(t),this.baseRender=this.render,this.render=function(t,e,n){t.translate(e.x,e.y),"auto"==this.attribute("orient").valueOrDefault("auto")&&t.rotate(n),"strokeWidth"==this.attribute("markerUnits").valueOrDefault("strokeWidth")&&t.scale(t.lineWidth,t.lineWidth),t.save();var i=new r.Element.svg;i.attributes.viewBox=new r.Property("viewBox",this.attribute("viewBox").value),i.attributes.refX=new r.Property("refX",this.attribute("refX").value),i.attributes.refY=new r.Property("refY",this.attribute("refY").value),i.attributes.width=new r.Property("width",this.attribute("markerWidth").value),i.attributes.height=new r.Property("height",this.attribute("markerHeight").value),i.attributes.fill=new r.Property("fill",this.attribute("fill").valueOrDefault("black")),i.attributes.stroke=new r.Property("stroke",this.attribute("stroke").valueOrDefault("none")),i.children=this.children,i.render(t),t.restore(),"strokeWidth"==this.attribute("markerUnits").valueOrDefault("strokeWidth")&&t.scale(1/t.lineWidth,1/t.lineWidth),
"auto"==this.attribute("orient").valueOrDefault("auto")&&t.rotate(-n),t.translate(-e.x,-e.y)}},r.Element.marker.prototype=new r.Element.ElementBase,r.Element.defs=function(t){this.base=r.Element.ElementBase,this.base(t),this.render=function(t){}},r.Element.defs.prototype=new r.Element.ElementBase,r.Element.GradientBase=function(t){this.base=r.Element.ElementBase,this.base(t),this.stops=[];for(var e=0;e<this.children.length;e++){var n=this.children[e];"stop"==n.type&&this.stops.push(n)}this.getGradient=function(){},this.gradientUnits=function(){return this.attribute("gradientUnits").valueOrDefault("objectBoundingBox")},this.attributesToInherit=["gradientUnits"],this.inheritStopContainer=function(t){for(var e=0;e<this.attributesToInherit.length;e++){var n=this.attributesToInherit[e];!this.attribute(n).hasValue()&&t.attribute(n).hasValue()&&(this.attribute(n,!0).value=t.attribute(n).value)}},this.createGradient=function(t,e,n){var i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var a=function(t){if(n.hasValue()){var e=new r.Property("color",t);return e.addOpacity(n).value}return t},s=this.getGradient(t,e);if(null==s)return a(i.stops[i.stops.length-1].color);for(var o=0;o<i.stops.length;o++)s.addColorStop(i.stops[o].offset,a(i.stops[o].color));if(this.attribute("gradientTransform").hasValue()){var l=r.ViewPort.viewPorts[0],u=new r.Element.rect;u.attributes.x=new r.Property("x",-r.MAX_VIRTUAL_PIXELS/3),u.attributes.y=new r.Property("y",-r.MAX_VIRTUAL_PIXELS/3),u.attributes.width=new r.Property("width",r.MAX_VIRTUAL_PIXELS),u.attributes.height=new r.Property("height",r.MAX_VIRTUAL_PIXELS);var h=new r.Element.g;h.attributes.transform=new r.Property("transform",this.attribute("gradientTransform").value),h.children=[u];var c=new r.Element.svg;c.attributes.x=new r.Property("x",0),c.attributes.y=new r.Property("y",0),c.attributes.width=new r.Property("width",l.width),c.attributes.height=new r.Property("height",l.height),c.children=[h];var f=document.createElement("canvas");f.width=l.width,f.height=l.height;var d=f.getContext("2d");return d.fillStyle=s,c.render(d),d.createPattern(f,"no-repeat")}return s}},r.Element.GradientBase.prototype=new r.Element.ElementBase,r.Element.linearGradient=function(t){this.base=r.Element.GradientBase,this.base(t),this.attributesToInherit.push("x1"),this.attributesToInherit.push("y1"),this.attributesToInherit.push("x2"),this.attributesToInherit.push("y2"),this.getGradient=function(t,e){var n="objectBoundingBox"==this.gradientUnits()?e.getBoundingBox():null;this.attribute("x1").hasValue()||this.attribute("y1").hasValue()||this.attribute("x2").hasValue()||this.attribute("y2").hasValue()||(this.attribute("x1",!0).value=0,this.attribute("y1",!0).value=0,this.attribute("x2",!0).value=1,this.attribute("y2",!0).value=0);var r="objectBoundingBox"==this.gradientUnits()?n.x()+n.width()*this.attribute("x1").numValue():this.attribute("x1").toPixels("x"),i="objectBoundingBox"==this.gradientUnits()?n.y()+n.height()*this.attribute("y1").numValue():this.attribute("y1").toPixels("y"),a="objectBoundingBox"==this.gradientUnits()?n.x()+n.width()*this.attribute("x2").numValue():this.attribute("x2").toPixels("x"),s="objectBoundingBox"==this.gradientUnits()?n.y()+n.height()*this.attribute("y2").numValue():this.attribute("y2").toPixels("y");return r==a&&i==s?null:t.createLinearGradient(r,i,a,s)}},r.Element.linearGradient.prototype=new r.Element.GradientBase,r.Element.radialGradient=function(t){this.base=r.Element.GradientBase,this.base(t),this.attributesToInherit.push("cx"),this.attributesToInherit.push("cy"),this.attributesToInherit.push("r"),this.attributesToInherit.push("fx"),this.attributesToInherit.push("fy"),this.getGradient=function(t,e){var n=e.getBoundingBox();this.attribute("cx").hasValue()||(this.attribute("cx",!0).value="50%"),this.attribute("cy").hasValue()||(this.attribute("cy",!0).value="50%"),this.attribute("r").hasValue()||(this.attribute("r",!0).value="50%");var r="objectBoundingBox"==this.gradientUnits()?n.x()+n.width()*this.attribute("cx").numValue():this.attribute("cx").toPixels("x"),i="objectBoundingBox"==this.gradientUnits()?n.y()+n.height()*this.attribute("cy").numValue():this.attribute("cy").toPixels("y"),a=r,s=i;this.attribute("fx").hasValue()&&(a="objectBoundingBox"==this.gradientUnits()?n.x()+n.width()*this.attribute("fx").numValue():this.attribute("fx").toPixels("x")),this.attribute("fy").hasValue()&&(s="objectBoundingBox"==this.gradientUnits()?n.y()+n.height()*this.attribute("fy").numValue():this.attribute("fy").toPixels("y"));var o="objectBoundingBox"==this.gradientUnits()?(n.width()+n.height())/2*this.attribute("r").numValue():this.attribute("r").toPixels();return t.createRadialGradient(a,s,0,r,i,o)}},r.Element.radialGradient.prototype=new r.Element.GradientBase,r.Element.stop=function(t){this.base=r.Element.ElementBase,this.base(t),this.offset=this.attribute("offset").numValue(),this.offset<0&&(this.offset=0),this.offset>1&&(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.begin<this.duration){var n=this.calcValue();if(this.attribute("type").hasValue()){var r=this.attribute("type").value;n=r+"("+n+")"}this.getProperty().value=n,e=!0}return e},this.from=this.attribute("from"),this.to=this.attribute("to"),this.values=this.attribute("values"),this.values.hasValue()&&(this.values.value=this.values.value.split(";")),this.progress=function(){var t={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(this.values.hasValue()){var e=t.progress*(this.values.value.length-1),n=Math.floor(e),i=Math.ceil(e);t.from=new r.Property("from",parseFloat(this.values.value[n])),t.to=new r.Property("to",parseFloat(this.values.value[i])),t.progress=(e-n)/(i-n)}else t.from=this.from,t.to=this.to;return t}},r.Element.AnimateBase.prototype=new r.Element.ElementBase,r.Element.animate=function(t){this.base=r.Element.AnimateBase,this.base(t),this.calcValue=function(){var t=this.progress(),e=t.from.numValue()+(t.to.numValue()-t.from.numValue())*t.progress;return e+this.initialUnits}},r.Element.animate.prototype=new r.Element.AnimateBase,r.Element.animateColor=function(t){this.base=r.Element.AnimateBase,this.base(t),this.calcValue=function(){var t=this.progress(),e=new RGBColor(t.from.value),n=new RGBColor(t.to.value);if(e.ok&&n.ok){var r=e.r+(n.r-e.r)*t.progress,i=e.g+(n.g-e.g)*t.progress,a=e.b+(n.b-e.b)*t.progress;return"rgb("+parseInt(r,10)+","+parseInt(i,10)+","+parseInt(a,10)+")"}return this.attribute("from").value}},r.Element.animateColor.prototype=new r.Element.AnimateBase,r.Element.animateTransform=function(t){this.base=r.Element.AnimateBase,this.base(t),this.calcValue=function(){for(var t=this.progress(),e=r.ToNumberArray(t.from.value),n=r.ToNumberArray(t.to.value),i="",a=0;a<e.length;a++)i+=e[a]+(n[a]-e[a])*t.progress+" ";return i}},r.Element.animateTransform.prototype=new r.Element.animate,r.Element.font=function(t){this.base=r.Element.ElementBase,this.base(t),this.horizAdvX=this.attribute("horiz-adv-x").numValue(),this.isRTL=!1,this.isArabic=!1,this.fontFace=null,this.missingGlyph=null,this.glyphs=[];for(var e=0;e<this.children.length;e++){var n=this.children[e];"font-face"==n.type?(this.fontFace=n,n.style("font-family").hasValue()&&(r.Definitions[n.style("font-family").value]=this)):"missing-glyph"==n.type?this.missingGlyph=n:"glyph"==n.type&&(""!=n.arabicForm?(this.isRTL=!0,this.isArabic=!0,"undefined"==typeof this.glyphs[n.unicode]&&(this.glyphs[n.unicode]=[]),this.glyphs[n.unicode][n.arabicForm]=n):this.glyphs[n.unicode]=n)}},r.Element.font.prototype=new r.Element.ElementBase,r.Element.fontface=function(t){this.base=r.Element.ElementBase,this.base(t),this.ascent=this.attribute("ascent").value,this.descent=this.attribute("descent").value,this.unitsPerEm=this.attribute("units-per-em").numValue()},r.Element.fontface.prototype=new r.Element.ElementBase,r.Element.missingglyph=function(t){this.base=r.Element.path,this.base(t),this.horizAdvX=0},r.Element.missingglyph.prototype=new r.Element.path,r.Element.glyph=function(t){this.base=r.Element.path,this.base(t),this.horizAdvX=this.attribute("horiz-adv-x").numValue(),this.unicode=this.attribute("unicode").value,this.arabicForm=this.attribute("arabic-form").value},r.Element.glyph.prototype=new r.Element.path,r.Element.text=function(t){this.captureTextNodes=!0,this.base=r.Element.RenderedElementBase,this.base(t),this.baseSetContext=this.setContext,this.setContext=function(t){this.baseSetContext(t);var e=this.style("dominant-baseline").toTextBaseline();null==e&&(e=this.style("alignment-baseline").toTextBaseline()),null!=e&&(t.textBaseline=e)},this.getBoundingBox=function(){var t=this.attribute("x").toPixels("x"),e=this.attribute("y").toPixels("y"),n=this.parent.style("font-size").numValueOrDefault(r.Font.Parse(r.ctx.font).fontSize);return new r.BoundingBox(t,e-n,t+Math.floor(2*n/3)*this.children[0].getText().length,e)},this.renderChildren=function(t){this.x=this.attribute("x").toPixels("x"),this.y=this.attribute("y").toPixels("y"),this.attribute("dx").hasValue()&&(this.x+=this.attribute("dx").toPixels("x")),this.attribute("dy").hasValue()&&(this.y+=this.attribute("dy").toPixels("y")),this.x+=this.getAnchorDelta(t,this,0);for(var e=0;e<this.children.length;e++)this.renderChild(t,this,e)},this.getAnchorDelta=function(t,e,n){var r=this.style("text-anchor").valueOrDefault("start");if("start"!=r){for(var i=0,a=n;a<e.children.length;a++){var s=e.children[a];if(a>n&&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;n<r.children.length;n++)e.renderChild(t,r,n)}},r.Element.text.prototype=new r.Element.RenderedElementBase,r.Element.TextElementBase=function(t){this.base=r.Element.RenderedElementBase,this.base(t),this.getGlyph=function(t,e,n){var r=e[n],i=null;if(t.isArabic){var a="isolated";(0==n||" "==e[n-1])&&n<e.length-2&&" "!=e[n+1]&&(a="terminal"),n>0&&" "!=e[n-1]&&n<e.length-2&&" "!=e[n+1]&&(a="medial"),n>0&&" "!=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;o<a.length;o++){var l=this.getGlyph(e,a,o),u=n/e.fontFace.unitsPerEm;t.translate(this.x,this.y),t.scale(u,-u);var h=t.lineWidth;t.lineWidth=t.lineWidth*e.fontFace.unitsPerEm/n,"italic"==i&&t.transform(1,0,.4,1,0,0),l.render(t),"italic"==i&&t.transform(1,0,-.4,1,0,0),t.lineWidth=h,t.scale(1/u,-1/u),t.translate(-this.x,-this.y),this.x+=n*(l.horizAdvX||e.horizAdvX)/e.fontFace.unitsPerEm,"undefined"==typeof s[o]||isNaN(s[o])||(this.x+=s[o])}}},this.getText=function(){},this.measureTextRecursive=function(t){for(var e=this.measureText(t),n=0;n<this.children.length;n++)e+=this.children[n].measureTextRecursive(t);return e},this.measureText=function(t){var e=this.parent.style("font-family").getDefinition();if(null!=e){var n=this.parent.style("font-size").numValueOrDefault(r.Font.Parse(r.ctx.font).fontSize),i=0,a=this.getText();e.isRTL&&(a=a.split("").reverse().join(""));for(var s=r.ToNumberArray(this.parent.attribute("dx").value),o=0;o<a.length;o++){var l=this.getGlyph(e,a,o);i+=(l.horizAdvX||e.horizAdvX)*n/e.fontFace.unitsPerEm,"undefined"==typeof s[o]||isNaN(s[o])||(i+=s[o])}return i}var u=r.compressSpaces(this.getText());if(!t.measureText)return 10*u.length;t.save(),this.setContext(t);var h=t.measureText(u).width;return t.restore(),h}},r.Element.TextElementBase.prototype=new r.Element.RenderedElementBase,r.Element.tspan=function(t){this.captureTextNodes=!0,this.base=r.Element.TextElementBase,this.base(t),this.text=r.compressSpaces(t.value||t.text||t.textContent||""),this.getText=function(){return this.children.length>0?"":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;e<t.childNodes.length;e++)3!=t.childNodes[e].nodeType&&(this.hasText=!1);this.text=this.hasText?t.childNodes[0].value:"",this.getText=function(){return this.text},this.baseRenderChildren=this.renderChildren,this.renderChildren=function(t){if(this.hasText){this.baseRenderChildren(t);var e=new r.Property("fontSize",r.Font.Parse(r.ctx.font).fontSize);r.Mouse.checkBoundingBox(this,new r.BoundingBox(this.x,this.y-e.toPixels("y"),this.x+this.measureText(t),this.y))}else if(this.children.length>0){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;e<this.children.length;e++)t.addBoundingBox(this.children[e].getBoundingBox());return t}},r.Element.g.prototype=new r.Element.RenderedElementBase,r.Element.symbol=function(t){this.base=r.Element.RenderedElementBase,this.base(t),this.render=function(t){}},r.Element.symbol.prototype=new r.Element.RenderedElementBase,r.Element.style=function(e){this.base=r.Element.ElementBase,this.base(e);for(var n="",i=0;i<e.childNodes.length;i++)n+=e.childNodes[i].data;n=n.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,""),n=r.compressSpaces(n);for(var a=n.split("}"),i=0;i<a.length;i++)if(""!=r.trim(a[i]))for(var s=a[i].split("{"),o=s[0].split(","),l=s[1].split(";"),u=0;u<o.length;u++){var h=r.trim(o[u]);if(""!=h){for(var c={},f=0;f<l.length;f++){var d=l[f].indexOf(":"),p=l[f].substr(0,d),g=l[f].substr(d+1,l[f].length-d);null!=p&&null!=g&&(c[r.trim(p)]=new r.Property(r.trim(p),r.trim(g)))}if(r.Styles[h]=c,r.StylesSpecificity[h]=t(h),"@font-face"==h)for(var m=c["font-family"].value.replace(/"/g,""),y=c.src.value.split(","),v=0;v<y.length;v++)if(y[v].indexOf('format("svg")')>0)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<P.length;A++){var k=r.CreateElement(P[A]);r.Definitions[m]=k}}}},r.Element.style.prototype=new r.Element.ElementBase,r.Element.use=function(t){this.base=r.Element.RenderedElementBase,this.base(t),this.baseSetContext=this.setContext,this.setContext=function(t){this.baseSetContext(t),this.attribute("x").hasValue()&&t.translate(this.attribute("x").toPixels("x"),0),this.attribute("y").hasValue()&&t.translate(0,this.attribute("y").toPixels("y"))};var e=this.getHrefAttribute().getDefinition();this.path=function(t){null!=e&&e.path(t)},this.getBoundingBox=function(){if(null!=e)return e.getBoundingBox()},this.renderChildren=function(t){if(null!=e){var n=e;"symbol"==e.type&&(n=new r.Element.svg,n.type="svg",n.attributes.viewBox=new r.Property("viewBox",e.attribute("viewBox").value),n.attributes.preserveAspectRatio=new r.Property("preserveAspectRatio",e.attribute("preserveAspectRatio").value),n.attributes.overflow=new r.Property("overflow",e.attribute("overflow").value),n.children=e.children),"svg"==n.type&&(this.attribute("width").hasValue()&&(n.attributes.width=new r.Property("width",this.attribute("width").value)),this.attribute("height").hasValue()&&(n.attributes.height=new r.Property("height",this.attribute("height").value)));var i=n.parent;n.parent=null,n.render(t),n.parent=i}}},r.Element.use.prototype=new r.Element.RenderedElementBase,r.Element.mask=function(t){this.base=r.Element.ElementBase,this.base(t),this.apply=function(t,e){var n=this.attribute("x").toPixels("x"),i=this.attribute("y").toPixels("y"),a=this.attribute("width").toPixels("x"),s=this.attribute("height").toPixels("y");if(0==a&&0==s){for(var o=new r.BoundingBox,l=0;l<this.children.length;l++)o.addBoundingBox(this.children[l].getBoundingBox());var n=Math.floor(o.x1),i=Math.floor(o.y1),a=Math.floor(o.width()),s=Math.floor(o.height())}var u=e.attribute("mask").value;e.attribute("mask").value="";var h=document.createElement("canvas");h.width=n+a,h.height=i+s;var c=h.getContext("2d");this.renderChildren(c);var f=document.createElement("canvas");f.width=n+a,f.height=i+s;var d=f.getContext("2d");e.render(d),d.globalCompositeOperation="destination-in",d.fillStyle=c.createPattern(h,"no-repeat"),d.fillRect(0,0,n+a,i+s),t.fillStyle=d.createPattern(f,"no-repeat"),t.fillRect(0,0,n+a,i+s),e.attribute("mask").value=u},this.render=function(t){}},r.Element.mask.prototype=new r.Element.ElementBase,r.Element.clipPath=function(t){this.base=r.Element.ElementBase,this.base(t),this.apply=function(t){var e=CanvasRenderingContext2D.prototype.beginPath;CanvasRenderingContext2D.prototype.beginPath=function(){};var n=CanvasRenderingContext2D.prototype.closePath;CanvasRenderingContext2D.prototype.closePath=function(){},e.call(t);for(var i=0;i<this.children.length;i++){var a=this.children[i];if("undefined"!=typeof a.path){var s=null;a.style("transform",!1,!0).hasValue()&&(s=new r.Transform(a.style("transform",!1,!0).value),s.apply(t)),a.path(t),CanvasRenderingContext2D.prototype.closePath=n,s&&s.unapply(t)}}n.call(t),t.clip(),CanvasRenderingContext2D.prototype.beginPath=e,CanvasRenderingContext2D.prototype.closePath=n},this.render=function(t){}},r.Element.clipPath.prototype=new r.Element.ElementBase,r.Element.filter=function(t){this.base=r.Element.ElementBase,this.base(t),this.apply=function(t,e){var n=e.getBoundingBox(),r=Math.floor(n.x1),i=Math.floor(n.y1),a=Math.floor(n.width()),s=Math.floor(n.height()),o=e.style("filter").value;e.style("filter").value="";for(var l=0,u=0,h=0;h<this.children.length;h++){var c=this.children[h].extraFilterDistance||0;l=Math.max(l,c),u=Math.max(u,c)}var f=document.createElement("canvas");f.width=a+2*l,f.height=s+2*u;var d=f.getContext("2d");d.translate(-r+l,-i+u),e.render(d);for(var h=0;h<this.children.length;h++)"function"==typeof this.children[h].apply&&this.children[h].apply(d,0,0,a+2*l,s+2*u);t.drawImage(f,0,0,a+2*l,s+2*u,r-l,i-u,a+2*l,s+2*u),e.style("filter",!0).value=o},this.render=function(t){}},r.Element.filter.prototype=new r.Element.ElementBase,r.Element.feMorphology=function(t){this.base=r.Element.ElementBase,this.base(t),this.apply=function(t,e,n,r,i){}},r.Element.feMorphology.prototype=new r.Element.ElementBase,r.Element.feComposite=function(t){this.base=r.Element.ElementBase,this.base(t),this.apply=function(t,e,n,r,i){}},r.Element.feComposite.prototype=new r.Element.ElementBase,r.Element.feColorMatrix=function(t){function e(t,e,n,r,i,a){return t[n*r*4+4*e+a]}function n(t,e,n,r,i,a,s){t[n*r*4+4*e+a]=s}function i(t,e){var n=a[t];return n*(n<0?e-255:e)}this.base=r.Element.ElementBase,this.base(t);var a=r.ToNumberArray(this.attribute("values").value);switch(this.attribute("type").valueOrDefault("matrix")){case"saturate":var s=a[0];a=[.213+.787*s,.715-.715*s,.072-.072*s,0,0,.213-.213*s,.715+.285*s,.072-.072*s,0,0,.213-.213*s,.715-.715*s,.072+.928*s,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var o=a[0]*Math.PI/180,l=function(t,e,n){return t+Math.cos(o)*e+Math.sin(o)*n};a=[l(.213,.787,-.213),l(.715,-.715,-.715),l(.072,-.072,.928),0,0,l(.213,-.213,.143),l(.715,.285,.14),l(.072,-.072,-.283),0,0,l(.213,-.213,-.787),l(.715,-.715,.715),l(.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.apply=function(t,r,a,s,o){for(var l=t.getImageData(0,0,s,o),a=0;a<o;a++)for(var r=0;r<s;r++){var u=e(l.data,r,a,s,o,0),h=e(l.data,r,a,s,o,1),c=e(l.data,r,a,s,o,2),f=e(l.data,r,a,s,o,3);n(l.data,r,a,s,o,0,i(0,u)+i(1,h)+i(2,c)+i(3,f)+i(4,1)),n(l.data,r,a,s,o,1,i(5,u)+i(6,h)+i(7,c)+i(8,f)+i(9,1)),n(l.data,r,a,s,o,2,i(10,u)+i(11,h)+i(12,c)+i(13,f)+i(14,1)),n(l.data,r,a,s,o,3,i(15,u)+i(16,h)+i(17,c)+i(18,f)+i(19,1))}t.clearRect(0,0,s,o),t.putImageData(l,0,0)}},r.Element.feColorMatrix.prototype=new r.Element.ElementBase,r.Element.feGaussianBlur=function(t){this.base=r.Element.ElementBase,this.base(t),this.blurRadius=Math.floor(this.attribute("stdDeviation").numValue()),this.extraFilterDistance=this.blurRadius,this.apply=function(t,e,n,i,a){return"undefined"==typeof stackBlurCanvasRGBA?void r.log("ERROR: StackBlur.js must be included for blur to work"):(t.canvas.id=r.UniqueId(),t.canvas.style.display="none",document.body.appendChild(t.canvas),stackBlurCanvasRGBA(t.canvas.id,e,n,i,a,this.blurRadius),void document.body.removeChild(t.canvas))}},r.Element.feGaussianBlur.prototype=new r.Element.ElementBase,r.Element.title=function(t){},r.Element.title.prototype=new r.Element.ElementBase,r.Element.desc=function(t){},r.Element.desc.prototype=new r.Element.ElementBase,r.Element.MISSING=function(t){r.log("ERROR: Element '"+t.nodeName+"' not yet implemented.")},r.Element.MISSING.prototype=new r.Element.ElementBase,r.CreateElement=function(t){var e=t.nodeName.replace(/^[^:]+:/,"");e=e.replace(/\-/g,"");var n=null;return n="undefined"!=typeof r.Element[e]?new r.Element[e](t):new r.Element.MISSING(t),n.type=t.nodeName,n},r.load=function(t,e){r.loadXml(t,r.ajax(e))},r.loadXml=function(t,e){r.loadXmlDoc(t,r.parseXml(e))},r.loadXmlDoc=function(t,e){r.init(t);var n=function(e){for(var n=t.canvas;n;)e.x-=n.offsetLeft,e.y-=n.offsetTop,n=n.offsetParent;return window.scrollX&&(e.x+=window.scrollX),window.scrollY&&(e.y+=window.scrollY),e};1!=r.opts.ignoreMouse&&(t.canvas.onclick=function(t){var e=n(new r.Point(null!=t?t.clientX:event.clientX,null!=t?t.clientY:event.clientY));r.Mouse.onclick(e.x,e.y)},t.canvas.onmousemove=function(t){var e=n(new r.Point(null!=t?t.clientX:event.clientX,null!=t?t.clientY:event.clientY));r.Mouse.onmousemove(e.x,e.y)});var i=r.CreateElement(e.documentElement);i.root=!0,i.addStylesFromStyleDefinition();var a=!0,s=function(){r.ViewPort.Clear(),t.canvas.parentNode&&r.ViewPort.SetCurrent(t.canvas.parentNode.clientWidth,t.canvas.parentNode.clientHeight),1!=r.opts.ignoreDimensions&&(i.style("width").hasValue()&&(t.canvas.width=i.style("width").toPixels("x"),t.canvas.style.width=t.canvas.width+"px"),i.style("height").hasValue()&&(t.canvas.height=i.style("height").toPixels("y"),t.canvas.style.height=t.canvas.height+"px"));var n=t.canvas.clientWidth||t.canvas.width,s=t.canvas.clientHeight||t.canvas.height;if(1==r.opts.ignoreDimensions&&i.style("width").hasValue()&&i.style("height").hasValue()&&(n=i.style("width").toPixels("x"),s=i.style("height").toPixels("y")),r.ViewPort.SetCurrent(n,s),null!=r.opts.offsetX&&(i.attribute("x",!0).value=r.opts.offsetX),null!=r.opts.offsetY&&(i.attribute("y",!0).value=r.opts.offsetY),null!=r.opts.scaleWidth||null!=r.opts.scaleHeight){var o=null,l=null,u=r.ToNumberArray(i.attribute("viewBox").value);null!=r.opts.scaleWidth&&(i.attribute("width").hasValue()?o=i.attribute("width").toPixels("x")/r.opts.scaleWidth:isNaN(u[2])||(o=u[2]/r.opts.scaleWidth)),null!=r.opts.scaleHeight&&(i.attribute("height").hasValue()?l=i.attribute("height").toPixels("y")/r.opts.scaleHeight:isNaN(u[3])||(l=u[3]/r.opts.scaleHeight)),null==o&&(o=l),null==l&&(l=o),i.attribute("width",!0).value=r.opts.scaleWidth,i.attribute("height",!0).value=r.opts.scaleHeight,i.style("transform",!0,!0).value+=" scale("+1/o+","+1/l+")"}1!=r.opts.ignoreClear&&t.clearRect(0,0,n,s),i.render(t),a&&(a=!1,"function"==typeof r.opts.renderCallback&&r.opts.renderCallback(e))},o=!0;r.ImagesLoaded()&&(o=!1,s()),r.intervalID=setInterval(function(){var t=!1;if(o&&r.ImagesLoaded()&&(o=!1,t=!0),1!=r.opts.ignoreMouse&&(t|=r.Mouse.hasEvents()),1!=r.opts.ignoreAnimation)for(var e=0;e<r.Animations.length;e++)t|=r.Animations[e].update(1e3/r.FRAMERATE);"function"==typeof r.opts.forceRedraw&&1==r.opts.forceRedraw()&&(t=!0),t&&(s(),r.Mouse.runEvents())},1e3/r.FRAMERATE)},r.stop=function(){r.intervalID&&clearInterval(r.intervalID)},r.Mouse=new function(){this.events=[],this.hasEvents=function(){return 0!=this.events.length},this.onclick=function(t,e){this.events.push({type:"onclick",x:t,y:e,run:function(t){t.onclick&&t.onclick()}})},this.onmousemove=function(t,e){this.events.push({type:"onmousemove",x:t,y:e,run:function(t){t.onmousemove&&t.onmousemove()}})},this.eventElements=[],this.checkPath=function(t,e){for(var n=0;n<this.events.length;n++){var r=this.events[n];e.isPointInPath&&e.isPointInPath(r.x,r.y)&&(this.eventElements[n]=t)}},this.checkBoundingBox=function(t,e){for(var n=0;n<this.events.length;n++){var r=this.events[n];e.isPointInBox(r.x,r.y)&&(this.eventElements[n]=t)}},this.runEvents=function(){r.ctx.canvas.style.cursor="";for(var t=0;t<this.events.length;t++)for(var e=this.events[t],n=this.eventElements[t];n;)e.run(n),n=n.parent;this.events=[],this.eventElements=[]}},r}this.canvg=function(t,n,r){if(null!=t||null!=n||null!=r){"string"==typeof t&&(t=document.getElementById(t)),null!=t.svg&&t.svg.stop();var i=e(r||{});1==t.childNodes.length&&"OBJECT"==t.childNodes[0].nodeName||(t.svg=i);var a=t.getContext("2d");"undefined"!=typeof n.documentElement?i.loadXmlDoc(a,n):"<"==n.substr(0,1)?i.loadXml(a,n):i.load(a,n)}else for(var s=document.querySelectorAll("svg"),o=0;o<s.length;o++){var l=s[o],u=document.createElement("canvas");u.width=l.clientWidth,u.height=l.clientHeight,l.parentNode.insertBefore(u,l),l.parentNode.removeChild(l);var h=document.createElement("div");h.appendChild(l),canvg(u,h.innerHTML)}};var n;"undefined"!=typeof Element.prototype.matches?n=function(t,e){return t.matches(e)}:"undefined"!=typeof Element.prototype.webkitMatchesSelector?n=function(t,e){return t.webkitMatchesSelector(e)}:"undefined"!=typeof Element.prototype.mozMatchesSelector?n=function(t,e){return t.mozMatchesSelector(e)}:"undefined"!=typeof Element.prototype.msMatchesSelector?n=function(t,e){return t.msMatchesSelector(e)}:"undefined"!=typeof Element.prototype.oMatchesSelector?n=function(t,e){return t.oMatchesSelector(e)}:("function"!=typeof jQuery&&"function"!=typeof Zepto||(n=function(t,e){return $(t).is(e)}),"undefined"==typeof n&&(n=Sizzle.matchesSelector));var r=/(\[[^\]]+\])/g,a=/(#[^\s\+>~\.\[:]+)/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment