From f8141b28ac8ae908e72cee9d8e787c85d83b29ae Mon Sep 17 00:00:00 2001 From: PierreCapo Date: Tue, 9 Apr 2019 13:37:57 +0200 Subject: [PATCH] Fix d3 zoom --- dist/index.js | 2 +- package.json | 2 +- src/initializeSVG.ts | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 14654b9..58f5256 100644 --- a/dist/index.js +++ b/dist/index.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.Treeviz=n():t.Treeviz=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,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},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=4)}([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 u=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 a(){}var c=function(t){return null==t?a:function(){return this.querySelector(t)}};function s(){return[]}var l=function(t){return null==t?s:function(){return this.querySelectorAll(t)}},h=function(t){return function(){return this.matches(t)}},f=function(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 v(t,n,e,r,i,o){for(var u,a=0,c=n.length,s=o.length;an?1:t>=n?0:NaN}var g=function(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 x(t){return t.classList||new b(t)}function b(t){this._node=t,this._names=w(t.getAttribute("class")||"")}function M(t,n){for(var e=x(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 z(){this.textContent=""}function A(){this.innerHTML=""}function N(){this.nextSibling&&this.parentNode.appendChild(this)}function E(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function S(){return null}function O(){var t=this.parentNode;t&&t.removeChild(this)}function j(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function P(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var T={},L=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(T={mouseenter:"mouseover",mouseleave:"mouseout"}));function q(t,n,e){return t=B(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function B(t,n,e){return function(r){var i=L;L=r;try{t.call(this,this.__data__,n,e)}finally{L=i}}}function D(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=M&&(M=b+1);!(x=_[M])&&++M=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=m);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)):_(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=x(this.node()),i=-1,o=e.length;++i=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:D,null==e&&(e=!1),r=0;r=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}})),c=-1,s=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++c0)for(var e,r,i=new Array(e),o=0;o>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=x.exec(t))?O(parseInt(n[1],16)):(n=b.exec(t))?new L(n[1],n[2],n[3],1):(n=M.exec(t))?new L(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=k.exec(t))?j(n[1],n[2],n[3],n[4]):(n=z.exec(t))?j(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=A.exec(t))?B(n[1],n[2]/100,n[3]/100,1):(n=N.exec(t))?B(n[1],n[2]/100,n[3]/100,n[4]):E.hasOwnProperty(t)?O(E[t]):"transparent"===t?new L(NaN,NaN,NaN,0):null}function O(t){return new L(t>>16&255,t>>8&255,255&t,1)}function j(t,n,e,r){return r<=0&&(t=n=e=NaN),new L(t,n,e,r)}function P(t){return t instanceof y||(t=S(t)),t?new L((t=t.rgb()).r,t.g,t.b,t.opacity):new L}function T(t,n,e,r){return 1===arguments.length?P(t):new L(t,n,e,null==r?1:r)}function L(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function q(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function B(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new I(t,n,e,r)}function D(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof I)return new I(t.h,t.s,t.l,t.opacity);if(t instanceof y||(t=S(t)),!t)return new I;if(t instanceof I)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,c=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e0&&c<1?0:u,new I(u,a,c,t.opacity)}(t):new I(t,n,e,null==r?1:r)}function I(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function C(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}d(y,S,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),d(L,T,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new L(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new L(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"#"+q(this.r)+q(this.g)+q(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+")")}})),d(I,D,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new I(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new I(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 L(C(t>=240?t-240:t+120,i,r),C(t,i,r),C(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 X=Math.PI/180,Y=180/Math.PI,H=.96422,R=1,V=.82521,W=4/29,U=6/29,$=3*U*U,F=U*U*U;function G(t){if(t instanceof Q)return new Q(t.l,t.a,t.b,t.opacity);if(t instanceof it){if(isNaN(t.h))return new Q(t.l,0,0,t.opacity);var n=t.h*X;return new Q(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof L||(t=P(t));var e,r,i=nt(t.r),o=nt(t.g),u=nt(t.b),a=J((.2225045*i+.7168786*o+.0606169*u)/R);return i===o&&o===u?e=r=a:(e=J((.4360747*i+.3850649*o+.1430804*u)/H),r=J((.0139322*i+.0971045*o+.7141733*u)/V)),new Q(116*a-16,500*(e-a),200*(a-r),t.opacity)}function K(t,n,e,r){return 1===arguments.length?G(t):new Q(t,n,e,null==r?1:r)}function Q(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function J(t){return t>F?Math.pow(t,1/3):t/$+W}function Z(t){return t>U?t*t*t:$*(t-W)}function tt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function nt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function et(t){if(t instanceof it)return new it(t.h,t.c,t.l,t.opacity);if(t instanceof Q||(t=G(t)),0===t.a&&0===t.b)return new it(NaN,0,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*Y;return new it(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function rt(t,n,e,r){return 1===arguments.length?et(t):new it(t,n,e,null==r?1:r)}function it(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}d(Q,K,v(y,{brighter:function(t){return new Q(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Q(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 L(tt(3.1338561*(n=H*Z(n))-1.6168667*(t=R*Z(t))-.4906146*(e=V*Z(e))),tt(-.9787684*n+1.9161415*t+.033454*e),tt(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),d(it,rt,v(y,{brighter:function(t){return new it(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new it(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return G(this).rgb()}}));var ot=-.14861,ut=1.78277,at=-.29227,ct=-.90649,st=1.97294,lt=st*ct,ht=st*ut,ft=ut*at-ct*ot;function pt(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof dt)return new dt(t.h,t.s,t.l,t.opacity);t instanceof L||(t=P(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(ft*r+lt*n-ht*e)/(ft+lt-ht),o=r-i,u=(st*(e-i)-at*o)/ct,a=Math.sqrt(u*u+o*o)/(st*i*(1-i)),c=a?Math.atan2(u,o)*Y-120:NaN;return new dt(c<0?c+360:c,a,i,t.opacity)}(t):new dt(t,n,e,null==r?1:r)}function dt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function vt(t,n,e,r,i){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*e+(1+3*t+3*o-3*u)*r+u*i)/6}d(dt,pt,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*X,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new L(255*(n+e*(ot*r+ut*i)),255*(n+e*(at*r+ct*i)),255*(n+e*(st*r)),this.opacity)}}));var yt=function(t){return function(){return t}};function mt(t,n){return function(e){return t+e*n}}function gt(t,n){var e=n-t;return e?mt(t,e>180||e<-180?e-360*Math.round(e/360):e):yt(isNaN(t)?n:t)}function _t(t){return 1==(t=+t)?wt: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):yt(isNaN(n)?e:n)}}function wt(t,n){var e=n-t;return e?mt(t,e):yt(isNaN(t)?n:t)}var xt=function t(n){var e=_t(n);function r(t,n){var r=e((t=T(t)).r,(n=T(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=wt(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 bt(t){return function(n){var e,r,i=n.length,o=new Array(i),u=new Array(i),a=new Array(i);for(e=0;e=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],u=r>0?t[r-1]:2*i-o,a=ro&&(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,c.push({i:u,x:Mt(e,r)})),o=zt.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Mt(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Mt(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,c),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:Mt(t,e)},{i:a-2,x:Mt(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,c),o=u=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Wt}()}finally{Wt=0,function(){var t,n,e=Rt,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:Rt=n);Vt=t,an(r)}(),Kt=0}}function un(){var t=Jt.now(),n=t-Gt;n>Ft&&(Qt-=n,Gt=t)}function an(t){Wt||(Ut&&(Ut=clearTimeout(Ut)),t-Kt>24?(t<1/0&&(Ut=setTimeout(on,t-Jt.now()-Qt)),$t&&($t=clearInterval($t))):($t||(Gt=Jt.now(),$t=setInterval(un,Ft)),Wt=1,Zt(on)))}en.prototype=rn.prototype={constructor:en,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?tn():+e)+(null==n?0:+n),this._next||Vt===this||(Vt?Vt._next=this:Rt=this,Vt=this),this._call=t,this._time=e,an()},stop:function(){this._call&&(this._call=null,this._time=1/0,an())}};var cn=function(t,n,e){var r=new en;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r},sn=c("start","end","cancel","interrupt"),ln=[],hn=0,fn=1,pn=2,dn=3,vn=4,yn=5,mn=6,gn=function(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(c){var s,l,h,f;if(e.state!==fn)return a();for(s in i)if((f=i[s]).name===e.name){if(f.state===dn)return cn(o);f.state===vn?(f.state=mn,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[s]):+shn)throw new Error("too late; already scheduled");return e}function wn(t,n){var e=xn(t,n);if(e.state>dn)throw new Error("too late; already running");return e}function xn(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var bn=function(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>pn&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?_n:wn;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=Object(s.namespace)(t),r="transform"===e?Bt:kn;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttributeNS(t.space,t.local))===(a=c+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,c));this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttribute(t))===(a=c+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,c));this.removeAttribute(t)}})(e,r,Mn(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=Object(s.namespace)(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+="")?qt:kn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=Object(s.style)(this,t),u=(this.style.removeProperty(t),Object(s.style)(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,An(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=Object(s.style)(this,t),a=e(this),c=a+"";return null==a&&(this.style.removeProperty(t),c=a=Object(s.style)(this,t)),u===c?null:u===r&&c===i?o:(i=c,o=n(r=u,a))}}(t,r,Mn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var c=wn(this,t),s=c.on,l=null==c.value[u]?o||(o=An(n)):void 0;s===e&&i===l||(r=(e=s).copy()).on(a,i=l),c.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=Object(s.style)(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}}(Mn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=xn(this.node(),e).tween,o=0,u=i.length;or?(r+i)/2:Math.min(0,r)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}var $n=function(){var t,n,e=Yn,r=Hn,i=Un,o=Vn,u=Wn,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],p=250,d=Ct,v=[],y=c("start","zoom","end"),m=500,g=150,_=0;function w(t){t.property("__zoom",Rn).on("wheel.zoom",N).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(u).on("touchstart.zoom",O).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new Bn(n,t.x,t.y)}function b(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 Bn(t.k,r,i)}function M(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function k(t,n,e){t.on("start.zoom",function(){z(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).end()}).tween("zoom",function(){var t=arguments,i=z(this,t),o=r.apply(this,t),u=e||M(o),a=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=this.__zoom,s="function"==typeof n?n.apply(this,t):n,l=d(c.invert(u).concat(a/c.k),s.invert(u).concat(a/s.k));return function(t){if(1===t)t=s;else{var n=l(t),e=a/n[2];t=new Bn(e,u[0]-n[0]*e,u[1]-n[1]*e)}i.zoom(null,t)}})}function z(t,n){for(var e,r=0,i=v.length;r_}t.zoom("mouse",i(b(t.that.__zoom,t.mouse[0]=Object(s.mouse)(t.that),t.mouse[1]),t.extent,l))},!0).on("mouseup.zoom",function(){r.on("mousemove.zoom mouseup.zoom",null),f(s.event.view,t.moved),Xn(),t.end()},!0),o=Object(s.mouse)(this),u=s.event.clientX,a=s.event.clientY;h(s.event.view),Cn(),t.mouse=[o,this.__zoom.invert(o)],bn(this),t.start()}}function S(){if(e.apply(this,arguments)){var t=this.__zoom,n=Object(s.mouse)(this),o=t.invert(n),u=t.k*(s.event.shiftKey?.5:2),a=i(b(x(t,u),n,o),r.apply(this,arguments),l);Xn(),p>0?Object(s.select)(this).transition().duration(p).call(k,a,n):Object(s.select)(this).call(w.transform,a)}}function O(){if(e.apply(this,arguments)){var n,r,i,o,u=z(this,arguments),a=s.event.changedTouches,c=a.length;for(Cn(),r=0;r=0;)n+=e[r].value;else n=1;t.value=n}function c(t,n){var e,r,i,o,u,a=new f(t),c=+t.value&&(a.value=t.value),l=[a];for(null==n&&(n=s);e=l.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(u=i.length))for(e.children=new Array(u),o=u-1;o>=0;--o)l.push(r=e.children[o]=new f(i[o])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(h)}function s(t){return t.children}function l(t){t.data=t.data.data}function h(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function f(t){this.data=t,this.depth=this.height=0,this.parent=null}f.prototype=c.prototype={constructor:f,count:function(){return this.eachAfter(a)},each:function(t){var n,e,r,i,o=this,u=[o];do{for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})},sort:function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each(function(n){t.push(n)}),t},leaves:function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},links:function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n},copy:function(){return c(this).eachBefore(l)}};var p=Array.prototype.slice;var d=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(p.call(t))).length,o=[];r0&&e*e>r*r+i*i}function g(t,n){for(var e=0;e(u*=u)?(r=(s+u-i)/(2*s),o=Math.sqrt(Math.max(0,u/s-r*r)),e.x=t.x-r*a-o*c,e.y=t.y-r*c+o*a):(r=(s+i-u)/(2*s),o=Math.sqrt(Math.max(0,i/s-r*r)),e.x=n.x+r*a-o*c,e.y=n.y+r*c+o*a)):(e.x=n.x+e.r,e.y=n.y)}function M(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function k(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function z(t){this._=t,this.next=null,this.previous=null}function A(t){if(!(i=t.length))return 0;var n,e,r,i,o,u,a,c,s,l,h;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;b(e,n,r=t[2]),n=new z(n),e=new z(e),r=new z(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=E(n),e):t},e.parentId=function(t){return arguments.length?(n=E(t),e):n},e};function W(t,n){return t.parent===n.parent?1:2}function U(t){var n=t.children;return n?n[0]:t.t}function $(t){var n=t.children;return n?n[n.length-1]:t.t}function F(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function G(t,n,e){return t.a.parent===n.parent?t.a:e}function K(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}K.prototype=Object.create(f.prototype);var Q=function(){var t=W,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,u=new K(t,0),a=[u];n=a.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)a.push(e=n.children[i]=new K(r[i],i)),e.parent=n;return(u.parent=new K(null,0)).children=[u],u}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(u),r)i.eachBefore(a);else{var s=i,l=i,h=i;i.eachBefore(function(t){t.xl.x&&(l=t),t.depth>h.depth&&(h=t)});var f=s===l?1:t(s,l)/2,p=f-s.x,d=n/(l.x+f+p),v=e/(h.depth||1);i.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*v})}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,u=n,a=e,c=o.parent.children[0],s=o.m,l=u.m,h=a.m,f=c.m;a=$(a),o=U(o),a&&o;)c=U(c),(u=$(u)).a=n,(i=a.z+h-o.z-s+t(a._,o._))>0&&(F(G(a,n,r),n,i),s+=i,l+=i),h+=a.m,s+=o.m,f+=c.m,l+=u.m;a&&!$(u)&&(u.t=a,u.m+=h-l),o&&!U(c)&&(c.t=o,c.m+=s-f,r=n)}return r}(n,i,n.parent.A||r[0])}function u(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},J=function(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,s=t.value&&(i-e)/t.value;++af&&(f=a),y=l*l*v,(p=Math.max(f/y,y/h))>d){l-=a;break}d=p}m.push(u={value:l,dice:c1?n:1)},e}(Z),et=function(){var t=nt,n=!1,e=1,r=1,i=[0],o=S,u=S,a=S,c=S,s=S;function l(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(h),i=[0],n&&t.eachBefore(B),t}function h(n){var e=i[n.depth],r=n.x0+e,l=n.y0+e,h=n.x1-e,f=n.y1-e;h=e-1){var l=a[n];return l.x0=i,l.y0=o,l.x1=u,void(l.y1=c)}var h=s[n],f=r/2+h,p=n+1,d=e-1;for(;p>>1;s[v]c-o){var g=(i*m+u*y)/r;t(n,p,y,i,o,g,c),t(p,e,m,g,o,u,c)}else{var _=(o*m+c*y)/r;t(n,p,y,i,o,u,_),t(p,e,m,i,_,u,c)}}(0,c,t.value,n,e,r,i)},it=function(t,n,e,r,i){(1&t.depth?J:D)(t,n,e,r,i)},ot=function t(n){function e(t,e,r,i,o){if((u=t._squarify)&&u.ratio===n)for(var u,a,c,s,l,h=-1,f=u.length,p=t.value;++h1?n:1)},e}(Z);e.d(n,"cluster",function(){return u}),e.d(n,"hierarchy",function(){return c}),e.d(n,"pack",function(){return P}),e.d(n,"packSiblings",function(){return N}),e.d(n,"packEnclose",function(){return d}),e.d(n,"partition",function(){return I}),e.d(n,"stratify",function(){return V}),e.d(n,"tree",function(){return Q}),e.d(n,"treemap",function(){return et}),e.d(n,"treemapBinary",function(){return rt}),e.d(n,"treemapDice",function(){return D}),e.d(n,"treemapSlice",function(){return J}),e.d(n,"treemapSliceDice",function(){return it}),e.d(n,"treemapSquarify",function(){return nt}),e.d(n,"treemapResquarify",function(){return ot})}])}); \ No newline at end of file +!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Treeviz=n():t.Treeviz=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,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},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=4)}([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 u=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 a(){}var c=function(t){return null==t?a:function(){return this.querySelector(t)}};function s(){return[]}var l=function(t){return null==t?s:function(){return this.querySelectorAll(t)}},h=function(t){return function(){return this.matches(t)}},f=function(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 v(t,n,e,r,i,o){for(var u,a=0,c=n.length,s=o.length;an?1:t>=n?0:NaN}var g=function(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 x(t){return t.classList||new b(t)}function b(t){this._node=t,this._names=w(t.getAttribute("class")||"")}function M(t,n){for(var e=x(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 z(){this.textContent=""}function A(){this.innerHTML=""}function N(){this.nextSibling&&this.parentNode.appendChild(this)}function E(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function S(){return null}function O(){var t=this.parentNode;t&&t.removeChild(this)}function j(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function P(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var T={},L=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(T={mouseenter:"mouseover",mouseleave:"mouseout"}));function q(t,n,e){return t=B(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function B(t,n,e){return function(r){var i=L;L=r;try{t.call(this,this.__data__,n,e)}finally{L=i}}}function D(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=M&&(M=b+1);!(x=_[M])&&++M=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=m);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)):_(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=x(this.node()),i=-1,o=e.length;++i=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:D,null==e&&(e=!1),r=0;r=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}})),c=-1,s=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++c0)for(var e,r,i=new Array(e),o=0;o>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=x.exec(t))?O(parseInt(n[1],16)):(n=b.exec(t))?new L(n[1],n[2],n[3],1):(n=M.exec(t))?new L(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=k.exec(t))?j(n[1],n[2],n[3],n[4]):(n=z.exec(t))?j(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=A.exec(t))?B(n[1],n[2]/100,n[3]/100,1):(n=N.exec(t))?B(n[1],n[2]/100,n[3]/100,n[4]):E.hasOwnProperty(t)?O(E[t]):"transparent"===t?new L(NaN,NaN,NaN,0):null}function O(t){return new L(t>>16&255,t>>8&255,255&t,1)}function j(t,n,e,r){return r<=0&&(t=n=e=NaN),new L(t,n,e,r)}function P(t){return t instanceof y||(t=S(t)),t?new L((t=t.rgb()).r,t.g,t.b,t.opacity):new L}function T(t,n,e,r){return 1===arguments.length?P(t):new L(t,n,e,null==r?1:r)}function L(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function q(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function B(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new I(t,n,e,r)}function D(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof I)return new I(t.h,t.s,t.l,t.opacity);if(t instanceof y||(t=S(t)),!t)return new I;if(t instanceof I)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,c=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e0&&c<1?0:u,new I(u,a,c,t.opacity)}(t):new I(t,n,e,null==r?1:r)}function I(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function C(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}d(y,S,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),d(L,T,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new L(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new L(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"#"+q(this.r)+q(this.g)+q(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+")")}})),d(I,D,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new I(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new I(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 L(C(t>=240?t-240:t+120,i,r),C(t,i,r),C(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 X=Math.PI/180,Y=180/Math.PI,H=.96422,R=1,V=.82521,W=4/29,U=6/29,$=3*U*U,F=U*U*U;function G(t){if(t instanceof Q)return new Q(t.l,t.a,t.b,t.opacity);if(t instanceof it){if(isNaN(t.h))return new Q(t.l,0,0,t.opacity);var n=t.h*X;return new Q(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof L||(t=P(t));var e,r,i=nt(t.r),o=nt(t.g),u=nt(t.b),a=J((.2225045*i+.7168786*o+.0606169*u)/R);return i===o&&o===u?e=r=a:(e=J((.4360747*i+.3850649*o+.1430804*u)/H),r=J((.0139322*i+.0971045*o+.7141733*u)/V)),new Q(116*a-16,500*(e-a),200*(a-r),t.opacity)}function K(t,n,e,r){return 1===arguments.length?G(t):new Q(t,n,e,null==r?1:r)}function Q(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function J(t){return t>F?Math.pow(t,1/3):t/$+W}function Z(t){return t>U?t*t*t:$*(t-W)}function tt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function nt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function et(t){if(t instanceof it)return new it(t.h,t.c,t.l,t.opacity);if(t instanceof Q||(t=G(t)),0===t.a&&0===t.b)return new it(NaN,0,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*Y;return new it(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function rt(t,n,e,r){return 1===arguments.length?et(t):new it(t,n,e,null==r?1:r)}function it(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}d(Q,K,v(y,{brighter:function(t){return new Q(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Q(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 L(tt(3.1338561*(n=H*Z(n))-1.6168667*(t=R*Z(t))-.4906146*(e=V*Z(e))),tt(-.9787684*n+1.9161415*t+.033454*e),tt(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),d(it,rt,v(y,{brighter:function(t){return new it(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new it(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return G(this).rgb()}}));var ot=-.14861,ut=1.78277,at=-.29227,ct=-.90649,st=1.97294,lt=st*ct,ht=st*ut,ft=ut*at-ct*ot;function pt(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof dt)return new dt(t.h,t.s,t.l,t.opacity);t instanceof L||(t=P(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(ft*r+lt*n-ht*e)/(ft+lt-ht),o=r-i,u=(st*(e-i)-at*o)/ct,a=Math.sqrt(u*u+o*o)/(st*i*(1-i)),c=a?Math.atan2(u,o)*Y-120:NaN;return new dt(c<0?c+360:c,a,i,t.opacity)}(t):new dt(t,n,e,null==r?1:r)}function dt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function vt(t,n,e,r,i){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*e+(1+3*t+3*o-3*u)*r+u*i)/6}d(dt,pt,v(y,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new dt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*X,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new L(255*(n+e*(ot*r+ut*i)),255*(n+e*(at*r+ct*i)),255*(n+e*(st*r)),this.opacity)}}));var yt=function(t){return function(){return t}};function mt(t,n){return function(e){return t+e*n}}function gt(t,n){var e=n-t;return e?mt(t,e>180||e<-180?e-360*Math.round(e/360):e):yt(isNaN(t)?n:t)}function _t(t){return 1==(t=+t)?wt: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):yt(isNaN(n)?e:n)}}function wt(t,n){var e=n-t;return e?mt(t,e):yt(isNaN(t)?n:t)}var xt=function t(n){var e=_t(n);function r(t,n){var r=e((t=T(t)).r,(n=T(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=wt(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 bt(t){return function(n){var e,r,i=n.length,o=new Array(i),u=new Array(i),a=new Array(i);for(e=0;e=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],u=r>0?t[r-1]:2*i-o,a=ro&&(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,c.push({i:u,x:Mt(e,r)})),o=zt.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Mt(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Mt(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,c),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:Mt(t,e)},{i:a-2,x:Mt(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,c),o=u=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Wt}()}finally{Wt=0,function(){var t,n,e=Rt,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:Rt=n);Vt=t,an(r)}(),Kt=0}}function un(){var t=Jt.now(),n=t-Gt;n>Ft&&(Qt-=n,Gt=t)}function an(t){Wt||(Ut&&(Ut=clearTimeout(Ut)),t-Kt>24?(t<1/0&&(Ut=setTimeout(on,t-Jt.now()-Qt)),$t&&($t=clearInterval($t))):($t||(Gt=Jt.now(),$t=setInterval(un,Ft)),Wt=1,Zt(on)))}en.prototype=rn.prototype={constructor:en,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?tn():+e)+(null==n?0:+n),this._next||Vt===this||(Vt?Vt._next=this:Rt=this,Vt=this),this._call=t,this._time=e,an()},stop:function(){this._call&&(this._call=null,this._time=1/0,an())}};var cn=function(t,n,e){var r=new en;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r},sn=c("start","end","cancel","interrupt"),ln=[],hn=0,fn=1,pn=2,dn=3,vn=4,yn=5,mn=6,gn=function(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(c){var s,l,h,f;if(e.state!==fn)return a();for(s in i)if((f=i[s]).name===e.name){if(f.state===dn)return cn(o);f.state===vn?(f.state=mn,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[s]):+shn)throw new Error("too late; already scheduled");return e}function wn(t,n){var e=xn(t,n);if(e.state>dn)throw new Error("too late; already running");return e}function xn(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var bn=function(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>pn&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?_n:wn;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=Object(s.namespace)(t),r="transform"===e?Bt:kn;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttributeNS(t.space,t.local))===(a=c+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,c));this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttribute(t))===(a=c+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,c));this.removeAttribute(t)}})(e,r,Mn(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=Object(s.namespace)(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+="")?qt:kn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=Object(s.style)(this,t),u=(this.style.removeProperty(t),Object(s.style)(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,An(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=Object(s.style)(this,t),a=e(this),c=a+"";return null==a&&(this.style.removeProperty(t),c=a=Object(s.style)(this,t)),u===c?null:u===r&&c===i?o:(i=c,o=n(r=u,a))}}(t,r,Mn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var c=wn(this,t),s=c.on,l=null==c.value[u]?o||(o=An(n)):void 0;s===e&&i===l||(r=(e=s).copy()).on(a,i=l),c.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=Object(s.style)(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}}(Mn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=xn(this.node(),e).tween,o=0,u=i.length;or?(r+i)/2:Math.min(0,r)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}var $n=function(){var t,n,e=Yn,r=Hn,i=Un,o=Vn,u=Wn,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],p=250,d=Ct,v=[],y=c("start","zoom","end"),m=500,g=150,_=0;function w(t){t.property("__zoom",Rn).on("wheel.zoom",N).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(u).on("touchstart.zoom",O).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new Bn(n,t.x,t.y)}function b(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 Bn(t.k,r,i)}function M(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function k(t,n,e){t.on("start.zoom",function(){z(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).end()}).tween("zoom",function(){var t=arguments,i=z(this,t),o=r.apply(this,t),u=e||M(o),a=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=this.__zoom,s="function"==typeof n?n.apply(this,t):n,l=d(c.invert(u).concat(a/c.k),s.invert(u).concat(a/s.k));return function(t){if(1===t)t=s;else{var n=l(t),e=a/n[2];t=new Bn(e,u[0]-n[0]*e,u[1]-n[1]*e)}i.zoom(null,t)}})}function z(t,n){for(var e,r=0,i=v.length;r_}t.zoom("mouse",i(b(t.that.__zoom,t.mouse[0]=Object(s.mouse)(t.that),t.mouse[1]),t.extent,l))},!0).on("mouseup.zoom",function(){r.on("mousemove.zoom mouseup.zoom",null),f(s.event.view,t.moved),Xn(),t.end()},!0),o=Object(s.mouse)(this),u=s.event.clientX,a=s.event.clientY;h(s.event.view),Cn(),t.mouse=[o,this.__zoom.invert(o)],bn(this),t.start()}}function S(){if(e.apply(this,arguments)){var t=this.__zoom,n=Object(s.mouse)(this),o=t.invert(n),u=t.k*(s.event.shiftKey?.5:2),a=i(b(x(t,u),n,o),r.apply(this,arguments),l);Xn(),p>0?Object(s.select)(this).transition().duration(p).call(k,a,n):Object(s.select)(this).call(w.transform,a)}}function O(){if(e.apply(this,arguments)){var n,r,i,o,u=z(this,arguments),a=s.event.changedTouches,c=a.length;for(Cn(),r=0;r=0;)n+=e[r].value;else n=1;t.value=n}function c(t,n){var e,r,i,o,u,a=new f(t),c=+t.value&&(a.value=t.value),l=[a];for(null==n&&(n=s);e=l.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(u=i.length))for(e.children=new Array(u),o=u-1;o>=0;--o)l.push(r=e.children[o]=new f(i[o])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(h)}function s(t){return t.children}function l(t){t.data=t.data.data}function h(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function f(t){this.data=t,this.depth=this.height=0,this.parent=null}f.prototype=c.prototype={constructor:f,count:function(){return this.eachAfter(a)},each:function(t){var n,e,r,i,o=this,u=[o];do{for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})},sort:function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each(function(n){t.push(n)}),t},leaves:function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},links:function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n},copy:function(){return c(this).eachBefore(l)}};var p=Array.prototype.slice;var d=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(p.call(t))).length,o=[];r0&&e*e>r*r+i*i}function g(t,n){for(var e=0;e(u*=u)?(r=(s+u-i)/(2*s),o=Math.sqrt(Math.max(0,u/s-r*r)),e.x=t.x-r*a-o*c,e.y=t.y-r*c+o*a):(r=(s+i-u)/(2*s),o=Math.sqrt(Math.max(0,i/s-r*r)),e.x=n.x+r*a-o*c,e.y=n.y+r*c+o*a)):(e.x=n.x+e.r,e.y=n.y)}function M(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function k(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function z(t){this._=t,this.next=null,this.previous=null}function A(t){if(!(i=t.length))return 0;var n,e,r,i,o,u,a,c,s,l,h;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;b(e,n,r=t[2]),n=new z(n),e=new z(e),r=new z(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=E(n),e):t},e.parentId=function(t){return arguments.length?(n=E(t),e):n},e};function W(t,n){return t.parent===n.parent?1:2}function U(t){var n=t.children;return n?n[0]:t.t}function $(t){var n=t.children;return n?n[n.length-1]:t.t}function F(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function G(t,n,e){return t.a.parent===n.parent?t.a:e}function K(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}K.prototype=Object.create(f.prototype);var Q=function(){var t=W,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,u=new K(t,0),a=[u];n=a.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)a.push(e=n.children[i]=new K(r[i],i)),e.parent=n;return(u.parent=new K(null,0)).children=[u],u}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(u),r)i.eachBefore(a);else{var s=i,l=i,h=i;i.eachBefore(function(t){t.xl.x&&(l=t),t.depth>h.depth&&(h=t)});var f=s===l?1:t(s,l)/2,p=f-s.x,d=n/(l.x+f+p),v=e/(h.depth||1);i.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*v})}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,u=n,a=e,c=o.parent.children[0],s=o.m,l=u.m,h=a.m,f=c.m;a=$(a),o=U(o),a&&o;)c=U(c),(u=$(u)).a=n,(i=a.z+h-o.z-s+t(a._,o._))>0&&(F(G(a,n,r),n,i),s+=i,l+=i),h+=a.m,s+=o.m,f+=c.m,l+=u.m;a&&!$(u)&&(u.t=a,u.m+=h-l),o&&!U(c)&&(c.t=o,c.m+=s-f,r=n)}return r}(n,i,n.parent.A||r[0])}function u(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},J=function(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,s=t.value&&(i-e)/t.value;++af&&(f=a),y=l*l*v,(p=Math.max(f/y,y/h))>d){l-=a;break}d=p}m.push(u={value:l,dice:c1?n:1)},e}(Z),et=function(){var t=nt,n=!1,e=1,r=1,i=[0],o=S,u=S,a=S,c=S,s=S;function l(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(h),i=[0],n&&t.eachBefore(B),t}function h(n){var e=i[n.depth],r=n.x0+e,l=n.y0+e,h=n.x1-e,f=n.y1-e;h=e-1){var l=a[n];return l.x0=i,l.y0=o,l.x1=u,void(l.y1=c)}var h=s[n],f=r/2+h,p=n+1,d=e-1;for(;p>>1;s[v]c-o){var g=(i*m+u*y)/r;t(n,p,y,i,o,g,c),t(p,e,m,g,o,u,c)}else{var _=(o*m+c*y)/r;t(n,p,y,i,o,u,_),t(p,e,m,i,_,u,c)}}(0,c,t.value,n,e,r,i)},it=function(t,n,e,r,i){(1&t.depth?J:D)(t,n,e,r,i)},ot=function t(n){function e(t,e,r,i,o){if((u=t._squarify)&&u.ratio===n)for(var u,a,c,s,l,h=-1,f=u.length,p=t.value;++h1?n:1)},e}(Z);e.d(n,"cluster",function(){return u}),e.d(n,"hierarchy",function(){return c}),e.d(n,"pack",function(){return P}),e.d(n,"packSiblings",function(){return N}),e.d(n,"packEnclose",function(){return d}),e.d(n,"partition",function(){return I}),e.d(n,"stratify",function(){return V}),e.d(n,"tree",function(){return Q}),e.d(n,"treemap",function(){return et}),e.d(n,"treemapBinary",function(){return rt}),e.d(n,"treemapDice",function(){return D}),e.d(n,"treemapSlice",function(){return J}),e.d(n,"treemapSliceDice",function(){return it}),e.d(n,"treemapSquarify",function(){return nt}),e.d(n,"treemapResquarify",function(){return ot})}])}); \ No newline at end of file diff --git a/package.json b/package.json index b2fb0fc..d9eafe0 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "treeviz", - "version": "1.3.2", + "version": "1.3.3", "description": "Library which aims to represent trees for data visualization", "keywords": [ "d3", diff --git a/src/initializeSVG.ts b/src/initializeSVG.ts index 00acde2..a6af209 100644 --- a/src/initializeSVG.ts +++ b/src/initializeSVG.ts @@ -1,4 +1,6 @@ -import d3 from "./d3"; +// Got to import d3 two times because of an issue with Webpack/Babel with d3.event +import * as d3 from "d3-selection"; +import customD3 from "./d3"; import { ITreeConfig } from "./typings"; import { getAreaSize } from "./utils"; @@ -25,7 +27,7 @@ export const initiliazeSVG = (treeConfig: ITreeConfig) => { const width = areaWidth - margin.left - margin.right; const height = areaHeight - margin.top - margin.bottom; - const zoom = d3 + const zoom = customD3 .zoom() .scaleExtent([0.2, 20]) .on("zoom", () => {