From 7fc361f07ce9188559e78228824f721043883885 Mon Sep 17 00:00:00 2001 From: Ben Neigher Date: Wed, 7 Mar 2018 17:21:04 -0800 Subject: [PATCH] updated fixing bug with not configuring instance, more illustrations of multiple instances in example --- CHANGELOG.md | 26 +++++---- dist/bundle.js | 2 +- dist/bundle.js.map | 2 +- package.json | 2 +- sandbox/example.css | 3 ++ sandbox/example.js | 56 ++++++++++++++------ sandbox/example.svg | 88 +++++++++++++++++++++++++++++++ sandbox/index.html | 57 +++++++++++++++++--- src/assets/scss/lib/_default.scss | 13 +++-- src/lib/index.js | 2 + 10 files changed, 212 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a924904..8ba1a7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,35 +1,39 @@ -# Changelog +## Changelog -v1.1.6 +# v1.2.2 +- fix bug with configure not getting called results in error +- added multiple instances to example for illustation + +# v1.1.6 - Fix css away from using transform: scale due to weird behavior -v1.1.5 +# v1.1.5 - Expose overwrite options for kConfig values - Update README - Update Webpack dev for devServer goodies -v1.1.4 +# v1.1.4 - UMD - github pages update -v1.1.3 +# v1.1.3 - forgot to bundle -v1.1.2 +# v1.1.2 - ff css transition has different behavior - looks bad. replace ff with separate animation effect -v1.1.1 +# v1.1.1 - forgot to bundle build -v1.1.0 +# v1.1.0 - modularize d3 -v1.0.2 +# v1.0.2 - moved d3 to modular libraries -v1.0.1 +# v1.0.1 - fix webpack dev builds to not need expliticly set to window - added reDrawMarker method -v1.0.0 +# v1.0.0 - initial release diff --git a/dist/bundle.js b/dist/bundle.js index 5e88fed..f46bdb8 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1 +1 @@ -!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["@skycatch/model-trainer-image-marker"]=n():t["@skycatch/model-trainer-image-marker"]=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=18)}([function(t,n,e){"use strict";e.r(n);var r="http://www.w3.org/1999/xhtml",i={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},o=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),i.hasOwnProperty(n)?{space:i[n],local:t}:t};var a=function(t){var n=o(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===r&&n.documentElement.namespaceURI===r?n.createElement(t):n.createElementNS(e,t)}})(n)};function u(){}var c=function(t){return null==t?u:function(){return this.querySelector(t)}};function s(){return[]}var l=function(t){return null==t?s:function(){return this.querySelectorAll(t)}},f=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var h=document.documentElement;if(!h.matches){var p=h.webkitMatchesSelector||h.msMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector;f=function(t){return function(){return p.call(this,t)}}}}var d=f,m=function(t){return new Array(t.length)};function g(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}g.prototype={constructor:g,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var v="$";function y(t,n,e,r,i,o){for(var a,u=0,c=n.length,s=o.length;un?1:t>=n?0:NaN}var M=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function x(t,n){return t.style.getPropertyValue(n)||M(t).getComputedStyle(t,null).getPropertyValue(n)}function _(t){return t.trim().split(/^|\s+/)}function k(t){return t.classList||new S(t)}function S(t){this._node=t,this._names=_(t.getAttribute("class")||"")}function A(t,n){for(var e=k(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function C(){this.textContent=""}function T(){this.innerHTML=""}function N(){this.nextSibling&&this.parentNode.appendChild(this)}function I(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function U(){return null}function D(){var t=this.parentNode;t&&t.removeChild(this)}function j(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function O(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var L={},E=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(L={mouseenter:"mouseover",mouseleave:"mouseout"}));function P(t,n,e){return t=Y(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function Y(t,n,e){return function(r){var i=E;E=r;try{t.call(this,this.__data__,n,e)}finally{E=i}}}function F(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=x&&(x=M+1);!(b=g[x])&&++x=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=b);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):x(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=_(t+"");if(arguments.length<2){for(var r=k(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?Z:F,null==e&&(e=!1),r=0;r>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=l.exec(t))?w(parseInt(n[1],16)):(n=f.exec(t))?new _(n[1],n[2],n[3],1):(n=h.exec(t))?new _(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=p.exec(t))?b(n[1],n[2],n[3],n[4]):(n=d.exec(t))?b(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=m.exec(t))?k(n[1],n[2]/100,n[3]/100,1):(n=g.exec(t))?k(n[1],n[2]/100,n[3]/100,n[4]):v.hasOwnProperty(t)?w(v[t]):"transparent"===t?new _(NaN,NaN,NaN,0):null}function w(t){return new _(t>>16&255,t>>8&255,255&t,1)}function b(t,n,e,r){return r<=0&&(t=n=e=NaN),new _(t,n,e,r)}function M(t){return t instanceof o||(t=y(t)),t?new _((t=t.rgb()).r,t.g,t.b,t.opacity):new _}function x(t,n,e,r){return 1===arguments.length?M(t):new _(t,n,e,null==r?1:r)}function _(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function k(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new A(t,n,e,r)}function S(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof A)return new A(t.h,t.s,t.l,t.opacity);if(t instanceof o||(t=y(t)),!t)return new A;if(t instanceof A)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),a=Math.max(n,e,r),u=NaN,c=a-i,s=(a+i)/2;return c?(u=n===a?(e-r)/c+6*(e0&&s<1?0:u,new A(u,c,s,t.opacity)}(t):new A(t,n,e,null==r?1:r)}function A(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function z(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}r(o,y,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),r(_,x,i(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),r(A,S,i(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new A(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new A(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new _(z(t>=240?t-240:t+120,i,r),z(t,i,r),z(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var C=Math.PI/180,T=180/Math.PI,N=.95047,I=1,U=1.08883,D=4/29,j=6/29,O=3*j*j,L=j*j*j;function E(t){if(t instanceof Y)return new Y(t.l,t.a,t.b,t.opacity);if(t instanceof J){var n=t.h*C;return new Y(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof _||(t=M(t));var e=R(t.r),r=R(t.g),i=R(t.b),o=F((.4124564*e+.3575761*r+.1804375*i)/N),a=F((.2126729*e+.7151522*r+.072175*i)/I);return new Y(116*a-16,500*(o-a),200*(a-F((.0193339*e+.119192*r+.9503041*i)/U)),t.opacity)}function P(t,n,e,r){return 1===arguments.length?E(t):new Y(t,n,e,null==r?1:r)}function Y(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function F(t){return t>L?Math.pow(t,1/3):t/O+D}function Z(t){return t>j?t*t*t:O*(t-D)}function H(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function R(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function X(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof J)return new J(t.h,t.c,t.l,t.opacity);t instanceof Y||(t=E(t));var n=Math.atan2(t.b,t.a)*T;return new J(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new J(t,n,e,null==r?1:r)}function J(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}r(Y,P,i(o,{brighter:function(t){return new Y(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Y(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=I*Z(t),new _(H(3.2404542*(n=N*Z(n))-1.5371385*t-.4985314*(e=U*Z(e))),H(-.969266*n+1.8760108*t+.041556*e),H(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),r(J,X,i(o,{brighter:function(t){return new J(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new J(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return E(this).rgb()}}));var V=-.14861,B=1.78277,q=-.29227,G=-.90649,$=1.97294,W=$*G,Q=$*B,K=B*q-G*V;function tt(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof nt)return new nt(t.h,t.s,t.l,t.opacity);t instanceof _||(t=M(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(K*r+W*n-Q*e)/(K+W-Q),o=r-i,a=($*(e-i)-q*o)/G,u=Math.sqrt(a*a+o*o)/($*i*(1-i)),c=u?Math.atan2(a,o)*T-120:NaN;return new nt(c<0?c+360:c,u,i,t.opacity)}(t):new nt(t,n,e,null==r?1:r)}function nt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}r(nt,tt,i(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new nt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new nt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*C,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new _(255*(n+e*(V*r+B*i)),255*(n+e*(q*r+G*i)),255*(n+e*($*r)),this.opacity)}})),e.d(n,"a",function(){return y}),e.d(n,"f",function(){return x}),e.d(n,"d",function(){return S}),e.d(n,"e",function(){return P}),e.d(n,"c",function(){return X}),e.d(n,"b",function(){return tt})},function(t,n,e){"use strict";var r=e(1);function i(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}var o=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),o=t[r],a=t[r+1],u=r>0?t[r-1]:2*o-a,c=r180||e<-180?e-360*Math.round(e/360):e):u(isNaN(t)?n:t)}function l(t){return 1==(t=+t)?f:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):u(isNaN(n)?e:n)}}function f(t,n){var e=n-t;return e?c(t,e):u(isNaN(t)?n:t)}var h=function t(n){var e=l(n);function i(t,n){var i=e((t=Object(r.f)(t)).r,(n=Object(r.f)(n)).r),o=e(t.g,n.g),a=e(t.b,n.b),u=f(t.opacity,n.opacity);return function(n){return t.r=i(n),t.g=o(n),t.b=a(n),t.opacity=u(n),t+""}}return i.gamma=t,i}(1);function p(t){return function(n){var e,i,o=n.length,a=new Array(o),u=new Array(o),c=new Array(o);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:y(e,r)})),o=M.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:y(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:y(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:y(t,e)},{i:u-2,x:y(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}(t+"",r),o=-1,c=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o0)for(var e,r,i=new Array(e),o=0;o=0&&n._call.call(null,t),n=n._next;--u}()}finally{u=0,function(){var t,n,e=r,o=1/0;for(;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:r=n);i=t,x(o)}(),h=0}}function M(){var t=d.now(),n=t-f;n>l&&(p-=n,f=t)}function x(t){u||(c&&(c=clearTimeout(c)),t-h>24?(t<1/0&&(c=setTimeout(b,t-d.now()-p)),s&&(s=clearInterval(s))):(s||(f=d.now(),s=setInterval(M,l)),u=1,m(b)))}y.prototype=w.prototype={constructor:y,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?g():+e)+(null==n?0:+n),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=e,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}};var _=function(t,n,e){var r=new y;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r},k=Object(a.a)("start","end","interrupt"),S=[],A=0,z=1,C=2,T=3,N=4,I=5,U=6,D=function(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(c){var s,l,f,h;if(e.state!==z)return u();for(s in i)if((h=i[s]).name===e.name){if(h.state===T)return _(o);h.state===N?(h.state=U,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[s]):+sA)throw new Error("too late; already scheduled");return e}function O(t,n){var e=L(t,n);if(e.state>C)throw new Error("too late; already started");return e}function L(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var E=function(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>C&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?j:O;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=Object(o.namespace)(t),r="transform"===e?P.g:Z;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var a,u=e(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===u?null:a===r&&u===i?o:o=n(r=a,i=u);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var a,u=e(this);if(null!=u)return(a=this.getAttribute(t))===u?null:a===r&&u===i?o:o=n(r=a,i=u);this.removeAttribute(t)}})(e,r,Y(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}:function(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=Object(o.namespace)(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?P.f:Z;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var a=Object(o.style)(this,t),u=(this.style.removeProperty(t),Object(o.style)(this,t));return a===u?null:a===e&&u===r?i:i=n(e=a,r=u)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,a;return function(){var u=Object(o.style)(this,t),c=e(this);return null==c&&(this.style.removeProperty(t),c=Object(o.style)(this,t)),u===c?null:u===r&&c===i?a:a=n(r=u,i=c)}}(t,r,Y(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var a=Object(o.style)(this,t);return a===e?null:a===r?i:i=n(r=a,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Y(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=L(this.node(),e).tween,o=0,a=i.length;oz&&e.name===n)return new X([[t]],W,n,+r);return null};e.d(n,"transition",function(){return J}),e.d(n,"active",function(){return Q}),e.d(n,"interrupt",function(){return E})},function(t,n,e){"use strict";e.r(n);var r=Array.prototype.slice,i=function(t){return t},o=1,a=2,u=3,c=4,s=1e-6;function l(t){return"translate("+(t+.5)+",0)"}function f(t){return"translate(0,"+(t+.5)+")"}function h(){return!this.__axis}function p(t,n){var e=[],p=null,d=null,m=6,g=6,v=3,y=t===o||t===c?-1:1,w=t===c||t===a?"x":"y",b=t===o||t===u?l:f;function M(r){var l=null==p?n.ticks?n.ticks.apply(n,e):n.domain():p,f=null==d?n.tickFormat?n.tickFormat.apply(n,e):i:d,M=Math.max(m,0)+v,x=n.range(),_=+x[0]+.5,k=+x[x.length-1]+.5,S=(n.bandwidth?function(t){var n=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(n=Math.round(n)),function(e){return+t(e)+n}}:function(t){return function(n){return+t(n)}})(n.copy()),A=r.selection?r.selection():r,z=A.selectAll(".domain").data([null]),C=A.selectAll(".tick").data(l,n).order(),T=C.exit(),N=C.enter().append("g").attr("class","tick"),I=C.select("line"),U=C.select("text");z=z.merge(z.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),C=C.merge(N),I=I.merge(N.append("line").attr("stroke","#000").attr(w+"2",y*m)),U=U.merge(N.append("text").attr("fill","#000").attr(w,y*M).attr("dy",t===o?"0em":t===u?"0.71em":"0.32em")),r!==A&&(z=z.transition(r),C=C.transition(r),I=I.transition(r),U=U.transition(r),T=T.transition(r).attr("opacity",s).attr("transform",function(t){return isFinite(t=S(t))?b(t):this.getAttribute("transform")}),N.attr("opacity",s).attr("transform",function(t){var n=this.parentNode.__axis;return b(n&&isFinite(n=n(t))?n:S(t))})),T.remove(),z.attr("d",t===c||t==a?"M"+y*g+","+_+"H0.5V"+k+"H"+y*g:"M"+_+","+y*g+"V0.5H"+k+"V"+y*g),C.attr("opacity",1).attr("transform",function(t){return b(S(t))}),I.attr(w+"2",y*m),U.attr(w,y*M).text(f),A.filter(h).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===a?"start":t===c?"end":"middle"),A.each(function(){this.__axis=S})}return M.scale=function(t){return arguments.length?(n=t,M):n},M.ticks=function(){return e=r.call(arguments),M},M.tickArguments=function(t){return arguments.length?(e=null==t?[]:r.call(t),M):e.slice()},M.tickValues=function(t){return arguments.length?(p=null==t?null:r.call(t),M):p&&p.slice()},M.tickFormat=function(t){return arguments.length?(d=t,M):d},M.tickSize=function(t){return arguments.length?(m=g=+t,M):m},M.tickSizeInner=function(t){return arguments.length?(m=+t,M):m},M.tickSizeOuter=function(t){return arguments.length?(g=+t,M):g},M.tickPadding=function(t){return arguments.length?(v=+t,M):v},M}function d(t){return p(o,t)}function m(t){return p(a,t)}function g(t){return p(u,t)}function v(t){return p(c,t)}e.d(n,"axisTop",function(){return d}),e.d(n,"axisRight",function(){return m}),e.d(n,"axisBottom",function(){return g}),e.d(n,"axisLeft",function(){return v})},function(t,n,e){"use strict";e.r(n);var r=e(3),i=e(0);var o=function(){i.event.preventDefault(),i.event.stopImmediatePropagation()},a=function(t){var n=t.document.documentElement,e=Object(i.select)(t).on("dragstart.drag",o,!0);"onselectstart"in n?e.on("selectstart.drag",o,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};function u(t,n){var e=t.document.documentElement,r=Object(i.select)(t).on("dragstart.drag",null);n&&(r.on("click.drag",o,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function c(t,n,e,r,i,o,a,u,c,s){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=u,this.dy=c,this._=s}c.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var s=e(2),l=e(4),f=function(t){return function(){return t}};function h(t,n,e){this.k=t,this.x=n,this.y=e}h.prototype={constructor:h,scale:function(t){return 1===t?this:new h(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new h(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var p=new h(1,0,0);function d(t){return t.__zoom||p}function m(){i.event.stopImmediatePropagation()}d.prototype=h.prototype;var g=function(){i.event.preventDefault(),i.event.stopImmediatePropagation()};function v(){return!i.event.button}function y(){var t,n,e=this;return e instanceof SVGElement?(t=(e=e.ownerSVGElement||e).width.baseVal.value,n=e.height.baseVal.value):(t=e.clientWidth,n=e.clientHeight),[[0,0],[t,n]]}function w(){return this.__zoom||p}function b(){return-i.event.deltaY*(i.event.deltaMode?120:1)/500}function M(){return"ontouchstart"in this}function x(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var _=function(){var t,n,e=v,o=y,c=x,d=b,_=M,k=[0,1/0],S=[[-1/0,-1/0],[1/0,1/0]],A=250,z=s.h,C=[],T=Object(r.a)("start","zoom","end"),N=500,I=150,U=0;function D(t){t.property("__zoom",w).on("wheel.zoom",F).on("mousedown.zoom",Z).on("dblclick.zoom",H).filter(_).on("touchstart.zoom",R).on("touchmove.zoom",X).on("touchend.zoom touchcancel.zoom",J).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function j(t,n){return(n=Math.max(k[0],Math.min(k[1],n)))===t.k?t:new h(n,t.x,t.y)}function O(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new h(t.k,r,i)}function L(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function E(t,n,e){t.on("start.zoom",function(){P(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).end()}).tween("zoom",function(){var t=arguments,r=P(this,t),i=o.apply(this,t),a=e||L(i),u=Math.max(i[1][0]-i[0][0],i[1][1]-i[0][1]),c=this.__zoom,s="function"==typeof n?n.apply(this,t):n,l=z(c.invert(a).concat(u/c.k),s.invert(a).concat(u/s.k));return function(t){if(1===t)t=s;else{var n=l(t),e=u/n[2];t=new h(e,a[0]-n[0]*e,a[1]-n[1]*e)}r.zoom(null,t)}})}function P(t,n){for(var e,r=0,i=C.length;rU}t.zoom("mouse",c(O(t.that.__zoom,t.mouse[0]=Object(i.mouse)(t.that),t.mouse[1]),t.extent,S))},!0).on("mouseup.zoom",function(){r.on("mousemove.zoom mouseup.zoom",null),u(i.event.view,t.moved),g(),t.end()},!0),o=Object(i.mouse)(this),s=i.event.clientX,f=i.event.clientY;a(i.event.view),m(),t.mouse=[o,this.__zoom.invert(o)],Object(l.interrupt)(this),t.start()}}function H(){if(e.apply(this,arguments)){var t=this.__zoom,n=Object(i.mouse)(this),r=t.invert(n),a=t.k*(i.event.shiftKey?.5:2),u=c(O(j(t,a),n,r),o.apply(this,arguments),S);g(),A>0?Object(i.select)(this).transition().duration(A).call(E,u,n):Object(i.select)(this).call(D.transform,u)}}function R(){if(e.apply(this,arguments)){var n,r,o,a,u=P(this,arguments),c=i.event.changedTouches,s=c.length;for(m(),r=0;rn?1:t>=n?0:NaN},i=function(t){return 1===t.length&&(t=function(t){return function(n,e){return r(t(n),e)}}(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}};var o=i(r),a=o.right,u=(o.left,a);var c=function(t){return null===t?NaN:+t},s=Array.prototype,l=(s.slice,s.map,function(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u=0?(o>=f?10:o>=h?5:o>=p?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=f?10:o>=h?5:o>=p?2:1)}function g(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=f?i*=10:o>=h?i*=5:o>=p&&(i*=2),n=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t);return a+(+e(t[o+1],o+1,t)-a)*(i-o)}};function y(){}function w(t,n){var e=new y;if(t instanceof y)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i2?E:L,r=i=null,l}function l(n){return(r||(r=e(o,a,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,u)))(+n)}return l.invert=function(t){return(i||(i=e(a,o,O,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},l.domain=function(t){return arguments.length?(o=S.call(t,D),s()):o.slice()},l.range=function(t){return arguments.length?(a=A.call(t),s()):a.slice()},l.rangeRound=function(t){return a=A.call(t),u=I.d,s()},l.clamp=function(t){return arguments.length?(c=!!t,s()):c},l.interpolate=function(t){return arguments.length?(u=t,s()):u},s()}var F,Z=function(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]},H=function(t){return(t=Z(Math.abs(t)))?t[1]:NaN},R=function(t,n){var e=Z(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},X={"":function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return R(100*t,n)},r:R,s:function(t,n){var e=Z(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(F=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Z(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},J=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function V(t){return new B(t)}function B(t){if(!(n=J.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",o=n[4]||"",a=!!n[5],u=n[6]&&+n[6],c=!!n[7],s=n[8]&&+n[8].slice(1),l=n[9]||"";"n"===l?(c=!0,l="g"):X[l]||(l=""),(a||"0"===e&&"="===r)&&(a=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=a,this.width=u,this.comma=c,this.precision=s,this.type=l}V.prototype=B.prototype,B.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var q,G,$,W=function(t){return t},Q=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],K=function(t){var n=t.grouping&&t.thousands?function(t,n){return function(e,r){for(var i=e.length,o=[],a=0,u=t[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(e.substring(i-=u,i+u)),!((c+=u+1)>r));)u=t[a=(a+1)%t.length];return o.reverse().join(n)}}(t.grouping,t.thousands):W,e=t.currency,r=t.decimal,i=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}}(t.numerals):W,o=t.percent||"%";function a(t){var a=(t=V(t)).fill,u=t.align,c=t.sign,s=t.symbol,l=t.zero,f=t.width,h=t.comma,p=t.precision,d=t.type,m="$"===s?e[0]:"#"===s&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",g="$"===s?e[1]:/[%p]/.test(d)?o:"",v=X[d],y=!d||/[defgprs%]/.test(d);function w(t){var e,o,s,w=m,b=g;if("c"===d)b=v(t)+b,t="";else{var M=(t=+t)<0;if(t=v(Math.abs(t),p),M&&0==+t&&(M=!1),w=(M?"("===c?c:"-":"-"===c||"("===c?"":c)+w,b=("s"===d?Q[8+F/3]:"")+b+(M&&"("===c?")":""),y)for(e=-1,o=t.length;++e(s=t.charCodeAt(e))||s>57){b=(46===s?r+t.slice(e+1):t.slice(e))+b,t=t.slice(0,e);break}}h&&!l&&(t=n(t,1/0));var x=w.length+t.length+b.length,_=x>1)+w+t+b+_.slice(x);break;default:t=_+w+t+b}return i(t)}return p=null==p?d?6:12:/[gprs]/.test(d)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),w.toString=function(){return t+""},w}return{format:a,formatPrefix:function(t,n){var e=a(((t=V(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(H(n)/3))),i=Math.pow(10,-r),o=Q[8+r/3];return function(t){return e(i*t)+o}}}};!function(t){q=K(t),G=q.format,$=q.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var tt=function(t,n,e){var r,i=t[0],o=t[t.length-1],a=g(i,o,null==n?10:n);switch((e=V(null==e?",f":e)).type){case"s":var u=Math.max(Math.abs(i),Math.abs(o));return null!=e.precision||isNaN(r=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(H(n)/3)))-H(Math.abs(t)))}(a,u))||(e.precision=r),$(e,u);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(r=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,H(n)-H(t))+1}(a,Math.max(Math.abs(i),Math.abs(o))))||(e.precision=r-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(r=function(t){return Math.max(0,-H(Math.abs(t)))}(a))||(e.precision=r-2*("%"===e.type))}return G(e)};function nt(t){var n=t.domain;return t.ticks=function(t){var e=n();return d(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return tt(n(),t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,a=i.length-1,u=i[o],c=i[a];return c0?r=m(u=Math.floor(u/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=m(u=Math.ceil(u*r)/r,c=Math.floor(c*r)/r,e)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(c/r)*r,n(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(c*r)/r,n(i)),t},t}function et(){var t=Y(O,I.b);return t.copy=function(){return P(t,et())},nt(t)}function rt(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=S.call(e,D),n):t.slice()},n.copy=function(){return rt().domain(t)},nt(n)}var it=function(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;hc)break;g.push(f)}}else for(;h=1;--l)if(!((f=s*l)c)break;g.push(f)}}else g=d(h,p,Math.min(p-h,m)).map(i);return o?g.reverse():g},t.tickFormat=function(n,o){if(null==o&&(o=10===e?".0e":","),"function"!=typeof o&&(o=G(o)),n===1/0)return o;null==n&&(n=10);var a=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/i(Math.round(r(t)));return n*e0?e[i-1]:t[0],i=e?[r[e-1],n]:[r[a-1],r[a]]},o.copy=function(){return gt().domain([t,n]).range(i)},nt(o)}function vt(){var t=[.5],n=[0,1],e=1;function r(r){if(r<=r)return n[u(t,r,0,e)]}return r.domain=function(i){return arguments.length?(t=A.call(i),e=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(i){return arguments.length?(n=A.call(i),e=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},r.copy=function(){return vt().domain(t).range(n)},r}var yt=new Date,wt=new Date;function bt(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return yt.setTime(+n),wt.setTime(+r),t(yt),t(wt),Math.floor(e(yt,wt))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var Mt=bt(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});Mt.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?bt(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Mt:null};var xt=Mt,_t=(Mt.range,6e4),kt=6048e5,St=bt(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),At=St,zt=(St.range,bt(function(t){t.setTime(Math.floor(t/_t)*_t)},function(t,n){t.setTime(+t+n*_t)},function(t,n){return(n-t)/_t},function(t){return t.getMinutes()})),Ct=zt,Tt=(zt.range,bt(function(t){var n=t.getTimezoneOffset()*_t%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()})),Nt=Tt,It=(Tt.range,bt(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*_t)/864e5},function(t){return t.getDate()-1})),Ut=It;It.range;function Dt(t){return bt(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*_t)/kt})}var jt=Dt(0),Ot=Dt(1),Lt=Dt(2),Et=Dt(3),Pt=Dt(4),Yt=Dt(5),Ft=Dt(6),Zt=(jt.range,Ot.range,Lt.range,Et.range,Pt.range,Yt.range,Ft.range,bt(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()})),Ht=Zt,Rt=(Zt.range,bt(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()}));Rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?bt(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var Xt=Rt,Jt=(Rt.range,bt(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*_t)},function(t,n){return(n-t)/_t},function(t){return t.getUTCMinutes()})),Vt=Jt,Bt=(Jt.range,bt(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()})),qt=Bt,Gt=(Bt.range,bt(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1})),$t=Gt;Gt.range;function Wt(t){return bt(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/kt})}var Qt=Wt(0),Kt=Wt(1),tn=Wt(2),nn=Wt(3),en=Wt(4),rn=Wt(5),on=Wt(6),an=(Qt.range,Kt.range,tn.range,nn.range,en.range,rn.range,on.range,bt(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()})),un=an,cn=(an.range,bt(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()}));cn.every=function(t){return isFinite(t=Math.floor(t))&&t>0?bt(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var sn=cn;cn.range;function ln(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function fn(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function hn(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}var pn,dn,mn,gn,vn={"-":"",_:" ",0:"0"},yn=/^\s*\d+/,wn=/^%/,bn=/[\\^$*+?|[\]().{}]/g;function Mn(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function Un(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Dn(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function jn(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function On(t,n,e){var r=yn.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function Ln(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function En(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Pn(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function Yn(t,n,e){var r=yn.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Fn(t,n,e){var r=yn.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Zn(t,n,e){var r=wn.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Hn(t,n,e){var r=yn.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Rn(t,n,e){var r=yn.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function Xn(t,n){return Mn(t.getDate(),n,2)}function Jn(t,n){return Mn(t.getHours(),n,2)}function Vn(t,n){return Mn(t.getHours()%12||12,n,2)}function Bn(t,n){return Mn(1+Ut.count(Xt(t),t),n,3)}function qn(t,n){return Mn(t.getMilliseconds(),n,3)}function Gn(t,n){return qn(t,n)+"000"}function $n(t,n){return Mn(t.getMonth()+1,n,2)}function Wn(t,n){return Mn(t.getMinutes(),n,2)}function Qn(t,n){return Mn(t.getSeconds(),n,2)}function Kn(t){var n=t.getDay();return 0===n?7:n}function te(t,n){return Mn(jt.count(Xt(t),t),n,2)}function ne(t,n){var e=t.getDay();return t=e>=4||0===e?Pt(t):Pt.ceil(t),Mn(Pt.count(Xt(t),t)+(4===Xt(t).getDay()),n,2)}function ee(t){return t.getDay()}function re(t,n){return Mn(Ot.count(Xt(t),t),n,2)}function ie(t,n){return Mn(t.getFullYear()%100,n,2)}function oe(t,n){return Mn(t.getFullYear()%1e4,n,4)}function ae(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Mn(n/60|0,"0",2)+Mn(n%60,"0",2)}function ue(t,n){return Mn(t.getUTCDate(),n,2)}function ce(t,n){return Mn(t.getUTCHours(),n,2)}function se(t,n){return Mn(t.getUTCHours()%12||12,n,2)}function le(t,n){return Mn(1+$t.count(sn(t),t),n,3)}function fe(t,n){return Mn(t.getUTCMilliseconds(),n,3)}function he(t,n){return fe(t,n)+"000"}function pe(t,n){return Mn(t.getUTCMonth()+1,n,2)}function de(t,n){return Mn(t.getUTCMinutes(),n,2)}function me(t,n){return Mn(t.getUTCSeconds(),n,2)}function ge(t){var n=t.getUTCDay();return 0===n?7:n}function ve(t,n){return Mn(Qt.count(sn(t),t),n,2)}function ye(t,n){var e=t.getUTCDay();return t=e>=4||0===e?en(t):en.ceil(t),Mn(en.count(sn(t),t)+(4===sn(t).getUTCDay()),n,2)}function we(t){return t.getUTCDay()}function be(t,n){return Mn(Kt.count(sn(t),t),n,2)}function Me(t,n){return Mn(t.getUTCFullYear()%100,n,2)}function xe(t,n){return Mn(t.getUTCFullYear()%1e4,n,4)}function _e(){return"+0000"}function ke(){return"%"}function Se(t){return+t}function Ae(t){return Math.floor(+t/1e3)}!function(t){pn=function(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,c=t.shortMonths,s=_n(i),l=kn(i),f=_n(o),h=kn(o),p=_n(a),d=kn(a),m=_n(u),g=kn(u),v=_n(c),y=kn(c),w={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:Xn,e:Xn,f:Gn,H:Jn,I:Vn,j:Bn,L:qn,m:$n,M:Wn,p:function(t){return i[+(t.getHours()>=12)]},Q:Se,s:Ae,S:Qn,u:Kn,U:te,V:ne,w:ee,W:re,x:null,X:null,y:ie,Y:oe,Z:ae,"%":ke},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:ue,e:ue,f:he,H:ce,I:se,j:le,L:fe,m:pe,M:de,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Se,s:Ae,S:me,u:ge,U:ve,V:ye,w:we,W:be,x:null,X:null,y:Me,Y:xe,Z:_e,"%":ke},M={a:function(t,n,e){var r=p.exec(n.slice(e));return r?(t.w=d[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=y[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=m.exec(n.slice(e));return r?(t.m=g[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return k(t,n,e,r)},d:jn,e:jn,f:Fn,H:Ln,I:Ln,j:On,L:Yn,m:Dn,M:En,p:function(t,n,e){var r=s.exec(n.slice(e));return r?(t.p=l[r[0].toLowerCase()],e+r[0].length):-1},Q:Hn,s:Rn,S:Pn,u:An,U:zn,V:Cn,w:Sn,W:Tn,x:function(t,n,r){return k(t,e,n,r)},X:function(t,n,e){return k(t,r,n,e)},y:In,Y:Nn,Z:Un,"%":Zn};function x(t,n){return function(e){var r,i,o,a=[],u=-1,c=0,s=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=(r=fn(hn(o.y))).getUTCDay())>4||0===i?Kt.ceil(r):Kt(r),r=$t.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(r=(i=(r=n(hn(o.y))).getDay())>4||0===i?Ot.ceil(r):Ot(r),r=Ut.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?fn(hn(o.y)).getUTCDay():n(hn(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,fn(o)):n(o)}}function k(t,n,e,r){for(var i,o,a=0,u=n.length,c=e.length;a=c)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=M[i in vn?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return w.x=x(e,w),w.X=x(r,w),w.c=x(n,w),b.x=x(e,b),b.X=x(r,b),b.c=x(n,b),{format:function(t){var n=x(t+="",w);return n.toString=function(){return t},n},parse:function(t){var n=_(t+="",ln);return n.toString=function(){return t},n},utcFormat:function(t){var n=x(t+="",b);return n.toString=function(){return t},n},utcParse:function(t){var n=_(t,fn);return n.toString=function(){return t},n}}}(t),dn=pn.format,pn.parse,mn=pn.utcFormat,gn=pn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Date.prototype.toISOString||mn("%Y-%m-%dT%H:%M:%S.%LZ");+new Date("2000-01-01T00:00:00.000Z")||gn("%Y-%m-%dT%H:%M:%S.%LZ");var ze=1e3,Ce=60*ze,Te=60*Ce,Ne=24*Te,Ie=7*Ne,Ue=30*Ne,De=365*Ne;function je(t){return new Date(t)}function Oe(t){return t instanceof Date?+t:+new Date(+t)}function Le(t,n,e,r,o,a,u,c,s){var l=Y(O,I.b),f=l.invert,h=l.domain,p=s(".%L"),d=s(":%S"),m=s("%I:%M"),v=s("%I %p"),y=s("%a %d"),w=s("%b %d"),b=s("%B"),M=s("%Y"),x=[[u,1,ze],[u,5,5*ze],[u,15,15*ze],[u,30,30*ze],[a,1,Ce],[a,5,5*Ce],[a,15,15*Ce],[a,30,30*Ce],[o,1,Te],[o,3,3*Te],[o,6,6*Te],[o,12,12*Te],[r,1,Ne],[r,2,2*Ne],[e,1,Ie],[n,1,Ue],[n,3,3*Ue],[t,1,De]];function _(i){return(u(i)0&&n>0&&(this.mark=this.CanvasArea.append("circle").attr("id",e.cpId).attr("class","control-point-static").attr("dr",this.optionMarkerShadowSize).attr("r",this.optionMarkerShadowSize/i).attr("cx",t).attr("cy",n).on("mouseover",function(t){return r.tip.style("left",s.event.pageX-30+"px").style("top",s.event.pageY-50+"px").style("display","inline-block").style("visibility","visible").html('
'+e.name+"
")}).on("mousemove",function(t){return r.tip.style("left",s.event.pageX-30+"px").style("top",s.event.pageY-50+"px").style("display","inline-block").html('
'+e.name+"
")}).on("mouseout",function(t){return r.tip.style("visibility","hidden")}).on("click",function(t,n){s.event.stopPropagation(),r.events.onMarkClick?r.events.onMarkClick({photoId:r.imgId,cpId:e.cpId}):r.onMarkClick({photoId:r.imgId,cpId:e.cpId})}))}},{key:"reDrawMarker",value:function(){if(this.CanvasArea){this.CanvasArea.selectAll("use.control-point").remove(),this.CanvasArea.selectAll("circle.control-point").remove(),this.CanvasArea.selectAll("circle.shadow").remove();var t=f.zoomTransform(this.cartesianSystem.node()).k;if(this.pin.pixelLocation[0]>0&&this.pin.pixelLocation[1]>0){var n=this.pin.pixelLocation[0],e=this.pin.pixelLocation[1];this.targetIcon?this.mark=this.CanvasArea.append("use").attr("id",this.cpId).attr("xlink:href",this.targetIcon).attr("class","control-point").attr("width",this.optionMarkerSize/t).attr("height",this.optionMarkerSize/t).attr("x",n-this.optionMarkerSize/t/2).attr("y",e-this.optionMarkerSize/t/2):this.mark=this.CanvasArea.append("circle").attr("id",this.cpId).attr("class","control-point").attr("dr",this.optionMarkerShadowSize+6).attr("r",this.optionMarkerShadowSize/t+6).attr("cx",n).attr("cy",e),this.CanvasArea.append("circle").attr("class","shadow").attr("dr",this.optionMarkerShadowSize).attr("r",this.optionMarkerShadowSize/t).attr("cx",n).attr("cy",e)}}}},{key:"drawMarker",value:function(t,n){if(this.CanvasArea){if(this.CanvasArea.selectAll("use.control-point").remove(),this.CanvasArea.selectAll("circle.control-point").remove(),this.CanvasArea.selectAll("circle.shadow").remove(),!t&&!n){var e=f.mouse(s.event.currentTarget);t=e[0],n=e[1],this.pin={marked:!0,pixelLocation:[t,n]}}var r=f.zoomTransform(this.cartesianSystem.node()).k;t>0&&n>0&&(this.targetIcon?this.mark=this.CanvasArea.append("use").attr("id",this.cpId).attr("xlink:href",this.targetIcon).attr("class","control-point").attr("width",this.optionMarkerSize/r).attr("height",this.optionMarkerSize/r).attr("x",t-this.optionMarkerSize/r/2).attr("y",n-this.optionMarkerSize/r/2):this.mark=this.CanvasArea.append("circle").attr("id",this.cpId).attr("class","control-point").attr("dr",this.optionMarkerShadowSize).attr("r",this.optionMarkerShadowSize/r).attr("cx",t).attr("cy",n),this.CanvasArea.append("circle").attr("class","shadow").attr("dr",this.optionMarkerShadowSize).attr("r",this.optionMarkerShadowSize/r).attr("cx",t).attr("cy",n),this.events.onMark?this.events.onMark({photoId:this.imgId,cpId:this.cpId,x:t,y:n}):this.onMark({photoId:this.imgId,cpId:this.cpId,x:t,y:n}))}}},{key:"clearMarker",value:function(){this.CanvasArea&&(this.CanvasArea.selectAll("use.control-point").remove(),this.CanvasArea.selectAll("circle.control-point").remove(),this.CanvasArea.selectAll("circle.shadow").remove(),this.pin={marked:!1,pixelLocation:[]},this.events.onMarkDelete?this.events.onMarkDelete({photoId:this.imgId,cpId:this.cpId}):this.onMarkDelete({photoId:this.imgId,cpId:this.cpId}))}},{key:"findCP",value:function(t){if(t||(t=0),this.pin&&this.pin.pixelLocation&&2===this.pin.pixelLocation.length){var n=this.width/2-this.pin.pixelLocation[0]*this.optionScaleLocateZoom,e=this.height/2-this.pin.pixelLocation[1]*this.optionScaleLocateZoom;this.cartesianSystem.transition().duration(t).call(this._zoomStrat().transform,f.zoomIdentity.translate(n,e).scale(this.optionScaleLocateZoom))}else this.resetZoom(750);this.events.onZoomToCP?this.events.onZoomToCP():this.onZoomToCP()}},{key:"zoomIn",value:function(){var t=f.zoomTransform(this.cartesianSystem.node()).k,n=f.zoomTransform(this.cartesianSystem.node()).x*t-this.width*t/2,e=f.zoomTransform(this.cartesianSystem.node()).y*t-this.height*t/2;this.cartesianSystem.transition().duration(375).call(this._zoomStrat().transform,f.zoomIdentity.translate(n,e).scale(2*t))}},{key:"zoomOut",value:function(){var t=f.zoomTransform(this.cartesianSystem.node()).k,n=f.zoomTransform(this.cartesianSystem.node()).x*t-this.width*t/2,e=f.zoomTransform(this.cartesianSystem.node()).y*t-this.height*t/2;this.cartesianSystem.transition().duration(375).call(this._zoomStrat().transform,f.zoomIdentity.translate(n,e).scale(t/2))}},{key:"_zoomStrat",value:function(){var t=this;return f.zoom().scaleExtent([this.optionScaleMin,this.optionScaleMax]).on("zoom",function(){var n=t.optionMarkerSize;t.CanvasArea.attr("transform",s.event.transform),t.pX.call(t.xAxis.scale(s.event.transform.rescaleX(t.xScale))),t.pY.call(t.yAxis.scale(s.event.transform.rescaleY(t.yScale))),s.event.transform&&(t.CanvasArea.selectAll("use.control-point").each(function(t){var e=f.select(this),r=s.event.transform.k,i=(parseFloat(e.attr("width"))-n/r)/2,o=(parseFloat(e.attr("height"))-n/r)/2,a=parseFloat(e.attr("x"))+i,u=parseFloat(e.attr("y"))+o;e.attr("width",n/r),e.attr("height",n/r),e.attr("x",a),e.attr("y",u)}),t.CanvasArea.selectAll("circle.control-point").each(function(t){var n=f.select(this),e=s.event.transform.k;n.attr("dr")&&(e=n.attr("dr")/e),n.attr("r",e)}),t.CanvasArea.selectAll("circle.shadow").each(function(t){var n=f.select(this),e=s.event.transform.k;n.attr("dr")&&(e=n.attr("dr")/e),n.attr("r",e)}),t.CanvasArea.selectAll("circle.control-point-static").each(function(t){var n=f.select(this),e=s.event.transform.k;n.attr("dr")&&(e=n.attr("dr")/e),n.attr("r",e)}))})}},{key:"_init",value:function(){var t=this;this.xScale=f.scaleLinear().domain([-1,this.img.width+1]).range([-1,this.img.width+1]),this.yScale=f.scaleLinear().domain([-1,this.img.height+1]).range([-1,this.img.height+1]),this.xAxis=f.axisBottom(this.xScale).ticks(20).tickSize(10).tickPadding(5),this.yAxis=f.axisRight(this.yScale).ticks(20).tickSize(10).tickPadding(5),this.pX=this.cartesianSystem.append("g").attr("class","axis axis--x").call(this.xAxis),this.pY=this.cartesianSystem.append("g").attr("class","axis axis--y").call(this.yAxis),this.CanvasArea=this.cartesianSystem.append("g").attr("class","canvas"),f.selectAll("#d3-tooltip").remove(),this.tip=f.select("body").append("div").attr("id","d3-tooltip"),this.CanvasImage=this.CanvasArea.append("svg:image").attr("xlink:href",this.img.src||this.img).attr("x",0).attr("y",0).attr("width",this.img.width).attr("height",this.img.height),this.resetDimentions(),this.CanvasArea.on("click",this.drawMarker.bind(this)),this.cartesianSystem.call(this._zoomStrat().bind(this)),this.resetZoom.bind(this),this.events.onReady?this.events.onReady(this.cpId):this.onReady(this.cpId),this.objects&&this.objects.length&&this.objects.forEach(function(n){t.drawStatic(n.xPos,n.yPos,n)}),this.pin&&this.pin.pixelLocation&&2===this.pin.pixelLocation.length?(this.drawMarker(this.pin.pixelLocation[0],this.pin.pixelLocation[1]),this.findCP()):this.resetZoom()}},{key:"onReady",value:function(t){}},{key:"onMark",value:function(t){}},{key:"onMarkClick",value:function(t){}},{key:"onMarkDelete",value:function(t){}},{key:"onZoomReset",value:function(t){}},{key:"onZoomToCP",value:function(t){}},{key:"resetDimentions",value:function(){this.cartesianSystem&&(this.width=parseFloat(this.cartesianSystem.style("width")),this.height=parseFloat(this.cartesianSystem.style("height")))}}]),t}();n.default=h,t.exports=n.default},function(t,n,e){"use strict"},function(t,n){t.exports=function(t){var n="undefined"!=typeof window&&window.location;if(!n)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var e=n.protocol+"//"+n.host,r=e+n.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,n){var i,o=n.trim().replace(/^"(.*)"$/,function(t,n){return n}).replace(/^'(.*)'$/,function(t,n){return n});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(o)?t:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?e+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")})}},function(t,n,e){var r={},i=function(t){var n;return function(){return void 0===n&&(n=t.apply(this,arguments)),n}}(function(){return window&&document&&document.all&&!window.atob}),o=function(t){var n={};return function(t){return void 0===n[t]&&(n[t]=function(t){return document.querySelector(t)}.call(this,t)),n[t]}}(),a=null,u=0,c=[],s=e(11);function l(t,n){for(var e=0;e=0&&c.splice(n,1)}function d(t){var n=document.createElement("style");return t.attrs.type="text/css",m(n,t.attrs),h(t,n),n}function m(t,n){Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])})}function g(t,n){var e,r,i,o;if(n.transform&&t.css){if(!(o=n.transform(t.css)))return function(){};t.css=o}if(n.singleton){var c=u++;e=a||(a=d(n)),r=y.bind(null,e,c,!1),i=y.bind(null,e,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=function(t){var n=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",m(n,t.attrs),h(t,n),n}(n),r=function(t,n,e){var r=e.css,i=e.sourceMap,o=void 0===n.convertToAbsoluteUrls&&i;(n.convertToAbsoluteUrls||o)&&(r=s(r));i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),u=t.href;t.href=URL.createObjectURL(a),u&&URL.revokeObjectURL(u)}.bind(null,e,n),i=function(){p(e),e.href&&URL.revokeObjectURL(e.href)}):(e=d(n),r=function(t,n){var e=n.css,r=n.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}.bind(null,e),i=function(){p(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else i()}}t.exports=function(t,n){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(n=n||{}).attrs="object"==typeof n.attrs?n.attrs:{},n.singleton||(n.singleton=i()),n.insertInto||(n.insertInto="head"),n.insertAt||(n.insertAt="bottom");var e=f(t,n);return l(e,n),function(t){for(var i=[],o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),i.hasOwnProperty(n)?{space:i[n],local:t}:t};var a=function(t){var n=o(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===r&&n.documentElement.namespaceURI===r?n.createElement(t):n.createElementNS(e,t)}})(n)};function u(){}var c=function(t){return null==t?u:function(){return this.querySelector(t)}};function s(){return[]}var l=function(t){return null==t?s:function(){return this.querySelectorAll(t)}},f=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var h=document.documentElement;if(!h.matches){var p=h.webkitMatchesSelector||h.msMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector;f=function(t){return function(){return p.call(this,t)}}}}var d=f,m=function(t){return new Array(t.length)};function g(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}g.prototype={constructor:g,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var v="$";function y(t,n,e,r,i,o){for(var a,u=0,c=n.length,s=o.length;un?1:t>=n?0:NaN}var M=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function x(t,n){return t.style.getPropertyValue(n)||M(t).getComputedStyle(t,null).getPropertyValue(n)}function _(t){return t.trim().split(/^|\s+/)}function k(t){return t.classList||new S(t)}function S(t){this._node=t,this._names=_(t.getAttribute("class")||"")}function A(t,n){for(var e=k(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function C(){this.textContent=""}function T(){this.innerHTML=""}function N(){this.nextSibling&&this.parentNode.appendChild(this)}function I(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function U(){return null}function D(){var t=this.parentNode;t&&t.removeChild(this)}function j(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function O(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var L={},E=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(L={mouseenter:"mouseover",mouseleave:"mouseout"}));function P(t,n,e){return t=Y(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function Y(t,n,e){return function(r){var i=E;E=r;try{t.call(this,this.__data__,n,e)}finally{E=i}}}function F(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=x&&(x=M+1);!(b=g[x])&&++x=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=b);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):x(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=_(t+"");if(arguments.length<2){for(var r=k(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?Z:F,null==e&&(e=!1),r=0;r>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=l.exec(t))?w(parseInt(n[1],16)):(n=f.exec(t))?new _(n[1],n[2],n[3],1):(n=h.exec(t))?new _(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=p.exec(t))?b(n[1],n[2],n[3],n[4]):(n=d.exec(t))?b(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=m.exec(t))?k(n[1],n[2]/100,n[3]/100,1):(n=g.exec(t))?k(n[1],n[2]/100,n[3]/100,n[4]):v.hasOwnProperty(t)?w(v[t]):"transparent"===t?new _(NaN,NaN,NaN,0):null}function w(t){return new _(t>>16&255,t>>8&255,255&t,1)}function b(t,n,e,r){return r<=0&&(t=n=e=NaN),new _(t,n,e,r)}function M(t){return t instanceof o||(t=y(t)),t?new _((t=t.rgb()).r,t.g,t.b,t.opacity):new _}function x(t,n,e,r){return 1===arguments.length?M(t):new _(t,n,e,null==r?1:r)}function _(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function k(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new A(t,n,e,r)}function S(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof A)return new A(t.h,t.s,t.l,t.opacity);if(t instanceof o||(t=y(t)),!t)return new A;if(t instanceof A)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),a=Math.max(n,e,r),u=NaN,c=a-i,s=(a+i)/2;return c?(u=n===a?(e-r)/c+6*(e0&&s<1?0:u,new A(u,c,s,t.opacity)}(t):new A(t,n,e,null==r?1:r)}function A(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function z(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}r(o,y,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),r(_,x,i(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),r(A,S,i(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new A(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new A(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new _(z(t>=240?t-240:t+120,i,r),z(t,i,r),z(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var C=Math.PI/180,T=180/Math.PI,N=.95047,I=1,U=1.08883,D=4/29,j=6/29,O=3*j*j,L=j*j*j;function E(t){if(t instanceof Y)return new Y(t.l,t.a,t.b,t.opacity);if(t instanceof J){var n=t.h*C;return new Y(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof _||(t=M(t));var e=R(t.r),r=R(t.g),i=R(t.b),o=F((.4124564*e+.3575761*r+.1804375*i)/N),a=F((.2126729*e+.7151522*r+.072175*i)/I);return new Y(116*a-16,500*(o-a),200*(a-F((.0193339*e+.119192*r+.9503041*i)/U)),t.opacity)}function P(t,n,e,r){return 1===arguments.length?E(t):new Y(t,n,e,null==r?1:r)}function Y(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function F(t){return t>L?Math.pow(t,1/3):t/O+D}function Z(t){return t>j?t*t*t:O*(t-D)}function H(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function R(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function X(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof J)return new J(t.h,t.c,t.l,t.opacity);t instanceof Y||(t=E(t));var n=Math.atan2(t.b,t.a)*T;return new J(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new J(t,n,e,null==r?1:r)}function J(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}r(Y,P,i(o,{brighter:function(t){return new Y(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Y(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=I*Z(t),new _(H(3.2404542*(n=N*Z(n))-1.5371385*t-.4985314*(e=U*Z(e))),H(-.969266*n+1.8760108*t+.041556*e),H(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),r(J,X,i(o,{brighter:function(t){return new J(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new J(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return E(this).rgb()}}));var V=-.14861,B=1.78277,q=-.29227,G=-.90649,$=1.97294,W=$*G,Q=$*B,K=B*q-G*V;function tt(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof nt)return new nt(t.h,t.s,t.l,t.opacity);t instanceof _||(t=M(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(K*r+W*n-Q*e)/(K+W-Q),o=r-i,a=($*(e-i)-q*o)/G,u=Math.sqrt(a*a+o*o)/($*i*(1-i)),c=u?Math.atan2(a,o)*T-120:NaN;return new nt(c<0?c+360:c,u,i,t.opacity)}(t):new nt(t,n,e,null==r?1:r)}function nt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}r(nt,tt,i(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new nt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new nt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*C,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new _(255*(n+e*(V*r+B*i)),255*(n+e*(q*r+G*i)),255*(n+e*($*r)),this.opacity)}})),e.d(n,"a",function(){return y}),e.d(n,"f",function(){return x}),e.d(n,"d",function(){return S}),e.d(n,"e",function(){return P}),e.d(n,"c",function(){return X}),e.d(n,"b",function(){return tt})},function(t,n,e){"use strict";var r=e(1);function i(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}var o=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),o=t[r],a=t[r+1],u=r>0?t[r-1]:2*o-a,c=r180||e<-180?e-360*Math.round(e/360):e):u(isNaN(t)?n:t)}function l(t){return 1==(t=+t)?f:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):u(isNaN(n)?e:n)}}function f(t,n){var e=n-t;return e?c(t,e):u(isNaN(t)?n:t)}var h=function t(n){var e=l(n);function i(t,n){var i=e((t=Object(r.f)(t)).r,(n=Object(r.f)(n)).r),o=e(t.g,n.g),a=e(t.b,n.b),u=f(t.opacity,n.opacity);return function(n){return t.r=i(n),t.g=o(n),t.b=a(n),t.opacity=u(n),t+""}}return i.gamma=t,i}(1);function p(t){return function(n){var e,i,o=n.length,a=new Array(o),u=new Array(o),c=new Array(o);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:y(e,r)})),o=M.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:y(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:y(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:y(t,e)},{i:u-2,x:y(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}(t+"",r),o=-1,c=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o0)for(var e,r,i=new Array(e),o=0;o=0&&n._call.call(null,t),n=n._next;--u}()}finally{u=0,function(){var t,n,e=r,o=1/0;for(;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:r=n);i=t,x(o)}(),h=0}}function M(){var t=d.now(),n=t-f;n>l&&(p-=n,f=t)}function x(t){u||(c&&(c=clearTimeout(c)),t-h>24?(t<1/0&&(c=setTimeout(b,t-d.now()-p)),s&&(s=clearInterval(s))):(s||(f=d.now(),s=setInterval(M,l)),u=1,m(b)))}y.prototype=w.prototype={constructor:y,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?g():+e)+(null==n?0:+n),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=e,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}};var _=function(t,n,e){var r=new y;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r},k=Object(a.a)("start","end","interrupt"),S=[],A=0,z=1,C=2,T=3,N=4,I=5,U=6,D=function(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(c){var s,l,f,h;if(e.state!==z)return u();for(s in i)if((h=i[s]).name===e.name){if(h.state===T)return _(o);h.state===N?(h.state=U,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[s]):+sA)throw new Error("too late; already scheduled");return e}function O(t,n){var e=L(t,n);if(e.state>C)throw new Error("too late; already started");return e}function L(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var E=function(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>C&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?j:O;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=Object(o.namespace)(t),r="transform"===e?P.g:Z;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var a,u=e(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===u?null:a===r&&u===i?o:o=n(r=a,i=u);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var a,u=e(this);if(null!=u)return(a=this.getAttribute(t))===u?null:a===r&&u===i?o:o=n(r=a,i=u);this.removeAttribute(t)}})(e,r,Y(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}:function(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=Object(o.namespace)(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?P.f:Z;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var a=Object(o.style)(this,t),u=(this.style.removeProperty(t),Object(o.style)(this,t));return a===u?null:a===e&&u===r?i:i=n(e=a,r=u)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,a;return function(){var u=Object(o.style)(this,t),c=e(this);return null==c&&(this.style.removeProperty(t),c=Object(o.style)(this,t)),u===c?null:u===r&&c===i?a:a=n(r=u,i=c)}}(t,r,Y(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var a=Object(o.style)(this,t);return a===e?null:a===r?i:i=n(r=a,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Y(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=L(this.node(),e).tween,o=0,a=i.length;oz&&e.name===n)return new X([[t]],W,n,+r);return null};e.d(n,"transition",function(){return J}),e.d(n,"active",function(){return Q}),e.d(n,"interrupt",function(){return E})},function(t,n,e){"use strict";e.r(n);var r=Array.prototype.slice,i=function(t){return t},o=1,a=2,u=3,c=4,s=1e-6;function l(t){return"translate("+(t+.5)+",0)"}function f(t){return"translate(0,"+(t+.5)+")"}function h(){return!this.__axis}function p(t,n){var e=[],p=null,d=null,m=6,g=6,v=3,y=t===o||t===c?-1:1,w=t===c||t===a?"x":"y",b=t===o||t===u?l:f;function M(r){var l=null==p?n.ticks?n.ticks.apply(n,e):n.domain():p,f=null==d?n.tickFormat?n.tickFormat.apply(n,e):i:d,M=Math.max(m,0)+v,x=n.range(),_=+x[0]+.5,k=+x[x.length-1]+.5,S=(n.bandwidth?function(t){var n=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(n=Math.round(n)),function(e){return+t(e)+n}}:function(t){return function(n){return+t(n)}})(n.copy()),A=r.selection?r.selection():r,z=A.selectAll(".domain").data([null]),C=A.selectAll(".tick").data(l,n).order(),T=C.exit(),N=C.enter().append("g").attr("class","tick"),I=C.select("line"),U=C.select("text");z=z.merge(z.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),C=C.merge(N),I=I.merge(N.append("line").attr("stroke","#000").attr(w+"2",y*m)),U=U.merge(N.append("text").attr("fill","#000").attr(w,y*M).attr("dy",t===o?"0em":t===u?"0.71em":"0.32em")),r!==A&&(z=z.transition(r),C=C.transition(r),I=I.transition(r),U=U.transition(r),T=T.transition(r).attr("opacity",s).attr("transform",function(t){return isFinite(t=S(t))?b(t):this.getAttribute("transform")}),N.attr("opacity",s).attr("transform",function(t){var n=this.parentNode.__axis;return b(n&&isFinite(n=n(t))?n:S(t))})),T.remove(),z.attr("d",t===c||t==a?"M"+y*g+","+_+"H0.5V"+k+"H"+y*g:"M"+_+","+y*g+"V0.5H"+k+"V"+y*g),C.attr("opacity",1).attr("transform",function(t){return b(S(t))}),I.attr(w+"2",y*m),U.attr(w,y*M).text(f),A.filter(h).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===a?"start":t===c?"end":"middle"),A.each(function(){this.__axis=S})}return M.scale=function(t){return arguments.length?(n=t,M):n},M.ticks=function(){return e=r.call(arguments),M},M.tickArguments=function(t){return arguments.length?(e=null==t?[]:r.call(t),M):e.slice()},M.tickValues=function(t){return arguments.length?(p=null==t?null:r.call(t),M):p&&p.slice()},M.tickFormat=function(t){return arguments.length?(d=t,M):d},M.tickSize=function(t){return arguments.length?(m=g=+t,M):m},M.tickSizeInner=function(t){return arguments.length?(m=+t,M):m},M.tickSizeOuter=function(t){return arguments.length?(g=+t,M):g},M.tickPadding=function(t){return arguments.length?(v=+t,M):v},M}function d(t){return p(o,t)}function m(t){return p(a,t)}function g(t){return p(u,t)}function v(t){return p(c,t)}e.d(n,"axisTop",function(){return d}),e.d(n,"axisRight",function(){return m}),e.d(n,"axisBottom",function(){return g}),e.d(n,"axisLeft",function(){return v})},function(t,n,e){"use strict";e.r(n);var r=e(3),i=e(0);var o=function(){i.event.preventDefault(),i.event.stopImmediatePropagation()},a=function(t){var n=t.document.documentElement,e=Object(i.select)(t).on("dragstart.drag",o,!0);"onselectstart"in n?e.on("selectstart.drag",o,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};function u(t,n){var e=t.document.documentElement,r=Object(i.select)(t).on("dragstart.drag",null);n&&(r.on("click.drag",o,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function c(t,n,e,r,i,o,a,u,c,s){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=u,this.dy=c,this._=s}c.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var s=e(2),l=e(4),f=function(t){return function(){return t}};function h(t,n,e){this.k=t,this.x=n,this.y=e}h.prototype={constructor:h,scale:function(t){return 1===t?this:new h(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new h(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var p=new h(1,0,0);function d(t){return t.__zoom||p}function m(){i.event.stopImmediatePropagation()}d.prototype=h.prototype;var g=function(){i.event.preventDefault(),i.event.stopImmediatePropagation()};function v(){return!i.event.button}function y(){var t,n,e=this;return e instanceof SVGElement?(t=(e=e.ownerSVGElement||e).width.baseVal.value,n=e.height.baseVal.value):(t=e.clientWidth,n=e.clientHeight),[[0,0],[t,n]]}function w(){return this.__zoom||p}function b(){return-i.event.deltaY*(i.event.deltaMode?120:1)/500}function M(){return"ontouchstart"in this}function x(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var _=function(){var t,n,e=v,o=y,c=x,d=b,_=M,k=[0,1/0],S=[[-1/0,-1/0],[1/0,1/0]],A=250,z=s.h,C=[],T=Object(r.a)("start","zoom","end"),N=500,I=150,U=0;function D(t){t.property("__zoom",w).on("wheel.zoom",F).on("mousedown.zoom",Z).on("dblclick.zoom",H).filter(_).on("touchstart.zoom",R).on("touchmove.zoom",X).on("touchend.zoom touchcancel.zoom",J).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function j(t,n){return(n=Math.max(k[0],Math.min(k[1],n)))===t.k?t:new h(n,t.x,t.y)}function O(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new h(t.k,r,i)}function L(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function E(t,n,e){t.on("start.zoom",function(){P(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).end()}).tween("zoom",function(){var t=arguments,r=P(this,t),i=o.apply(this,t),a=e||L(i),u=Math.max(i[1][0]-i[0][0],i[1][1]-i[0][1]),c=this.__zoom,s="function"==typeof n?n.apply(this,t):n,l=z(c.invert(a).concat(u/c.k),s.invert(a).concat(u/s.k));return function(t){if(1===t)t=s;else{var n=l(t),e=u/n[2];t=new h(e,a[0]-n[0]*e,a[1]-n[1]*e)}r.zoom(null,t)}})}function P(t,n){for(var e,r=0,i=C.length;rU}t.zoom("mouse",c(O(t.that.__zoom,t.mouse[0]=Object(i.mouse)(t.that),t.mouse[1]),t.extent,S))},!0).on("mouseup.zoom",function(){r.on("mousemove.zoom mouseup.zoom",null),u(i.event.view,t.moved),g(),t.end()},!0),o=Object(i.mouse)(this),s=i.event.clientX,f=i.event.clientY;a(i.event.view),m(),t.mouse=[o,this.__zoom.invert(o)],Object(l.interrupt)(this),t.start()}}function H(){if(e.apply(this,arguments)){var t=this.__zoom,n=Object(i.mouse)(this),r=t.invert(n),a=t.k*(i.event.shiftKey?.5:2),u=c(O(j(t,a),n,r),o.apply(this,arguments),S);g(),A>0?Object(i.select)(this).transition().duration(A).call(E,u,n):Object(i.select)(this).call(D.transform,u)}}function R(){if(e.apply(this,arguments)){var n,r,o,a,u=P(this,arguments),c=i.event.changedTouches,s=c.length;for(m(),r=0;rn?1:t>=n?0:NaN},i=function(t){return 1===t.length&&(t=function(t){return function(n,e){return r(t(n),e)}}(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}};var o=i(r),a=o.right,u=(o.left,a);var c=function(t){return null===t?NaN:+t},s=Array.prototype,l=(s.slice,s.map,function(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u=0?(o>=f?10:o>=h?5:o>=p?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=f?10:o>=h?5:o>=p?2:1)}function g(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=f?i*=10:o>=h?i*=5:o>=p&&(i*=2),n=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t);return a+(+e(t[o+1],o+1,t)-a)*(i-o)}};function y(){}function w(t,n){var e=new y;if(t instanceof y)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i2?E:L,r=i=null,l}function l(n){return(r||(r=e(o,a,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,u)))(+n)}return l.invert=function(t){return(i||(i=e(a,o,O,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},l.domain=function(t){return arguments.length?(o=S.call(t,D),s()):o.slice()},l.range=function(t){return arguments.length?(a=A.call(t),s()):a.slice()},l.rangeRound=function(t){return a=A.call(t),u=I.d,s()},l.clamp=function(t){return arguments.length?(c=!!t,s()):c},l.interpolate=function(t){return arguments.length?(u=t,s()):u},s()}var F,Z=function(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]},H=function(t){return(t=Z(Math.abs(t)))?t[1]:NaN},R=function(t,n){var e=Z(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},X={"":function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return R(100*t,n)},r:R,s:function(t,n){var e=Z(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(F=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Z(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},J=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function V(t){return new B(t)}function B(t){if(!(n=J.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",o=n[4]||"",a=!!n[5],u=n[6]&&+n[6],c=!!n[7],s=n[8]&&+n[8].slice(1),l=n[9]||"";"n"===l?(c=!0,l="g"):X[l]||(l=""),(a||"0"===e&&"="===r)&&(a=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=a,this.width=u,this.comma=c,this.precision=s,this.type=l}V.prototype=B.prototype,B.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var q,G,$,W=function(t){return t},Q=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],K=function(t){var n=t.grouping&&t.thousands?function(t,n){return function(e,r){for(var i=e.length,o=[],a=0,u=t[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(e.substring(i-=u,i+u)),!((c+=u+1)>r));)u=t[a=(a+1)%t.length];return o.reverse().join(n)}}(t.grouping,t.thousands):W,e=t.currency,r=t.decimal,i=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}}(t.numerals):W,o=t.percent||"%";function a(t){var a=(t=V(t)).fill,u=t.align,c=t.sign,s=t.symbol,l=t.zero,f=t.width,h=t.comma,p=t.precision,d=t.type,m="$"===s?e[0]:"#"===s&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",g="$"===s?e[1]:/[%p]/.test(d)?o:"",v=X[d],y=!d||/[defgprs%]/.test(d);function w(t){var e,o,s,w=m,b=g;if("c"===d)b=v(t)+b,t="";else{var M=(t=+t)<0;if(t=v(Math.abs(t),p),M&&0==+t&&(M=!1),w=(M?"("===c?c:"-":"-"===c||"("===c?"":c)+w,b=("s"===d?Q[8+F/3]:"")+b+(M&&"("===c?")":""),y)for(e=-1,o=t.length;++e(s=t.charCodeAt(e))||s>57){b=(46===s?r+t.slice(e+1):t.slice(e))+b,t=t.slice(0,e);break}}h&&!l&&(t=n(t,1/0));var x=w.length+t.length+b.length,_=x>1)+w+t+b+_.slice(x);break;default:t=_+w+t+b}return i(t)}return p=null==p?d?6:12:/[gprs]/.test(d)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),w.toString=function(){return t+""},w}return{format:a,formatPrefix:function(t,n){var e=a(((t=V(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(H(n)/3))),i=Math.pow(10,-r),o=Q[8+r/3];return function(t){return e(i*t)+o}}}};!function(t){q=K(t),G=q.format,$=q.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var tt=function(t,n,e){var r,i=t[0],o=t[t.length-1],a=g(i,o,null==n?10:n);switch((e=V(null==e?",f":e)).type){case"s":var u=Math.max(Math.abs(i),Math.abs(o));return null!=e.precision||isNaN(r=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(H(n)/3)))-H(Math.abs(t)))}(a,u))||(e.precision=r),$(e,u);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(r=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,H(n)-H(t))+1}(a,Math.max(Math.abs(i),Math.abs(o))))||(e.precision=r-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(r=function(t){return Math.max(0,-H(Math.abs(t)))}(a))||(e.precision=r-2*("%"===e.type))}return G(e)};function nt(t){var n=t.domain;return t.ticks=function(t){var e=n();return d(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return tt(n(),t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,a=i.length-1,u=i[o],c=i[a];return c0?r=m(u=Math.floor(u/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=m(u=Math.ceil(u*r)/r,c=Math.floor(c*r)/r,e)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(c/r)*r,n(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(c*r)/r,n(i)),t},t}function et(){var t=Y(O,I.b);return t.copy=function(){return P(t,et())},nt(t)}function rt(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=S.call(e,D),n):t.slice()},n.copy=function(){return rt().domain(t)},nt(n)}var it=function(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;hc)break;g.push(f)}}else for(;h=1;--l)if(!((f=s*l)c)break;g.push(f)}}else g=d(h,p,Math.min(p-h,m)).map(i);return o?g.reverse():g},t.tickFormat=function(n,o){if(null==o&&(o=10===e?".0e":","),"function"!=typeof o&&(o=G(o)),n===1/0)return o;null==n&&(n=10);var a=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/i(Math.round(r(t)));return n*e0?e[i-1]:t[0],i=e?[r[e-1],n]:[r[a-1],r[a]]},o.copy=function(){return gt().domain([t,n]).range(i)},nt(o)}function vt(){var t=[.5],n=[0,1],e=1;function r(r){if(r<=r)return n[u(t,r,0,e)]}return r.domain=function(i){return arguments.length?(t=A.call(i),e=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(i){return arguments.length?(n=A.call(i),e=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},r.copy=function(){return vt().domain(t).range(n)},r}var yt=new Date,wt=new Date;function bt(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return yt.setTime(+n),wt.setTime(+r),t(yt),t(wt),Math.floor(e(yt,wt))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var Mt=bt(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});Mt.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?bt(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Mt:null};var xt=Mt,_t=(Mt.range,6e4),kt=6048e5,St=bt(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),At=St,zt=(St.range,bt(function(t){t.setTime(Math.floor(t/_t)*_t)},function(t,n){t.setTime(+t+n*_t)},function(t,n){return(n-t)/_t},function(t){return t.getMinutes()})),Ct=zt,Tt=(zt.range,bt(function(t){var n=t.getTimezoneOffset()*_t%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()})),Nt=Tt,It=(Tt.range,bt(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*_t)/864e5},function(t){return t.getDate()-1})),Ut=It;It.range;function Dt(t){return bt(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*_t)/kt})}var jt=Dt(0),Ot=Dt(1),Lt=Dt(2),Et=Dt(3),Pt=Dt(4),Yt=Dt(5),Ft=Dt(6),Zt=(jt.range,Ot.range,Lt.range,Et.range,Pt.range,Yt.range,Ft.range,bt(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()})),Ht=Zt,Rt=(Zt.range,bt(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()}));Rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?bt(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var Xt=Rt,Jt=(Rt.range,bt(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*_t)},function(t,n){return(n-t)/_t},function(t){return t.getUTCMinutes()})),Vt=Jt,Bt=(Jt.range,bt(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()})),qt=Bt,Gt=(Bt.range,bt(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1})),$t=Gt;Gt.range;function Wt(t){return bt(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/kt})}var Qt=Wt(0),Kt=Wt(1),tn=Wt(2),nn=Wt(3),en=Wt(4),rn=Wt(5),on=Wt(6),an=(Qt.range,Kt.range,tn.range,nn.range,en.range,rn.range,on.range,bt(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()})),un=an,cn=(an.range,bt(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()}));cn.every=function(t){return isFinite(t=Math.floor(t))&&t>0?bt(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var sn=cn;cn.range;function ln(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function fn(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function hn(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}var pn,dn,mn,gn,vn={"-":"",_:" ",0:"0"},yn=/^\s*\d+/,wn=/^%/,bn=/[\\^$*+?|[\]().{}]/g;function Mn(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function Un(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Dn(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function jn(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function On(t,n,e){var r=yn.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function Ln(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function En(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Pn(t,n,e){var r=yn.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function Yn(t,n,e){var r=yn.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Fn(t,n,e){var r=yn.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Zn(t,n,e){var r=wn.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Hn(t,n,e){var r=yn.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Rn(t,n,e){var r=yn.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function Xn(t,n){return Mn(t.getDate(),n,2)}function Jn(t,n){return Mn(t.getHours(),n,2)}function Vn(t,n){return Mn(t.getHours()%12||12,n,2)}function Bn(t,n){return Mn(1+Ut.count(Xt(t),t),n,3)}function qn(t,n){return Mn(t.getMilliseconds(),n,3)}function Gn(t,n){return qn(t,n)+"000"}function $n(t,n){return Mn(t.getMonth()+1,n,2)}function Wn(t,n){return Mn(t.getMinutes(),n,2)}function Qn(t,n){return Mn(t.getSeconds(),n,2)}function Kn(t){var n=t.getDay();return 0===n?7:n}function te(t,n){return Mn(jt.count(Xt(t),t),n,2)}function ne(t,n){var e=t.getDay();return t=e>=4||0===e?Pt(t):Pt.ceil(t),Mn(Pt.count(Xt(t),t)+(4===Xt(t).getDay()),n,2)}function ee(t){return t.getDay()}function re(t,n){return Mn(Ot.count(Xt(t),t),n,2)}function ie(t,n){return Mn(t.getFullYear()%100,n,2)}function oe(t,n){return Mn(t.getFullYear()%1e4,n,4)}function ae(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Mn(n/60|0,"0",2)+Mn(n%60,"0",2)}function ue(t,n){return Mn(t.getUTCDate(),n,2)}function ce(t,n){return Mn(t.getUTCHours(),n,2)}function se(t,n){return Mn(t.getUTCHours()%12||12,n,2)}function le(t,n){return Mn(1+$t.count(sn(t),t),n,3)}function fe(t,n){return Mn(t.getUTCMilliseconds(),n,3)}function he(t,n){return fe(t,n)+"000"}function pe(t,n){return Mn(t.getUTCMonth()+1,n,2)}function de(t,n){return Mn(t.getUTCMinutes(),n,2)}function me(t,n){return Mn(t.getUTCSeconds(),n,2)}function ge(t){var n=t.getUTCDay();return 0===n?7:n}function ve(t,n){return Mn(Qt.count(sn(t),t),n,2)}function ye(t,n){var e=t.getUTCDay();return t=e>=4||0===e?en(t):en.ceil(t),Mn(en.count(sn(t),t)+(4===sn(t).getUTCDay()),n,2)}function we(t){return t.getUTCDay()}function be(t,n){return Mn(Kt.count(sn(t),t),n,2)}function Me(t,n){return Mn(t.getUTCFullYear()%100,n,2)}function xe(t,n){return Mn(t.getUTCFullYear()%1e4,n,4)}function _e(){return"+0000"}function ke(){return"%"}function Se(t){return+t}function Ae(t){return Math.floor(+t/1e3)}!function(t){pn=function(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,c=t.shortMonths,s=_n(i),l=kn(i),f=_n(o),h=kn(o),p=_n(a),d=kn(a),m=_n(u),g=kn(u),v=_n(c),y=kn(c),w={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:Xn,e:Xn,f:Gn,H:Jn,I:Vn,j:Bn,L:qn,m:$n,M:Wn,p:function(t){return i[+(t.getHours()>=12)]},Q:Se,s:Ae,S:Qn,u:Kn,U:te,V:ne,w:ee,W:re,x:null,X:null,y:ie,Y:oe,Z:ae,"%":ke},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:ue,e:ue,f:he,H:ce,I:se,j:le,L:fe,m:pe,M:de,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Se,s:Ae,S:me,u:ge,U:ve,V:ye,w:we,W:be,x:null,X:null,y:Me,Y:xe,Z:_e,"%":ke},M={a:function(t,n,e){var r=p.exec(n.slice(e));return r?(t.w=d[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=y[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=m.exec(n.slice(e));return r?(t.m=g[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return k(t,n,e,r)},d:jn,e:jn,f:Fn,H:Ln,I:Ln,j:On,L:Yn,m:Dn,M:En,p:function(t,n,e){var r=s.exec(n.slice(e));return r?(t.p=l[r[0].toLowerCase()],e+r[0].length):-1},Q:Hn,s:Rn,S:Pn,u:An,U:zn,V:Cn,w:Sn,W:Tn,x:function(t,n,r){return k(t,e,n,r)},X:function(t,n,e){return k(t,r,n,e)},y:In,Y:Nn,Z:Un,"%":Zn};function x(t,n){return function(e){var r,i,o,a=[],u=-1,c=0,s=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=(r=fn(hn(o.y))).getUTCDay())>4||0===i?Kt.ceil(r):Kt(r),r=$t.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(r=(i=(r=n(hn(o.y))).getDay())>4||0===i?Ot.ceil(r):Ot(r),r=Ut.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?fn(hn(o.y)).getUTCDay():n(hn(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,fn(o)):n(o)}}function k(t,n,e,r){for(var i,o,a=0,u=n.length,c=e.length;a=c)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=M[i in vn?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return w.x=x(e,w),w.X=x(r,w),w.c=x(n,w),b.x=x(e,b),b.X=x(r,b),b.c=x(n,b),{format:function(t){var n=x(t+="",w);return n.toString=function(){return t},n},parse:function(t){var n=_(t+="",ln);return n.toString=function(){return t},n},utcFormat:function(t){var n=x(t+="",b);return n.toString=function(){return t},n},utcParse:function(t){var n=_(t,fn);return n.toString=function(){return t},n}}}(t),dn=pn.format,pn.parse,mn=pn.utcFormat,gn=pn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Date.prototype.toISOString||mn("%Y-%m-%dT%H:%M:%S.%LZ");+new Date("2000-01-01T00:00:00.000Z")||gn("%Y-%m-%dT%H:%M:%S.%LZ");var ze=1e3,Ce=60*ze,Te=60*Ce,Ne=24*Te,Ie=7*Ne,Ue=30*Ne,De=365*Ne;function je(t){return new Date(t)}function Oe(t){return t instanceof Date?+t:+new Date(+t)}function Le(t,n,e,r,o,a,u,c,s){var l=Y(O,I.b),f=l.invert,h=l.domain,p=s(".%L"),d=s(":%S"),m=s("%I:%M"),v=s("%I %p"),y=s("%a %d"),w=s("%b %d"),b=s("%B"),M=s("%Y"),x=[[u,1,ze],[u,5,5*ze],[u,15,15*ze],[u,30,30*ze],[a,1,Ce],[a,5,5*Ce],[a,15,15*Ce],[a,30,30*Ce],[o,1,Te],[o,3,3*Te],[o,6,6*Te],[o,12,12*Te],[r,1,Ne],[r,2,2*Ne],[e,1,Ie],[n,1,Ue],[n,3,3*Ue],[t,1,De]];function _(i){return(u(i)0&&n>0&&(this.mark=this.CanvasArea.append("circle").attr("id",e.cpId).attr("class","control-point-static").attr("dr",this.optionMarkerShadowSize).attr("r",this.optionMarkerShadowSize/i).attr("cx",t).attr("cy",n).on("mouseover",function(t){return r.tip.style("left",s.event.pageX-30+"px").style("top",s.event.pageY-50+"px").style("display","inline-block").style("visibility","visible").html('
'+e.name+"
")}).on("mousemove",function(t){return r.tip.style("left",s.event.pageX-30+"px").style("top",s.event.pageY-50+"px").style("display","inline-block").html('
'+e.name+"
")}).on("mouseout",function(t){return r.tip.style("visibility","hidden")}).on("click",function(t,n){s.event.stopPropagation(),r.events.onMarkClick?r.events.onMarkClick({photoId:r.imgId,cpId:e.cpId}):r.onMarkClick({photoId:r.imgId,cpId:e.cpId})}))}},{key:"reDrawMarker",value:function(){if(this.CanvasArea){this.CanvasArea.selectAll("use.control-point").remove(),this.CanvasArea.selectAll("circle.control-point").remove(),this.CanvasArea.selectAll("circle.shadow").remove();var t=f.zoomTransform(this.cartesianSystem.node()).k;if(this.pin.pixelLocation[0]>0&&this.pin.pixelLocation[1]>0){var n=this.pin.pixelLocation[0],e=this.pin.pixelLocation[1];this.targetIcon?this.mark=this.CanvasArea.append("use").attr("id",this.cpId).attr("xlink:href",this.targetIcon).attr("class","control-point").attr("width",this.optionMarkerSize/t).attr("height",this.optionMarkerSize/t).attr("x",n-this.optionMarkerSize/t/2).attr("y",e-this.optionMarkerSize/t/2):this.mark=this.CanvasArea.append("circle").attr("id",this.cpId).attr("class","control-point").attr("dr",this.optionMarkerShadowSize+6).attr("r",this.optionMarkerShadowSize/t+6).attr("cx",n).attr("cy",e),this.CanvasArea.append("circle").attr("class","shadow").attr("dr",this.optionMarkerShadowSize).attr("r",this.optionMarkerShadowSize/t).attr("cx",n).attr("cy",e)}}}},{key:"drawMarker",value:function(t,n){if(this.CanvasArea){if(this.CanvasArea.selectAll("use.control-point").remove(),this.CanvasArea.selectAll("circle.control-point").remove(),this.CanvasArea.selectAll("circle.shadow").remove(),!t&&!n){var e=f.mouse(s.event.currentTarget);t=e[0],n=e[1],this.pin={marked:!0,pixelLocation:[t,n]}}var r=f.zoomTransform(this.cartesianSystem.node()).k;t>0&&n>0&&(this.targetIcon?this.mark=this.CanvasArea.append("use").attr("id",this.cpId).attr("xlink:href",this.targetIcon).attr("class","control-point").attr("width",this.optionMarkerSize/r).attr("height",this.optionMarkerSize/r).attr("x",t-this.optionMarkerSize/r/2).attr("y",n-this.optionMarkerSize/r/2):this.mark=this.CanvasArea.append("circle").attr("id",this.cpId).attr("class","control-point").attr("dr",this.optionMarkerShadowSize).attr("r",this.optionMarkerShadowSize/r).attr("cx",t).attr("cy",n),this.CanvasArea.append("circle").attr("class","shadow").attr("dr",this.optionMarkerShadowSize).attr("r",this.optionMarkerShadowSize/r).attr("cx",t).attr("cy",n),this.events.onMark?this.events.onMark({photoId:this.imgId,cpId:this.cpId,x:t,y:n}):this.onMark({photoId:this.imgId,cpId:this.cpId,x:t,y:n}))}}},{key:"clearMarker",value:function(){this.CanvasArea&&(this.CanvasArea.selectAll("use.control-point").remove(),this.CanvasArea.selectAll("circle.control-point").remove(),this.CanvasArea.selectAll("circle.shadow").remove(),this.pin={marked:!1,pixelLocation:[]},this.events.onMarkDelete?this.events.onMarkDelete({photoId:this.imgId,cpId:this.cpId}):this.onMarkDelete({photoId:this.imgId,cpId:this.cpId}))}},{key:"findCP",value:function(t){if(t||(t=0),this.pin&&this.pin.pixelLocation&&2===this.pin.pixelLocation.length){var n=this.width/2-this.pin.pixelLocation[0]*this.optionScaleLocateZoom,e=this.height/2-this.pin.pixelLocation[1]*this.optionScaleLocateZoom;this.cartesianSystem.transition().duration(t).call(this._zoomStrat().transform,f.zoomIdentity.translate(n,e).scale(this.optionScaleLocateZoom))}else this.resetZoom(750);this.events.onZoomToCP?this.events.onZoomToCP():this.onZoomToCP()}},{key:"zoomIn",value:function(){var t=f.zoomTransform(this.cartesianSystem.node()).k,n=f.zoomTransform(this.cartesianSystem.node()).x*t-this.width*t/2,e=f.zoomTransform(this.cartesianSystem.node()).y*t-this.height*t/2;this.cartesianSystem.transition().duration(375).call(this._zoomStrat().transform,f.zoomIdentity.translate(n,e).scale(2*t))}},{key:"zoomOut",value:function(){var t=f.zoomTransform(this.cartesianSystem.node()).k,n=f.zoomTransform(this.cartesianSystem.node()).x*t-this.width*t/2,e=f.zoomTransform(this.cartesianSystem.node()).y*t-this.height*t/2;this.cartesianSystem.transition().duration(375).call(this._zoomStrat().transform,f.zoomIdentity.translate(n,e).scale(t/2))}},{key:"_zoomStrat",value:function(){var t=this;return f.zoom().scaleExtent([this.optionScaleMin,this.optionScaleMax]).on("zoom",function(){var n=t.optionMarkerSize;t.CanvasArea.attr("transform",s.event.transform),t.pX.call(t.xAxis.scale(s.event.transform.rescaleX(t.xScale))),t.pY.call(t.yAxis.scale(s.event.transform.rescaleY(t.yScale))),s.event.transform&&(t.CanvasArea.selectAll("use.control-point").each(function(t){var e=f.select(this),r=s.event.transform.k,i=(parseFloat(e.attr("width"))-n/r)/2,o=(parseFloat(e.attr("height"))-n/r)/2,a=parseFloat(e.attr("x"))+i,u=parseFloat(e.attr("y"))+o;e.attr("width",n/r),e.attr("height",n/r),e.attr("x",a),e.attr("y",u)}),t.CanvasArea.selectAll("circle.control-point").each(function(t){var n=f.select(this),e=s.event.transform.k;n.attr("dr")&&(e=n.attr("dr")/e),n.attr("r",e)}),t.CanvasArea.selectAll("circle.shadow").each(function(t){var n=f.select(this),e=s.event.transform.k;n.attr("dr")&&(e=n.attr("dr")/e),n.attr("r",e)}),t.CanvasArea.selectAll("circle.control-point-static").each(function(t){var n=f.select(this),e=s.event.transform.k;n.attr("dr")&&(e=n.attr("dr")/e),n.attr("r",e)}))})}},{key:"_init",value:function(){var t=this;this.configure(),this.xScale=f.scaleLinear().domain([-1,this.img.width+1]).range([-1,this.img.width+1]),this.yScale=f.scaleLinear().domain([-1,this.img.height+1]).range([-1,this.img.height+1]),this.xAxis=f.axisBottom(this.xScale).ticks(20).tickSize(10).tickPadding(5),this.yAxis=f.axisRight(this.yScale).ticks(20).tickSize(10).tickPadding(5),this.pX=this.cartesianSystem.append("g").attr("class","axis axis--x").call(this.xAxis),this.pY=this.cartesianSystem.append("g").attr("class","axis axis--y").call(this.yAxis),this.CanvasArea=this.cartesianSystem.append("g").attr("class","canvas"),f.selectAll("#d3-tooltip").remove(),this.tip=f.select("body").append("div").attr("id","d3-tooltip"),this.CanvasImage=this.CanvasArea.append("svg:image").attr("xlink:href",this.img.src||this.img).attr("x",0).attr("y",0).attr("width",this.img.width).attr("height",this.img.height),this.resetDimentions(),this.CanvasArea.on("click",this.drawMarker.bind(this)),this.cartesianSystem.call(this._zoomStrat().bind(this)),this.resetZoom.bind(this),this.events.onReady?this.events.onReady(this.cpId):this.onReady(this.cpId),this.objects&&this.objects.length&&this.objects.forEach(function(n){t.drawStatic(n.xPos,n.yPos,n)}),this.pin&&this.pin.pixelLocation&&2===this.pin.pixelLocation.length?(this.drawMarker(this.pin.pixelLocation[0],this.pin.pixelLocation[1]),this.findCP()):this.resetZoom()}},{key:"onReady",value:function(t){}},{key:"onMark",value:function(t){}},{key:"onMarkClick",value:function(t){}},{key:"onMarkDelete",value:function(t){}},{key:"onZoomReset",value:function(t){}},{key:"onZoomToCP",value:function(t){}},{key:"resetDimentions",value:function(){this.cartesianSystem&&(this.width=parseFloat(this.cartesianSystem.style("width")),this.height=parseFloat(this.cartesianSystem.style("height")))}}]),t}();n.default=h,t.exports=n.default},function(t,n,e){"use strict"},function(t,n){t.exports=function(t){var n="undefined"!=typeof window&&window.location;if(!n)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var e=n.protocol+"//"+n.host,r=e+n.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,n){var i,o=n.trim().replace(/^"(.*)"$/,function(t,n){return n}).replace(/^'(.*)'$/,function(t,n){return n});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(o)?t:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?e+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")})}},function(t,n,e){var r={},i=function(t){var n;return function(){return void 0===n&&(n=t.apply(this,arguments)),n}}(function(){return window&&document&&document.all&&!window.atob}),o=function(t){var n={};return function(t){return void 0===n[t]&&(n[t]=function(t){return document.querySelector(t)}.call(this,t)),n[t]}}(),a=null,u=0,c=[],s=e(11);function l(t,n){for(var e=0;e=0&&c.splice(n,1)}function d(t){var n=document.createElement("style");return t.attrs.type="text/css",m(n,t.attrs),h(t,n),n}function m(t,n){Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])})}function g(t,n){var e,r,i,o;if(n.transform&&t.css){if(!(o=n.transform(t.css)))return function(){};t.css=o}if(n.singleton){var c=u++;e=a||(a=d(n)),r=y.bind(null,e,c,!1),i=y.bind(null,e,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=function(t){var n=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",m(n,t.attrs),h(t,n),n}(n),r=function(t,n,e){var r=e.css,i=e.sourceMap,o=void 0===n.convertToAbsoluteUrls&&i;(n.convertToAbsoluteUrls||o)&&(r=s(r));i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),u=t.href;t.href=URL.createObjectURL(a),u&&URL.revokeObjectURL(u)}.bind(null,e,n),i=function(){p(e),e.href&&URL.revokeObjectURL(e.href)}):(e=d(n),r=function(t,n){var e=n.css,r=n.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}.bind(null,e),i=function(){p(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else i()}}t.exports=function(t,n){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(n=n||{}).attrs="object"==typeof n.attrs?n.attrs:{},n.singleton||(n.singleton=i()),n.insertInto||(n.insertInto="head"),n.insertAt||(n.insertAt="bottom");var e=f(t,n);return l(e,n),function(t){for(var i=[],o=0;o= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;\n}\n","import namespace from \"./namespace\";\nimport {xhtml} from \"./namespaces\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n","function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n","function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n","var matcher = function(selector) {\n return function() {\n return this.matches(selector);\n };\n};\n\nif (typeof document !== \"undefined\") {\n var element = document.documentElement;\n if (!element.matches) {\n var vendorMatches = element.webkitMatchesSelector\n || element.msMatchesSelector\n || element.mozMatchesSelector\n || element.oMatchesSelector;\n matcher = function(selector) {\n return function() {\n return vendorMatches.call(this, selector);\n };\n };\n }\n}\n\nexport default matcher;\n","export default function(update) {\n return new Array(update.length);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {Selection} from \"./index\";\nimport {EnterNode} from \"./enter\";\nimport constant from \"../constant\";\n\nvar keyPrefix = \"$\"; // Protect against keys like “__proto__”.\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = {},\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group);\n if (keyValue in nodeByKeyValue) {\n exit[i] = node;\n } else {\n nodeByKeyValue[keyValue] = node;\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = keyPrefix + key.call(parent, data[i], i, data);\n if (node = nodeByKeyValue[keyValue]) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue[keyValue] = null;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) {\n exit[i] = node;\n }\n }\n}\n\nexport default function(value, key) {\n if (!value) {\n data = new Array(this.size()), j = -1;\n this.each(function(d) { data[++j] = d; });\n return data;\n }\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = value.call(parent, parent && parent.__data__, j, parents),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import namespace from \"../namespace\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n","function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n","function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n","function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n","function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n","import creator from \"../creator\";\nimport selector from \"../selector\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n","function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n","function selection_cloneShallow() {\n return this.parentNode.insertBefore(this.cloneNode(false), this.nextSibling);\n}\n\nfunction selection_cloneDeep() {\n return this.parentNode.insertBefore(this.cloneNode(true), this.nextSibling);\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","var filterEvents = {};\n\nexport var event = null;\n\nif (typeof document !== \"undefined\") {\n var element = document.documentElement;\n if (!(\"onmouseenter\" in element)) {\n filterEvents = {mouseenter: \"mouseover\", mouseleave: \"mouseout\"};\n }\n}\n\nfunction filterContextListener(listener, index, group) {\n listener = contextListener(listener, index, group);\n return function(event) {\n var related = event.relatedTarget;\n if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) {\n listener.call(this, event);\n }\n };\n}\n\nfunction contextListener(listener, index, group) {\n return function(event1) {\n var event0 = event; // Events can be reentrant (e.g., focus).\n event = event1;\n try {\n listener.call(this, this.__data__, index, group);\n } finally {\n event = event0;\n }\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, capture) {\n var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener;\n return function(d, i, group) {\n var on = this.__on, o, listener = wrap(value, i, group);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n this.addEventListener(o.type, o.listener = listener, o.capture = capture);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, capture);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, capture) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n if (capture == null) capture = false;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));\n return this;\n}\n\nexport function customEvent(event1, listener, that, args) {\n var event0 = event;\n event1.sourceEvent = event;\n event = event1;\n try {\n return listener.apply(that, args);\n } finally {\n event = event0;\n }\n}\n","import defaultView from \"../window\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n","import selection_select from \"./select\";\nimport selection_selectAll from \"./selectAll\";\nimport selection_filter from \"./filter\";\nimport selection_data from \"./data\";\nimport selection_enter from \"./enter\";\nimport selection_exit from \"./exit\";\nimport selection_merge from \"./merge\";\nimport selection_order from \"./order\";\nimport selection_sort from \"./sort\";\nimport selection_call from \"./call\";\nimport selection_nodes from \"./nodes\";\nimport selection_node from \"./node\";\nimport selection_size from \"./size\";\nimport selection_empty from \"./empty\";\nimport selection_each from \"./each\";\nimport selection_attr from \"./attr\";\nimport selection_style from \"./style\";\nimport selection_property from \"./property\";\nimport selection_classed from \"./classed\";\nimport selection_text from \"./text\";\nimport selection_html from \"./html\";\nimport selection_raise from \"./raise\";\nimport selection_lower from \"./lower\";\nimport selection_append from \"./append\";\nimport selection_insert from \"./insert\";\nimport selection_remove from \"./remove\";\nimport selection_clone from \"./clone\";\nimport selection_datum from \"./datum\";\nimport selection_on from \"./on\";\nimport selection_dispatch from \"./dispatch\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n merge: selection_merge,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch\n};\n\nexport default selection;\n","import {Selection} from \"./index\";\nimport selector from \"../selector\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import {Selection} from \"./index\";\nimport selectorAll from \"../selectorAll\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n","import {Selection} from \"./index\";\nimport matcher from \"../matcher\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","import {Selection} from \"./index\";\n\nexport default function(selection) {\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n","export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n","export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n","export default function() {\n var nodes = new Array(this.size()), i = -1;\n this.each(function() { nodes[++i] = this; });\n return nodes;\n}\n","export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n","export default function() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n}\n","export default function() {\n return !this.node();\n}\n","export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n","function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n","import creator from \"../creator\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n","export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n","import {Selection, root} from \"./selection/index\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n","import creator from \"./creator\";\nimport select from \"./select\";\n\nexport default function(name) {\n return select(creator(name).call(document.documentElement));\n}\n","var nextId = 0;\n\nexport default function local() {\n return new Local;\n}\n\nfunction Local() {\n this._ = \"@\" + (++nextId).toString(36);\n}\n\nLocal.prototype = local.prototype = {\n constructor: Local,\n get: function(node) {\n var id = this._;\n while (!(id in node)) if (!(node = node.parentNode)) return;\n return node[id];\n },\n set: function(node, value) {\n return node[this._] = value;\n },\n remove: function(node) {\n return this._ in node && delete node[this._];\n },\n toString: function() {\n return this._;\n }\n};\n","import {event} from \"./selection/on\";\n\nexport default function() {\n var current = event, source;\n while (source = current.sourceEvent) current = source;\n return current;\n}\n","export default function(node, event) {\n var svg = node.ownerSVGElement || node;\n\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node) {\n var event = sourceEvent();\n if (event.changedTouches) event = event.changedTouches[0];\n return point(node, event);\n}\n","import {Selection, root} from \"./selection/index\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([document.querySelectorAll(selector)], [document.documentElement])\n : new Selection([selector == null ? [] : selector], root);\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node, touches, identifier) {\n if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;\n\n for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {\n if ((touch = touches[i]).identifier === identifier) {\n return point(node, touch);\n }\n }\n\n return null;\n}\n","import sourceEvent from \"./sourceEvent\";\nimport point from \"./point\";\n\nexport default function(node, touches) {\n if (touches == null) touches = sourceEvent().touches;\n\n for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) {\n points[i] = point(node, touches[i]);\n }\n\n return points;\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex3 = /^#([0-9a-f]{3})$/,\n reHex6 = /^#([0-9a-f]{6})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n displayable: function() {\n return this.rgb().displayable();\n },\n toString: function() {\n return this.rgb() + \"\";\n }\n});\n\nexport default function color(format) {\n var m;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1)) // #f00\n : (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format])\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (0 <= this.r && this.r <= 255)\n && (0 <= this.g && this.g <= 255)\n && (0 <= this.b && this.b <= 255)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n toString: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export var deg2rad = Math.PI / 180;\nexport var rad2deg = 180 / Math.PI;\n","import define, {extend} from \"./define\";\nimport {Color, rgbConvert, Rgb} from \"./color\";\nimport {deg2rad, rad2deg} from \"./math\";\n\nvar Kn = 18,\n Xn = 0.950470, // D65 standard referent\n Yn = 1,\n Zn = 1.088830,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) {\n var h = o.h * deg2rad;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n }\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var b = rgb2xyz(o.r),\n a = rgb2xyz(o.g),\n l = rgb2xyz(o.b),\n x = xyz2lab((0.4124564 * b + 0.3575761 * a + 0.1804375 * l) / Xn),\n y = xyz2lab((0.2126729 * b + 0.7151522 * a + 0.0721750 * l) / Yn),\n z = xyz2lab((0.0193339 * b + 0.1191920 * a + 0.9503041 * l) / Zn);\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter: function(k) {\n return new Lab(this.l + Kn * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker: function(k) {\n return new Lab(this.l - Kn * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb: function() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n y = Yn * lab2xyz(y);\n x = Xn * lab2xyz(x);\n z = Zn * lab2xyz(z);\n return new Rgb(\n xyz2rgb( 3.2404542 * x - 1.5371385 * y - 0.4985314 * z), // D65 -> sRGB\n xyz2rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z),\n xyz2rgb( 0.0556434 * x - 0.2040259 * y + 1.0572252 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction xyz2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2xyz(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n var h = Math.atan2(o.b, o.a) * rad2deg;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter: function(k) {\n return new Hcl(this.h, this.c, this.l + Kn * (k == null ? 1 : k), this.opacity);\n },\n darker: function(k) {\n return new Hcl(this.h, this.c, this.l - Kn * (k == null ? 1 : k), this.opacity);\n },\n rgb: function() {\n return labConvert(this).rgb();\n }\n}));\n","import define, {extend} from \"./define\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color\";\nimport {deg2rad, rad2deg} from \"./math\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import {basis} from \"./basis\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import constant from \"./constant\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis\";\nimport basisClosed from \"./basisClosed\";\nimport nogamma, {gamma} from \"./color\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","import value from \"./value\";\n\nexport default function(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b -= a, function(t) {\n return d.setTime(a + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b -= a, function(t) {\n return a + b * t;\n };\n}\n","import value from \"./value\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import decompose, {identity} from \"./decompose\";\n\nvar cssNode,\n cssRoot,\n cssView,\n svgNode;\n\nexport function parseCss(value) {\n if (value === \"none\") return identity;\n if (!cssNode) cssNode = document.createElement(\"DIV\"), cssRoot = document.documentElement, cssView = document.defaultView;\n cssNode.style.transform = value;\n value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue(\"transform\");\n cssRoot.removeChild(cssNode);\n value = value.slice(7, -1).split(\",\");\n return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb\";\nimport array from \"./array\";\nimport date from \"./date\";\nimport number from \"./number\";\nimport object from \"./object\";\nimport string from \"./string\";\nimport constant from \"./constant\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : Array.isArray(b) ? array\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b -= a, function(t) {\n return Math.round(a + b * t);\n };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import number from \"../number\";\nimport {parseCss, parseSvg} from \"./parse\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var rho = Math.SQRT2,\n rho2 = 2,\n rho4 = 4,\n epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\n// p0 = [ux0, uy0, w0]\n// p1 = [ux1, uy1, w1]\nexport default function(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000;\n\n return i;\n}\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","import {lab as colorLab} from \"d3-color\";\nimport color from \"./color\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n","import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n","var noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import {Timer} from \"./timer\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(function(elapsed) {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTING) throw new Error(\"too late; already started\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n // Dispatch the interrupt event.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions. No interrupt event is dispatched\n // because the cancelled transitions never started. Note that this also\n // removes this transition from the pending list!\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(null, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n if (active) schedule.on.call(\"interrupt\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n","import {get, set} from \"./schedule\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n","function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n","import {tweenValue} from \"./tween\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr\";\nimport transition_attrTween from \"./attrTween\";\nimport transition_delay from \"./delay\";\nimport transition_duration from \"./duration\";\nimport transition_ease from \"./ease\";\nimport transition_filter from \"./filter\";\nimport transition_merge from \"./merge\";\nimport transition_on from \"./on\";\nimport transition_remove from \"./remove\";\nimport transition_select from \"./select\";\nimport transition_selectAll from \"./selectAll\";\nimport transition_selection from \"./selection\";\nimport transition_style from \"./style\";\nimport transition_styleTween from \"./styleTween\";\nimport transition_text from \"./text\";\nimport transition_transition from \"./transition\";\nimport transition_tween from \"./tween\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease\n};\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index\";\nimport schedule, {get} from \"./schedule\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index\";\nimport schedule, {get} from \"./schedule\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {Transition, newId} from \"./index\";\nimport schedule, {get} from \"./schedule\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n","import {get, set, init} from \"./schedule\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween\";\nimport interpolate from \"./interpolate\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var value00,\n interpolate0;\n return function() {\n var value0 = this.getAttribute(name);\n return value0 === value1 ? null\n : value0 === value00 ? interpolate0\n : interpolate0 = interpolate(value00 = value0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var value00,\n interpolate0;\n return function() {\n var value0 = this.getAttributeNS(fullname.space, fullname.local);\n return value0 === value1 ? null\n : value0 === value00 ? interpolate0\n : interpolate0 = interpolate(value00 = value0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var value00,\n value10,\n interpolate0;\n return function() {\n var value0, value1 = value(this);\n if (value1 == null) return void this.removeAttribute(name);\n value0 = this.getAttribute(name);\n return value0 === value1 ? null\n : value0 === value00 && value1 === value10 ? interpolate0\n : interpolate0 = interpolate(value00 = value0, value10 = value1);\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var value00,\n value10,\n interpolate0;\n return function() {\n var value0, value1 = value(this);\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n value0 = this.getAttributeNS(fullname.space, fullname.local);\n return value0 === value1 ? null\n : value0 === value00 && value1 === value10 ? interpolate0\n : interpolate0 = interpolate(value00 = value0, value10 = value1);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value + \"\"));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrTweenNS(fullname, value) {\n function tween() {\n var node = this, i = value.apply(node, arguments);\n return i && function(t) {\n node.setAttributeNS(fullname.space, fullname.local, i(t));\n };\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n function tween() {\n var node = this, i = value.apply(node, arguments);\n return i && function(t) {\n node.setAttribute(name, i(t));\n };\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {tweenValue} from \"./tween\";\nimport interpolate from \"./interpolate\";\n\nfunction styleRemove(name, interpolate) {\n var value00,\n value10,\n interpolate0;\n return function() {\n var value0 = style(this, name),\n value1 = (this.style.removeProperty(name), style(this, name));\n return value0 === value1 ? null\n : value0 === value00 && value1 === value10 ? interpolate0\n : interpolate0 = interpolate(value00 = value0, value10 = value1);\n };\n}\n\nfunction styleRemoveEnd(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var value00,\n interpolate0;\n return function() {\n var value0 = style(this, name);\n return value0 === value1 ? null\n : value0 === value00 ? interpolate0\n : interpolate0 = interpolate(value00 = value0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var value00,\n value10,\n interpolate0;\n return function() {\n var value0 = style(this, name),\n value1 = value(this);\n if (value1 == null) value1 = (this.style.removeProperty(name), style(this, name));\n return value0 === value1 ? null\n : value0 === value00 && value1 === value10 ? interpolate0\n : interpolate0 = interpolate(value00 = value0, value10 = value1);\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleRemove(name, i))\n .on(\"end.style.\" + name, styleRemoveEnd(name))\n : this.styleTween(name, typeof value === \"function\"\n ? styleFunction(name, i, tweenValue(this, \"style.\" + name, value))\n : styleConstant(name, i, value + \"\"), priority);\n}\n","function styleTween(name, value, priority) {\n function tween() {\n var node = this, i = value.apply(node, arguments);\n return i && function(t) {\n node.style.setProperty(name, i(t), priority);\n };\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {get, init} from \"./schedule\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n","var exponent = 3;\n\nexport var polyIn = (function custom(e) {\n e = +e;\n\n function polyIn(t) {\n return Math.pow(t, e);\n }\n\n polyIn.exponent = custom;\n\n return polyIn;\n})(exponent);\n\nexport var polyOut = (function custom(e) {\n e = +e;\n\n function polyOut(t) {\n return 1 - Math.pow(1 - t, e);\n }\n\n polyOut.exponent = custom;\n\n return polyOut;\n})(exponent);\n\nexport var polyInOut = (function custom(e) {\n e = +e;\n\n function polyInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\n }\n\n polyInOut.exponent = custom;\n\n return polyInOut;\n})(exponent);\n","var pi = Math.PI,\n halfPi = pi / 2;\n\nexport function sinIn(t) {\n return 1 - Math.cos(t * halfPi);\n}\n\nexport function sinOut(t) {\n return Math.sin(t * halfPi);\n}\n\nexport function sinInOut(t) {\n return (1 - Math.cos(pi * t)) / 2;\n}\n","var overshoot = 1.70158;\n\nexport var backIn = (function custom(s) {\n s = +s;\n\n function backIn(t) {\n return t * t * ((s + 1) * t - s);\n }\n\n backIn.overshoot = custom;\n\n return backIn;\n})(overshoot);\n\nexport var backOut = (function custom(s) {\n s = +s;\n\n function backOut(t) {\n return --t * t * ((s + 1) * t + s) + 1;\n }\n\n backOut.overshoot = custom;\n\n return backOut;\n})(overshoot);\n\nexport var backInOut = (function custom(s) {\n s = +s;\n\n function backInOut(t) {\n return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;\n }\n\n backInOut.overshoot = custom;\n\n return backInOut;\n})(overshoot);\n","var tau = 2 * Math.PI,\n amplitude = 1,\n period = 0.3;\n\nexport var elasticIn = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticIn(t) {\n return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);\n }\n\n elasticIn.amplitude = function(a) { return custom(a, p * tau); };\n elasticIn.period = function(p) { return custom(a, p); };\n\n return elasticIn;\n})(amplitude, period);\n\nexport var elasticOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticOut(t) {\n return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);\n }\n\n elasticOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticOut.period = function(p) { return custom(a, p); };\n\n return elasticOut;\n})(amplitude, period);\n\nexport var elasticInOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticInOut(t) {\n return ((t = t * 2 - 1) < 0\n ? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p)\n : 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;\n }\n\n elasticInOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticInOut.period = function(p) { return custom(a, p); };\n\n return elasticInOut;\n})(amplitude, period);\n","import {Transition, newId} from \"../transition/index\";\nimport schedule from \"../transition/schedule\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n return defaultTiming.time = now(), defaultTiming;\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n","export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt\";\nimport selection_transition from \"./transition\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","import interrupt from \"../interrupt\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n","import {Transition} from \"./transition/index\";\nimport {SCHEDULED} from \"./transition/schedule\";\n\nvar root = [null];\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n i;\n\n if (schedules) {\n name = name == null ? null : name + \"\";\n for (i in schedules) {\n if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) {\n return new Transition([[node]], root, name, +i);\n }\n }\n }\n\n return null;\n}\n","export var slice = Array.prototype.slice;\n","export default function(x) {\n return x;\n}\n","import {slice} from \"./array\";\nimport identity from \"./identity\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + (x + 0.5) + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + (y + 0.5) + \")\";\n}\n\nfunction number(scale) {\n return function(d) {\n return +scale(d);\n };\n}\n\nfunction center(scale) {\n var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.\n if (scale.round()) offset = Math.round(offset);\n return function(d) {\n return +scale(d) + offset;\n };\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + 0.5,\n range1 = +range[range.length - 1] + 0.5,\n position = (scale.bandwidth ? center : number)(scale.copy()),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"#000\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"#000\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient == right\n ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H0.5V\" + range1 + \"H\" + k * tickSizeOuter\n : \"M\" + range0 + \",\" + k * tickSizeOuter + \"V0.5H\" + range1 + \"V\" + k * tickSizeOuter);\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d)); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = slice.call(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n","import {event} from \"d3-selection\";\n\nexport function nopropagation() {\n event.stopImmediatePropagation();\n}\n\nexport default function() {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent from \"./noevent\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, true);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, true);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, true);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n","export default function DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch) {\n this.target = target;\n this.type = type;\n this.subject = subject;\n this.identifier = id;\n this.active = active;\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this._ = dispatch;\n}\n\nDragEvent.prototype.on = function() {\n var value = this._.on.apply(this._, arguments);\n return value === this._ ? this : value;\n};\n","import {dispatch} from \"d3-dispatch\";\nimport {event, customEvent, select, mouse, touch} from \"d3-selection\";\nimport nodrag, {yesdrag} from \"./nodrag\";\nimport noevent, {nopropagation} from \"./noevent\";\nimport constant from \"./constant\";\nimport DragEvent from \"./event\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter() {\n return !event.button;\n}\n\nfunction defaultContainer() {\n return this.parentNode;\n}\n\nfunction defaultSubject(d) {\n return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n return \"ontouchstart\" in this;\n}\n\nexport default function() {\n var filter = defaultFilter,\n container = defaultContainer,\n subject = defaultSubject,\n touchable = defaultTouchable,\n gestures = {},\n listeners = dispatch(\"start\", \"drag\", \"end\"),\n active = 0,\n mousedownx,\n mousedowny,\n mousemoving,\n touchending,\n clickDistance2 = 0;\n\n function drag(selection) {\n selection\n .on(\"mousedown.drag\", mousedowned)\n .filter(touchable)\n .on(\"touchstart.drag\", touchstarted)\n .on(\"touchmove.drag\", touchmoved)\n .on(\"touchend.drag touchcancel.drag\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n function mousedowned() {\n if (touchending || !filter.apply(this, arguments)) return;\n var gesture = beforestart(\"mouse\", container.apply(this, arguments), mouse, this, arguments);\n if (!gesture) return;\n select(event.view).on(\"mousemove.drag\", mousemoved, true).on(\"mouseup.drag\", mouseupped, true);\n nodrag(event.view);\n nopropagation();\n mousemoving = false;\n mousedownx = event.clientX;\n mousedowny = event.clientY;\n gesture(\"start\");\n }\n\n function mousemoved() {\n noevent();\n if (!mousemoving) {\n var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n mousemoving = dx * dx + dy * dy > clickDistance2;\n }\n gestures.mouse(\"drag\");\n }\n\n function mouseupped() {\n select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n yesdrag(event.view, mousemoving);\n noevent();\n gestures.mouse(\"end\");\n }\n\n function touchstarted() {\n if (!filter.apply(this, arguments)) return;\n var touches = event.changedTouches,\n c = container.apply(this, arguments),\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = beforestart(touches[i].identifier, c, touch, this, arguments)) {\n nopropagation();\n gesture(\"start\");\n }\n }\n }\n\n function touchmoved() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n noevent();\n gesture(\"drag\");\n }\n }\n }\n\n function touchended() {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n nopropagation();\n gesture(\"end\");\n }\n }\n }\n\n function beforestart(id, container, point, that, args) {\n var p = point(container, id), s, dx, dy,\n sublisteners = listeners.copy();\n\n if (!customEvent(new DragEvent(drag, \"beforestart\", s, id, active, p[0], p[1], 0, 0, sublisteners), function() {\n if ((event.subject = s = subject.apply(that, args)) == null) return false;\n dx = s.x - p[0] || 0;\n dy = s.y - p[1] || 0;\n return true;\n })) return;\n\n return function gesture(type) {\n var p0 = p, n;\n switch (type) {\n case \"start\": gestures[id] = gesture, n = active++; break;\n case \"end\": delete gestures[id], --active; // nobreak\n case \"drag\": p = point(container, id), n = active; break;\n }\n customEvent(new DragEvent(drag, type, s, id, n, p[0] + dx, p[1] + dy, p[0] - p0[0], p[1] - p0[1], sublisteners), sublisteners.apply, sublisteners, [type, that, args]);\n };\n }\n\n drag.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n };\n\n drag.container = function(_) {\n return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n };\n\n drag.subject = function(_) {\n return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n };\n\n drag.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n };\n\n drag.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? drag : value;\n };\n\n drag.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n };\n\n return drag;\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export function Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n return node.__zoom || identity;\n}\n","import {event} from \"d3-selection\";\n\nexport function nopropagation() {\n event.stopImmediatePropagation();\n}\n\nexport default function() {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolateZoom} from \"d3-interpolate\";\nimport {event, customEvent, select, mouse, touch} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant\";\nimport ZoomEvent from \"./event\";\nimport {Transform, identity} from \"./transform\";\nimport noevent, {nopropagation} from \"./noevent\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter() {\n return !event.button;\n}\n\nfunction defaultExtent() {\n var e = this, w, h;\n if (e instanceof SVGElement) {\n e = e.ownerSVGElement || e;\n w = e.width.baseVal.value;\n h = e.height.baseVal.value;\n } else {\n w = e.clientWidth;\n h = e.clientHeight;\n }\n return [[0, 0], [w, h]];\n}\n\nfunction defaultTransform() {\n return this.__zoom || identity;\n}\n\nfunction defaultWheelDelta() {\n return -event.deltaY * (event.deltaMode ? 120 : 1) / 500;\n}\n\nfunction defaultTouchable() {\n return \"ontouchstart\" in this;\n}\n\nfunction defaultConstrain(transform, extent, translateExtent) {\n var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],\n dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],\n dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],\n dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];\n return transform.translate(\n dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),\n dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)\n );\n}\n\nexport default function() {\n var filter = defaultFilter,\n extent = defaultExtent,\n constrain = defaultConstrain,\n wheelDelta = defaultWheelDelta,\n touchable = defaultTouchable,\n scaleExtent = [0, Infinity],\n translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],\n duration = 250,\n interpolate = interpolateZoom,\n gestures = [],\n listeners = dispatch(\"start\", \"zoom\", \"end\"),\n touchstarting,\n touchending,\n touchDelay = 500,\n wheelDelay = 150,\n clickDistance2 = 0;\n\n function zoom(selection) {\n selection\n .property(\"__zoom\", defaultTransform)\n .on(\"wheel.zoom\", wheeled)\n .on(\"mousedown.zoom\", mousedowned)\n .on(\"dblclick.zoom\", dblclicked)\n .filter(touchable)\n .on(\"touchstart.zoom\", touchstarted)\n .on(\"touchmove.zoom\", touchmoved)\n .on(\"touchend.zoom touchcancel.zoom\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n zoom.transform = function(collection, transform) {\n var selection = collection.selection ? collection.selection() : collection;\n selection.property(\"__zoom\", defaultTransform);\n if (collection !== selection) {\n schedule(collection, transform);\n } else {\n selection.interrupt().each(function() {\n gesture(this, arguments)\n .start()\n .zoom(null, typeof transform === \"function\" ? transform.apply(this, arguments) : transform)\n .end();\n });\n }\n };\n\n zoom.scaleBy = function(selection, k) {\n zoom.scaleTo(selection, function() {\n var k0 = this.__zoom.k,\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return k0 * k1;\n });\n };\n\n zoom.scaleTo = function(selection, k) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t0 = this.__zoom,\n p0 = centroid(e),\n p1 = t0.invert(p0),\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);\n });\n };\n\n zoom.translateBy = function(selection, x, y) {\n zoom.transform(selection, function() {\n return constrain(this.__zoom.translate(\n typeof x === \"function\" ? x.apply(this, arguments) : x,\n typeof y === \"function\" ? y.apply(this, arguments) : y\n ), extent.apply(this, arguments), translateExtent);\n });\n };\n\n zoom.translateTo = function(selection, x, y) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t = this.__zoom,\n p = centroid(e);\n return constrain(identity.translate(p[0], p[1]).scale(t.k).translate(\n typeof x === \"function\" ? -x.apply(this, arguments) : -x,\n typeof y === \"function\" ? -y.apply(this, arguments) : -y\n ), e, translateExtent);\n });\n };\n\n function scale(transform, k) {\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));\n return k === transform.k ? transform : new Transform(k, transform.x, transform.y);\n }\n\n function translate(transform, p0, p1) {\n var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;\n return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);\n }\n\n function centroid(extent) {\n return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];\n }\n\n function schedule(transition, transform, center) {\n transition\n .on(\"start.zoom\", function() { gesture(this, arguments).start(); })\n .on(\"interrupt.zoom end.zoom\", function() { gesture(this, arguments).end(); })\n .tween(\"zoom\", function() {\n var that = this,\n args = arguments,\n g = gesture(that, args),\n e = extent.apply(that, args),\n p = center || centroid(e),\n w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),\n a = that.__zoom,\n b = typeof transform === \"function\" ? transform.apply(that, args) : transform,\n i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));\n return function(t) {\n if (t === 1) t = b; // Avoid rounding error on end.\n else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }\n g.zoom(null, t);\n };\n });\n }\n\n function gesture(that, args) {\n for (var i = 0, n = gestures.length, g; i < n; ++i) {\n if ((g = gestures[i]).that === that) {\n return g;\n }\n }\n return new Gesture(that, args);\n }\n\n function Gesture(that, args) {\n this.that = that;\n this.args = args;\n this.index = -1;\n this.active = 0;\n this.extent = extent.apply(that, args);\n }\n\n Gesture.prototype = {\n start: function() {\n if (++this.active === 1) {\n this.index = gestures.push(this) - 1;\n this.emit(\"start\");\n }\n return this;\n },\n zoom: function(key, transform) {\n if (this.mouse && key !== \"mouse\") this.mouse[1] = transform.invert(this.mouse[0]);\n if (this.touch0 && key !== \"touch\") this.touch0[1] = transform.invert(this.touch0[0]);\n if (this.touch1 && key !== \"touch\") this.touch1[1] = transform.invert(this.touch1[0]);\n this.that.__zoom = transform;\n this.emit(\"zoom\");\n return this;\n },\n end: function() {\n if (--this.active === 0) {\n gestures.splice(this.index, 1);\n this.index = -1;\n this.emit(\"end\");\n }\n return this;\n },\n emit: function(type) {\n customEvent(new ZoomEvent(zoom, type, this.that.__zoom), listeners.apply, listeners, [type, this.that, this.args]);\n }\n };\n\n function wheeled() {\n if (!filter.apply(this, arguments)) return;\n var g = gesture(this, arguments),\n t = this.__zoom,\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),\n p = mouse(this);\n\n // If the mouse is in the same location as before, reuse it.\n // If there were recent wheel events, reset the wheel idle timeout.\n if (g.wheel) {\n if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {\n g.mouse[1] = t.invert(g.mouse[0] = p);\n }\n clearTimeout(g.wheel);\n }\n\n // If this wheel event won’t trigger a transform change, ignore it.\n else if (t.k === k) return;\n\n // Otherwise, capture the mouse point and location at the start.\n else {\n g.mouse = [p, t.invert(p)];\n interrupt(this);\n g.start();\n }\n\n noevent();\n g.wheel = setTimeout(wheelidled, wheelDelay);\n g.zoom(\"mouse\", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));\n\n function wheelidled() {\n g.wheel = null;\n g.end();\n }\n }\n\n function mousedowned() {\n if (touchending || !filter.apply(this, arguments)) return;\n var g = gesture(this, arguments),\n v = select(event.view).on(\"mousemove.zoom\", mousemoved, true).on(\"mouseup.zoom\", mouseupped, true),\n p = mouse(this),\n x0 = event.clientX,\n y0 = event.clientY;\n\n dragDisable(event.view);\n nopropagation();\n g.mouse = [p, this.__zoom.invert(p)];\n interrupt(this);\n g.start();\n\n function mousemoved() {\n noevent();\n if (!g.moved) {\n var dx = event.clientX - x0, dy = event.clientY - y0;\n g.moved = dx * dx + dy * dy > clickDistance2;\n }\n g.zoom(\"mouse\", constrain(translate(g.that.__zoom, g.mouse[0] = mouse(g.that), g.mouse[1]), g.extent, translateExtent));\n }\n\n function mouseupped() {\n v.on(\"mousemove.zoom mouseup.zoom\", null);\n dragEnable(event.view, g.moved);\n noevent();\n g.end();\n }\n }\n\n function dblclicked() {\n if (!filter.apply(this, arguments)) return;\n var t0 = this.__zoom,\n p0 = mouse(this),\n p1 = t0.invert(p0),\n k1 = t0.k * (event.shiftKey ? 0.5 : 2),\n t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, arguments), translateExtent);\n\n noevent();\n if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0);\n else select(this).call(zoom.transform, t1);\n }\n\n function touchstarted() {\n if (!filter.apply(this, arguments)) return;\n var g = gesture(this, arguments),\n touches = event.changedTouches,\n started,\n n = touches.length, i, t, p;\n\n nopropagation();\n for (i = 0; i < n; ++i) {\n t = touches[i], p = touch(this, touches, t.identifier);\n p = [p, this.__zoom.invert(p), t.identifier];\n if (!g.touch0) g.touch0 = p, started = true;\n else if (!g.touch1) g.touch1 = p;\n }\n\n // If this is a dbltap, reroute to the (optional) dblclick.zoom handler.\n if (touchstarting) {\n touchstarting = clearTimeout(touchstarting);\n if (!g.touch1) {\n g.end();\n p = select(this).on(\"dblclick.zoom\");\n if (p) p.apply(this, arguments);\n return;\n }\n }\n\n if (started) {\n touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);\n interrupt(this);\n g.start();\n }\n }\n\n function touchmoved() {\n var g = gesture(this, arguments),\n touches = event.changedTouches,\n n = touches.length, i, t, p, l;\n\n noevent();\n if (touchstarting) touchstarting = clearTimeout(touchstarting);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = touch(this, touches, t.identifier);\n if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;\n else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;\n }\n t = g.that.__zoom;\n if (g.touch1) {\n var p0 = g.touch0[0], l0 = g.touch0[1],\n p1 = g.touch1[0], l1 = g.touch1[1],\n dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,\n dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;\n t = scale(t, Math.sqrt(dp / dl));\n p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];\n l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];\n }\n else if (g.touch0) p = g.touch0[0], l = g.touch0[1];\n else return;\n g.zoom(\"touch\", constrain(translate(t, p, l), g.extent, translateExtent));\n }\n\n function touchended() {\n var g = gesture(this, arguments),\n touches = event.changedTouches,\n n = touches.length, i, t;\n\n nopropagation();\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, touchDelay);\n for (i = 0; i < n; ++i) {\n t = touches[i];\n if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;\n else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;\n }\n if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;\n if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);\n else g.end();\n }\n\n zoom.wheelDelta = function(_) {\n return arguments.length ? (wheelDelta = typeof _ === \"function\" ? _ : constant(+_), zoom) : wheelDelta;\n };\n\n zoom.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), zoom) : filter;\n };\n\n zoom.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), zoom) : touchable;\n };\n\n zoom.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;\n };\n\n zoom.scaleExtent = function(_) {\n return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];\n };\n\n zoom.translateExtent = function(_) {\n return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];\n };\n\n zoom.constrain = function(_) {\n return arguments.length ? (constrain = _, zoom) : constrain;\n };\n\n zoom.duration = function(_) {\n return arguments.length ? (duration = +_, zoom) : duration;\n };\n\n zoom.interpolate = function(_) {\n return arguments.length ? (interpolate = _, zoom) : interpolate;\n };\n\n zoom.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? zoom : value;\n };\n\n zoom.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);\n };\n\n return zoom;\n}\n","export default function ZoomEvent(target, type, transform) {\n this.target = target;\n this.type = type;\n this.transform = transform;\n}\n","export default function(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import ascending from \"./ascending\";\n\nexport default function(compare) {\n if (compare.length === 1) compare = ascendingComparator(compare);\n return {\n left: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n };\n}\n\nfunction ascendingComparator(f) {\n return function(d, x) {\n return ascending(f(d), x);\n };\n}\n","import ascending from \"./ascending\";\nimport bisector from \"./bisector\";\n\nvar ascendingBisect = bisector(ascending);\nexport var bisectRight = ascendingBisect.right;\nexport var bisectLeft = ascendingBisect.left;\nexport default bisectRight;\n","import {pair} from \"./pairs\";\n\nexport default function(values0, values1, reduce) {\n var n0 = values0.length,\n n1 = values1.length,\n values = new Array(n0 * n1),\n i0,\n i1,\n i,\n value0;\n\n if (reduce == null) reduce = pair;\n\n for (i0 = i = 0; i0 < n0; ++i0) {\n for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) {\n values[i] = reduce(value0, values1[i1]);\n }\n }\n\n return values;\n}\n","export default function(x) {\n return x === null ? NaN : +x;\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","export default function(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","var e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nexport default function(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array(n = Math.ceil(stop - start + 1));\n while (++i < n) ticks[i] = (start + i) * step;\n } else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array(n = Math.ceil(start - stop + 1));\n while (++i < n) ticks[i] = (start - i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nexport function tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n","export default function(values) {\n return Math.ceil(Math.log(values.length) / Math.LN2) + 1;\n}\n","import number from \"./number\";\n\nexport default function(values, p, valueof) {\n if (valueof == null) valueof = number;\n if (!(n = values.length)) return;\n if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n","export var prefix = \"$\";\n\nfunction Map() {}\n\nMap.prototype = map.prototype = {\n constructor: Map,\n has: function(key) {\n return (prefix + key) in this;\n },\n get: function(key) {\n return this[prefix + key];\n },\n set: function(key, value) {\n this[prefix + key] = value;\n return this;\n },\n remove: function(key) {\n var property = prefix + key;\n return property in this && delete this[property];\n },\n clear: function() {\n for (var property in this) if (property[0] === prefix) delete this[property];\n },\n keys: function() {\n var keys = [];\n for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));\n return keys;\n },\n values: function() {\n var values = [];\n for (var property in this) if (property[0] === prefix) values.push(this[property]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});\n return entries;\n },\n size: function() {\n var size = 0;\n for (var property in this) if (property[0] === prefix) ++size;\n return size;\n },\n empty: function() {\n for (var property in this) if (property[0] === prefix) return false;\n return true;\n },\n each: function(f) {\n for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);\n }\n};\n\nfunction map(object, f) {\n var map = new Map;\n\n // Copy constructor.\n if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });\n\n // Index array by numeric index or specified key function.\n else if (Array.isArray(object)) {\n var i = -1,\n n = object.length,\n o;\n\n if (f == null) while (++i < n) map.set(i, object[i]);\n else while (++i < n) map.set(f(o = object[i], i, object), o);\n }\n\n // Convert object to map.\n else if (object) for (var key in object) map.set(key, object[key]);\n\n return map;\n}\n\nexport default map;\n","import {default as map, prefix} from \"./map\";\n\nfunction Set() {}\n\nvar proto = map.prototype;\n\nSet.prototype = set.prototype = {\n constructor: Set,\n has: proto.has,\n add: function(value) {\n value += \"\";\n this[prefix + value] = value;\n return this;\n },\n remove: proto.remove,\n clear: proto.clear,\n values: proto.keys,\n size: proto.size,\n empty: proto.empty,\n each: proto.each\n};\n\nfunction set(object, f) {\n var set = new Set;\n\n // Copy constructor.\n if (object instanceof Set) object.each(function(value) { set.add(value); });\n\n // Otherwise, assume it’s an array.\n else if (object) {\n var i = -1, n = object.length;\n if (f == null) while (++i < n) set.add(object[i]);\n else while (++i < n) set.add(f(object[i], i, object));\n }\n\n return set;\n}\n\nexport default set;\n","var array = Array.prototype;\n\nexport var map = array.map;\nexport var slice = array.slice;\n","import {map} from \"d3-collection\";\nimport {slice} from \"./array\";\n\nexport var implicit = {name: \"implicit\"};\n\nexport default function ordinal(range) {\n var index = map(),\n domain = [],\n unknown = implicit;\n\n range = range == null ? [] : slice.call(range);\n\n function scale(d) {\n var key = d + \"\", i = index.get(key);\n if (!i) {\n if (unknown !== implicit) return unknown;\n index.set(key, i = domain.push(d));\n }\n return range[(i - 1) % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = map();\n var i = -1, n = _.length, d, key;\n while (++i < n) if (!index.has(key = (d = _[i]) + \"\")) index.set(key, domain.push(d));\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport ordinal from \"./ordinal\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n range = [0, 1],\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = range[1] < range[0],\n start = range[reverse - 0],\n stop = range[1 - reverse];\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = [+_[0], +_[1]], round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band()\n .domain(domain())\n .range(range)\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return rescale();\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band().paddingInner(1));\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateRound} from \"d3-interpolate\";\nimport {map, slice} from \"./array\";\nimport constant from \"./constant\";\nimport number from \"./number\";\n\nvar unit = [0, 1];\n\nexport function deinterpolateLinear(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(b);\n}\n\nfunction deinterpolateClamp(deinterpolate) {\n return function(a, b) {\n var d = deinterpolate(a = +a, b = +b);\n return function(x) { return x <= a ? 0 : x >= b ? 1 : d(x); };\n };\n}\n\nfunction reinterpolateClamp(reinterpolate) {\n return function(a, b) {\n var r = reinterpolate(a = +a, b = +b);\n return function(t) { return t <= 0 ? a : t >= 1 ? b : r(t); };\n };\n}\n\nfunction bimap(domain, range, deinterpolate, reinterpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate(r1, r0);\n else d0 = deinterpolate(d0, d1), r0 = reinterpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, deinterpolate, reinterpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = deinterpolate(domain[i], domain[i + 1]);\n r[i] = reinterpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp());\n}\n\n// deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].\nexport default function continuous(deinterpolate, reinterpolate) {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n clamp = false,\n piecewise,\n output,\n input;\n\n function rescale() {\n piecewise = Math.min(domain.length, range.length) > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return (output || (output = piecewise(domain, range, clamp ? deinterpolateClamp(deinterpolate) : deinterpolate, interpolate)))(+x);\n }\n\n scale.invert = function(y) {\n return (input || (input = piecewise(range, domain, deinterpolateLinear, clamp ? reinterpolateClamp(reinterpolate) : reinterpolate)))(+y);\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = map.call(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = slice.call(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, rescale()) : clamp;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n return rescale();\n}\n","// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimal(1.23) returns [\"123\", 0].\nexport default function(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import formatDecimal from \"./formatDecimal\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import formatDecimal from \"./formatDecimal\";\n\nexport default function(x) {\n return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;\n}\n","import formatDecimal from \"./formatDecimal\";\n\nexport default function(x, p) {\n var d = formatDecimal(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDefault from \"./formatDefault\";\nimport formatPrefixAuto from \"./formatPrefixAuto\";\nimport formatRounded from \"./formatRounded\";\n\nexport default {\n \"\": formatDefault,\n \"%\": function(x, p) { return (x * 100).toFixed(p); },\n \"b\": function(x) { return Math.round(x).toString(2); },\n \"c\": function(x) { return x + \"\"; },\n \"d\": function(x) { return Math.round(x).toString(10); },\n \"e\": function(x, p) { return x.toExponential(p); },\n \"f\": function(x, p) { return x.toFixed(p); },\n \"g\": function(x, p) { return x.toPrecision(p); },\n \"o\": function(x) { return Math.round(x).toString(8); },\n \"p\": function(x, p) { return formatRounded(x * 100, p); },\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": function(x) { return Math.round(x).toString(16).toUpperCase(); },\n \"x\": function(x) { return Math.round(x).toString(16); }\n};\n","export default function(x, p) {\n x = x.toPrecision(p);\n\n out: for (var n = x.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (x[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n case \"e\": break out;\n default: if (i0 > 0) i0 = 0; break;\n }\n }\n\n return i0 > 0 ? x.slice(0, i0) + x.slice(i1 + 1) : x;\n}\n","import formatTypes from \"./formatTypes\";\n\n// [[fill]align][sign][symbol][0][width][,][.precision][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-\\( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n return new FormatSpecifier(specifier);\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nfunction FormatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n\n var match,\n fill = match[1] || \" \",\n align = match[2] || \">\",\n sign = match[3] || \"-\",\n symbol = match[4] || \"\",\n zero = !!match[5],\n width = match[6] && +match[6],\n comma = !!match[7],\n precision = match[8] && +match[8].slice(1),\n type = match[9] || \"\";\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // Map invalid types to the default format.\n else if (!formatTypes[type]) type = \"\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n this.fill = fill;\n this.align = align;\n this.sign = sign;\n this.symbol = symbol;\n this.zero = zero;\n this.width = width;\n this.comma = comma;\n this.precision = precision;\n this.type = type;\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width == null ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision == null ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + this.type;\n};\n","export default function(x) {\n return x;\n}\n","import formatLocale from \"./locale\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n decimal: \".\",\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","import exponent from \"./exponent\";\nimport formatGroup from \"./formatGroup\";\nimport formatNumerals from \"./formatNumerals\";\nimport formatSpecifier from \"./formatSpecifier\";\nimport formatTypes from \"./formatTypes\";\nimport {prefixExponent} from \"./formatPrefixAuto\";\nimport identity from \"./identity\";\n\nvar prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping && locale.thousands ? formatGroup(locale.grouping, locale.thousands) : identity,\n currency = locale.currency,\n decimal = locale.decimal,\n numerals = locale.numerals ? formatNumerals(locale.numerals) : identity,\n percent = locale.percent || \"%\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n type = specifier.type;\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currency[0] : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currency[1] : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = !type || /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision == null ? (type ? 6 : 12)\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Perform the initial formatting.\n var valueNegative = value < 0;\n value = formatType(Math.abs(value), precision);\n\n // If a negative value rounds to zero during formatting, treat as positive.\n if (valueNegative && +value === 0) valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : \"-\") : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","import exponent from \"./exponent\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function(domain, count, specifier) {\n var start = domain[0],\n stop = domain[domain.length - 1],\n step = tickStep(start, stop, count == null ? 10 : count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import exponent from \"./exponent\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport tickFormat from \"./tickFormat\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n return tickFormat(domain(), count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain(),\n i0 = 0,\n i1 = d.length - 1,\n start = d[i0],\n stop = d[i1],\n step;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n\n step = tickIncrement(start, stop, count);\n\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n domain(d);\n } else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n domain(d);\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous(deinterpolate, reinterpolate);\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n return linearish(scale);\n}\n","import {map} from \"./array\";\nimport {linearish} from \"./linear\";\nimport number from \"./number\";\n\nexport default function identity() {\n var domain = [0, 1];\n\n function scale(x) {\n return +x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = map.call(_, number), scale) : domain.slice();\n };\n\n scale.copy = function() {\n return identity().domain(domain);\n };\n\n return linearish(scale);\n}\n","export default function(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format} from \"d3-format\";\nimport constant from \"./constant\";\nimport nice from \"./nice\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction deinterpolate(a, b) {\n return (b = Math.log(b / a))\n ? function(x) { return Math.log(x / a) / b; }\n : constant(b);\n}\n\nfunction reinterpolate(a, b) {\n return a < 0\n ? function(t) { return -Math.pow(-b, t) * Math.pow(-a, 1 - t); }\n : function(t) { return Math.pow(b, t) * Math.pow(a, 1 - t); };\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : function(x) { return Math.pow(base, x); };\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), function(x) { return Math.log(x) / base; });\n}\n\nfunction reflect(f) {\n return function(x) {\n return -f(-x);\n };\n}\n\nexport default function log() {\n var scale = continuous(deinterpolate, reinterpolate).domain([1, 10]),\n domain = scale.domain,\n base = 10,\n logs = logp(10),\n pows = powp(10);\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) logs = reflect(logs), pows = reflect(pows);\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = function(count) {\n var d = domain(),\n u = d[0],\n v = d[d.length - 1],\n r;\n\n if (r = v < u) i = u, u = v, v = i;\n\n var i = logs(u),\n j = logs(v),\n p,\n k,\n t,\n n = count == null ? 10 : +count,\n z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.round(i) - 1, j = Math.round(j) + 1;\n if (u > 0) for (; i < j; ++i) {\n for (k = 1, p = pows(i); k < base; ++k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i < j; ++i) {\n for (k = base - 1, p = pows(i); k >= 1; --k) {\n t = p * k;\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = function(count, specifier) {\n if (specifier == null) specifier = base === 10 ? \".0e\" : \",\";\n if (typeof specifier !== \"function\") specifier = format(specifier);\n if (count === Infinity) return specifier;\n if (count == null) count = 10;\n var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return function(d) {\n var i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = function() {\n return domain(nice(domain(), {\n floor: function(x) { return pows(Math.floor(logs(x))); },\n ceil: function(x) { return pows(Math.ceil(logs(x))); }\n }));\n };\n\n scale.copy = function() {\n return copy(scale, log().base(base));\n };\n\n return scale;\n}\n","import constant from \"./constant\";\nimport {linearish} from \"./linear\";\nimport {default as continuous, copy} from \"./continuous\";\n\nfunction raise(x, exponent) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n}\n\nexport default function pow() {\n var exponent = 1,\n scale = continuous(deinterpolate, reinterpolate),\n domain = scale.domain;\n\n function deinterpolate(a, b) {\n return (b = raise(b, exponent) - (a = raise(a, exponent)))\n ? function(x) { return (raise(x, exponent) - a) / b; }\n : constant(b);\n }\n\n function reinterpolate(a, b) {\n b = raise(b, exponent) - (a = raise(a, exponent));\n return function(t) { return raise(a + b * t, 1 / exponent); };\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, domain(domain())) : exponent;\n };\n\n scale.copy = function() {\n return copy(scale, pow().exponent(exponent));\n };\n\n return linearish(scale);\n}\n\nexport function sqrt() {\n return pow().exponent(0.5);\n}\n","import {ascending, bisect, quantile as threshold} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [];\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n if (!isNaN(x = +x)) return range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), rescale()) : range.slice();\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\nimport {linearish} from \"./linear\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1];\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = slice.call(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range);\n };\n\n return linearish(scale);\n}\n","import {bisect} from \"d3-array\";\nimport {slice} from \"./array\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n n = 1;\n\n function scale(x) {\n if (x <= x) return range[bisect(domain, x, 0, n)];\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range);\n };\n\n return scale;\n}\n","var t0 = new Date,\n t1 = new Date;\n\nexport default function newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = new Date(+date)), date;\n }\n\n interval.floor = interval;\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n","import interval from \"./interval\";\n\nvar millisecond = interval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return interval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\n\nexport default millisecond;\nexport var milliseconds = millisecond.range;\n","export var durationSecond = 1e3;\nexport var durationMinute = 6e4;\nexport var durationHour = 36e5;\nexport var durationDay = 864e5;\nexport var durationWeek = 6048e5;\n","import interval from \"./interval\";\nimport {durationSecond} from \"./duration\";\n\nvar second = interval(function(date) {\n date.setTime(Math.floor(date / durationSecond) * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\n\nexport default second;\nexport var seconds = second.range;\n","import interval from \"./interval\";\nimport {durationMinute} from \"./duration\";\n\nvar minute = interval(function(date) {\n date.setTime(Math.floor(date / durationMinute) * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\n\nexport default minute;\nexport var minutes = minute.range;\n","import interval from \"./interval\";\nimport {durationHour, durationMinute} from \"./duration\";\n\nvar hour = interval(function(date) {\n var offset = date.getTimezoneOffset() * durationMinute % durationHour;\n if (offset < 0) offset += durationHour;\n date.setTime(Math.floor((+date - offset) / durationHour) * durationHour + offset);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\n\nexport default hour;\nexport var hours = hour.range;\n","import interval from \"./interval\";\nimport {durationDay, durationMinute} from \"./duration\";\n\nvar day = interval(function(date) {\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setDate(date.getDate() + step);\n}, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;\n}, function(date) {\n return date.getDate() - 1;\n});\n\nexport default day;\nexport var days = day.range;\n","import interval from \"./interval\";\nimport {durationMinute, durationWeek} from \"./duration\";\n\nfunction weekday(i) {\n return interval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport var sunday = weekday(0);\nexport var monday = weekday(1);\nexport var tuesday = weekday(2);\nexport var wednesday = weekday(3);\nexport var thursday = weekday(4);\nexport var friday = weekday(5);\nexport var saturday = weekday(6);\n\nexport var sundays = sunday.range;\nexport var mondays = monday.range;\nexport var tuesdays = tuesday.range;\nexport var wednesdays = wednesday.range;\nexport var thursdays = thursday.range;\nexport var fridays = friday.range;\nexport var saturdays = saturday.range;\n","import interval from \"./interval\";\n\nvar month = interval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\n\nexport default month;\nexport var months = month.range;\n","import interval from \"./interval\";\n\nvar year = interval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport default year;\nexport var years = year.range;\n","import interval from \"./interval\";\nimport {durationMinute} from \"./duration\";\n\nvar utcMinute = interval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\n\nexport default utcMinute;\nexport var utcMinutes = utcMinute.range;\n","import interval from \"./interval\";\nimport {durationHour} from \"./duration\";\n\nvar utcHour = interval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\n\nexport default utcHour;\nexport var utcHours = utcHour.range;\n","import interval from \"./interval\";\nimport {durationDay} from \"./duration\";\n\nvar utcDay = interval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\nexport default utcDay;\nexport var utcDays = utcDay.range;\n","import interval from \"./interval\";\nimport {durationWeek} from \"./duration\";\n\nfunction utcWeekday(i) {\n return interval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nexport var utcSunday = utcWeekday(0);\nexport var utcMonday = utcWeekday(1);\nexport var utcTuesday = utcWeekday(2);\nexport var utcWednesday = utcWeekday(3);\nexport var utcThursday = utcWeekday(4);\nexport var utcFriday = utcWeekday(5);\nexport var utcSaturday = utcWeekday(6);\n\nexport var utcSundays = utcSunday.range;\nexport var utcMondays = utcMonday.range;\nexport var utcTuesdays = utcTuesday.range;\nexport var utcWednesdays = utcWednesday.range;\nexport var utcThursdays = utcThursday.range;\nexport var utcFridays = utcFriday.range;\nexport var utcSaturdays = utcSaturday.range;\n","import interval from \"./interval\";\n\nvar utcMonth = interval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\n\nexport default utcMonth;\nexport var utcMonths = utcMonth.range;\n","import interval from \"./interval\";\n\nvar utcYear = interval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport default utcYear;\nexport var utcYears = utcYear.range;\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newYear(y) {\n return {y: y, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, newDate) {\n return function(string) {\n var d = newYear(1900),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newYear(d.y)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = newDate(newYear(d.y)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return newDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", localDate);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier, utcDate);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n var map = {}, i = -1, n = names.length;\n while (++i < n) map[names[i].toLowerCase()] = i;\n return map;\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = (+n[0]) * 1000, i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d), d), p, 2);\n}\n\nfunction formatWeekNumberISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d), d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d), d), p, 2);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d), d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {utcFormat} from \"./defaultLocale\";\n\nexport var isoSpecifier = \"%Y-%m-%dT%H:%M:%S.%LZ\";\n\nfunction formatIsoNative(date) {\n return date.toISOString();\n}\n\nvar formatIso = Date.prototype.toISOString\n ? formatIsoNative\n : utcFormat(isoSpecifier);\n\nexport default formatIso;\n","import {isoSpecifier} from \"./isoFormat\";\nimport {utcParse} from \"./defaultLocale\";\n\nfunction parseIsoNative(string) {\n var date = new Date(string);\n return isNaN(date) ? null : date;\n}\n\nvar parseIso = +new Date(\"2000-01-01T00:00:00.000Z\")\n ? parseIsoNative\n : utcParse(isoSpecifier);\n\nexport default parseIso;\n","import {bisector, tickStep} from \"d3-array\";\nimport {interpolateNumber as reinterpolate} from \"d3-interpolate\";\nimport {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport {map} from \"./array\";\nimport {default as continuous, copy, deinterpolateLinear as deinterpolate} from \"./continuous\";\nimport nice from \"./nice\";\n\nvar durationSecond = 1000,\n durationMinute = durationSecond * 60,\n durationHour = durationMinute * 60,\n durationDay = durationHour * 24,\n durationWeek = durationDay * 7,\n durationMonth = durationDay * 30,\n durationYear = durationDay * 365;\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(year, month, week, day, hour, minute, second, millisecond, format) {\n var scale = continuous(deinterpolate, reinterpolate),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n var tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n function tickInterval(interval, start, stop, step) {\n if (interval == null) interval = 10;\n\n // If a desired tick count is specified, pick a reasonable tick interval\n // based on the extent of the domain and a rough estimate of tick size.\n // Otherwise, assume interval is already a time interval and use it.\n if (typeof interval === \"number\") {\n var target = Math.abs(stop - start) / interval,\n i = bisector(function(i) { return i[2]; }).right(tickIntervals, target);\n if (i === tickIntervals.length) {\n step = tickStep(start / durationYear, stop / durationYear, interval);\n interval = year;\n } else if (i) {\n i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n step = i[1];\n interval = i[0];\n } else {\n step = Math.max(tickStep(start, stop, interval), 1);\n interval = millisecond;\n }\n }\n\n return step == null ? interval : interval.every(step);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(map.call(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval, step) {\n var d = domain(),\n t0 = d[0],\n t1 = d[d.length - 1],\n r = t1 < t0,\n t;\n if (r) t = t0, t0 = t1, t1 = t;\n t = tickInterval(interval, t0, t1, step);\n t = t ? t.range(t0, t1 + 1) : []; // inclusive stop\n return r ? t.reverse() : t;\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval, step) {\n var d = domain();\n return (interval = tickInterval(interval, d[0], d[d.length - 1], step))\n ? domain(nice(d, interval))\n : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format));\n };\n\n return scale;\n}\n\nexport default function() {\n return calendar(timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);\n}\n","import {calendar} from \"./time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcMillisecond} from \"d3-time\";\n\nexport default function() {\n return calendar(utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcMillisecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]);\n}\n","import {linearish} from \"./linear\";\n\nexport default function sequential(interpolator) {\n var x0 = 0,\n x1 = 1,\n clamp = false;\n\n function scale(x) {\n var t = (x - x0) / (x1 - x0);\n return interpolator(clamp ? Math.max(0, Math.min(1, t)) : t);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (x0 = +_[0], x1 = +_[1], scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.copy = function() {\n return sequential(interpolator).domain([x0, x1]).clamp(clamp);\n };\n\n return linearish(scale);\n}\n","function d3Transform(chain) {\n var transforms = [];\n if (chain !== undefined) {\n transforms.push(chain);\n }\n\n function push(kind, args) {\n var n = args.length;\n\n transforms.push(function () {\n if (kind == 'seq') {\n return args[0].apply(this, arr(arguments));\n } else {\n return kind + '(' + (n == 1 && typeof args[0] == 'function' ? args[0].apply(this, arr(arguments)) : args) + ')';\n }\n });\n }\n\n function arr(args) {\n return Array.prototype.slice.call(args);\n }\n\n var my = function my() {\n var that = this,\n args = arr(arguments);\n\n return transforms.map(function (f) {\n return f.apply(that, args);\n }).join(' ');\n };\n\n ['translate', 'rotate', 'scale', 'matrix', 'skewX', 'skewY', 'seq'].forEach(function (t) {\n my[t] = function () {\n push(t, arr(arguments));\n return my;\n };\n });\n\n return my;\n}\n\nexport { d3Transform as transform };\n//# sourceMappingURL=d3-transform.mjs.map\n","'use strict';\n\nimport * as axis from 'd3-axis';\nimport * as scale from 'd3-scale';\nimport * as transform from 'd3-transform';\nimport * as transition from 'd3-transition';\nimport * as zoom from 'd3-zoom';\nimport { select, selectAll, mouse } from 'd3-selection';\nimport { event as currentEvent } from 'd3-selection';\n\nconst d3 = Object.assign({},\n { mouse, select, selectAll },\n axis,\n scale,\n transform,\n transition,\n zoom\n);\n\nconst kScaleMin = .09;\nconst kScaleMax = 20;\nconst kScaleLocateZoom = 2;\nconst kMarkerSize = 38;\nconst kMarkerShadowSize = 9;\n\n/**\n * @Class ModelTrainerImageMarker class used to provide pan, zoom, and mark capabilities\n *\n * Methods:\n * boot (6)\n * destroy ()\n */\n\nclass ModelTrainerImageMarker {\n\n constructor (id) {\n\n this.cpId = id;\n this.imgId, this.target, this.pin, this.mark, this.events, this.width, this.height;\n this.cartesianSystem;\n this.hasPin = false;\n }\n\n boot (img, imgId, target, objects, mark, events) {\n\n if (events) {\n this.events = events;\n }\n this.objects = objects; // other markers on image\n this.pin = {\n marked: false,\n pixelLocation: []\n };\n if (mark && mark.x && mark.y) {\n this.pin.pixelLocation = [mark.x, mark.y];\n }\n if (img) {\n this.img = img;\n }\n this.events = events;\n this.target = target;\n this.imgId = imgId;\n this.cartesianSystem = d3.select(`svg${this.target}`);\n\n this._init();\n }\n\n configure (options) {\n\n /* Superset */\n /*\n { targetIcon, scaleMin, scaleMax, scaleLocateZoom, markerSize, markerShadowSize }\n */\n\n options = options || {};\n if (options.targetIcon) {\n this.targetIcon = options.targetIcon;\n }\n\n this.optionScaleMin = options.scaleMin ? options.scaleMin : kScaleMin;\n this.optionScaleMax = options.scaleMax ? options.scaleMax : kScaleMax;\n this.optionScaleLocateZoom = options.scaleLocateZoom ? options.scaleLocateZoom : kScaleLocateZoom;\n this.optionMarkerSize = options.markerSize ? options.markerSize : kMarkerSize;\n this.optionMarkerShadowSize = options.markerShadowSize ? options.markerShadowSize : kMarkerShadowSize;\n }\n\n // Zooms backwards to a hollistic perspective\n resetZoom (delay) {\n\n if (!delay) {\n delay = 0;\n }\n const scaledWidth = this.img.width * this.optionScaleMin;\n const scaledHeight = this.img.height * this.optionScaleMin;\n const x = (this.width - scaledWidth) / 2;\n const y = (this.height - scaledHeight) / 2;\n this.cartesianSystem.transition()\n .duration(delay)\n .call(this._zoomStrat().transform, d3.zoomIdentity.translate(x, y).scale(this.optionScaleMin));\n this.events.onZoomReset ? this.events.onZoomReset() : this.onZoomReset();\n }\n\n // Cleans DOM and D3 Nodes / Listeners\n destroy () {\n\n if (!this.cartesianSystem) {\n return;\n }\n this.cartesianSystem.selectAll('*').remove();\n this.cartesianSystem = null;\n this.img = '';\n return null;\n }\n\n\n // Marks a pixel location on the system w.r.t. transformation and scale, uneditable marker\n drawStatic (x, y, context) {\n\n // draw static object\n const z = d3.zoomTransform(this.cartesianSystem.node()).k;\n if (x > 0 && y > 0) {\n this.mark = this.CanvasArea.append('circle')\n .attr('id', context.cpId)\n .attr('class', 'control-point-static')\n .attr('dr', this.optionMarkerShadowSize)\n .attr('r', this.optionMarkerShadowSize / z)\n .attr('cx', x )\n .attr('cy', y )\n .on('mouseover', (d) => {\n\n return this.tip\n .style('left', currentEvent.pageX - 30 + 'px')\n .style('top', currentEvent.pageY - 50 + 'px')\n .style('display', 'inline-block')\n .style('visibility', 'visible')\n .html('
' + context.name + '
');\n })\n .on('mousemove', (d) => {\n\n return this.tip\n .style('left', currentEvent.pageX - 30 + 'px')\n .style('top', currentEvent.pageY - 50 + 'px')\n .style('display', 'inline-block')\n .html('
' + context.name + '
');\n })\n .on('mouseout', (d) => {\n\n return this.tip.style('visibility', 'hidden');\n })\n .on('click', (d, i) => {\n\n currentEvent.stopPropagation();\n this.events.onMarkClick ? this.events.onMarkClick({ photoId: this.imgId, cpId: context.cpId }) : this.onMarkClick({ photoId: this.imgId, cpId: context.cpId });\n });\n }\n }\n\n reDrawMarker () {\n\n if (!this.CanvasArea) {\n return;\n }\n\n this.CanvasArea.selectAll('use.control-point').remove();\n this.CanvasArea.selectAll('circle.control-point').remove();\n this.CanvasArea.selectAll('circle.shadow').remove();\n const z = d3.zoomTransform(this.cartesianSystem.node()).k;\n if (this.pin.pixelLocation[0] > 0 && this.pin.pixelLocation[1] > 0) {\n const x = this.pin.pixelLocation[0];\n const y = this.pin.pixelLocation[1];\n if (this.targetIcon) {\n this.mark = this.CanvasArea.append('use')\n .attr('id', this.cpId)\n .attr('xlink:href', this.targetIcon)\n .attr('class', 'control-point')\n .attr('width', this.optionMarkerSize / z)\n .attr('height', this.optionMarkerSize / z)\n .attr('x', x - (this.optionMarkerSize / z / 2) )\n .attr('y', y - (this.optionMarkerSize / z / 2));\n }\n else {\n this.mark = this.CanvasArea.append('circle')\n .attr('id', this.cpId)\n .attr('class', 'control-point')\n .attr('dr', this.optionMarkerShadowSize + 6)\n .attr('r', this.optionMarkerShadowSize / z + 6)\n .attr('cx', x )\n .attr('cy', y );\n }\n\n this.CanvasArea.append('circle')\n .attr('class', 'shadow')\n .attr('dr', this.optionMarkerShadowSize)\n .attr('r', this.optionMarkerShadowSize / z)\n .attr('cx', x )\n .attr('cy', y );\n }\n }\n\n // Marks a pixel location on the system w.r.t. transformation and scale\n drawMarker (x, y) {\n\n if (!this.CanvasArea) {\n return;\n }\n // draw pin on mouse click\n\n this.CanvasArea.selectAll('use.control-point').remove();\n this.CanvasArea.selectAll('circle.control-point').remove();\n this.CanvasArea.selectAll('circle.shadow').remove();\n if (!x && !y) {\n const mouse = d3.mouse(currentEvent.currentTarget);\n x = mouse[0];\n y = mouse[1];\n this.pin = {\n marked: true,\n pixelLocation: [x, y]\n };\n }\n const z = d3.zoomTransform(this.cartesianSystem.node()).k;\n if (x > 0 && y > 0) {\n if (this.targetIcon) {\n this.mark = this.CanvasArea.append('use')\n .attr('id', this.cpId)\n .attr('xlink:href', this.targetIcon)\n .attr('class', 'control-point')\n .attr('width', this.optionMarkerSize / z)\n .attr('height', this.optionMarkerSize / z)\n .attr('x', x - (this.optionMarkerSize / z / 2) )\n .attr('y', y - (this.optionMarkerSize / z / 2));\n }\n else {\n this.mark = this.CanvasArea.append('circle')\n .attr('id', this.cpId)\n .attr('class', 'control-point')\n .attr('dr', this.optionMarkerShadowSize)\n .attr('r', this.optionMarkerShadowSize / z)\n .attr('cx', x )\n .attr('cy', y );\n }\n\n this.CanvasArea.append('circle')\n .attr('class', 'shadow')\n .attr('dr', this.optionMarkerShadowSize)\n .attr('r', this.optionMarkerShadowSize / z)\n .attr('cx', x )\n .attr('cy', y );\n\n this.events.onMark ? this.events.onMark({ photoId: this.imgId, cpId: this.cpId, x, y }) : this.onMark({ photoId: this.imgId, cpId: this.cpId, x, y });\n }\n }\n\n // Erases the marked location from the system\n clearMarker () {\n\n if (!this.CanvasArea) {\n return;\n }\n this.CanvasArea.selectAll('use.control-point').remove();\n this.CanvasArea.selectAll('circle.control-point').remove();\n this.CanvasArea.selectAll('circle.shadow').remove();\n this.pin = {\n marked: false,\n pixelLocation: [] // x, y\n };\n\n this.events.onMarkDelete ? this.events.onMarkDelete({ photoId: this.imgId, cpId: this.cpId }) : this.onMarkDelete({ photoId: this.imgId, cpId: this.cpId });\n }\n\n // Locates and zooms gradually to the Point of Interest\n findCP (delay) {\n\n if (!delay) {\n delay = 0;\n }\n\n if (this.pin && this.pin.pixelLocation && this.pin.pixelLocation.length === 2) {\n const x = (this.width / 2) - this.pin.pixelLocation[0] * this.optionScaleLocateZoom;\n const y = (this.height / 2) - this.pin.pixelLocation[1] * this.optionScaleLocateZoom;\n this.cartesianSystem.transition()\n .duration(delay)\n .call(this._zoomStrat().transform, d3.zoomIdentity.translate(x, y).scale(this.optionScaleLocateZoom));\n }\n else {\n this.resetZoom(750);\n }\n\n this.events.onZoomToCP ? this.events.onZoomToCP() : this.onZoomToCP();\n\n }\n\n // Incrementally Zoom in\n zoomIn () {\n\n const z = d3.zoomTransform(this.cartesianSystem.node()).k;\n const x = d3.zoomTransform(this.cartesianSystem.node()).x * z - this.width * z / 2;\n const y = d3.zoomTransform(this.cartesianSystem.node()).y * z - this.height * z / 2;\n this.cartesianSystem.transition()\n .duration(375)\n .call(this._zoomStrat().transform, d3.zoomIdentity.translate(x, y).scale(z * 2));\n }\n\n // Incrementally Zoom Out\n zoomOut () {\n\n const z = d3.zoomTransform(this.cartesianSystem.node()).k;\n const x = d3.zoomTransform(this.cartesianSystem.node()).x * z - this.width * z / 2;\n const y = d3.zoomTransform(this.cartesianSystem.node()).y * z - this.height * z / 2;\n this.cartesianSystem.transition()\n .duration(375)\n .call(this._zoomStrat().transform, d3.zoomIdentity.translate(x, y).scale(z / 2));\n }\n\n // Method that governs zoom behavior\n _zoomStrat () {\n\n return d3.zoom()\n .scaleExtent([this.optionScaleMin, this.optionScaleMax])\n .on('zoom', () => {\n\n const markerSize = this.optionMarkerSize;\n this.CanvasArea.attr('transform', currentEvent.transform);\n this.pX.call(this.xAxis.scale(currentEvent.transform.rescaleX(this.xScale)));\n this.pY.call(this.yAxis.scale(currentEvent.transform.rescaleY(this.yScale)));\n if (currentEvent.transform) {\n // Resize the marker icon\n this.CanvasArea.selectAll('use.control-point')\n .each(function(d) {\n\n const cp = d3.select(this);\n const k = currentEvent.transform.k;\n const dWidth = (parseFloat(cp.attr('width')) - markerSize / k) / 2;\n const dHeight = (parseFloat(cp.attr('height')) - markerSize / k) / 2;\n const x = parseFloat(cp.attr('x')) + dWidth;\n const y = parseFloat(cp.attr('y')) + dHeight;\n cp.attr('width', markerSize / k)\n cp.attr('height', markerSize / k)\n cp.attr('x', x)\n cp.attr('y', y);\n });\n this.CanvasArea.selectAll('circle.control-point')\n .each(function(d) {\n\n const cp = d3.select(this);\n let z = currentEvent.transform.k;\n if (cp.attr('dr')) {\n z = cp.attr('dr') / z;\n }\n cp.attr('r', z);\n });\n this.CanvasArea.selectAll('circle.shadow')\n .each(function(d) {\n\n const cp = d3.select(this);\n let z = currentEvent.transform.k;\n if (cp.attr('dr')) {\n z = cp.attr('dr') / z;\n }\n cp.attr('r', z);\n });\n this.CanvasArea.selectAll('circle.control-point-static')\n .each(function(d) {\n\n const cp = d3.select(this);\n let z = currentEvent.transform.k;\n if (cp.attr('dr')) {\n z = cp.attr('dr') / z;\n }\n cp.attr('r', z);\n });\n }\n });\n }\n\n // Initialize System\n _init () {\n\n // X Scaling Behavior\n this.xScale = d3.scaleLinear()\n .domain([-1, this.img.width + 1])\n .range([-1, this.img.width + 1]);\n\n // Y Scaling Behavior\n this.yScale = d3.scaleLinear()\n .domain([-1, this.img.height + 1])\n .range([-1, this.img.height + 1]);\n\n // X Axis Rules\n this.xAxis = d3.axisBottom(this.xScale)\n .ticks( 20 )\n .tickSize( 10 )\n .tickPadding( 5 );\n\n // Y Axis Rules\n this.yAxis = d3.axisRight(this.yScale)\n .ticks( 20 )\n .tickSize( 10 )\n .tickPadding( 5 );\n\n // Physical X Axis\n this.pX = this.cartesianSystem.append('g')\n .attr('class', 'axis axis--x')\n .call(this.xAxis);\n\n // Physical Y Axis\n this.pY = this.cartesianSystem.append('g')\n .attr('class', 'axis axis--y')\n .call(this.yAxis);\n\n // Photo Canvas Area\n this.CanvasArea = this.cartesianSystem.append('g')\n .attr('class', 'canvas');\n\n // Tooltip\n d3.selectAll('#d3-tooltip').remove();\n this.tip = d3.select('body')\n .append('div')\n .attr('id', 'd3-tooltip');\n\n // Photo\n this.CanvasImage = this.CanvasArea.append('svg:image')\n .attr('xlink:href', this.img.src || this.img)\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', this.img.width)\n .attr('height', this.img.height);\n\n this.resetDimentions();\n this.CanvasArea.on('click', this.drawMarker.bind(this));\n this.cartesianSystem.call(this._zoomStrat().bind(this));\n this.resetZoom.bind(this);\n this.events.onReady ? this.events.onReady(this.cpId) : this.onReady(this.cpId);\n if (this.objects && this.objects.length) {\n this.objects.forEach((object) => {\n\n this.drawStatic(object.xPos, object.yPos, object);\n });\n }\n if (this.pin && this.pin.pixelLocation && this.pin.pixelLocation.length === 2) {\n this.drawMarker(this.pin.pixelLocation[0], this.pin.pixelLocation[1]);\n this.findCP();\n }\n else {\n this.resetZoom();\n }\n\n }\n\n onReady (data) {\n\n // noop... set by application\n }\n\n onMark (data) {\n\n // noop... set by application\n }\n\n onMarkClick (data) {\n\n // noop... set by application\n }\n\n onMarkDelete (data) {\n\n // noop... set by application\n }\n\n onZoomReset (data) {\n\n // noop... set by application\n }\n\n onZoomToCP (data) {\n\n // noop... set by application\n }\n\n resetDimentions() {\n\n if (this.cartesianSystem) {\n this.width = parseFloat(this.cartesianSystem.style('width'));\n this.height = parseFloat(this.cartesianSystem.style('height'));\n }\n }\n}\n\nexport default ModelTrainerImageMarker;\n","\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of