StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
StackGenVis/frontend/node_modules/d3-zoomable/dist/d3-zoomable.min.js

2 lines
51 KiB

// Version 1.1.1 d3-zoomable - https://github.com/vasturiano/d3-zoomable
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).zoomable=n()}(this,function(){"use strict";function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n)}function n(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function e(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),i.forEach(function(e){n(t,e,r[e])})}return t}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/"};function o(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}function u(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 a(){}function s(t){return null==t?a:function(){return this.querySelector(t)}}function c(){return[]}function l(t){return null==t?c:function(){return this.querySelectorAll(t)}}function h(t){return function(){return this.matches(t)}}function f(t){return new Array(t.length)}function p(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}p.prototype={constructor:p,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 d="$";function m(t,n,e,r,i,o){for(var u,a=0,s=n.length,c=o.length;a<c;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new p(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function v(t,n,e,r,i,o,u){var a,s,c,l={},h=n.length,f=o.length,m=new Array(h);for(a=0;a<h;++a)(s=n[a])&&(m[a]=c=d+u.call(s,s.__data__,a,n),c in l?i[a]=s:l[c]=s);for(a=0;a<f;++a)(s=l[c=d+u.call(t,o[a],a,o)])?(r[a]=s,s.__data__=o[a],l[c]=null):e[a]=new p(t,o[a]);for(a=0;a<h;++a)(s=n[a])&&l[m[a]]===s&&(i[a]=s)}function y(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function g(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function _(t,n){return t.style.getPropertyValue(n)||g(t).getComputedStyle(t,null).getPropertyValue(n)}function w(t){return t.trim().split(/^|\s+/)}function b(t){return t.classList||new x(t)}function x(t){this._node=t,this._names=w(t.getAttribute("class")||"")}function k(t,n){for(var e=b(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function M(t,n){for(var e=b(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function E(){this.textContent=""}function z(){this.innerHTML=""}function N(){this.nextSibling&&this.parentNode.appendChild(this)}function A(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function S(){return null}function T(){var t=this.parentNode;t&&t.removeChild(this)}function C(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function P(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}x.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var X={},q=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(X={mouseenter:"mouseover",mouseleave:"mouseout"}));function O(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=q;q=r;try{t.call(this,this.__data__,n,e)}finally{q=i}}}function j(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function I(t,n,e){var r=X.hasOwnProperty(t.type)?O:Y;return function(i,o,u){var a,s=this.__on,c=r(n,o,u);if(s)for(var l=0,h=s.length;l<h;++l)if((a=s[l]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=c,a.capture=e),void(a.value=n);this.addEventListener(t.type,c,e),a={type:t.type,name:t.name,value:n,listener:c,capture:e},s?s.push(a):this.__on=[a]}}function D(t,n,e){var r=g(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}var U=[null];function V(t,n){this._groups=t,this._parents=n}function R(){return new V([[document.documentElement]],U)}function B(t){return"string"==typeof t?new V([[document.querySelector(t)]],[document.documentElement]):new V([[t]],U)}function L(){for(var t,n=q;t=n.sourceEvent;)n=t;return n}function $(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]}function G(t){var n=L();return n.changedTouches&&(n=n.changedTouches[0]),$(t,n)}function H(t,n,e){arguments.length<3&&(e=n,n=L().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return $(t,r);return null}V.prototype=R.prototype={constructor:V,select:function(t){"function"!=typeof t&&(t=s(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],c=a.length,l=r[i]=new Array(c),h=0;h<c;++h)(o=a[h])&&(u=t.call(o,o.__data__,h,a))&&("__data__"in o&&(u.__data__=o.__data__),l[h]=u);return new V(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=l(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],s=a.length,c=0;c<s;++c)(u=a[c])&&(r.push(t.call(u,u.__data__,c,a)),i.push(u));return new V(r,i)},filter:function(t){"function"!=typeof t&&(t=h(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],c=0;c<a;++c)(o=u[c])&&t.call(o,o.__data__,c,u)&&s.push(o);return new V(r,this._parents)},data:function(t,n){if(!t)return d=new Array(this.size()),l=-1,this.each(function(t){d[++l]=t}),d;var e,r=n?v:m,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var u=o.length,a=new Array(u),s=new Array(u),c=new Array(u),l=0;l<u;++l){var h=i[l],f=o[l],p=f.length,d=t.call(h,h&&h.__data__,l,i),y=d.length,g=s[l]=new Array(y),_=a[l]=new Array(y);r(h,f,g,_,c[l]=new Array(p),d,n);for(var w,b,x=0,k=0;x<y;++x)if(w=g[x]){for(x>=k&&(k=x+1);!(b=_[k])&&++k<y;);w._next=b||null}}return(a=new V(a,i))._enter=s,a._exit=c,a},enter:function(){return new V(this._enter||this._groups.map(f),this._parents)},exit:function(){return new V(this._exit||this._groups.map(f),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,c=n[a],l=e[a],h=c.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=c[p]||l[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new V(u,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=y);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],s=a.length,c=i[o]=new Array(s),l=0;l<s;++l)(u=a[l])&&(c[l]=u);c.sort(n)}return new V(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null},size:function(){var t=0;return this.each(function(){++t}),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},attr:function(t,n){var e=o(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof n?e.local?function(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}:function(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}:e.local?function(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}:function(t,n){return function(){this.setAttribute(t,n)}})(e,n))},style:function(t,n,e){return arguments.length>1?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)):_(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=w(t+"");if(arguments.length<2){for(var r=b(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?function(t,n){return function(){(n.apply(this,arguments)?k:M)(this,t)}}:n?function(t){return function(){k(this,t)}}:function(t){return function(){M(this,t)}})(e,n))},text:function(t){return arguments.length?this.each(null==t?E:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?z:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(N)},lower:function(){return this.each(A)},append:function(t){var n="function"==typeof t?t:u(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:u(t),r=null==n?S:"function"==typeof n?n:s(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(T)},clone:function(t){return this.select(t?P:C)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),u=o.length;if(!(arguments.length<2)){for(a=n?I:j,null==e&&(e=!1),r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var s,c=0,l=a.length;c<l;++c)for(r=0,s=a[c];r<u;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?function(t,n){return function(){return D(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return D(this,t,n)}})(t,n))}};var F={value:function(){}};function K(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new Q(r)}function Q(t){this._=t}function W(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function J(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=F,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}Q.prototype=K.prototype={constructor:Q,on:function(t,n){var e,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})),u=-1,a=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++u<a;)if(e=(t=o[u]).type)i[e]=J(i[e],t.name,n);else if(null==n)for(e in i)i[e]=J(i[e],t.name,null);return this}for(;++u<a;)if((e=(t=o[u]).type)&&(e=W(i[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Q(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var Z,tt,nt=0,et=0,rt=0,it=1e3,ot=0,ut=0,at=0,st="object"==typeof performance&&performance.now?performance:Date,ct="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function lt(){return ut||(ct(ht),ut=st.now()+at)}function ht(){ut=0}function ft(){this._call=this._time=this._next=null}function pt(t,n,e){var r=new ft;return r.restart(t,n,e),r}function dt(){ut=(ot=st.now())+at,nt=et=0;try{!function(){lt(),++nt;for(var t,n=Z;n;)(t=ut-n._time)>=0&&n._call.call(null,t),n=n._next;--nt}()}finally{nt=0,function(){var t,n,e=Z,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Z=n);tt=t,vt(r)}(),ut=0}}function mt(){var t=st.now(),n=t-ot;n>it&&(at-=n,ot=t)}function vt(t){nt||(et&&(et=clearTimeout(et)),t-ut>24?(t<1/0&&(et=setTimeout(dt,t-st.now()-at)),rt&&(rt=clearInterval(rt))):(rt||(ot=st.now(),rt=setInterval(mt,it)),nt=1,ct(dt)))}function yt(t,n,e){var r=new ft;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r}ft.prototype=pt.prototype={constructor:ft,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?lt():+e)+(null==n?0:+n),this._next||tt===this||(tt?tt._next=this:Z=this,tt=this),this._call=t,this._time=e,vt()},stop:function(){this._call&&(this._call=null,this._time=1/0,vt())}};var gt=K("start","end","cancel","interrupt"),_t=[],wt=0,bt=1,xt=2,kt=3,Mt=4,Et=5,zt=6;function Nt(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(s){var c,l,h,f;if(e.state!==bt)return a();for(c in i)if((f=i[c]).name===e.name){if(f.state===kt)return yt(o);f.state===Mt?(f.state=zt,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[c]):+c<n&&(f.state=zt,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[c])}if(yt(function(){e.state===kt&&(e.state=Mt,e.timer.restart(u,e.delay,e.time),u(s))}),e.state=xt,e.on.call("start",t,t.__data__,e.index,e.group),e.state===xt){for(e.state=kt,r=new Array(h=e.tween.length),c=0,l=-1;c<h;++c)(f=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(r[++l]=f);r.length=l+1}}function u(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(a),e.state=Et,1),o=-1,u=r.length;++o<u;)r[o].call(t,i);e.state===Et&&(e.on.call("end",t,t.__data__,e.index,e.group),a())}function a(){for(var r in e.state=zt,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=pt(function(t){e.state=bt,e.timer.restart(o,e.delay,e.time),e.delay<=t&&o(t-e.delay)},0,e.time)}(t,e,{name:n,index:r,group:i,on:gt,tween:_t,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:wt})}function At(t,n){var e=Tt(t,n);if(e.state>wt)throw new Error("too late; already scheduled");return e}function St(t,n){var e=Tt(t,n);if(e.state>kt)throw new Error("too late; already running");return e}function Tt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ct(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>xt&&e.state<Et,e.state=zt,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function Pt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Xt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function qt(){}var Ot="\\s*([+-]?\\d+)\\s*",Yt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",jt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",It=/^#([0-9a-f]{3})$/,Dt=/^#([0-9a-f]{6})$/,Ut=new RegExp("^rgb\\("+[Ot,Ot,Ot]+"\\)$"),Vt=new RegExp("^rgb\\("+[jt,jt,jt]+"\\)$"),Rt=new RegExp("^rgba\\("+[Ot,Ot,Ot,Yt]+"\\)$"),Bt=new RegExp("^rgba\\("+[jt,jt,jt,Yt]+"\\)$"),Lt=new RegExp("^hsl\\("+[Yt,jt,jt]+"\\)$"),$t=new RegExp("^hsla\\("+[Yt,jt,jt,Yt]+"\\)$"),Gt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ht(t){var n;return t=(t+"").trim().toLowerCase(),(n=It.exec(t))?new Jt((n=parseInt(n[1],16))>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=Dt.exec(t))?Ft(parseInt(n[1],16)):(n=Ut.exec(t))?new Jt(n[1],n[2],n[3],1):(n=Vt.exec(t))?new Jt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Rt.exec(t))?Kt(n[1],n[2],n[3],n[4]):(n=Bt.exec(t))?Kt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Lt.exec(t))?tn(n[1],n[2]/100,n[3]/100,1):(n=$t.exec(t))?tn(n[1],n[2]/100,n[3]/100,n[4]):Gt.hasOwnProperty(t)?Ft(Gt[t]):"transparent"===t?new Jt(NaN,NaN,NaN,0):null}function Ft(t){return new Jt(t>>16&255,t>>8&255,255&t,1)}function Kt(t,n,e,r){return r<=0&&(t=n=e=NaN),new Jt(t,n,e,r)}function Qt(t){return t instanceof qt||(t=Ht(t)),t?new Jt((t=t.rgb()).r,t.g,t.b,t.opacity):new Jt}function Wt(t,n,e,r){return 1===arguments.length?Qt(t):new Jt(t,n,e,null==r?1:r)}function Jt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Zt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function tn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new nn(t,n,e,r)}function nn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function en(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Pt(qt,Ht,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),Pt(Jt,Wt,Xt(qt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Jt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Jt(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},hex:function(){return"#"+Zt(this.r)+Zt(this.g)+Zt(this.b)},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+")")}})),Pt(nn,function(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof nn)return new nn(t.h,t.s,t.l,t.opacity);if(t instanceof qt||(t=Ht(t)),!t)return new nn;if(t instanceof nn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new nn(u,a,s,t.opacity)}(t):new nn(t,n,e,null==r?1:r)},Xt(qt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new nn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new nn(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 Jt(en(t>=240?t-240:t+120,i,r),en(t,i,r),en(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 rn=Math.PI/180,on=180/Math.PI,un=.96422,an=1,sn=.82521,cn=4/29,ln=6/29,hn=3*ln*ln,fn=ln*ln*ln;function pn(t){if(t instanceof dn)return new dn(t.l,t.a,t.b,t.opacity);if(t instanceof _n){if(isNaN(t.h))return new dn(t.l,0,0,t.opacity);var n=t.h*rn;return new dn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof Jt||(t=Qt(t));var e,r,i=gn(t.r),o=gn(t.g),u=gn(t.b),a=mn((.2225045*i+.7168786*o+.0606169*u)/an);return i===o&&o===u?e=r=a:(e=mn((.4360747*i+.3850649*o+.1430804*u)/un),r=mn((.0139322*i+.0971045*o+.7141733*u)/sn)),new dn(116*a-16,500*(e-a),200*(a-r),t.opacity)}function dn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function mn(t){return t>fn?Math.pow(t,1/3):t/hn+cn}function vn(t){return t>ln?t*t*t:hn*(t-cn)}function yn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function gn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _n(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}Pt(dn,function(t,n,e,r){return 1===arguments.length?pn(t):new dn(t,n,e,null==r?1:r)},Xt(qt,{brighter:function(t){return new dn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new dn(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 new Jt(yn(3.1338561*(n=un*vn(n))-1.6168667*(t=an*vn(t))-.4906146*(e=sn*vn(e))),yn(-.9787684*n+1.9161415*t+.033454*e),yn(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),Pt(_n,function(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof _n)return new _n(t.h,t.c,t.l,t.opacity);if(t instanceof dn||(t=pn(t)),0===t.a&&0===t.b)return new _n(NaN,0,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*on;return new _n(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new _n(t,n,e,null==r?1:r)},Xt(qt,{brighter:function(t){return new _n(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new _n(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return pn(this).rgb()}}));var wn=-.14861,bn=1.78277,xn=-.29227,kn=-.90649,Mn=1.97294,En=Mn*kn,zn=Mn*bn,Nn=bn*xn-kn*wn;function An(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Sn(t){return function(){return t}}function Tn(t){return 1==(t=+t)?Cn: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):Sn(isNaN(n)?e:n)}}function Cn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Sn(isNaN(t)?n:t)}Pt(An,function(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof An)return new An(t.h,t.s,t.l,t.opacity);t instanceof Jt||(t=Qt(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Nn*r+En*n-zn*e)/(Nn+En-zn),o=r-i,u=(Mn*(e-i)-xn*o)/kn,a=Math.sqrt(u*u+o*o)/(Mn*i*(1-i)),s=a?Math.atan2(u,o)*on-120:NaN;return new An(s<0?s+360:s,a,i,t.opacity)}(t):new An(t,n,e,null==r?1:r)},Xt(qt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new An(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new An(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*rn,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new Jt(255*(n+e*(wn*r+bn*i)),255*(n+e*(xn*r+kn*i)),255*(n+e*(Mn*r)),this.opacity)}}));var Pn=function t(n){var e=Tn(n);function r(t,n){var r=e((t=Wt(t)).r,(n=Wt(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=Cn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}return r.gamma=t,r}(1);function Xn(t,n){return n-=t=+t,function(e){return t+n*e}}var qn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,On=new RegExp(qn.source,"g");var Yn,jn,In,Dn,Un=180/Math.PI,Vn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rn(t,n,e,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,s/=a),t*r<n*e&&(t=-t,n=-n,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Un,skewX:Math.atan(s)*Un,scaleX:u,scaleY:a}}function Bn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,u){var a=[],s=[];return o=t(o),u=t(u),function(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:Xn(t,i)},{i:s-2,x:Xn(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}(o.translateX,o.translateY,u.translateX,u.translateY,a,s),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Xn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Xn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,s),function(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:Xn(t,e)},{i:a-2,x:Xn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,s),o=u=null,function(t){for(var n,e=-1,r=s.length;++e<r;)a[(n=s[e]).i]=n.x(t);return a.join("")}}}var Ln=Bn(function(t){return"none"===t?Vn:(Yn||(Yn=document.createElement("DIV"),jn=document.documentElement,In=document.defaultView),Yn.style.transform=t,t=In.getComputedStyle(jn.appendChild(Yn),null).getPropertyValue("transform"),jn.removeChild(Yn),Rn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},"px, ","px)","deg)"),$n=Bn(function(t){return null==t?Vn:(Dn||(Dn=document.createElementNS("http://www.w3.org/2000/svg","g")),Dn.setAttribute("transform",t),(t=Dn.transform.baseVal.consolidate())?Rn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Vn)},", ",")",")"),Gn=Math.SQRT2,Hn=2,Fn=4,Kn=1e-12;function Qn(t){return((t=Math.exp(t))+1/t)/2}function Wn(t,n){var e,r,i=t[0],o=t[1],u=t[2],a=n[0],s=n[1],c=n[2],l=a-i,h=s-o,f=l*l+h*h;if(f<Kn)r=Math.log(c/u)/Gn,e=function(t){return[i+t*l,o+t*h,u*Math.exp(Gn*t*r)]};else{var p=Math.sqrt(f),d=(c*c-u*u+Fn*f)/(2*u*Hn*p),m=(c*c-u*u-Fn*f)/(2*c*Hn*p),v=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(m*m+1)-m);r=(y-v)/Gn,e=function(t){var n,e=t*r,a=Qn(v),s=u/(Hn*p)*(a*(n=Gn*e+v,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+s*l,o+s*h,u*a/Qn(Gn*e+v)]}}return e.duration=1e3*r,e}function Jn(t,n,e){var r=t._id;return t.each(function(){var t=St(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Tt(t,r).value[n]}}function Zn(t,n){var e;return("number"==typeof n?Xn:n instanceof Ht?Pn:(e=Ht(n))?(n=e,Pn):function(t,n){var e,r,i,o=qn.lastIndex=On.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=qn.exec(t))&&(r=On.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:Xn(e,r)})),o=On.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})})(t,n)}var te=R.prototype.constructor;function ne(t){return function(){this.style.removeProperty(t)}}var ee=0;function re(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ie(t){return R().transition(t)}function oe(){return++ee}var ue=R.prototype;re.prototype=ie.prototype={constructor:re,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=s(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,c,l=r[u],h=l.length,f=o[u]=new Array(h),p=0;p<h;++p)(a=l[p])&&(c=t.call(a,a.__data__,p,l))&&("__data__"in a&&(c.__data__=a.__data__),f[p]=c,Nt(f[p],n,e,p,f,Tt(a,e)));return new re(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=l(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,c=r[a],h=c.length,f=0;f<h;++f)if(s=c[f]){for(var p,d=t.call(s,s.__data__,f,c),m=Tt(s,e),v=0,y=d.length;v<y;++v)(p=d[v])&&Nt(p,n,e,v,d,m);o.push(d),u.push(s)}return new re(o,u,n,e)},filter:function(t){"function"!=typeof t&&(t=h(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],c=0;c<a;++c)(o=u[c])&&t.call(o,o.__data__,c,u)&&s.push(o);return new re(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,c=n[a],l=e[a],h=c.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=c[p]||l[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new re(u,this._parents,this._name,this._id)},selection:function(){return new te(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=oe(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,c=0;c<s;++c)if(u=a[c]){var l=Tt(u,n);Nt(u,t,e,c,a,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new re(r,this._parents,t,e)},call:ue.call,nodes:ue.nodes,node:ue.node,size:ue.size,empty:ue.empty,each:ue.each,on:function(t,n){var e=this._id;return arguments.length<2?Tt(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?At:St;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}(e,t,n))},attr:function(t,n){var e=o(t),r="transform"===e?$n:Zn;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttributeNS(t.space,t.local))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttribute(t))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttribute(t)}})(e,r,Jn(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,o=e+"";return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===r?i:i=n(r=u,e)}}:function(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttribute(t);return u===o?null:u===r?i:i=n(r=u,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=o(t);return this.tween(e,(r.local?function(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n(e))}}(t,i)),e}return i._value=n,i}:function(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n(e))}}(t,i)),e}return i._value=n,i})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Ln:Zn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=_(this,t),u=(this.style.removeProperty(t),_(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,ne(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=_(this,t),a=e(this),s=a+"";return null==a&&(this.style.removeProperty(t),s=a=_(this,t)),u===s?null:u===r&&s===i?o:(i=s,o=n(r=u,a))}}(t,r,Jn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=St(this,t),c=s.on,l=null==s.value[u]?o||(o=ne(n)):void 0;c===e&&i===l||(r=(e=c).copy()).on(a,i=l),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=_(this,t);return u===o?null:u===r?i:i=n(r=u,e)}}(t,r,n),e).on("end.style."+t,null)},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){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n(r),e)}}(t,o,e)),r}return o._value=n,o}(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}}(Jn(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=Tt(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?function(t,n){var e,r;return function(){var i=St(this,t),o=i.tween;if(o!==e)for(var u=0,a=(r=e=o).length;u<a;++u)if(r[u].name===n){(r=r.slice()).splice(u,1);break}i.tween=r}}:function(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=St(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,c=i.length;s<c;++s)if(i[s].name===n){i[s]=a;break}s===c&&i.push(a)}o.tween=i}})(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?function(t,n){return function(){At(this,t).delay=+n.apply(this,arguments)}}:function(t,n){return n=+n,function(){At(this,t).delay=n}})(n,t)):Tt(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?function(t,n){return function(){St(this,t).duration=+n.apply(this,arguments)}}:function(t,n){return n=+n,function(){St(this,t).duration=n}})(n,t)):Tt(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){St(this,t).ease=n}}(n,t)):Tt(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise(function(o,u){var a={value:u},s={value:function(){0==--i&&o()}};e.each(function(){var e=St(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(a),n._.interrupt.push(a),n._.end.push(s)),e.on=n})})}};Math.PI,Math.PI;var ae={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function se(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return ae.time=lt(),ae;return e}function ce(){q.preventDefault(),q.stopImmediatePropagation()}function le(t){return function(){return t}}function he(t,n,e){this.target=t,this.type=n,this.transform=e}function fe(t,n,e){this.k=t,this.x=n,this.y=e}R.prototype.interrupt=function(t){return this.each(function(){Ct(this,t)})},R.prototype.transition=function(t){var n,e;t instanceof re?(n=t._id,t=t._name):(n=oe(),(e=ae).time=lt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,c=0;c<s;++c)(u=a[c])&&Nt(u,t,n,c,a,e||se(u,n));return new re(r,this._parents,t,n)},fe.prototype={constructor:fe,scale:function(t){return 1===t?this:new fe(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new fe(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 pe=new fe(1,0,0);function de(){q.stopImmediatePropagation()}function me(){q.preventDefault(),q.stopImmediatePropagation()}function ve(){return!q.button}function ye(){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 ge(){return this.__zoom||pe}function _e(){return-q.deltaY*(q.deltaMode?120:1)/500}function we(){return"ontouchstart"in this}function be(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],u=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}function xe(){var t,n,e=ve,r=ye,i=be,o=_e,u=we,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,l=Wn,h=[],f=K("start","zoom","end"),p=500,d=150,m=0;function v(t){t.property("__zoom",ge).on("wheel.zoom",k).on("mousedown.zoom",M).on("dblclick.zoom",E).filter(u).on("touchstart.zoom",z).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new fe(n,t.x,t.y)}function g(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 fe(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,n,e){t.on("start.zoom",function(){b(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).end()}).tween("zoom",function(){var t=arguments,i=b(this,t),o=r.apply(this,t),u=e||_(o),a=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),s=this.__zoom,c="function"==typeof n?n.apply(this,t):n,h=l(s.invert(u).concat(a/s.k),c.invert(u).concat(a/c.k));return function(t){if(1===t)t=c;else{var n=h(t),e=a/n[2];t=new fe(e,u[0]-n[0]*e,u[1]-n[1]*e)}i.zoom(null,t)}})}function b(t,n){for(var e,r=0,i=h.length;r<i;++r)if((e=h[r]).that===t)return e;return new x(t,n)}function x(t,n){this.that=t,this.args=n,this.index=-1,this.active=0,this.extent=r.apply(t,n)}function k(){if(e.apply(this,arguments)){var t=b(this,arguments),n=this.__zoom,r=Math.max(a[0],Math.min(a[1],n.k*Math.pow(2,o.apply(this,arguments)))),u=G(this);if(t.wheel)t.mouse[0][0]===u[0]&&t.mouse[0][1]===u[1]||(t.mouse[1]=n.invert(t.mouse[0]=u)),clearTimeout(t.wheel);else{if(n.k===r)return;t.mouse=[u,n.invert(u)],Ct(this),t.start()}me(),t.wheel=setTimeout(function(){t.wheel=null,t.end()},d),t.zoom("mouse",i(g(y(n,r),t.mouse[0],t.mouse[1]),t.extent,s))}}function M(){if(!n&&e.apply(this,arguments)){var t=b(this,arguments),r=B(q.view).on("mousemove.zoom",function(){if(me(),!t.moved){var n=q.clientX-u,e=q.clientY-a;t.moved=n*n+e*e>m}t.zoom("mouse",i(g(t.that.__zoom,t.mouse[0]=G(t.that),t.mouse[1]),t.extent,s))},!0).on("mouseup.zoom",function(){r.on("mousemove.zoom mouseup.zoom",null),function(t,n){var e=t.document.documentElement,r=B(t).on("dragstart.drag",null);n&&(r.on("click.drag",ce,!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)}(q.view,t.moved),me(),t.end()},!0),o=G(this),u=q.clientX,a=q.clientY;!function(t){var n=t.document.documentElement,e=B(t).on("dragstart.drag",ce,!0);"onselectstart"in n?e.on("selectstart.drag",ce,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(q.view),de(),t.mouse=[o,this.__zoom.invert(o)],Ct(this),t.start()}}function E(){if(e.apply(this,arguments)){var t=this.__zoom,n=G(this),o=t.invert(n),u=t.k*(q.shiftKey?.5:2),a=i(g(y(t,u),n,o),r.apply(this,arguments),s);me(),c>0?B(this).transition().duration(c).call(w,a,n):B(this).call(v.transform,a)}}function z(){if(e.apply(this,arguments)){var n,r,i,o,u=b(this,arguments),a=q.changedTouches,s=a.length;for(de(),r=0;r<s;++r)o=[o=H(this,a,(i=a[r]).identifier),this.__zoom.invert(o),i.identifier],u.touch0?u.touch1||(u.touch1=o):(u.touch0=o,n=!0);if(t&&(t=clearTimeout(t),!u.touch1))return u.end(),void((o=B(this).on("dblclick.zoom"))&&o.apply(this,arguments));n&&(t=setTimeout(function(){t=null},p),Ct(this),u.start())}}function N(){var n,e,r,o,u=b(this,arguments),a=q.changedTouches,c=a.length;for(me(),t&&(t=clearTimeout(t)),n=0;n<c;++n)r=H(this,a,(e=a[n]).identifier),u.touch0&&u.touch0[2]===e.identifier?u.touch0[0]=r:u.touch1&&u.touch1[2]===e.identifier&&(u.touch1[0]=r);if(e=u.that.__zoom,u.touch1){var l=u.touch0[0],h=u.touch0[1],f=u.touch1[0],p=u.touch1[1],d=(d=f[0]-l[0])*d+(d=f[1]-l[1])*d,m=(m=p[0]-h[0])*m+(m=p[1]-h[1])*m;e=y(e,Math.sqrt(d/m)),r=[(l[0]+f[0])/2,(l[1]+f[1])/2],o=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!u.touch0)return;r=u.touch0[0],o=u.touch0[1]}u.zoom("touch",i(g(e,r,o),u.extent,s))}function A(){var t,e,r=b(this,arguments),i=q.changedTouches,o=i.length;for(de(),n&&clearTimeout(n),n=setTimeout(function(){n=null},p),t=0;t<o;++t)e=i[t],r.touch0&&r.touch0[2]===e.identifier?delete r.touch0:r.touch1&&r.touch1[2]===e.identifier&&delete r.touch1;r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0?r.touch0[1]=this.__zoom.invert(r.touch0[0]):r.end()}return v.transform=function(t,n){var e=t.selection?t.selection():t;e.property("__zoom",ge),t!==e?w(t,n):e.interrupt().each(function(){b(this,arguments).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()})},v.scaleBy=function(t,n){v.scaleTo(t,function(){return this.__zoom.k*("function"==typeof n?n.apply(this,arguments):n)})},v.scaleTo=function(t,n){v.transform(t,function(){var t=r.apply(this,arguments),e=this.__zoom,o=_(t),u=e.invert(o),a="function"==typeof n?n.apply(this,arguments):n;return i(g(y(e,a),o,u),t,s)})},v.translateBy=function(t,n,e){v.transform(t,function(){return i(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),r.apply(this,arguments),s)})},v.translateTo=function(t,n,e){v.transform(t,function(){var t=r.apply(this,arguments),o=this.__zoom,u=_(t);return i(pe.translate(u[0],u[1]).scale(o.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof e?-e.apply(this,arguments):-e),t,s)})},x.prototype={start:function(){return 1==++this.active&&(this.index=h.push(this)-1,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(h.splice(this.index,1),this.index=-1,this.emit("end")),this},emit:function(t){!function(t,n,e,r){var i=q;t.sourceEvent=q,q=t;try{n.apply(e,r)}finally{q=i}}(new he(v,t,this.that.__zoom),f.apply,f,[t,this.that,this.args])}},v.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:le(+t),v):o},v.filter=function(t){return arguments.length?(e="function"==typeof t?t:le(!!t),v):e},v.touchable=function(t){return arguments.length?(u="function"==typeof t?t:le(!!t),v):u},v.extent=function(t){return arguments.length?(r="function"==typeof t?t:le([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),v):r},v.scaleExtent=function(t){return arguments.length?(a[0]=+t[0],a[1]=+t[1],v):[a[0],a[1]]},v.translateExtent=function(t){return arguments.length?(s[0][0]=+t[0][0],s[1][0]=+t[1][0],s[0][1]=+t[0][1],s[1][1]=+t[1][1],v):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},v.constrain=function(t){return arguments.length?(i=t,v):i},v.duration=function(t){return arguments.length?(c=+t,v):c},v.interpolate=function(t){return arguments.length?(l=t,v):l},v.on=function(){var t=f.on.apply(f,arguments);return t===f?v:t},v.clickDistance=function(t){return arguments.length?(m=(t=+t)*t,v):Math.sqrt(m)},v}function ke(t,n,e){var r,i,o,u,a;function s(){var c=Date.now()-u;c<n&&c>=0?r=setTimeout(s,n-c):(r=null,e||(a=t.apply(o,i),o=i=null))}null==n&&(n=100);var c=function(){o=this,i=arguments,u=Date.now();var c=e&&!r;return r||(r=setTimeout(s,n)),c&&(a=t.apply(o,i),o=i=null),a};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(a=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},c}ke.debounce=ke;var Me=ke;function Ee(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(e.push(u.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var ze,Ne,Ae,Se,Te,Ce,Pe,Xe,qe,Oe,Ye,je,Ie,De,Ue=function t(n,e){var r=e.default,i=void 0===r?null:r,o=e.triggerUpdate,u=void 0===o||o,a=e.onChange,s=void 0===a?function(t,n){}:a;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=n,this.defaultVal=i,this.triggerUpdate=u,this.onChange=s};return Ne=(ze={props:{htmlEl:{onChange:function(n,e){e.htmlEls=(n?n instanceof Array?n:[n]:[]).map(function(n){return"object"===t(n)&&n.node&&"function"==typeof n.node?n:B(n)})},triggerUpdate:!1},svgEl:{onChange:function(n,e){e.svgEls=(n?n instanceof Array?n:[n]:[]).map(function(n){return"object"===t(n)&&n.node&&"function"==typeof n.node?n:B(n)})},triggerUpdate:!1},canvasEl:{onChange:function(n,e){e.canvasCtxs=(n?n instanceof Array?n:[n]:[]).map(function(n){return"object"===t(n)&&n.node&&"function"==typeof n.node?n.node().getContext("2d"):n.getContext("2d")})},triggerUpdate:!1},enableX:{default:!0,triggerUpdate:!1},enableY:{default:!0,triggerUpdate:!1},scaleExtent:{default:[1,1/0],onChange:function(t,n){t&&n.zoom.scaleExtent(t)},triggerUpdate:!1},translateExtent:{onChange:function(t,n){t&&n.zoom.translateExtent(t)},triggerUpdate:!1},onChange:{triggerUpdate:!1}},methods:{current:function(t){return e({},t.zoomTransform)},zoomBy:function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t.initialised&&(t.transitionDuration=e,t.el.call(t.zoom.scaleBy,n)),this},zoomReset:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.initialised&&(t.transitionDuration=n,t.el.call(t.zoom.transform,pe)),this},zoomTo:function(t,n){var e=n.x,r=void 0===e?0:e,i=n.y,o=void 0===i?0:i,u=n.k,a=void 0===u?1:u,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t.initialised&&(t.transitionDuration=s,t.el.call(t.zoom.transform,pe.scale(a).translate(r,o))),this}},stateInit:function(){return{zoom:xe().filter(function(){return!q.button&&!q.dblclick}),zoomTransform:{x:0,y:0,k:1}}},init:function(n,r){var i=!!n&&"object"===t(n)&&!!n.node&&"function"==typeof n.node;r.el=B(i?n.node():n),r.el.call(r.zoom.on("zoom",function(){var t=e({},q.transform);!r.enableX&&(t.x=0),!r.enableY&&(t.y=0);var n=r.zoomTransform;r.zoomTransform=t;var i=r.transitionDuration||0;r.transitionDuration=0;var o=r.enableX?t.k:1,u=r.enableY?t.k:1;r.htmlEls.forEach(function(n){(i?n.transition().duration(i):n).style("transform","translate(".concat(t.x,"px, ").concat(t.y,"px) scale(").concat(o,", ").concat(u,")"))}),r.svgEls.forEach(function(n){(i?n.transition().duration(i):n).attr("transform","translate(".concat(t.x,", ").concat(t.y,") scale(").concat(o,", ").concat(u,")"))}),r.canvasCtxs.forEach(function(a,s){var c=function(t){var n=t.x,e=t.y,r=t.scX,i=t.scY;a.setTransform(r,0,0,i,n,e)};i?ie().duration(i).tween("animate-ctx-".concat(s),function(){var e=Xn(n.x,t.x),i=Xn(n.y,t.y),o=r.enableX?Xn(n.k,t.k):function(){return 1},u=r.enableY?Xn(n.k,t.k):function(){return 1};return function(t){return c({x:e(t),y:i(t),scX:o(t),scY:u(t)})}}):c(e({scX:o,scY:u},t))}),r.onChange&&r.onChange(t,n,i)})),r.el.on("dblclick.zoom",null)}}).stateInit,Ae=void 0===Ne?function(){return{}}:Ne,Se=ze.props,Te=void 0===Se?{}:Se,Ce=ze.methods,Pe=void 0===Ce?{}:Ce,Xe=ze.aliases,qe=void 0===Xe?{}:Xe,Oe=ze.init,Ye=void 0===Oe?function(){}:Oe,je=ze.update,Ie=void 0===je?function(){}:je,De=Object.keys(Te).map(function(t){return new Ue(t,Te[t])}),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},Ae instanceof Function?Ae(t):Ae,{initialised:!1});function e(n){return r(n,t),i(),e}var r=function(t,r){Ye.call(e,t,n,r),n.initialised=!0},i=Me(function(){n.initialised&&Ie.call(e,n)},1);return De.forEach(function(t){e[t.name]=function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t,n){};return function(u){var a=n[t];return arguments.length?(n[t]=u,o.call(e,u,n,a),r&&i(),e):a}}(t.name,t.triggerUpdate,t.onChange)}),Object.keys(Pe).forEach(function(t){e[t]=function(){for(var r,i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];return(r=Pe[t]).call.apply(r,[e,n].concat(o))}}),Object.entries(qe).forEach(function(t){var n=Ee(t,2),r=n[0],i=n[1];return e[r]=e[i]}),e.resetProps=function(){return De.forEach(function(t){e[t.name](t.defaultVal)}),e},e.resetProps(),n._rerender=i,e}});