diff --git a/front/lib/treeviz/treeviz.iife.js b/front/lib/treeviz/treeviz.iife.js index e661db52..12772427 100644 --- a/front/lib/treeviz/treeviz.iife.js +++ b/front/lib/treeviz/treeviz.iife.js @@ -1,4 +1,4 @@ -var Ua=Object.defineProperty;var Ka=(tt,X,et)=>X in tt?Ua(tt,X,{enumerable:!0,configurable:!0,writable:!0,value:et}):tt[X]=et;var ft=(tt,X,et)=>(Ka(tt,typeof X!="symbol"?X+"":X,et),et);(function(){"use strict";function tt(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function X(){return this.eachAfter(tt)}function et(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function kn(t,e){for(var n=this,r=[n],i,o,a=-1;n=r.pop();)if(t.call(e,n,++a,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function Nn(t,e){for(var n=this,r=[n],i=[],o,a,u,f=-1;n=r.pop();)if(i.push(n),o=n.children)for(a=0,u=o.length;a=0;)n+=r[i].value;e.value=n})}function An(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Sn(t){for(var e=this,n=En(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function En(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function Mn(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Tn(){return Array.from(this)}function Cn(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function In(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*Ln(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i=0;--u)i.push(o=a[u]=new at(a[u])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(Ne)}function Hn(){return Ut(this).eachBefore(qn)}function Fn(t){return t.children}function Dn(t){return Array.isArray(t)?t[1]:null}function qn(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ne(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function at(t){this.data=t,this.depth=this.height=0,this.parent=null}at.prototype=Ut.prototype={constructor:at,count:X,each:et,eachAfter:Nn,eachBefore:kn,find:$n,sum:zn,sort:An,path:Sn,ancestors:Mn,descendants:Tn,leaves:Cn,links:In,copy:Hn,[Symbol.iterator]:Ln};function Kt(t){return t==null?null:$e(t)}function $e(t){if(typeof t!="function")throw new Error;return t}function ht(){return 0}function dt(t){return function(){return t}}function Rn(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function On(t,e,n,r,i){for(var o=t.children,a,u=-1,f=o.length,s=t.value&&(r-e)/t.value;++uBn(n(z,E,i))),w=y.map(Ae),A=new Set(y).add("");for(const z of w)A.has(z)||(A.add(z),y.push(z),w.push(Ae(z)),o.push(Zt));a=(z,E)=>y[E],u=(z,E)=>w[E]}for(l=0,f=o.length;l=0&&(p=o[y],p.data===Zt);--y)p.data=null}if(d.parent=Pn,d.eachBefore(function(y){y.depth=y.parent.depth+1,--f}).eachBefore(Ne),d.parent=null,f>0)throw new Error("cycle");return d}return r.id=function(i){return arguments.length?(t=Kt(i),r):t},r.parentId=function(i){return arguments.length?(e=Kt(i),r):e},r.path=function(i){return arguments.length?(n=Kt(i),r):n},r}function Bn(t){t=`${t}`;let e=t.length;return Qt(t,e-1)&&!Qt(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function Ae(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Qt(t,e););return t.slice(0,e)}function Qt(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function Yn(t,e){return t.parent===e.parent?1:2}function Jt(t){var e=t.children;return e?e[0]:t.t}function jt(t){var e=t.children;return e?e[e.length-1]:t.t}function Gn(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Un(t){for(var e=0,n=0,r=t.children,i=r.length,o;--i>=0;)o=r[i],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function Kn(t,e,n){return t.a.parent===e.parent?t.a:n}function zt(t,e){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=e}zt.prototype=Object.create(at.prototype);function Zn(t){for(var e=new zt(t,0),n,r=[e],i,o,a,u;n=r.pop();)if(o=n._.children)for(n.children=new Array(u=o.length),a=u-1;a>=0;--a)r.push(i=n.children[a]=new zt(o[a],a)),i.parent=n;return(e.parent=new zt(null,0)).children=[e],e}function Qn(){var t=Yn,e=1,n=1,r=null;function i(s){var l=Zn(s);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(a),r)s.eachBefore(f);else{var d=s,c=s,p=s;s.eachBefore(function(w){w.xc.x&&(c=w),w.depth>p.depth&&(p=w)});var m=d===c?1:t(d,c)/2,_=m-d.x,x=e/(c.x+m+_),y=n/(p.depth||1);s.eachBefore(function(w){w.x=(w.x+_)*x,w.y=w.depth*y})}return s}function o(s){var l=s.children,d=s.parent.children,c=s.i?d[s.i-1]:null;if(l){Un(s);var p=(l[0].z+l[l.length-1].z)/2;c?(s.z=c.z+t(s._,c._),s.m=s.z-p):s.z=p}else c&&(s.z=c.z+t(s._,c._));s.parent.A=u(s,c,s.parent.A||d[0])}function a(s){s._.x=s.z+s.parent.m,s.m+=s.parent.m}function u(s,l,d){if(l){for(var c=s,p=s,m=l,_=c.parent.children[0],x=c.m,y=p.m,w=m.m,A=_.m,z;m=jt(m),c=Jt(c),m&&c;)_=Jt(_),p=jt(p),p.a=s,z=m.z+w-c.z-x+t(m._,c._),z>0&&(Gn(Kn(m,s,d),s,z),x+=z,y+=z),w+=m.m,x+=c.m,A+=_.m,y+=p.m;m&&!jt(p)&&(p.t=m,p.m+=w-y),c&&!Jt(_)&&(_.t=c,_.m+=x-A,d=s)}return d}function f(s){s.x*=e,s.y=s.depth*n}return i.separation=function(s){return arguments.length?(t=s,i):t},i.size=function(s){return arguments.length?(r=!1,e=+s[0],n=+s[1],i):r?null:[e,n]},i.nodeSize=function(s){return arguments.length?(r=!0,e=+s[0],n=+s[1],i):r?[e,n]:null},i}function Jn(t,e,n,r,i){for(var o=t.children,a,u=-1,f=o.length,s=t.value&&(i-n)/t.value;++uw&&(w=s),I=x*x*E,A=Math.max(w/I,I/y),A>z){x-=s;break}z=A}a.push(f={value:x,dice:p1?r:1)},n}(jn);function nr(){var t=er,e=!1,n=1,r=1,i=[0],o=ht,a=ht,u=ht,f=ht,s=ht;function l(c){return c.x0=c.y0=0,c.x1=n,c.y1=r,c.eachBefore(d),i=[0],e&&c.eachBefore(Rn),c}function d(c){var p=i[c.depth],m=c.x0+p,_=c.y0+p,x=c.x1-p,y=c.y1-p;x=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Se.hasOwnProperty(e)?{space:Se[e],local:t}:t}function rr(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===te&&e.documentElement.namespaceURI===te?e.createElement(t):e.createElementNS(n,t)}}function ir(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ee(t){var e=At(t);return(e.local?ir:rr)(e)}function or(){}function ee(t){return t==null?or:function(){return this.querySelector(t)}}function ar(t){typeof t!="function"&&(t=ee(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=A&&(A=w+1);!(E=x[A])&&++A=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function Mr(t){t||(t=Tr);function e(d,c){return d&&c?t(d.__data__,c.__data__):!d-!c}for(var n=this._groups,r=n.length,i=new Array(r),o=0;oe?1:t>=e?0:NaN}function Cr(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ir(){return Array.from(this)}function Lr(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?Br:typeof e=="function"?Gr:Yr)(t,e,n??"")):st(this.node(),t)}function st(t,e){return t.style.getPropertyValue(e)||He(t).getComputedStyle(t,null).getPropertyValue(e)}function Kr(t){return function(){delete this[t]}}function Zr(t,e){return function(){this[t]=e}}function Qr(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Jr(t,e){return arguments.length>1?this.each((e==null?Kr:typeof e=="function"?Qr:Zr)(t,e)):this.node()[t]}function Fe(t){return t.trim().split(/^|\s+/)}function ne(t){return t.classList||new De(t)}function De(t){this._node=t,this._names=Fe(t.getAttribute("class")||"")}De.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function qe(t,e){for(var n=ne(t),r=-1,i=e.length;++r=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function zi(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n{}};function ie(){for(var t=0,e=arguments.length,n={},r;t=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Et.prototype=ie.prototype={constructor:Et,on:function(t,e){var n=this._,r=Di(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Tt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Tt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Vi.exec(t))?new F(e[1],e[2],e[3],1):(e=Wi.exec(t))?new F(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Xi.exec(t))?Tt(e[1],e[2],e[3],e[4]):(e=Bi.exec(t))?Tt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Yi.exec(t))?Ke(e[1],e[2]/100,e[3]/100,1):(e=Gi.exec(t))?Ke(e[1],e[2]/100,e[3]/100,e[4]):We.hasOwnProperty(t)?Ye(We[t]):t==="transparent"?new F(NaN,NaN,NaN,0):null}function Ye(t){return new F(t>>16&255,t>>8&255,t&255,1)}function Tt(t,e,n,r){return r<=0&&(t=e=n=NaN),new F(t,e,n,r)}function Zi(t){return t instanceof gt||(t=_t(t)),t?(t=t.rgb(),new F(t.r,t.g,t.b,t.opacity)):new F}function ue(t,e,n,r){return arguments.length===1?Zi(t):new F(t,e,n,r??1)}function F(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}se(F,ue,Ve(gt,{brighter(t){return t=t==null?Mt:Math.pow(Mt,t),new F(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?yt:Math.pow(yt,t),new F(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new F(rt(this.r),rt(this.g),rt(this.b),Ct(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ge,formatHex:Ge,formatHex8:Qi,formatRgb:Ue,toString:Ue}));function Ge(){return`#${it(this.r)}${it(this.g)}${it(this.b)}`}function Qi(){return`#${it(this.r)}${it(this.g)}${it(this.b)}${it((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ue(){const t=Ct(this.opacity);return`${t===1?"rgb(":"rgba("}${rt(this.r)}, ${rt(this.g)}, ${rt(this.b)}${t===1?")":`, ${t})`}`}function Ct(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function rt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function it(t){return t=rt(t),(t<16?"0":"")+t.toString(16)}function Ke(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new D(t,e,n,r)}function Ze(t){if(t instanceof D)return new D(t.h,t.s,t.l,t.opacity);if(t instanceof gt||(t=_t(t)),!t)return new D;if(t instanceof D)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,f=(o+i)/2;return u?(e===o?a=(n-r)/u+(n0&&f<1?0:a,new D(a,u,f,t.opacity)}function Ji(t,e,n,r){return arguments.length===1?Ze(t):new D(t,e,n,r??1)}function D(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}se(D,Ji,Ve(gt,{brighter(t){return t=t==null?Mt:Math.pow(Mt,t),new D(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?yt:Math.pow(yt,t),new D(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new F(le(t>=240?t-240:t+120,i,r),le(t,i,r),le(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new D(Qe(this.h),It(this.s),It(this.l),Ct(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ct(this.opacity);return`${t===1?"hsl(":"hsla("}${Qe(this.h)}, ${It(this.s)*100}%, ${It(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Qe(t){return t=(t||0)%360,t<0?t+360:t}function It(t){return Math.max(0,Math.min(1,t||0))}function le(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Je=t=>()=>t;function ji(t,e){return function(n){return t+n*e}}function to(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function eo(t){return(t=+t)==1?je:function(e,n){return n-e?to(e,n,t):Je(isNaN(e)?n:e)}}function je(t,e){var n=e-t;return n?ji(t,n):Je(isNaN(t)?e:t)}const tn=function t(e){var n=eo(e);function r(i,o){var a=n((i=ue(i)).r,(o=ue(o)).r),u=n(i.g,o.g),f=n(i.b,o.b),s=je(i.opacity,o.opacity);return function(l){return i.r=a(l),i.g=u(l),i.b=f(l),i.opacity=s(l),i+""}}return r.gamma=t,r}(1);function Q(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var ce=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fe=new RegExp(ce.source,"g");function no(t){return function(){return t}}function ro(t){return function(e){return t(e)+""}}function io(t,e){var n=ce.lastIndex=fe.lastIndex=0,r,i,o,a=-1,u=[],f=[];for(t=t+"",e=e+"";(r=ce.exec(t))&&(i=fe.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(i=i[0])?u[a]?u[a]+=i:u[++a]=i:(u[++a]=null,f.push({i:a,x:Q(r,i)})),n=fe.lastIndex;return n180?l+=360:l-s>180&&(s+=360),c.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Q(s,l)})):l&&d.push(i(d)+"rotate("+l+r)}function u(s,l,d,c){s!==l?c.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Q(s,l)}):l&&d.push(i(d)+"skewX("+l+r)}function f(s,l,d,c,p,m){if(s!==d||l!==c){var _=p.push(i(p)+"scale(",null,",",null,")");m.push({i:_-4,x:Q(s,d)},{i:_-2,x:Q(l,c)})}else(d!==1||c!==1)&&p.push(i(p)+"scale("+d+","+c+")")}return function(s,l){var d=[],c=[];return s=t(s),l=t(l),o(s.translateX,s.translateY,l.translateX,l.translateY,d,c),a(s.rotate,l.rotate,d,c),u(s.skewX,l.skewX,d,c),f(s.scaleX,s.scaleY,l.scaleX,l.scaleY,d,c),s=l=null,function(p){for(var m=-1,_=c.length,x;++m<_;)d[(x=c[m]).i]=x.x(p);return d.join("")}}}var so=rn(oo,"px, ","px)","deg)"),uo=rn(ao,", ",")",")"),lo=1e-12;function on(t){return((t=Math.exp(t))+1/t)/2}function co(t){return((t=Math.exp(t))-1/t)/2}function fo(t){return((t=Math.exp(2*t))-1)/(t+1)}const ho=function t(e,n,r){function i(o,a){var u=o[0],f=o[1],s=o[2],l=a[0],d=a[1],c=a[2],p=l-u,m=d-f,_=p*p+m*m,x,y;if(_=0&&t._call.call(void 0,e),t=t._next;--lt}function ln(){ot=(Ft=bt.now())+Dt,lt=xt=0;try{go()}finally{lt=0,mo(),ot=0}}function yo(){var t=bt.now(),e=t-Ft;e>an&&(Dt-=e,Ft=t)}function mo(){for(var t,e=Ht,n,r=1/0;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:Ht=n);vt=t,pe(r)}function pe(t){if(!lt){xt&&(xt=clearTimeout(xt));var e=t-ot;e>24?(t<1/0&&(xt=setTimeout(ln,t-bt.now()-Dt)),wt&&(wt=clearInterval(wt))):(wt||(Ft=bt.now(),wt=setInterval(yo,an)),lt=1,sn(ln))}}function cn(t,e,n){var r=new qt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var _o=ie("start","end","cancel","interrupt"),xo=[],fn=0,hn=1,ge=2,Rt=3,dn=4,ye=5,Ot=6;function Pt(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;wo(t,n,{name:e,index:r,group:i,on:_o,tween:xo,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:fn})}function me(t,e){var n=q(t,e);if(n.state>fn)throw new Error("too late; already scheduled");return n}function V(t,e){var n=q(t,e);if(n.state>Rt)throw new Error("too late; already running");return n}function q(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function wo(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=un(o,0,n.time);function o(s){n.state=hn,n.timer.restart(a,n.delay,n.time),n.delay<=s&&a(s-n.delay)}function a(s){var l,d,c,p;if(n.state!==hn)return f();for(l in r)if(p=r[l],p.name===n.name){if(p.state===Rt)return cn(a);p.state===dn?(p.state=Ot,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[l]):+lge&&r.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function Zo(t,e,n){var r,i,o=Ko(e)?me:V;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}function Qo(t,e){var n=this._id;return arguments.length<2?q(this.node(),n).on.on(t):this.each(Zo(n,t,e))}function Jo(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function jo(){return this.on("end.remove",Jo(this._id))}function ta(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ee(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a()=>t;function $a(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function U(t,e,n){this.k=t,this.x=e,this.y=n}U.prototype={constructor:U,scale:function(t){return t===1?this:new U(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new U(this.k,this.x+this.k*t,this.y+this.k*e)},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 mn=new U(1,0,0);U.prototype;function xe(t){t.stopImmediatePropagation()}function kt(t){t.preventDefault(),t.stopImmediatePropagation()}function za(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Aa(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function _n(){return this.__zoom||mn}function Sa(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ea(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ma(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Ta(){var t=za,e=Aa,n=Ma,r=Sa,i=Ea,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],u=250,f=ho,s=ie("start","zoom","end"),l,d,c,p=500,m=150,_=0,x=10;function y(h){h.property("__zoom",_n).on("wheel.zoom",Bt,{passive:!1}).on("mousedown.zoom",Yt).on("dblclick.zoom",Gt).filter(i).on("touchstart.zoom",Ba).on("touchmove.zoom",Ya).on("touchend.zoom touchcancel.zoom",Ga).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(h,v,g,b){var k=h.selection?h.selection():h;k.property("__zoom",_n),h!==k?E(h,v,g,b):k.interrupt().each(function(){I(this,arguments).event(b).start().zoom(null,typeof v=="function"?v.apply(this,arguments):v).end()})},y.scaleBy=function(h,v,g,b){y.scaleTo(h,function(){var k=this.__zoom.k,N=typeof v=="function"?v.apply(this,arguments):v;return k*N},g,b)},y.scaleTo=function(h,v,g,b){y.transform(h,function(){var k=e.apply(this,arguments),N=this.__zoom,$=g==null?z(k):typeof g=="function"?g.apply(this,arguments):g,S=N.invert($),T=typeof v=="function"?v.apply(this,arguments):v;return n(A(w(N,T),$,S),k,a)},g,b)},y.translateBy=function(h,v,g,b){y.transform(h,function(){return n(this.__zoom.translate(typeof v=="function"?v.apply(this,arguments):v,typeof g=="function"?g.apply(this,arguments):g),e.apply(this,arguments),a)},null,b)},y.translateTo=function(h,v,g,b,k){y.transform(h,function(){var N=e.apply(this,arguments),$=this.__zoom,S=b==null?z(N):typeof b=="function"?b.apply(this,arguments):b;return n(mn.translate(S[0],S[1]).scale($.k).translate(typeof v=="function"?-v.apply(this,arguments):-v,typeof g=="function"?-g.apply(this,arguments):-g),N,a)},b,k)};function w(h,v){return v=Math.max(o[0],Math.min(o[1],v)),v===h.k?h:new U(v,h.x,h.y)}function A(h,v,g){var b=v[0]-g[0]*h.k,k=v[1]-g[1]*h.k;return b===h.x&&k===h.y?h:new U(h.k,b,k)}function z(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function E(h,v,g,b){h.on("start.zoom",function(){I(this,arguments).event(b).start()}).on("interrupt.zoom end.zoom",function(){I(this,arguments).event(b).end()}).tween("zoom",function(){var k=this,N=arguments,$=I(k,N).event(b),S=e.apply(k,N),T=g==null?z(S):typeof g=="function"?g.apply(k,N):g,W=Math.max(S[1][0]-S[0][0],S[1][1]-S[0][1]),L=k.__zoom,R=typeof v=="function"?v.apply(k,N):v,K=f(L.invert(T).concat(W/L.k),R.invert(T).concat(W/R.k));return function(O){if(O===1)O=R;else{var Z=K(O),ke=W/Z[2];O=new U(ke,T[0]-Z[0]*ke,T[1]-Z[1]*ke)}$.zoom(null,O)}})}function I(h,v,g){return!g&&h.__zooming||new j(h,v)}function j(h,v){this.that=h,this.args=v,this.active=0,this.sourceEvent=null,this.extent=e.apply(h,v),this.taps=0}j.prototype={event:function(h){return h&&(this.sourceEvent=h),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(h,v){return this.mouse&&h!=="mouse"&&(this.mouse[1]=v.invert(this.mouse[0])),this.touch0&&h!=="touch"&&(this.touch0[1]=v.invert(this.touch0[0])),this.touch1&&h!=="touch"&&(this.touch1[1]=v.invert(this.touch1[0])),this.that.__zoom=v,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(h){var v=B(this.that).datum();s.call(h,this.that,new $a(h,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:s}),v)}};function Bt(h,...v){if(!t.apply(this,arguments))return;var g=I(this,v).event(h),b=this.__zoom,k=Math.max(o[0],Math.min(o[1],b.k*Math.pow(2,r.apply(this,arguments)))),N=nt(h);if(g.wheel)(g.mouse[0][0]!==N[0]||g.mouse[0][1]!==N[1])&&(g.mouse[1]=b.invert(g.mouse[0]=N)),clearTimeout(g.wheel);else{if(b.k===k)return;g.mouse=[N,b.invert(N)],Vt(this),g.start()}kt(h),g.wheel=setTimeout($,m),g.zoom("mouse",n(A(w(b,k),g.mouse[0],g.mouse[1]),g.extent,a));function $(){g.wheel=null,g.end()}}function Yt(h,...v){if(c||!t.apply(this,arguments))return;var g=h.currentTarget,b=I(this,v,!0).event(h),k=B(h.view).on("mousemove.zoom",T,!0).on("mouseup.zoom",W,!0),N=nt(h,g),$=h.clientX,S=h.clientY;Ri(h.view),xe(h),b.mouse=[N,this.__zoom.invert(N)],Vt(this),b.start();function T(L){if(kt(L),!b.moved){var R=L.clientX-$,K=L.clientY-S;b.moved=R*R+K*K>_}b.event(L).zoom("mouse",n(A(b.that.__zoom,b.mouse[0]=nt(L,g),b.mouse[1]),b.extent,a))}function W(L){k.on("mousemove.zoom mouseup.zoom",null),Oi(L.view,b.moved),kt(L),b.event(L).end()}}function Gt(h,...v){if(t.apply(this,arguments)){var g=this.__zoom,b=nt(h.changedTouches?h.changedTouches[0]:h,this),k=g.invert(b),N=g.k*(h.shiftKey?.5:2),$=n(A(w(g,N),b,k),e.apply(this,v),a);kt(h),u>0?B(this).transition().duration(u).call(E,$,b,h):B(this).call(y.transform,$,b,h)}}function Ba(h,...v){if(t.apply(this,arguments)){var g=h.touches,b=g.length,k=I(this,v,h.changedTouches.length===b).event(h),N,$,S,T;for(xe(h),$=0;${const e=document.querySelector(`#${t}`);if(e===null)throw new Error(`Cannot find dom element with id:${t}`);const n=e.clientWidth,r=e.clientHeight;if(r===0||n===0)throw new Error("The tree can't be display because the svg height or width of the container is null");return{areaWidth:n,areaHeight:r}},Nt=(t,e,n)=>{try{const r=t.find(a=>a.id===n),i=r.ancestors()[1].id;return e.some(a=>a.id===i)?r.ancestors()[1]:Nt(t,e,i)}catch{return t.find(i=>i.id===n)}},wn=(t,e,n)=>n.isHorizontal?"translate("+e+","+t+")":"translate("+t+","+e+")";class ct{static add(e,n){this.queue.push({delayNextCallback:e+this.extraDelayBetweenCallbacks,callback:n}),this.log(this.queue.map(r=>r.delayNextCallback),"<-- New task !!!"),this.runner||(this.runnerFunction(),this.runner=setInterval(()=>this.runnerFunction(),this.runnerSpeed))}static runnerFunction(){if(this.queue[0]){if(this.queue[0].callback){this.log("Executing task, delaying next task...");try{this.queue[0].callback()}catch(e){console.error(e)}finally{this.queue[0].callback=null}}this.queue[0].delayNextCallback-=this.runnerSpeed,this.log(this.queue.map(e=>e.delayNextCallback)),this.queue[0].delayNextCallback<=0&&this.queue.shift()}else this.log("No task found"),clearInterval(this.runner),this.runner=0}static log(...e){this.showQueueLog&&console.log(...e)}}ft(ct,"queue",[]),ft(ct,"runner"),ft(ct,"runnerSpeed",100),ft(ct,"extraDelayBetweenCallbacks",100),ft(ct,"showQueueLog",!1);const Ca=t=>{const{htmlId:e,isHorizontal:n,hasPan:r,hasZoom:i,mainAxisNodeSpacing:o,nodeHeight:a,nodeWidth:u,marginBottom:f,marginLeft:s,marginRight:l,marginTop:d}=t,c={top:d,right:l,bottom:f,left:s},{areaHeight:p,areaWidth:m}=xn(t.htmlId),_=m-c.left-c.right,x=p-c.top-c.bottom,y=J.select("#"+e).append("svg").attr("width",m).attr("height",p),w=y.append("g"),A=J.zoom().on("zoom",E=>{w.attr("transform",()=>E.transform)});return y.call(A),r||y.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),i||y.on("wheel.zoom",null).on("mousewheel.zoom",null).on("mousemove.zoom",null).on("DOMMouseScroll.zoom",null).on("dblclick.zoom",null),w.append("g").attr("transform",o==="auto"?"translate(0,0)":n?"translate("+c.left+","+(c.top+x/2-a/2)+")":"translate("+(c.left+_/2-u/2)+","+c.top+")")},we=(t,e,n)=>{const{isHorizontal:r,nodeHeight:i,nodeWidth:o,linkShape:a}=n;return a==="orthogonal"?r?`M ${t.y} ${t.x+i/2} +var Za=Object.defineProperty;var Qa=(tt,X,et)=>X in tt?Za(tt,X,{enumerable:!0,configurable:!0,writable:!0,value:et}):tt[X]=et;var ft=(tt,X,et)=>(Qa(tt,typeof X!="symbol"?X+"":X,et),et);(function(){"use strict";function tt(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function X(){return this.eachAfter(tt)}function et(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function $n(t,e){for(var n=this,r=[n],i,o,a=-1;n=r.pop();)if(t.call(e,n,++a,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function zn(t,e){for(var n=this,r=[n],i=[],o,a,u,f=-1;n=r.pop();)if(i.push(n),o=n.children)for(a=0,u=o.length;a=0;)n+=r[i].value;e.value=n})}function En(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Mn(t){for(var e=this,n=Tn(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function Tn(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function Cn(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Ln(){return Array.from(this)}function In(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Hn(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*Fn(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i=0;--u)i.push(o=a[u]=new at(a[u])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(Ne)}function Dn(){return Ut(this).eachBefore(On)}function qn(t){return t.children}function Rn(t){return Array.isArray(t)?t[1]:null}function On(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ne(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function at(t){this.data=t,this.depth=this.height=0,this.parent=null}at.prototype=Ut.prototype={constructor:at,count:X,each:et,eachAfter:zn,eachBefore:$n,find:An,sum:Sn,sort:En,path:Mn,ancestors:Cn,descendants:Ln,leaves:In,links:Hn,copy:Dn,[Symbol.iterator]:Fn};function Kt(t){return t==null?null:$e(t)}function $e(t){if(typeof t!="function")throw new Error;return t}function ht(){return 0}function dt(t){return function(){return t}}function Pn(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Vn(t,e,n,r,i){for(var o=t.children,a,u=-1,f=o.length,s=t.value&&(r-e)/t.value;++uGn(n(z,E,i))),w=y.map(Ae),A=new Set(y).add("");for(const z of w)A.has(z)||(A.add(z),y.push(z),w.push(Ae(z)),o.push(Zt));a=(z,E)=>y[E],u=(z,E)=>w[E]}for(l=0,f=o.length;l=0&&(p=o[y],p.data===Zt);--y)p.data=null}if(d.parent=Wn,d.eachBefore(function(y){y.depth=y.parent.depth+1,--f}).eachBefore(Ne),d.parent=null,f>0)throw new Error("cycle");return d}return r.id=function(i){return arguments.length?(t=Kt(i),r):t},r.parentId=function(i){return arguments.length?(e=Kt(i),r):e},r.path=function(i){return arguments.length?(n=Kt(i),r):n},r}function Gn(t){t=`${t}`;let e=t.length;return Qt(t,e-1)&&!Qt(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function Ae(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Qt(t,e););return t.slice(0,e)}function Qt(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function Un(t,e){return t.parent===e.parent?1:2}function Jt(t){var e=t.children;return e?e[0]:t.t}function jt(t){var e=t.children;return e?e[e.length-1]:t.t}function Kn(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Zn(t){for(var e=0,n=0,r=t.children,i=r.length,o;--i>=0;)o=r[i],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function Qn(t,e,n){return t.a.parent===e.parent?t.a:n}function zt(t,e){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=e}zt.prototype=Object.create(at.prototype);function Jn(t){for(var e=new zt(t,0),n,r=[e],i,o,a,u;n=r.pop();)if(o=n._.children)for(n.children=new Array(u=o.length),a=u-1;a>=0;--a)r.push(i=n.children[a]=new zt(o[a],a)),i.parent=n;return(e.parent=new zt(null,0)).children=[e],e}function jn(){var t=Un,e=1,n=1,r=null;function i(s){var l=Jn(s);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(a),r)s.eachBefore(f);else{var d=s,c=s,p=s;s.eachBefore(function(w){w.xc.x&&(c=w),w.depth>p.depth&&(p=w)});var m=d===c?1:t(d,c)/2,x=m-d.x,_=e/(c.x+m+x),y=n/(p.depth||1);s.eachBefore(function(w){w.x=(w.x+x)*_,w.y=w.depth*y})}return s}function o(s){var l=s.children,d=s.parent.children,c=s.i?d[s.i-1]:null;if(l){Zn(s);var p=(l[0].z+l[l.length-1].z)/2;c?(s.z=c.z+t(s._,c._),s.m=s.z-p):s.z=p}else c&&(s.z=c.z+t(s._,c._));s.parent.A=u(s,c,s.parent.A||d[0])}function a(s){s._.x=s.z+s.parent.m,s.m+=s.parent.m}function u(s,l,d){if(l){for(var c=s,p=s,m=l,x=c.parent.children[0],_=c.m,y=p.m,w=m.m,A=x.m,z;m=jt(m),c=Jt(c),m&&c;)x=Jt(x),p=jt(p),p.a=s,z=m.z+w-c.z-_+t(m._,c._),z>0&&(Kn(Qn(m,s,d),s,z),_+=z,y+=z),w+=m.m,_+=c.m,A+=x.m,y+=p.m;m&&!jt(p)&&(p.t=m,p.m+=w-y),c&&!Jt(x)&&(x.t=c,x.m+=_-A,d=s)}return d}function f(s){s.x*=e,s.y=s.depth*n}return i.separation=function(s){return arguments.length?(t=s,i):t},i.size=function(s){return arguments.length?(r=!1,e=+s[0],n=+s[1],i):r?null:[e,n]},i.nodeSize=function(s){return arguments.length?(r=!0,e=+s[0],n=+s[1],i):r?[e,n]:null},i}function tr(t,e,n,r,i){for(var o=t.children,a,u=-1,f=o.length,s=t.value&&(i-n)/t.value;++uw&&(w=s),L=_*_*E,A=Math.max(w/L,L/y),A>z){_-=s;break}z=A}a.push(f={value:_,dice:p1?r:1)},n}(er);function ir(){var t=rr,e=!1,n=1,r=1,i=[0],o=ht,a=ht,u=ht,f=ht,s=ht;function l(c){return c.x0=c.y0=0,c.x1=n,c.y1=r,c.eachBefore(d),i=[0],e&&c.eachBefore(Pn),c}function d(c){var p=i[c.depth],m=c.x0+p,x=c.y0+p,_=c.x1-p,y=c.y1-p;_=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Se.hasOwnProperty(e)?{space:Se[e],local:t}:t}function or(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===te&&e.documentElement.namespaceURI===te?e.createElement(t):e.createElementNS(n,t)}}function ar(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ee(t){var e=At(t);return(e.local?ar:or)(e)}function sr(){}function ee(t){return t==null?sr:function(){return this.querySelector(t)}}function ur(t){typeof t!="function"&&(t=ee(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=A&&(A=w+1);!(E=_[A])&&++A=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function Cr(t){t||(t=Lr);function e(d,c){return d&&c?t(d.__data__,c.__data__):!d-!c}for(var n=this._groups,r=n.length,i=new Array(r),o=0;oe?1:t>=e?0:NaN}function Ir(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Hr(){return Array.from(this)}function Fr(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?Gr:typeof e=="function"?Kr:Ur)(t,e,n??"")):st(this.node(),t)}function st(t,e){return t.style.getPropertyValue(e)||He(t).getComputedStyle(t,null).getPropertyValue(e)}function Qr(t){return function(){delete this[t]}}function Jr(t,e){return function(){this[t]=e}}function jr(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function ti(t,e){return arguments.length>1?this.each((e==null?Qr:typeof e=="function"?jr:Jr)(t,e)):this.node()[t]}function Fe(t){return t.trim().split(/^|\s+/)}function ne(t){return t.classList||new De(t)}function De(t){this._node=t,this._names=Fe(t.getAttribute("class")||"")}De.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function qe(t,e){for(var n=ne(t),r=-1,i=e.length;++r=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Si(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n{}};function ie(){for(var t=0,e=arguments.length,n={},r;t=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Et.prototype=ie.prototype={constructor:Et,on:function(t,e){var n=this._,r=Ri(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Tt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Tt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Bi.exec(t))?new F(e[1],e[2],e[3],1):(e=Xi.exec(t))?new F(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Yi.exec(t))?Tt(e[1],e[2],e[3],e[4]):(e=Gi.exec(t))?Tt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ui.exec(t))?Ke(e[1],e[2]/100,e[3]/100,1):(e=Ki.exec(t))?Ke(e[1],e[2]/100,e[3]/100,e[4]):We.hasOwnProperty(t)?Ye(We[t]):t==="transparent"?new F(NaN,NaN,NaN,0):null}function Ye(t){return new F(t>>16&255,t>>8&255,t&255,1)}function Tt(t,e,n,r){return r<=0&&(t=e=n=NaN),new F(t,e,n,r)}function Ji(t){return t instanceof gt||(t=xt(t)),t?(t=t.rgb(),new F(t.r,t.g,t.b,t.opacity)):new F}function ue(t,e,n,r){return arguments.length===1?Ji(t):new F(t,e,n,r??1)}function F(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}se(F,ue,Ve(gt,{brighter(t){return t=t==null?Mt:Math.pow(Mt,t),new F(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?yt:Math.pow(yt,t),new F(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new F(rt(this.r),rt(this.g),rt(this.b),Ct(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ge,formatHex:Ge,formatHex8:ji,formatRgb:Ue,toString:Ue}));function Ge(){return`#${it(this.r)}${it(this.g)}${it(this.b)}`}function ji(){return`#${it(this.r)}${it(this.g)}${it(this.b)}${it((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ue(){const t=Ct(this.opacity);return`${t===1?"rgb(":"rgba("}${rt(this.r)}, ${rt(this.g)}, ${rt(this.b)}${t===1?")":`, ${t})`}`}function Ct(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function rt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function it(t){return t=rt(t),(t<16?"0":"")+t.toString(16)}function Ke(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new q(t,e,n,r)}function Ze(t){if(t instanceof q)return new q(t.h,t.s,t.l,t.opacity);if(t instanceof gt||(t=xt(t)),!t)return new q;if(t instanceof q)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,f=(o+i)/2;return u?(e===o?a=(n-r)/u+(n0&&f<1?0:a,new q(a,u,f,t.opacity)}function to(t,e,n,r){return arguments.length===1?Ze(t):new q(t,e,n,r??1)}function q(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}se(q,to,Ve(gt,{brighter(t){return t=t==null?Mt:Math.pow(Mt,t),new q(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?yt:Math.pow(yt,t),new q(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new F(le(t>=240?t-240:t+120,i,r),le(t,i,r),le(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new q(Qe(this.h),Lt(this.s),Lt(this.l),Ct(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ct(this.opacity);return`${t===1?"hsl(":"hsla("}${Qe(this.h)}, ${Lt(this.s)*100}%, ${Lt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Qe(t){return t=(t||0)%360,t<0?t+360:t}function Lt(t){return Math.max(0,Math.min(1,t||0))}function le(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Je=t=>()=>t;function eo(t,e){return function(n){return t+n*e}}function no(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function ro(t){return(t=+t)==1?je:function(e,n){return n-e?no(e,n,t):Je(isNaN(e)?n:e)}}function je(t,e){var n=e-t;return n?eo(t,n):Je(isNaN(t)?e:t)}const tn=function t(e){var n=ro(e);function r(i,o){var a=n((i=ue(i)).r,(o=ue(o)).r),u=n(i.g,o.g),f=n(i.b,o.b),s=je(i.opacity,o.opacity);return function(l){return i.r=a(l),i.g=u(l),i.b=f(l),i.opacity=s(l),i+""}}return r.gamma=t,r}(1);function Q(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var ce=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fe=new RegExp(ce.source,"g");function io(t){return function(){return t}}function oo(t){return function(e){return t(e)+""}}function ao(t,e){var n=ce.lastIndex=fe.lastIndex=0,r,i,o,a=-1,u=[],f=[];for(t=t+"",e=e+"";(r=ce.exec(t))&&(i=fe.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(i=i[0])?u[a]?u[a]+=i:u[++a]=i:(u[++a]=null,f.push({i:a,x:Q(r,i)})),n=fe.lastIndex;return n180?l+=360:l-s>180&&(s+=360),c.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Q(s,l)})):l&&d.push(i(d)+"rotate("+l+r)}function u(s,l,d,c){s!==l?c.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Q(s,l)}):l&&d.push(i(d)+"skewX("+l+r)}function f(s,l,d,c,p,m){if(s!==d||l!==c){var x=p.push(i(p)+"scale(",null,",",null,")");m.push({i:x-4,x:Q(s,d)},{i:x-2,x:Q(l,c)})}else(d!==1||c!==1)&&p.push(i(p)+"scale("+d+","+c+")")}return function(s,l){var d=[],c=[];return s=t(s),l=t(l),o(s.translateX,s.translateY,l.translateX,l.translateY,d,c),a(s.rotate,l.rotate,d,c),u(s.skewX,l.skewX,d,c),f(s.scaleX,s.scaleY,l.scaleX,l.scaleY,d,c),s=l=null,function(p){for(var m=-1,x=c.length,_;++m=0&&t._call.call(void 0,e),t=t._next;--lt}function ln(){ot=(Ft=bt.now())+Dt,lt=_t=0;try{mo()}finally{lt=0,_o(),ot=0}}function xo(){var t=bt.now(),e=t-Ft;e>an&&(Dt-=e,Ft=t)}function _o(){for(var t,e=Ht,n,r=1/0;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:Ht=n);vt=t,pe(r)}function pe(t){if(!lt){_t&&(_t=clearTimeout(_t));var e=t-ot;e>24?(t<1/0&&(_t=setTimeout(ln,t-bt.now()-Dt)),wt&&(wt=clearInterval(wt))):(wt||(Ft=bt.now(),wt=setInterval(xo,an)),lt=1,sn(ln))}}function cn(t,e,n){var r=new qt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var wo=ie("start","end","cancel","interrupt"),vo=[],fn=0,hn=1,ge=2,Rt=3,dn=4,ye=5,Ot=6;function Pt(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;bo(t,n,{name:e,index:r,group:i,on:wo,tween:vo,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:fn})}function me(t,e){var n=R(t,e);if(n.state>fn)throw new Error("too late; already scheduled");return n}function W(t,e){var n=R(t,e);if(n.state>Rt)throw new Error("too late; already running");return n}function R(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function bo(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=un(o,0,n.time);function o(s){n.state=hn,n.timer.restart(a,n.delay,n.time),n.delay<=s&&a(s-n.delay)}function a(s){var l,d,c,p;if(n.state!==hn)return f();for(l in r)if(p=r[l],p.name===n.name){if(p.state===Rt)return cn(a);p.state===dn?(p.state=Ot,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[l]):+lge&&r.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function Jo(t,e,n){var r,i,o=Qo(e)?me:W;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}function jo(t,e){var n=this._id;return arguments.length<2?R(this.node(),n).on.on(t):this.each(Jo(n,t,e))}function ta(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ea(){return this.on("end.remove",ta(this._id))}function na(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ee(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a()=>t;function Aa(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function U(t,e,n){this.k=t,this.x=e,this.y=n}U.prototype={constructor:U,scale:function(t){return t===1?this:new U(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new U(this.k,this.x+this.k*t,this.y+this.k*e)},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 mn=new U(1,0,0);U.prototype;function _e(t){t.stopImmediatePropagation()}function kt(t){t.preventDefault(),t.stopImmediatePropagation()}function Sa(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Ea(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function xn(){return this.__zoom||mn}function Ma(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ta(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ca(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function La(){var t=Sa,e=Ea,n=Ca,r=Ma,i=Ta,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],u=250,f=go,s=ie("start","zoom","end"),l,d,c,p=500,m=150,x=0,_=10;function y(h){h.property("__zoom",xn).on("wheel.zoom",Xt,{passive:!1}).on("mousedown.zoom",Yt).on("dblclick.zoom",Gt).filter(i).on("touchstart.zoom",Ga).on("touchmove.zoom",Ua).on("touchend.zoom touchcancel.zoom",Ka).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(h,v,g,b){var k=h.selection?h.selection():h;k.property("__zoom",xn),h!==k?E(h,v,g,b):k.interrupt().each(function(){L(this,arguments).event(b).start().zoom(null,typeof v=="function"?v.apply(this,arguments):v).end()})},y.scaleBy=function(h,v,g,b){y.scaleTo(h,function(){var k=this.__zoom.k,N=typeof v=="function"?v.apply(this,arguments):v;return k*N},g,b)},y.scaleTo=function(h,v,g,b){y.transform(h,function(){var k=e.apply(this,arguments),N=this.__zoom,$=g==null?z(k):typeof g=="function"?g.apply(this,arguments):g,S=N.invert($),T=typeof v=="function"?v.apply(this,arguments):v;return n(A(w(N,T),$,S),k,a)},g,b)},y.translateBy=function(h,v,g,b){y.transform(h,function(){return n(this.__zoom.translate(typeof v=="function"?v.apply(this,arguments):v,typeof g=="function"?g.apply(this,arguments):g),e.apply(this,arguments),a)},null,b)},y.translateTo=function(h,v,g,b,k){y.transform(h,function(){var N=e.apply(this,arguments),$=this.__zoom,S=b==null?z(N):typeof b=="function"?b.apply(this,arguments):b;return n(mn.translate(S[0],S[1]).scale($.k).translate(typeof v=="function"?-v.apply(this,arguments):-v,typeof g=="function"?-g.apply(this,arguments):-g),N,a)},b,k)};function w(h,v){return v=Math.max(o[0],Math.min(o[1],v)),v===h.k?h:new U(v,h.x,h.y)}function A(h,v,g){var b=v[0]-g[0]*h.k,k=v[1]-g[1]*h.k;return b===h.x&&k===h.y?h:new U(h.k,b,k)}function z(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function E(h,v,g,b){h.on("start.zoom",function(){L(this,arguments).event(b).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(b).end()}).tween("zoom",function(){var k=this,N=arguments,$=L(k,N).event(b),S=e.apply(k,N),T=g==null?z(S):typeof g=="function"?g.apply(k,N):g,B=Math.max(S[1][0]-S[0][0],S[1][1]-S[0][1]),I=k.__zoom,O=typeof v=="function"?v.apply(k,N):v,K=f(I.invert(T).concat(B/I.k),O.invert(T).concat(B/O.k));return function(P){if(P===1)P=O;else{var Z=K(P),ke=B/Z[2];P=new U(ke,T[0]-Z[0]*ke,T[1]-Z[1]*ke)}$.zoom(null,P)}})}function L(h,v,g){return!g&&h.__zooming||new j(h,v)}function j(h,v){this.that=h,this.args=v,this.active=0,this.sourceEvent=null,this.extent=e.apply(h,v),this.taps=0}j.prototype={event:function(h){return h&&(this.sourceEvent=h),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(h,v){return this.mouse&&h!=="mouse"&&(this.mouse[1]=v.invert(this.mouse[0])),this.touch0&&h!=="touch"&&(this.touch0[1]=v.invert(this.touch0[0])),this.touch1&&h!=="touch"&&(this.touch1[1]=v.invert(this.touch1[0])),this.that.__zoom=v,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(h){var v=D(this.that).datum();s.call(h,this.that,new Aa(h,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:s}),v)}};function Xt(h,...v){if(!t.apply(this,arguments))return;var g=L(this,v).event(h),b=this.__zoom,k=Math.max(o[0],Math.min(o[1],b.k*Math.pow(2,r.apply(this,arguments)))),N=nt(h);if(g.wheel)(g.mouse[0][0]!==N[0]||g.mouse[0][1]!==N[1])&&(g.mouse[1]=b.invert(g.mouse[0]=N)),clearTimeout(g.wheel);else{if(b.k===k)return;g.mouse=[N,b.invert(N)],Vt(this),g.start()}kt(h),g.wheel=setTimeout($,m),g.zoom("mouse",n(A(w(b,k),g.mouse[0],g.mouse[1]),g.extent,a));function $(){g.wheel=null,g.end()}}function Yt(h,...v){if(c||!t.apply(this,arguments))return;var g=h.currentTarget,b=L(this,v,!0).event(h),k=D(h.view).on("mousemove.zoom",T,!0).on("mouseup.zoom",B,!0),N=nt(h,g),$=h.clientX,S=h.clientY;Pi(h.view),_e(h),b.mouse=[N,this.__zoom.invert(N)],Vt(this),b.start();function T(I){if(kt(I),!b.moved){var O=I.clientX-$,K=I.clientY-S;b.moved=O*O+K*K>x}b.event(I).zoom("mouse",n(A(b.that.__zoom,b.mouse[0]=nt(I,g),b.mouse[1]),b.extent,a))}function B(I){k.on("mousemove.zoom mouseup.zoom",null),Vi(I.view,b.moved),kt(I),b.event(I).end()}}function Gt(h,...v){if(t.apply(this,arguments)){var g=this.__zoom,b=nt(h.changedTouches?h.changedTouches[0]:h,this),k=g.invert(b),N=g.k*(h.shiftKey?.5:2),$=n(A(w(g,N),b,k),e.apply(this,v),a);kt(h),u>0?D(this).transition().duration(u).call(E,$,b,h):D(this).call(y.transform,$,b,h)}}function Ga(h,...v){if(t.apply(this,arguments)){var g=h.touches,b=g.length,k=L(this,v,h.changedTouches.length===b).event(h),N,$,S,T;for(_e(h),$=0;${const e=document.querySelector(`#${t}`);if(e===null)throw new Error(`Cannot find dom element with id:${t}`);const n=e.clientWidth,r=e.clientHeight;if(r===0||n===0)throw new Error("The tree can't be display because the svg height or width of the container is null");return{areaWidth:n,areaHeight:r}},Nt=(t,e,n)=>{try{const r=t.find(a=>a.id===n),i=r.ancestors()[1].id;return e.some(a=>a.id===i)?r.ancestors()[1]:Nt(t,e,i)}catch{return t.find(i=>i.id===n)}},wn=(t,e,n)=>n.isHorizontal?"translate("+e+","+t+")":"translate("+t+","+e+")";class ct{static add(e,n){this.queue.push({delayNextCallback:e+this.extraDelayBetweenCallbacks,callback:n}),this.log(this.queue.map(r=>r.delayNextCallback),"<-- New task !!!"),this.runner||(this.runnerFunction(),this.runner=setInterval(()=>this.runnerFunction(),this.runnerSpeed))}static runnerFunction(){if(this.queue[0]){if(this.queue[0].callback){this.log("Executing task, delaying next task...");try{this.queue[0].callback()}catch(e){console.error(e)}finally{this.queue[0].callback=null}}this.queue[0].delayNextCallback-=this.runnerSpeed,this.log(this.queue.map(e=>e.delayNextCallback)),this.queue[0].delayNextCallback<=0&&this.queue.shift()}else this.log("No task found"),clearInterval(this.runner),this.runner=0}static log(...e){this.showQueueLog&&console.log(...e)}}ft(ct,"queue",[]),ft(ct,"runner"),ft(ct,"runnerSpeed",100),ft(ct,"extraDelayBetweenCallbacks",100),ft(ct,"showQueueLog",!1);const Ia=t=>{const{htmlId:e,isHorizontal:n,hasPan:r,hasZoom:i,mainAxisNodeSpacing:o,nodeHeight:a,nodeWidth:u,marginBottom:f,marginLeft:s,marginRight:l,marginTop:d}=t,c={top:d,right:l,bottom:f,left:s},{areaHeight:p,areaWidth:m}=_n(t.htmlId),x=m-c.left-c.right,_=p-c.top-c.bottom,y=J.select("#"+e).append("svg").attr("width",m).attr("height",p),w=y.append("g"),A=J.zoom().on("zoom",E=>{w.attr("transform",()=>E.transform)});return y.call(A),r||y.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),i||y.on("wheel.zoom",null).on("mousewheel.zoom",null).on("mousemove.zoom",null).on("DOMMouseScroll.zoom",null).on("dblclick.zoom",null),w.append("g").attr("transform",o==="auto"?"translate(0,0)":n?"translate("+c.left+","+(c.top+_/2-a/2)+")":"translate("+(c.left+x/2-u/2)+","+c.top+")")},we=(t,e,n)=>{const{isHorizontal:r,nodeHeight:i,nodeWidth:o,linkShape:a}=n;return a==="orthogonal"?r?`M ${t.y} ${t.x+i/2} L ${(t.y+e.y+o)/2} ${t.x+i/2} L ${(t.y+e.y+o)/2} ${e.x+i/2} ${e.y+o} ${e.x+i/2}`:`M ${t.x+o/2} ${t.y} @@ -20,4 +20,4 @@ var Ua=Object.defineProperty;var Ka=(tt,X,et)=>X in tt?Ua(tt,X,{enumerable:!0,co ${e.y+o} ${e.x+i/2}`:`M ${t.x+o/2} ${t.y} C ${t.x+o/2} ${(t.y+e.y+i)/2} ${e.x+o/2} ${(t.y+e.y+i)/2} - ${e.x+o/2} ${e.y+i} `},vn=(t,e,n)=>t>e?n:tt.enter().insert("path","g").attr("class","link").attr("d",i=>{const o=Nt(n,r,i.id),a={x:o.x0,y:o.y0};return we(a,a,e)}).attr("fill","none").attr("stroke-width",i=>e.linkWidth(i)).attr("stroke",i=>e.linkColor(i)),La=(t,e,n,r)=>{t.exit().transition().duration(e.duration).style("opacity",0).attr("d",i=>{const o=Nt(r,n,i.id),a={x:o.x0,y:o.y0};return we(a,a,e)}).remove()},Ha=(t,e,n)=>{var i;const r=t.merge(e);if(r.transition().duration(n.duration).attr("d",o=>we(o,o.parent,n)).attr("fill","none").attr("stroke-width",o=>n.linkWidth(o)).attr("stroke",o=>n.linkColor(o)),n.linkLabel){const o=(i=r.node())==null?void 0:i.parentNode,u=B(o).selectAll("text.link-label").data(r.data(),(s,l)=>`link-label-${l}`);u.exit().remove(),u.enter().append("text").attr("class","link-label").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("fill",n.linkLabel.color||"#000000").attr("font-size",n.linkLabel.fontSize||12).attr("pointer-events","none").merge(u).attr("x",function(s){return n.isHorizontal?s.parent.y+(s.y-s.parent.y)-n.nodeWidth/4:s.parent.x+(s.x-s.parent.x)+n.nodeWidth/2}).attr("y",function(s){return n.isHorizontal?s.parent.x+(s.x-s.parent.x)+n.nodeHeight/2:s.parent.y+(s.y-s.parent.y)-n.nodeHeight/2}).html(function(s){const l={...s.parent,data:s.parent.data,settings:n},d={...s,data:s.data,settings:n};return n.linkLabel.render(l,d)})}},Fa=(t,e,n,r)=>{const i=t.enter().append("g").attr("class","node").attr("id",o=>o==null?void 0:o.id).attr("transform",o=>{const a=Nt(n,r,o.id);return wn(a.x0,a.y0,e)});return i.append("foreignObject").attr("width",e.nodeWidth).attr("height",e.nodeHeight),i},Da=(t,e,n,r)=>{const i=t.exit().transition().duration(e.duration).style("opacity",0).attr("transform",o=>{const a=Nt(r,n,o.id);return wn(a.x0,a.y0,e)}).remove();i.select("rect").style("fill-opacity",1e-6),i.select("circle").attr("r",1e-6),i.select("text").style("fill-opacity",1e-6)},qa=(t,e,n)=>{const r=t.merge(e);r.transition().duration(n.duration).attr("transform",i=>n.isHorizontal?"translate("+i.y+","+i.x+")":"translate("+i.x+","+i.y+")"),r.select("foreignObject").attr("width",n.nodeWidth).attr("height",n.nodeHeight).style("overflow","visible").on("click",(i,o)=>n.onNodeClick({...o,settings:n})).on("mouseenter",(i,o)=>n.onNodeMouseEnter({...o,settings:n})).on("mouseleave",(i,o)=>n.onNodeMouseLeave({...o,settings:n})).html(i=>n.renderNode({...i,settings:n}))},Ra=(t,e)=>{const{idKey:n,relationnalField:r,hasFlatData:i}=e;return i?J.stratify().id(o=>o[n]).parentId(o=>o[r])(t):J.hierarchy(t,o=>o[r])},Oa=t=>{const{areaHeight:e,areaWidth:n}=xn(t.htmlId);return t.mainAxisNodeSpacing==="auto"&&t.isHorizontal?J.tree().size([e-t.nodeHeight,n-t.nodeWidth]):t.mainAxisNodeSpacing==="auto"&&!t.isHorizontal?J.tree().size([n-t.nodeWidth,e-t.nodeHeight]):t.isHorizontal===!0?J.tree().nodeSize([t.nodeHeight*t.secondaryAxisNodeSpacing,t.nodeWidth]):J.tree().nodeSize([t.nodeWidth*t.secondaryAxisNodeSpacing,t.nodeHeight])},ve={create:Pa};typeof window<"u"&&(window.Treeviz=ve);function Pa(t){let n={...{data:[],htmlId:"",idKey:"id",relationnalField:"father",hasFlatData:!0,nodeWidth:160,nodeHeight:100,mainAxisNodeSpacing:300,renderNode:()=>"Node",linkColor:()=>"#ffcc80",linkWidth:()=>10,linkShape:"quadraticBeziers",isHorizontal:!0,hasPan:!1,hasZoom:!1,duration:600,onNodeClick:()=>{},onNodeMouseEnter:()=>{},onNodeMouseLeave:()=>{},marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,secondaryAxisNodeSpacing:1.25},...t},r=[];function i(s,l){const d=l.descendants(),c=l.descendants().slice(1),{mainAxisNodeSpacing:p}=n;p!=="auto"&&d.forEach(w=>{w.y=w.depth*n.nodeWidth*p}),d.forEach(w=>{const A=r.find(z=>z.id===w.id);w.x0=A?A.x0:w.x,w.y0=A?A.y0:w.y});const m=s.selectAll("g.node").data(d,w=>w[n.idKey]),_=Fa(m,n,d,r);qa(_,m,n),Da(m,n,d,r);const x=s.selectAll("path.link").data(c,w=>w.id),y=Ia(x,n,d,r);Ha(y,x,n),La(x,n,d,r),r=[...d]}function o(s,l){ct.add(n.duration,()=>{l&&(n={...n,...l});const d=Ra(s,n),p=Oa(n)(d);i(f,p)})}function a(s){const l=s?document.querySelector(`#${n.htmlId} svg g`):document.querySelector(`#${n.htmlId}`);if(l)for(;l.firstChild;)l.removeChild(l.firstChild);r=[]}const u={refresh:o,clean:a},f=Ca(n);return u}var $t=[{id:1,text_1:"Chaos",text_2:"Void",father:null,color:"#FF5722"},{id:2,text_1:"Tartarus",text_2:"Abyss",father:1,color:"#FFC107"},{id:3,text_1:"Gaia",text_2:"Earth",father:1,color:"#8BC34A"},{id:4,text_1:"Eros",text_2:"Desire",father:1,color:"#00BCD4"}],Va=[{id:1,text_1:"Chaos",text_2:" Void",father:null,color:"#2196F3"},{id:2,text_1:"Tartarus",text_2:"Abyss",father:1,color:"#F44336"},{id:3,text_1:"Gaia",text_2:"Earth",father:1,color:"#673AB7"},{id:4,text_1:"Eros",text_2:"Desire",father:1,color:"#009688"},{id:5,text_1:"Uranus",text_2:"Sky",father:3,color:"#4CAF50"},{id:6,text_1:"Ourea",text_2:"Mountains",father:3,color:"#FF9800"}],Wa=[{id:1,text_1:"Chaos",text_2:"Void",father:null,color:"#2196F3"},{id:2,text_1:"Tartarus",text_2:"Abyss",father:1,color:"#F44336"},{id:3,text_1:"Gaia",text_2:"Earth",father:1,color:"#673AB7"},{id:4,text_1:"Eros",text_2:"Desire",father:1,color:"#009688"},{id:5,text_1:"Uranus",text_2:"Sky",father:3,color:"#4CAF50"},{id:6,text_1:"Ourea",text_2:"Mountains",father:3,color:"#FF9800"},{id:7,text_1:"Hermes",text_2:" Sky",father:4,color:"#2196F3"},{id:8,text_1:"Aphrodite",text_2:"Love",father:4,color:"#8BC34A"},{id:3.3,text_1:"Love",text_2:"Peace",father:8,color:"#c72e99"},{id:4.1,text_1:"Hope",text_2:"Life",father:8,color:"#2eecc7"}],Xt=ve.create({data:$t,htmlId:"tree",idKey:"id",hasFlatData:!0,relationnalField:"father",nodeWidth:120,hasPan:!0,hasZoom:!0,nodeHeight:80,mainAxisNodeSpacing:2,isHorizontal:!1,renderNode:function(e){return"
"+e.data.text_1+"
is
"+e.data.text_2+"
"},linkWidth:t=>t.data.id*2,linkShape:"curve",linkColor:()=>"#B0BEC5",linkLabel:{render:(t,e)=>"is child",color:"#455A64",fontSize:11},onNodeClick:t=>{console.log(t.data)},onNodeMouseEnter:t=>{console.log(t.data)}});Xt.refresh($t);var bn=!0;const C=document.querySelector("#add"),M=document.querySelector("#remove"),be=document.querySelector("#doTasks");C==null||C.addEventListener("click",function(){console.log("addButton clicked"),bn?Xt.refresh(Va):Xt.refresh(Wa),bn=!1}),M==null||M.addEventListener("click",function(){console.log("removeButton clicked"),Xt.refresh($t)}),be==null||be.addEventListener("click",function(){C==null||C.click(),M==null||M.click(),C==null||C.click(),M==null||M.click(),M==null||M.click(),C==null||C.click(),M==null||M.click(),C==null||C.click(),C==null||C.click(),M==null||M.click(),M==null||M.click()});var Xa=ve.create({data:$t,htmlId:"tree-horizontal",idKey:"id",hasFlatData:!0,relationnalField:"father",nodeWidth:120,hasPan:!0,hasZoom:!0,nodeHeight:80,mainAxisNodeSpacing:2,isHorizontal:!0,renderNode:function(e){return"
"+e.data.text_1+"
is
"+e.data.text_2+"
"},linkWidth:t=>t.data.id*2,linkShape:"curve",linkColor:()=>"#B0BEC5",linkLabel:{render:(t,e)=>"is child",color:"#455A64",fontSize:11},onNodeClick:t=>{console.log(t.data)}});Xa.refresh($t)})(); + ${e.x+o/2} ${e.y+i} `},vn=(t,e,n)=>t>e?n:tt.enter().insert("path","g").attr("class","link").attr("d",i=>{const o=Nt(n,r,i.id),a={x:o.x0,y:o.y0};return we(a,a,e)}).attr("fill","none").attr("stroke-width",i=>e.linkWidth(i)).attr("stroke",i=>e.linkColor(i)),Fa=(t,e,n,r)=>{t.exit().transition().duration(e.duration).style("opacity",0).attr("d",i=>{const o=Nt(r,n,i.id),a={x:o.x0,y:o.y0};return we(a,a,e)}).remove()},bn=(t,e)=>{var n,r,i,o;if(t.nodeType===3){const a=(n=t.textContent)==null?void 0:n.trim();a&&e.append("tspan").text(a)}else if(t.nodeType===1)if(t.tagName==="TSPAN"||t.tagName==="tspan"){const a=e.append("tspan").text(((r=t.textContent)==null?void 0:r.trim())||"");t.getAttribute("dy")&&a.attr("dy",t.getAttribute("dy"))}else if(t.tagName==="STRONG"||t.tagName==="strong")e.append("tspan").attr("font-weight","bold").text(((i=t.textContent)==null?void 0:i.trim())||"");else if(t.tagName==="I"||t.tagName==="i")e.append("tspan").attr("font-style","italic").text(((o=t.textContent)==null?void 0:o.trim())||"");else for(let a=0;at==="quadraticBeziers"?e?0:20:0,Da=(t,e,n)=>{var i;const r=t.merge(e);if(r.transition().duration(n.duration).attr("d",o=>we(o,o.parent,n)).attr("fill","none").attr("stroke-width",o=>n.linkWidth(o)).attr("stroke",o=>n.linkColor(o)),n.linkLabel){const o=(i=r.node())==null?void 0:i.parentNode,u=D(o).selectAll("text.link-label").data(r.data(),(s,l)=>`link-label-${l}`);u.exit().remove(),u.enter().append("text").attr("class","link-label").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("fill",n.linkLabel.color||"#000000").attr("font-size",n.linkLabel.fontSize||12).attr("pointer-events","none").attr("opacity",0).merge(u).attr("x",function(s){const l=kn(n.linkShape||"quadraticBeziers",n.isHorizontal);return n.isHorizontal?s.parent.y+(s.y-s.parent.y)-n.nodeWidth/4+l:s.parent.x+(s.x-s.parent.x)+n.nodeWidth/2}).attr("y",function(s){const l=kn(n.linkShape||"quadraticBeziers",n.isHorizontal);return n.isHorizontal?s.parent.x+(s.x-s.parent.x)+n.nodeHeight/2:s.parent.y+(s.y-s.parent.y)-n.nodeHeight/2+l}).text("").each(function(s){D(this).selectAll("tspan").remove();const l={...s.parent,data:s.parent.data,settings:n},d={...s,data:s.data,settings:n},c=n.linkLabel.render(l,d),p=D(this);if(c.includes("")){const x=new DOMParser().parseFromString(`${c}`,"text/xml");bn(x.documentElement,p)}else p.text(c)}).transition().delay(n.duration).duration(300).attr("opacity",1)}},qa=(t,e,n,r)=>{const i=t.enter().append("g").attr("class","node").attr("id",o=>o==null?void 0:o.id).attr("transform",o=>{const a=Nt(n,r,o.id);return wn(a.x0,a.y0,e)});return i.append("foreignObject").attr("width",e.nodeWidth).attr("height",e.nodeHeight),i},Ra=(t,e,n,r)=>{const i=t.exit().transition().duration(e.duration).style("opacity",0).attr("transform",o=>{const a=Nt(r,n,o.id);return wn(a.x0,a.y0,e)}).remove();i.select("rect").style("fill-opacity",1e-6),i.select("circle").attr("r",1e-6),i.select("text").style("fill-opacity",1e-6)},Oa=(t,e,n)=>{const r=t.merge(e);r.transition().duration(n.duration).attr("transform",i=>n.isHorizontal?"translate("+i.y+","+i.x+")":"translate("+i.x+","+i.y+")"),r.select("foreignObject").attr("width",n.nodeWidth).attr("height",n.nodeHeight).style("overflow","visible").on("click",(i,o)=>n.onNodeClick({...o,settings:n})).on("mouseenter",(i,o)=>n.onNodeMouseEnter({...o,settings:n})).on("mouseleave",(i,o)=>n.onNodeMouseLeave({...o,settings:n})).html(i=>n.renderNode({...i,settings:n}))},Pa=(t,e)=>{const{idKey:n,relationnalField:r,hasFlatData:i}=e;return i?J.stratify().id(o=>o[n]).parentId(o=>o[r])(t):J.hierarchy(t,o=>o[r])},Va=t=>{const{areaHeight:e,areaWidth:n}=_n(t.htmlId);return t.mainAxisNodeSpacing==="auto"&&t.isHorizontal?J.tree().size([e-t.nodeHeight,n-t.nodeWidth]):t.mainAxisNodeSpacing==="auto"&&!t.isHorizontal?J.tree().size([n-t.nodeWidth,e-t.nodeHeight]):t.isHorizontal===!0?J.tree().nodeSize([t.nodeHeight*t.secondaryAxisNodeSpacing,t.nodeWidth]):J.tree().nodeSize([t.nodeWidth*t.secondaryAxisNodeSpacing,t.nodeHeight])},ve={create:Wa};typeof window<"u"&&(window.Treeviz=ve);function Wa(t){let n={...{data:[],htmlId:"",idKey:"id",relationnalField:"father",hasFlatData:!0,nodeWidth:160,nodeHeight:100,mainAxisNodeSpacing:300,renderNode:()=>"Node",linkColor:()=>"#ffcc80",linkWidth:()=>10,linkShape:"quadraticBeziers",isHorizontal:!0,hasPan:!1,hasZoom:!1,duration:600,onNodeClick:()=>{},onNodeMouseEnter:()=>{},onNodeMouseLeave:()=>{},marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,secondaryAxisNodeSpacing:1.25},...t},r=[];function i(s,l){const d=l.descendants(),c=l.descendants().slice(1),{mainAxisNodeSpacing:p}=n;p!=="auto"&&d.forEach(w=>{w.y=w.depth*n.nodeWidth*p}),d.forEach(w=>{const A=r.find(z=>z.id===w.id);w.x0=A?A.x0:w.x,w.y0=A?A.y0:w.y});const m=s.selectAll("g.node").data(d,w=>w[n.idKey]),x=qa(m,n,d,r);Oa(x,m,n),Ra(m,n,d,r);const _=s.selectAll("path.link").data(c,w=>w.id),y=Ha(_,n,d,r);Da(y,_,n),Fa(_,n,d,r),r=[...d]}function o(s,l){ct.add(n.duration,()=>{l&&(n={...n,...l});const d=Pa(s,n),p=Va(n)(d);i(f,p)})}function a(s){const l=s?document.querySelector(`#${n.htmlId} svg g`):document.querySelector(`#${n.htmlId}`);if(l)for(;l.firstChild;)l.removeChild(l.firstChild);r=[]}const u={refresh:o,clean:a},f=Ia(n);return u}var $t=[{id:1,text_1:"Chaos",text_2:"Void",father:null,color:"#FF5722"},{id:2,text_1:"Tartarus",text_2:"Abyss",father:1,color:"#FFC107"},{id:3,text_1:"Gaia",text_2:"Earth",father:1,color:"#8BC34A"},{id:4,text_1:"Eros",text_2:"Desire",father:1,color:"#00BCD4"}],Ba=[{id:1,text_1:"Chaos",text_2:" Void",father:null,color:"#2196F3"},{id:2,text_1:"Tartarus",text_2:"Abyss",father:1,color:"#F44336"},{id:3,text_1:"Gaia",text_2:"Earth",father:1,color:"#673AB7"},{id:4,text_1:"Eros",text_2:"Desire",father:1,color:"#009688"},{id:5,text_1:"Uranus",text_2:"Sky",father:3,color:"#4CAF50"},{id:6,text_1:"Ourea",text_2:"Mountains",father:3,color:"#FF9800"}],Xa=[{id:1,text_1:"Chaos",text_2:"Void",father:null,color:"#2196F3"},{id:2,text_1:"Tartarus",text_2:"Abyss",father:1,color:"#F44336"},{id:3,text_1:"Gaia",text_2:"Earth",father:1,color:"#673AB7"},{id:4,text_1:"Eros",text_2:"Desire",father:1,color:"#009688"},{id:5,text_1:"Uranus",text_2:"Sky",father:3,color:"#4CAF50"},{id:6,text_1:"Ourea",text_2:"Mountains",father:3,color:"#FF9800"},{id:7,text_1:"Hermes",text_2:" Sky",father:4,color:"#2196F3"},{id:8,text_1:"Aphrodite",text_2:"Love",father:4,color:"#8BC34A"},{id:3.3,text_1:"Love",text_2:"Peace",father:8,color:"#c72e99"},{id:4.1,text_1:"Hope",text_2:"Life",father:8,color:"#2eecc7"}],Bt=ve.create({data:$t,htmlId:"tree",idKey:"id",hasFlatData:!0,relationnalField:"father",nodeWidth:120,hasPan:!0,hasZoom:!0,nodeHeight:80,mainAxisNodeSpacing:2,isHorizontal:!1,renderNode:function(e){return"
"+e.data.text_1+"
is
"+e.data.text_2+"
"},linkWidth:t=>t.data.id*2,linkColor:()=>"#B0BEC5",linkLabel:{render:(t,e)=>"is child",color:"#455A64",fontSize:11},onNodeClick:t=>{console.log(t.data)},onNodeMouseEnter:t=>{console.log(t.data)}});Bt.refresh($t);var Nn=!0;const C=document.querySelector("#add"),M=document.querySelector("#remove"),be=document.querySelector("#doTasks");C==null||C.addEventListener("click",function(){console.log("addButton clicked"),Nn?Bt.refresh(Ba):Bt.refresh(Xa),Nn=!1}),M==null||M.addEventListener("click",function(){console.log("removeButton clicked"),Bt.refresh($t)}),be==null||be.addEventListener("click",function(){C==null||C.click(),M==null||M.click(),C==null||C.click(),M==null||M.click(),M==null||M.click(),C==null||C.click(),M==null||M.click(),C==null||C.click(),C==null||C.click(),M==null||M.click(),M==null||M.click()});var Ya=ve.create({data:$t,htmlId:"tree-horizontal",idKey:"id",hasFlatData:!0,relationnalField:"father",nodeWidth:120,hasPan:!0,hasZoom:!0,nodeHeight:80,mainAxisNodeSpacing:2,isHorizontal:!0,renderNode:function(e){return"
"+e.data.text_1+"
is
"+e.data.text_2+"
"},linkWidth:t=>t.data.id*2,linkShape:"curve",linkColor:()=>"#B0BEC5",linkLabel:{render:(t,e)=>"is child",color:"#455A64",fontSize:11},onNodeClick:t=>{console.log(t.data)}});Ya.refresh($t)})(); diff --git a/front/network.php b/front/network.php index 24d1b523..0d531233 100755 --- a/front/network.php +++ b/front/network.php @@ -611,6 +611,7 @@ function getChildren(node, list, path, visited = []) hasChildren: children.length > 0 || hiddenMacs.includes(node.devMac), relType: node.devParentRelType, devVlan: node.devVlan, + devSSID: node.devSSID, hiddenChildren: hiddenMacs.includes(node.devMac), qty: children.length, children: children @@ -890,12 +891,18 @@ function initTree(myHierarchy) linkLabel: { render: (parent, child) => { // Return text or HTML to display on the connection line - return child.data.devVlan ?? ""; + connectionLabel = (child?.data.devVlan ?? "") + "/" + (child?.data.devSSID ?? ""); + if(connectionLabel == "/") + { + connectionLabel = ""; + } + + return connectionLabel; // or with HTML: // return "reports to"; }, color: "#336c87ff", // Label text color (optional) - fontSize: 11 // Label font size in px (optional) + fontSize: nodeHeightPx - 5 // Label font size in px (optional) }, linkWidth: (nodeData) => 2, linkColor: (nodeData) => { diff --git a/front/plugins/newdev_template/config.json b/front/plugins/newdev_template/config.json index 6d3a98ff..10fb11cb 100755 --- a/front/plugins/newdev_template/config.json +++ b/front/plugins/newdev_template/config.json @@ -1516,6 +1516,9 @@ }, { "function": "devSSID", + "events": [ + "add_option" + ], "type": { "dataType": "string", "elements": [ @@ -1599,6 +1602,9 @@ }, { "function": "devVlan", + "events": [ + "add_option" + ], "type": { "dataType": "string", "elements": [