@hpcc-js/tree
Advanced tools
Comparing version 2.40.14 to 2.40.15
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/api"),require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/api","@hpcc-js/common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/tree"]={},t["@hpcc-js/api"],t["@hpcc-js/common"])}(this,(function(t,e,n){"use strict";var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function o(t,e){return t.parent===e.parent?1:2}function a(t,e){return t+e.x}function l(t,e){return Math.max(t,e.y)}function s(){var t=o,e=1,n=1,r=!1;function i(i){var o,s=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(a,0)/t.length}(n),e.y=function(t){return 1+t.reduce(l,0)}(n)):(e.x=o?s+=t(e,o):0,e.y=0,o=e)}));var u=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),p=u.x-t(u,c)/2,h=c.x+t(c,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-p)/(h-p)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function u(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function c(t,e){var n,r,i,o,a,l=new f(t),s=+t.value&&(l.value=t.value),u=[l];for(null==e&&(e=p);n=u.pop();)if(s&&(n.value=+n.data.value),(i=e(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new f(i[o])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(d)}function p(t){return t.children}function h(t){t.data=t.data.data}function d(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function f(t){this.data=t,this.depth=this.height=0,this.parent=null}"function"==typeof SuppressedError&&SuppressedError,f.prototype=c.prototype={constructor:f,count:function(){return this.eachAfter(u)},each:function(t){var e,n,r,i,o=this,a=[o];do{for(e=a.reverse(),a=[];o=e.pop();)if(t(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(t){for(var e,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n]);for(;i=a.pop();)t(i);return this},eachBefore:function(t){for(var e,n,r=this,i=[r];r=i.pop();)if(t(r),e=r.children)for(n=e.length-1;n>=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(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},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return c(this).eachBefore(h)}};var y=Array.prototype.slice;function g(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(y.call(t))).length,o=[];r<i;)e=t[r],n&&v(n,e)?++r:(n=b(o=m(o,e)),r=0);return n}function m(t,e){var n,r;if(_(e,t))return[e];for(n=0;n<t.length;++n)if(x(e,t[n])&&_(w(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(x(w(t[n],t[r]),e)&&x(w(t[n],e),t[r])&&x(w(t[r],e),t[n])&&_(S(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function x(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function v(t,e){var n=t.r-e.r+1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function _(t,e){for(var n=0;n<e.length;++n)if(!v(t,e[n]))return!1;return!0}function b(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return w(t[0],t[1]);case 3:return S(t[0],t[1],t[2])}var e}function w(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,l=e.r,s=o-n,u=a-r,c=l-i,p=Math.sqrt(s*s+u*u);return{x:(n+o+s/p*c)/2,y:(r+a+u/p*c)/2,r:(p+i+l)/2}}function S(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,l=e.y,s=e.r,u=n.x,c=n.y,p=n.r,h=r-a,d=r-u,f=i-l,y=i-c,g=s-o,m=p-o,x=r*r+i*i-o*o,v=x-a*a-l*l+s*s,_=x-u*u-c*c+p*p,b=d*f-h*y,w=(f*_-y*v)/(2*b)-r,S=(y*g-f*m)/b,k=(d*v-h*_)/(2*b)-i,T=(h*m-d*g)/b,z=S*S+T*T-1,M=2*(o+w*S+k*T),C=w*w+k*k-o*o,D=-(z?(M+Math.sqrt(M*M-4*z*C))/(2*z):C/M);return{x:r+w+S*D,y:i+k+T*D,r:D}}function k(t,e,n){var r,i,o,a,l=t.x-e.x,s=t.y-e.y,u=l*l+s*s;u?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(u+a-i)/(2*u),o=Math.sqrt(Math.max(0,a/u-r*r)),n.x=t.x-r*l-o*s,n.y=t.y-r*s+o*l):(r=(u+i-a)/(2*u),o=Math.sqrt(Math.max(0,i/u-r*r)),n.x=e.x+r*l-o*s,n.y=e.y+r*s+o*l)):(n.x=e.x+n.r,n.y=e.y)}function T(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function z(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function M(t){this._=t,this.next=null,this.previous=null}function C(t){if("function"!=typeof t)throw new Error;return t}function D(){return 0}function I(t){return function(){return t}}function A(t){return Math.sqrt(t.value)}function P(){var t=null,e=1,n=1,r=D;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(R(t)).eachAfter(E(r,.5)).eachBefore(L(1)):i.eachBefore(R(A)).eachAfter(E(D,1)).eachAfter(E(r,i.r/Math.min(e,n))).eachBefore(L(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(n=e)?null:C(n),i):t;var n},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:I(+t),i):r},i}function R(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function E(t,e){return function(n){if(r=n.children){var r,i,o,a=r.length,l=t(n)*e||0;if(l)for(i=0;i<a;++i)r[i].r+=l;if(o=function(t){if(!(i=t.length))return 0;var e,n,r,i,o,a,l,s,u,c,p;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;k(n,e,r=t[2]),e=new M(e),n=new M(n),r=new M(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(l=3;l<i;++l){k(e._,n._,r=t[l]),r=new M(r),s=n.next,u=e.previous,c=n._.r,p=e._.r;do{if(c<=p){if(T(s._,r._)){n=s,e.next=n,n.previous=e,--l;continue t}c+=s._.r,s=s.next}else{if(T(u._,r._)){(e=u).next=n,n.previous=e,--l;continue t}p+=u._.r,u=u.previous}}while(s!==u.next);for(r.previous=e,r.next=n,e.next=n.previous=n=r,o=z(e);(r=r.next)!==n;)(a=z(r))<o&&(e=r,o=a);n=e.next}for(e=[n._],r=n;(r=r.next)!==n;)e.push(r._);for(r=g(e),l=0;l<i;++l)(e=t[l]).x-=r.x,e.y-=r.y;return r.r}(r),l)for(i=0;i<a;++i)r[i].r-=l;n.r=o+l}}}function L(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function B(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 O(t,e,n,r,i){for(var o,a=t.children,l=-1,s=a.length,u=t.value&&(r-e)/t.value;++l<s;)(o=a[l]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*u}function F(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&O(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,l=r.y1-n;a<i&&(i=a=(i+a)/2),l<o&&(o=l=(o+l)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=l}}(e,o)),r&&i.eachBefore(B),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i}function q(t,e){return t.parent===e.parent?1:2}function V(t){var e=t.children;return e?e[0]:t.t}function N(t){var e=t.children;return e?e[e.length-1]:t.t}function W(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 j(t,e,n){return t.a.parent===e.parent?t.a:n}function H(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}function U(){var t=q,e=1,n=1,r=null;function i(i){var s=function(t){for(var e,n,r,i,o,a=new H(t,0),l=[a];e=l.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)l.push(n=e.children[i]=new H(r[i],i)),n.parent=e;return(a.parent=new H(null,0)).children=[a],a}(i);if(s.eachAfter(o),s.parent.m=-s.z,s.eachBefore(a),r)i.eachBefore(l);else{var u=i,c=i,p=i;i.eachBefore((function(t){t.x<u.x&&(u=t),t.x>c.x&&(c=t),t.depth>p.depth&&(p=t)}));var h=u===c?1:t(u,c)/2,d=h-u.x,f=e/(c.x+h+d),y=n/(p.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*f,t.y=t.depth*y}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,l=n,s=o.parent.children[0],u=o.m,c=a.m,p=l.m,h=s.m;l=N(l),o=V(o),l&&o;)s=V(s),(a=N(a)).a=e,(i=l.z+p-o.z-u+t(l._,o._))>0&&(W(j(l,e,r),e,i),u+=i,c+=i),p+=l.m,u+=o.m,h+=s.m,c+=a.m;l&&!N(a)&&(a.t=l,a.m+=p-c),o&&!V(s)&&(s.t=o,s.m+=u-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function G(t,e,n,r,i){for(var o,a=t.children,l=-1,s=a.length,u=t.value&&(i-n)/t.value;++l<s;)(o=a[l]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*u}H.prototype=Object.create(f.prototype);var Z=(1+Math.sqrt(5))/2;function K(t,e,n,r,i,o){for(var a,l,s,u,c,p,h,d,f,y,g,m=[],x=e.children,v=0,_=0,b=x.length,w=e.value;v<b;){s=i-n,u=o-r;do{c=x[_++].value}while(!c&&_<b);for(p=h=c,g=c*c*(y=Math.max(u/s,s/u)/(w*t)),f=Math.max(h/g,g/p);_<b;++_){if(c+=l=x[_].value,l<p&&(p=l),l>h&&(h=l),g=c*c*y,(d=Math.max(h/g,g/p))>f){c-=l;break}f=d}m.push(a={value:c,dice:s<u,children:x.slice(v,_)}),a.dice?O(a,n,r,i,w?r+=u*c/w:o):G(a,n,r,w?n+=s*c/w:i,o),w-=c,v=_}return m}var J=function t(e){function n(t,n,r,i,o){K(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(Z);function Q(t,e,n,r,i){var o,a,l=t.children,s=l.length,u=new Array(s+1);for(u[0]=a=o=0;o<s;++o)u[o+1]=a+=l[o].value;!function t(e,n,r,i,o,a,s){if(e>=n-1){var c=l[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=s)}var p=u[e],h=r/2+p,d=e+1,f=n-1;for(;d<f;){var y=d+f>>>1;u[y]<h?d=y+1:f=y}h-u[d-1]<u[d]-h&&e+1<d&&--d;var g=u[d]-p,m=r-g;if(a-i>s-o){var x=(i*m+a*g)/r;t(e,d,g,i,o,x,s),t(d,n,m,x,o,a,s)}else{var v=(o*m+s*g)/r;t(e,d,g,i,o,a,v),t(d,n,m,i,v,a,s)}}(0,s,t.value,e,n,r,i)}function X(t,e,n,r,i){(1&t.depth?G:O)(t,e,n,r,i)}var Y=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,l,s,u,c,p=-1,h=a.length,d=t.value;++p<h;){for(s=(l=a[p]).children,u=l.value=0,c=s.length;u<c;++u)l.value+=s[u].value;l.dice?O(l,n,r,i,r+=(o-r)*l.value/d):G(l,n,r,n+=(i-n)*l.value/d,o),d-=l.value}else t._squarify=a=K(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(Z);function $(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}$(".tree_CirclePacking circle{fill:#1f77b4;fill-opacity:.25;stroke:#1f77b4;stroke-width:1px}.tree_CirclePacking .leaf circle{fill:#ff7f0e;fill-opacity:1}.tree_CirclePacking .label{fill:#fff;text-anchor:middle}");var tt=function(t){function r(){var n=t.call(this)||this;return e.ITree.call(n),n}return i(r,t),r.prototype.enter=function(t,e){this.diameter=Math.min(this.width(),this.height()),this.pack=P().size([this.diameter-4,this.diameter-4]).padding(1.5),this.svg=e.append("g")},r.prototype.update=function(t,e){var r=this;this.diameter=Math.min(this.width(),this.height()),this.pack.size([this.diameter-4,this.diameter-4]).padding(1.5),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this.svg.selectAll("circle").remove(),this.svg.selectAll("text").remove();var i=c(this.data()).sum((function(t){return t&&t.size?t.size:1})).sort((function(t,e){return t.value<e.value?-1:t.value>e.value?1:0}));this._focus=i,this.pack(i),this.circle=this.svg.selectAll("circle").data(i.descendants()).enter().append("circle").attr("class",(function(t){return t.parent?t.children?"node":"node leaf":"node root"})).style("fill",(function(t){return t.color=r.paletteDepthLevel_exists()&&t.depth>r.paletteDepthLevel()?n.rgb(t.parent.color)[r.paletteDepthVariant()](1):r._palette(t.data.label),t.color})).on("click",(function(t){r.click(t.data,null,null)})).on("dblclick",(function(t){this._focus!==t&&r.zoom(t),n.d3Event().stopPropagation()})),this.circle.append("title").text((function(t){return t.data.label})),this.svg.selectAll("text").data(i.descendants()).enter().append("text").attr("class","label").style("fill-opacity",(function(t){return t.parent===i?1:0})).style("display",(function(t){return t.parent===i?null:"none"})).text((function(t){return t.data.label+(r.showSize()&&void 0!==t.data.size?" "+t.data.size:"")})),this._node=this.svg.selectAll("circle,text"),this.zoomTo([i.x,i.y,2*i.r])},r.prototype.zoom=function(t){this._focus=t;var e=this;function r(t){return t===e._focus&&!t.children||t.parent===e._focus}this.svg.transition().duration(n.d3Event().altKey?7500:750).tween("zoom",(function(){var t=n.interpolateZoom(e.view,[e._focus.x,e._focus.y,2*e._focus.r]);return function(n){e.zoomTo(t(n))}})).selectAll("text").filter((function(t){return r(t)||"inline"===this.style.display})).style("fill-opacity",(function(t){return r(t)?1:0})).on("start",(function(t){r(t)&&(this.style.display="inline")})).on("end",(function(t){r(t)||(this.style.display="none")}))},r.prototype.zoomTo=function(t){var e=this.diameter/t[2];this.view=t,this._node.attr("transform",(function(n){return"translate("+(n.x-t[0])*e+","+(n.y-t[1])*e+")"})),this.circle.attr("r",(function(t){return t.r*e}))},r}(n.SVGWidget);tt.prototype._class+=" tree_CirclePacking",tt.prototype.implements(e.ITree.prototype),tt.prototype.publish("showSize",!0,"boolean","Show size along with label"),tt.prototype.publish("paletteDepthLevel",null,"number","If not null then beyond this depth number the child node colors are based on parent",null,{optional:!0}),tt.prototype.publish("paletteDepthVariant","brighter","set","Determines paletteDepthLevel decendant color shade variant",["brighter","darker"],{disable:function(t){return t.paletteDepthLevel_exists()}}),tt.prototype.publish("paletteID","default","set","Color palette for this widget",tt.prototype._palette.switch(),{tags:["Basic","Shared"]}),tt.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});$(".tree_Dendrogram .node circle{fill:#dcf1ff;stroke:#1f77b4;stroke-width:1px}.tree_Dendrogram .node.selected circle{stroke:red}.tree_Dendrogram .node.over circle{stroke:orange}.tree_Dendrogram .node.selected.over circle{stroke:red}.tree_Dendrogram .node.selected text{fill:red}.tree_Dendrogram .node.over text{fill:orange}.tree_Dendrogram .node.selected.over text{fill:red}.tree_Dendrogram .node text{font-size:14px}.tree_Dendrogram .link{fill:none;stroke:#656565;stroke-width:1px}");var et=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.owner=function(t){return arguments.length?(this._owner=t,this):this._owner},e.prototype.valid=function(){return!!this.column()},e}(n.PropertyExt);et.prototype._class+=" tree_Dendrogram.DendrogramColumn",et.prototype.publish("column",null,"set","Field",(function(){return this._owner?this._owner.columns():[]}),{optional:!0});var nt=function(t){function r(){var r=t.call(this)||this;return e.ITree.call(r),n.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r._d3LayoutCluster=s(),r._d3LayoutTree=U(),r}return i(r,t),r.prototype.dendrogramData=function(){return 0===this.data().length?[]:this.mappings().filter((function(t){return t.valid()})).length?function t(e){return{label:e.key,children:e.values.filter((function(t){return!(t instanceof Array)})).map((function(e){return t(e)})),origRows:e.values}}({key:"root",values:this._db.rollupView(this.mappings().map((function(t){return t.column()}))).entries()}):this.data()},r.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._renderElement.attr("opacity",0).transition().duration(500).attr("opacity",1),this._selection.widgetElement(this._renderElement)},r.prototype.update=function(e,r){t.prototype.update.call(this,e,r);var i=this,o="vertical"===this.orientation();this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._d3Layout=this.dendrogram()?this._d3LayoutCluster:this._d3LayoutTree,this.radial()?(this._d3Layout.size([360,2*this.separation()]),this._d3Layout.separation((function(t,e){return(t.parent===e.parent?1:2)/t.depth}))):(this._d3Layout.nodeSize([14,this.separation()]),this._d3Layout.separation((function(t,e){return t.parent===e.parent?1:2})));var a=c(this.dendrogramData());this._d3Layout(a);var l=a.descendants(),s=a.descendants().slice(1);function u(t){return o?function(t){return"M"+t.parent.x+","+t.parent.y+"C"+t.parent.x+","+(t.parent.y+t.y)/2+" "+t.x+","+(t.parent.y+t.y)/2+" "+t.x+","+t.y}(t):function(t){return"M"+t.y+","+t.x+"C"+(t.y+t.parent.y)/2+","+t.x+" "+(t.y+t.parent.y)/2+","+t.parent.x+" "+t.parent.y+","+t.parent.x}(t)}function p(t,e){var n=(t-90)/180*Math.PI,r=e;return[r*Math.cos(n),r*Math.sin(n)]}function h(t){return"M"+p(t.x,t.y)+"C"+p(t.x,(t.y+t.parent.y)/2)+" "+p(t.parent.x,(t.y+t.parent.y)/2)+" "+p(t.parent.x,t.parent.y)}var d=this._renderCount?500:0,f=this._renderElement.selectAll(".link").data(s);f.enter().append("path").attr("class","link").attr("d",this.radial()?h:u),f.transition().duration(d).attr("d",this.radial()?h:u),f.exit().remove();var y=this.circleRadius()+2;function g(t){return i.radial()?"rotate("+(t.x-90)+")translate("+t.y+")":"horizontal"===i.orientation()?"translate("+t.y+","+t.x+")":"translate("+t.x+","+t.y+")"}var m=this._renderElement.selectAll(".node").data(l);m.transition().duration(d).attr("transform",g);var x=m.enter().append("g").attr("class","node").attr("transform",g).call(this._selection.enter.bind(this._selection)).on("click",(function(t){for(var e=t;e.children;)e=e.children[0];t.depth>0&&(e.origRows?i.click(i.rowToObj(e.origRows[0]),i.mappings()[t.depth-1].column(),!0):i.click(e.data,i.mappings()[t.depth-1].column(),!0))})).on("dblclick",(function(t){for(var e=t;e.children;)e=e.children[0];t.depth>0&&(e.origRows?i.dblclick(i.rowToObj(e.origRows[0]),i.mappings()[t.depth-1].column(),!0):i.dblclick(e.data,i.mappings()[t.depth-1].column(),!0))})).each((function(){var t=n.select(this);t.append("circle"),t.append("text")}));x.merge(m).select("circle").attr("r",this.circleRadius()).style("fill",(function(t){return i._palette(t.data.label)})).append("title").text((function(t){return t.data.label})),x.merge(m).select("text").attr("dx",(function(t){return i.radial()?t.children?t.x<180?-y:y:t.x<180?y:-y:o?t.children?y:-y:t.children?-y:y})).attr("dy","0.25em").style("text-anchor",(function(t){return i.radial()?t.children?t.x<180?"end":"start":t.x<180?"start":"end":o?t.children?"start":"end":t.children?"end":"start"})).attr("transform",(function(t){return i.radial()?t.x<180?null:"rotate(180)":o?"rotate(-66)":null})).text((function(t){return t.data.label})),m.exit().remove(),this._renderCount||i.zoomToFit()},r}(n.SVGZoomWidget);nt.prototype._class+=" tree_Dendrogram",nt.prototype.implements(e.ITree.prototype),nt.prototype.mixin(n.Utility.SimpleSelectionMixin),nt.prototype.Column=et,nt.prototype.publish("paletteID","default","set","Color palette for this widget",nt.prototype._palette.switch(),{tags:["Basic","Shared"]}),nt.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),nt.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:et}),nt.prototype.publish("circleRadius",4.5,"number","Text offset from circle"),nt.prototype.publish("separation",240,"number","Leaf Separation"),nt.prototype.publish("dendrogram",!0,"boolean","Dendrogram"),nt.prototype.publish("radial",!1,"boolean","Radial"),nt.prototype.publish("orientation","horizontal","set","Orientation",["horizontal","vertical"],{tags:["Private"],disable:function(t){return t.radial()}});var rt=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.flattenData=function(t){var e=this,n=c(t),r=[];return this.omitRoot()?n.children&&n.children.forEach(i):i(n),r;function i(t){var n=t.data.markers&&t.data.markers.length?t.data.markers.length:"";r.push({label:t.data.label,depth:t.depth-(e.omitRoot()?1:0),content:t.data.content,isFolder:!!t.data.children,iconClass:t.data.iconClass,color:t.data.color,bold:t.data.bold,weightValue:n,markers:t.data.markers,selected:t.data.selected}),t.children&&t.children.forEach(i)}},e.prototype.iconClass=function(t){return"error"===t.label?"fa fa-exclamation":t.isFolder?this.folderIconOpen():this.textFileIcon()},e.prototype.calcRequiredWidth=function(){var t=this,e=this.flattenData(this.data()),r=0,i=this.rowItemPadding(),o=this.iconSize()+2*i,a=n.Platform.getScrollbarWidth();return e.forEach((function(e){var l=e.depth*o+2*i,s=n.Utility.textSize(e.label,t.fontFamily(),t.fontSize(),!!e.bold).width+2*i+o+l+a;r<s&&(r=s)})),r},e.prototype.rowClick=function(t,e){},e.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),n.style("width","100%").style("height","100%")},e.prototype.update=function(e,r){var i=this;t.prototype.update.call(this,e,r),this._palette=this._palette.switch(this.paletteID()),r.style("overflow-y",this.verticalScroll()?"scroll":null);var o=this.flattenData(this.data()),a=n.max(o,(function(t){return Number(t.weightValue)}));o.forEach((function(t){t.weightValue?t.weightColor=i._palette(t.weightValue,1,a):t.weightColor="transparent"}));var l=this,s=this.rowItemPadding(),u=this.iconSize()+s,c=Math.max(l.iconSize(),l.fontSize()),p=r.selectAll(".directory-row").data(o),h=this.fontFamily(),d=this.fontSize(),f=n.max(o,(function(t){return i.textSize(t.weightValue,h,d).width})),y="".concat(s,"px ").concat(s,"px ").concat(s/2,"px ").concat(s,"px");p.enter().append("div").attr("class",(function(t){return"directory-row directory-row-depth-".concat(t.depth)})).style("display","flex").style("cursor","pointer").each((function(t){var e=n.select(this),i=t.color?t.color:l.fontColor(),o=t.weightColor?t.weightColor:"transparent",a=n.Palette.textColor(o),p=e.append("div").attr("class","row-weight").style("padding",y).style("color",a).style("box-shadow","inset 0 0 100px ".concat(o)).style("font-weight",t.bold?"bold":"normal").style("font-family",h).style("font-size",d+"px").text(t.weightValue).attr("title",t.weightValue).style("overflow","hidden").style("width",f+2*s+"px").style("text-overflow","ellipsis").style("text-align","right").style("line-height",c+"px");e.append("div").attr("class","row-depth").style("width",l.depthSize()*t.depth+"px").style("opacity",1).style("line-height",c+"px");var g=e.append("div").attr("class","row-icon "+(t.iconClass?t.iconClass:l.iconClass(t))).style("width",u+"px").style("height",c+"px").style("color",i).style("background-color",t.selected?l.selectionBackgroundColor():"transparent").style("font-size",l.iconSize()+"px").style("padding",y).style("line-height",c+"px"),m=e.append("div").attr("class","row-label").style("padding",y).style("color",i).style("background-color",t.selected?l.selectionBackgroundColor():"transparent").style("font-weight",t.bold?"bold":"normal").style("font-family",l.fontFamily()).style("font-size",l.fontSize()+"px").text(t.label).attr("title",t.label).style("flex",1).style("overflow","hidden").style("text-overflow","ellipsis").style("line-height",c+"px");e.on("mouseenter",(function(){m.style("font-weight","bold")})).on("mouseleave",(function(){m.style("font-weight",t.bold?"bold":"normal")})),p.on("mouseenter",(function(){l.weight_mouseenter(t)})).on("mouseleave",(function(){l.weight_mouseleave(t)})),t.isFolder?e.on("click",(function(t){var r=this.nextSibling,i=e.classed("folder-closed");for(i?(e.classed("folder-closed",!1),e.classed("folder-open",!0),g.attr("class","row-icon "+l.folderIconOpen())):(e.classed("folder-closed",!0),e.classed("folder-open",!1),g.attr("class","row-icon "+l.folderIconClosed()));null!==r;){n.select(r).datum().depth>t.depth?(r.style.display=i?"flex":"none",r=r.nextSibling):r=null}})):e.on("click",(function(){r.selectAll(".row-label").style("background-color","transparent"),r.selectAll(".row-icon").style("background-color","transparent"),g.style("background-color",l.selectionBackgroundColor()),m.style("background-color",l.selectionBackgroundColor());var e=t.label.split(".").pop().toLowerCase();l.rowClick("json"===e?JSON.stringify(JSON.parse(t.content),null,4):t.content,t.markers)}))})).merge(p).style("background-color",l.backgroundColor()),p.exit().remove()},e.prototype.weight_mouseenter=function(t){},e.prototype.weight_mouseleave=function(t){},e}(n.HTMLWidget);rt.prototype._class+=" tree_DirectoryTree",rt.prototype._palette=n.Palette.rainbow("Blues"),rt.prototype.publish("depthSize",14,"number","Width of indentation per file or folder depth (pixels)"),rt.prototype.publish("paletteID","Blues","set","Color palette for the weight backgrounds",rt.prototype._palette.switch(),{tags:["Basic"]}),rt.prototype.publish("omitRoot",!1,"boolean","If true, root node will not display"),rt.prototype.publish("rowItemPadding",2,"number","Top, bottom, left and right row item padding"),rt.prototype.publish("selectionBackgroundColor","#CCC","html-color","Background color of selected directory rows"),rt.prototype.publish("backgroundColor","#FFF","html-color","Directory item background color"),rt.prototype.publish("fontColor","#000","html-color","Directory item font color"),rt.prototype.publish("fontFamily","Arial","string","Directory item font family"),rt.prototype.publish("fontSize",12,"number","Directory item font size (pixels)"),rt.prototype.publish("iconSize",12,"number","Directory folder and file icon size (pixels)"),rt.prototype.publish("folderIconOpen","fa fa-folder-open","string","Open folder icon class"),rt.prototype.publish("folderIconClosed","fa fa-folder","string","Closed folder icon class"),rt.prototype.publish("textFileIcon","fa fa-file-text-o","string","Text file icon class"),rt.prototype.publish("verticalScroll",!0,"boolean","If true, vertical scroll bar will be shown");$(".tree_Indented .node rect{fill:#fff;stroke:#3182bd;stroke-width:1px;cursor:pointer}.tree_Indented .node text{font:10px sans-serif;pointer-events:none}.tree_Indented path.link{fill:none;stroke:#9ecae1;stroke-width:1.5px}");var it=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.owner=function(t){return arguments.length?(this._owner=t,this):this._owner},e.prototype.valid=function(){return!!this.column()},e}(n.PropertyExt);it.prototype._class+=" tree_Dendrogram.IndentedColumn",it.prototype.publish("column",null,"set","Field",(function(){return this._owner?this._owner.columns():[]}),{optional:!0});var ot=function(t){function r(){var r=t.call(this)||this;return r._collapsed={},e.ITree.call(r),n.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r._d3Tree=U(),r}return i(r,t),r.prototype.xmlToData=function(t,e){return void 0===e&&(e=""),DOMParser?at((new DOMParser).parseFromString(t,"text/xml"),e).children[0]:[]},r.prototype.xml=function(t){return arguments.length?(this._xml=t,this.data(this.xmlToData(this._xml)),this):this._xml},r.prototype.IndentedData=function(){if(0===this.data().length)return[];if(this.xmlColumn_exists()){var t=this.columns().indexOf(this.xmlColumn()),e={label:this.xmlColumn(),children:this.data().map((function(e,n){return this.xmlToData(e[t],"["+n+"]")}),this)};return 1===e.children.length?e.children[0]:e}return this.mappings().filter((function(t){return t.valid()})).length?function t(e){if(e.values instanceof Array){var n=e.values.filter((function(t){return!(t instanceof Array)})).map((function(e){return t(e)})),r={label:e.key};return n.length?r.children=n:r.size=22,r}return{label:e.key,size:e.values.aggregate,origRows:e.values}}({key:"root",values:this._db.rollupView(this.mappings().map((function(t){return t.column()}))).entries()}):this.data()},r.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._svgLinks=this._renderElement.append("g"),this._svgNodes=this._renderElement.append("g"),this._selection.widgetElement(this._svgNodes)},r.prototype.update=function(e,r){var i=this;t.prototype.update.call(this,e,r);var o=this;this._d3Tree.nodeSize([0,this.barHeight()]);var a=this._db.dataChecksum();function l(t){return(t.parent?l(t.parent)+".":"")+t.data.label}this._prevDataChecksum!==a&&(this._treeData=this.IndentedData(),this._prevDataChecksum=a);var s=c(this.data()).sum((function(t){return t.size||50})).each((function(t){i._collapsed[l(t)]&&delete t.children})),u=this._d3Tree(s).descendants(),p=this._d3Tree(s).descendants().slice(1),h=0;s.eachBefore((function(t){t.x=h*o.barHeight(),++h}));var d=this.barHeight()-4,f=this._renderCount?500:0,y=this._svgLinks.selectAll(".link").data(p,(function(t){return l(t)}));function g(t){return"M"+t.parent.y+","+t.parent.x+"V"+t.x+", H"+t.y}y.enter().append("path").attr("class","link").attr("d",g),y.transition().duration(f).attr("d",g),y.exit().remove();var m=this._svgNodes.selectAll(".node").data(u,(function(t){return l(t)}));m.transition().duration(f).attr("transform",(function(t){return"translate("+t.y+","+t.x+")"}));var x=m.enter().append("g").attr("class","node").attr("transform",(function(t){return"translate("+t.y+","+t.x+")"})).call(this._selection.enter.bind(this._selection)).each((function(){var t=n.select(this);t.append("rect").attr("height",d).attr("width",d).on("click",(function(t){o._collapsed[l(t)]?delete o._collapsed[l(t)]:t.children&&(o._collapsed[l(t)]=!0),o.lazyRender()})),t.append("text")})).style("opacity",0);x.transition().style("opacity",1),x.merge(m).select("rect").attr("x",-d/2).attr("y",-d/2).style("fill",(function(t){return o._collapsed[l(t)]?"#3182bd":t.children?"#c6dbef":"#fd8d3c"})),x.merge(m).select("text").attr("dx",d/2+4+"px").attr("dy","0.33em").text((function(t){return t.data.label})),m.exit().transition().style("opacity",0).remove(),this._renderCount||o.zoomToFit()},r}(n.SVGZoomWidget);function at(t,e){void 0===e&&(e="");var n={id:e,label:"",attributes:{},children:[]};if(n.label=t.nodeName,1===t.nodeType){if(t.attributes.length>0)for(var r=0;r<t.attributes.length;r++){var i=t.attributes.item(r);n.attributes[i.nodeName]=i.nodeValue}}else 3===t.nodeType&&(n.label=t.nodeValue);if(t.hasChildNodes())for(var o=0;o<t.childNodes.length;o++){var a=at(t.childNodes.item(o),e+"["+n.children.length+"]");n.children.push(a)}return n}ot.prototype._class+=" tree_Indented",ot.prototype.implements(e.ITree.prototype),ot.prototype.mixin(n.Utility.SimpleSelectionMixin),ot.prototype.Column=it,ot.prototype.publish("xmlColumn",null,"set","Field",(function(){return this.columns()}),{optional:!0}),ot.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:it,disable:function(t){return t.xmlColumn_exists()}}),ot.prototype.publish("barHeight",16,"number","Bar height");var lt=Math.PI,st=2*lt,ut=1e-6,ct=st-ut;function pt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ht(){return new pt}function dt(t){return function(){return t}}pt.prototype=ht.prototype={constructor:pt,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,l=n-t,s=r-e,u=o-t,c=a-e,p=u*u+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(p>ut)if(Math.abs(c*l-s*u)>ut&&i){var h=n-o,d=r-a,f=l*l+s*s,y=h*h+d*d,g=Math.sqrt(f),m=Math.sqrt(p),x=i*Math.tan((lt-Math.acos((f+p-y)/(2*g*m)))/2),v=x/m,_=x/g;Math.abs(v-1)>ut&&(this._+="L"+(t+v*u)+","+(e+v*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>u*d)+","+(this._x1=t+_*l)+","+(this._y1=e+_*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),l=n*Math.sin(r),s=t+a,u=e+l,c=1^o,p=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+u:(Math.abs(this._x1-s)>ut||Math.abs(this._y1-u)>ut)&&(this._+="L"+s+","+u),n&&(p<0&&(p=p%st+st),p>ct?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-l)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=u):p>ut&&(this._+="A"+n+","+n+",0,"+ +(p>=lt)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var ft=Math.abs,yt=Math.atan2,gt=Math.cos,mt=Math.max,xt=Math.min,vt=Math.sin,_t=Math.sqrt,bt=1e-12,wt=Math.PI,St=wt/2,kt=2*wt;function Tt(t){return t>=1?St:t<=-1?-St:Math.asin(t)}function zt(t){return t.innerRadius}function Mt(t){return t.outerRadius}function Ct(t){return t.startAngle}function Dt(t){return t.endAngle}function It(t){return t&&t.padAngle}function At(t,e,n,r,i,o,a){var l=t-n,s=e-r,u=(a?o:-o)/_t(l*l+s*s),c=u*s,p=-u*l,h=t+c,d=e+p,f=n+c,y=r+p,g=(h+f)/2,m=(d+y)/2,x=f-h,v=y-d,_=x*x+v*v,b=i-o,w=h*y-f*d,S=(v<0?-1:1)*_t(mt(0,b*b*_-w*w)),k=(w*v-x*S)/_,T=(-w*x-v*S)/_,z=(w*v+x*S)/_,M=(-w*x+v*S)/_,C=k-g,D=T-m,I=z-g,A=M-m;return C*C+D*D>I*I+A*A&&(k=z,T=M),{cx:k,cy:T,x01:-c,y01:-p,x11:k*(i/b-1),y11:T*(i/b-1)}}function Pt(){var t=zt,e=Mt,n=dt(0),r=null,i=Ct,o=Dt,a=It,l=null;function s(){var s,u,c,p=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-St,f=o.apply(this,arguments)-St,y=ft(f-d),g=f>d;if(l||(l=s=ht()),h<p&&(u=h,h=p,p=u),h>bt)if(y>kt-bt)l.moveTo(h*gt(d),h*vt(d)),l.arc(0,0,h,d,f,!g),p>bt&&(l.moveTo(p*gt(f),p*vt(f)),l.arc(0,0,p,f,d,g));else{var m,x,v=d,_=f,b=d,w=f,S=y,k=y,T=a.apply(this,arguments)/2,z=T>bt&&(r?+r.apply(this,arguments):_t(p*p+h*h)),M=xt(ft(h-p)/2,+n.apply(this,arguments)),C=M,D=M;if(z>bt){var I=Tt(z/p*vt(T)),A=Tt(z/h*vt(T));(S-=2*I)>bt?(b+=I*=g?1:-1,w-=I):(S=0,b=w=(d+f)/2),(k-=2*A)>bt?(v+=A*=g?1:-1,_-=A):(k=0,v=_=(d+f)/2)}var P=h*gt(v),R=h*vt(v),E=p*gt(w),L=p*vt(w);if(M>bt){var B,O=h*gt(_),F=h*vt(_),q=p*gt(b),V=p*vt(b);if(y<wt&&(B=function(t,e,n,r,i,o,a,l){var s=n-t,u=r-e,c=a-i,p=l-o,h=p*s-c*u;if(!(h*h<bt))return[t+(h=(c*(e-o)-p*(t-i))/h)*s,e+h*u]}(P,R,q,V,O,F,E,L))){var N=P-B[0],W=R-B[1],j=O-B[0],H=F-B[1],U=1/vt(((c=(N*j+W*H)/(_t(N*N+W*W)*_t(j*j+H*H)))>1?0:c<-1?wt:Math.acos(c))/2),G=_t(B[0]*B[0]+B[1]*B[1]);C=xt(M,(p-G)/(U-1)),D=xt(M,(h-G)/(U+1))}}k>bt?D>bt?(m=At(q,V,P,R,h,D,g),x=At(O,F,E,L,h,D,g),l.moveTo(m.cx+m.x01,m.cy+m.y01),D<M?l.arc(m.cx,m.cy,D,yt(m.y01,m.x01),yt(x.y01,x.x01),!g):(l.arc(m.cx,m.cy,D,yt(m.y01,m.x01),yt(m.y11,m.x11),!g),l.arc(0,0,h,yt(m.cy+m.y11,m.cx+m.x11),yt(x.cy+x.y11,x.cx+x.x11),!g),l.arc(x.cx,x.cy,D,yt(x.y11,x.x11),yt(x.y01,x.x01),!g))):(l.moveTo(P,R),l.arc(0,0,h,v,_,!g)):l.moveTo(P,R),p>bt&&S>bt?C>bt?(m=At(E,L,O,F,p,-C,g),x=At(P,R,q,V,p,-C,g),l.lineTo(m.cx+m.x01,m.cy+m.y01),C<M?l.arc(m.cx,m.cy,C,yt(m.y01,m.x01),yt(x.y01,x.x01),!g):(l.arc(m.cx,m.cy,C,yt(m.y01,m.x01),yt(m.y11,m.x11),!g),l.arc(0,0,p,yt(m.cy+m.y11,m.cx+m.x11),yt(x.cy+x.y11,x.cx+x.x11),g),l.arc(x.cx,x.cy,C,yt(x.y11,x.x11),yt(x.y01,x.x01),!g))):l.arc(0,0,p,w,b,g):l.lineTo(E,L)}else l.moveTo(0,0);if(l.closePath(),s)return l=null,s+""||null}return s.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-wt/2;return[gt(r)*n,vt(r)*n]},s.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:dt(+e),s):t},s.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:dt(+t),s):e},s.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:dt(+t),s):n},s.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:dt(+t),s):r},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:dt(+t),s):i},s.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:dt(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:dt(+t),s):a},s.context=function(t){return arguments.length?(l=null==t?null:t,s):l},s}$(".tree_Sunburst path{stroke:#fff;stroke-width:.5px;fill-rule:evenodd}");var Rt=function(t){function r(){var n=t.call(this)||this;return e.ITree.call(n),n}return i(r,t),r.prototype.data=function(t){var e=n.SVGWidget.prototype.data.apply(this,arguments);return arguments.length&&(this._resetRoot=!0),e},r.prototype.enter=function(t,e){var r=this;this.radius=Math.min(this.width(),this.height())/2,this._xScale=n.scaleLinear().range([0,2*Math.PI]),this._yScale=n.scaleSqrt().range([0,this.radius]),this.partition=F(),this.arc=Pt().startAngle((function(t){return Math.max(0,Math.min(2*Math.PI,r._xScale(t.x0)))})).endAngle((function(t){return Math.max(0,Math.min(2*Math.PI,r._xScale(t.x1)))})).innerRadius((function(t){return Math.max(0,r._yScale(t.y0))})).outerRadius((function(t){return Math.max(0,r._yScale(t.y1))})),this.svg=e.append("g")},r.prototype.update=function(t,e){var r=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this.radius=Math.min(this.width(),this.height())/2,this._yScale.range([0,this.radius]);var i=c(this.data()).sum((function(t){return void 0!==t.size?t.size:1})),o=this.svg.selectAll("path").data(this.partition(i).descendants(),(function(t,e){return void 0!==t.data.label?t.data.label:e}));o.enter().append("path").on("click",(function(t){r.click(t.data,null,null)})).on("dblclick",(function(t){var e=n.d3Event();e&&e.stopPropagation(),r.zoomTo(t)})).each((function(){n.select(this).append("title")})).merge(o).attr("d",this.arc).style("fill",(function(t){return t.data.__viz_fill?t.data.__viz_fill:r._palette(t.data.label)})).style("stroke",(function(t){return t.value>16?"white":"none"})).select("title").text((function(t){return t.data.label})),o.exit().remove(),this._resetRoot&&(this._resetRoot=!1,this.zoomTo(i))},r.prototype.zoomTo=function(t){var e=this;this.svg.transition().duration(750).tween("scale",(function(){var r=n.interpolate(e._xScale.domain(),[t.x0,t.x1]),i=n.interpolate(e._yScale.domain(),[t.y0,1]),o=n.interpolate(e._yScale.range(),[t.y0?20:0,e.radius]);return function(t){e._xScale.domain(r(t)),e._yScale.domain(i(t)).range(o(t))}})).selectAll("path").attrTween("d",(function(t){return function(){return e.arc(t)}}))},r}(n.SVGWidget);Rt.prototype._class+=" tree_SunburstPartition",Rt.prototype.implements(e.ITree.prototype),Rt.prototype.publish("paletteID","default","set","Color palette for this widget",Rt.prototype._palette.switch(),{tags:["Basic","Shared"]}),Rt.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});$(".tree_Treemap *{box-sizing:border-box}.tree_Treemap .node{border:1px solid #333;overflow:hidden;position:absolute;text-overflow:ellipsis}.tree_Treemap .node.selected{border-color:red}.tree_Treemap .node.over{border-color:orange}.tree_Treemap .node.selected.over{border-color:red}.tree_Treemap .node>span.treemap-parent-label{display:inline-block;font-weight:700;margin:4px 4px 0}.tree_Treemap .node>span.treemap-parent-value{font-style:italic;font-weight:400;margin:4px 0 0}.tree_Treemap .node>span.treemap-singleton-label{display:block;font-weight:400;margin:4px 0 0 4px}.tree_Treemap .node>span.treemap-singleton-value{display:block;font-style:italic;margin:0 0 0 4px}");var Et=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.owner=function(t){return arguments.length?(this._owner=t,this):this._owner},e.prototype.valid=function(){return!!this.column()},e}(n.PropertyExt);Et.prototype._class+=" tree_Dendrogram.TreemapColumn",Et.prototype.publish("column",null,"set","Field",(function(){return this._owner?this._owner.columns():[]}),{optional:!0});var Lt=function(t){function r(){var r=t.call(this)||this;return e.ITree.call(r),n.Utility.SimpleSelectionMixin.call(r,!0),r}return i(r,t),r.prototype.getTilingMethod=function(){switch(this.tilingMethod()){case"treemapBinary":return Q;case"treemapDice":return O;case"treemapSlice":return G;case"treemapSliceDice":return X;case"treemapResquarify":return Y;default:return J}},r.prototype.treemapData=function(){return this.mappings().filter((function(t){return t.valid()})).length?function t(e){if(e.values instanceof Array){var n=e.values.filter((function(t){return!(t instanceof Array)})).map((function(e){return t(e)})),r={label:e.key};return n.length?r.children=n:r.size=22,r}return{label:e.key,size:e.values.aggregate,origRows:e.values}}({key:"root",values:this._db.aggregateView(this.mappings().map((function(t){return t.column()})),this.aggrType(),this.aggrColumn()).entries()}):this.data()},r.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._d3Treemap=function(){var t=J,e=!1,n=1,r=1,i=[0],o=D,a=D,l=D,s=D,u=D;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(p),i=[0],e&&t.eachBefore(B),t}function p(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,p=e.x1-n,h=e.y1-n;p<r&&(r=p=(r+p)/2),h<c&&(c=h=(c+h)/2),e.x0=r,e.y0=c,e.x1=p,e.y1=h,e.children&&(n=i[e.depth+1]=o(e)/2,r+=u(e)-n,c+=a(e)-n,(p-=l(e)-n)<r&&(r=p=(r+p)/2),(h-=s(e)-n)<c&&(c=h=(c+h)/2),t(e,r,c,p,h))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=C(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:I(+t),c):o},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:I(+t),c):a},c.paddingRight=function(t){return arguments.length?(l="function"==typeof t?t:I(+t),c):l},c.paddingBottom=function(t){return arguments.length?(s="function"==typeof t?t:I(+t),c):s},c.paddingLeft=function(t){return arguments.length?(u="function"==typeof t?t:I(+t),c):u},c}(),this._elementDIV=n.append("div"),this._selection.widgetElement(this._elementDIV)},r.prototype.update=function(e,r){t.prototype.update.call(this,e,r);var i=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));var o=c(this.treemapData()).sum(this.nodeWeight);this._d3Treemap.size([this.width(),this.height()]).paddingInner(this.paddingInner()).paddingOuter(this.paddingOuter()).paddingTop(this.paddingTop()),-1!==["treemapSquarify","treemapResquarify"].indexOf(this.tilingMethod())?this._d3Treemap.tile(this.getTilingMethod().ratio(this.squarifyRatio())):this._d3Treemap.tile(this.getTilingMethod()),this._d3Treemap(o),this._elementDIV.style("font-size",this.fontSize_exists()?this.fontSize()+"px":null).style("line-height",this.fontSize_exists()?this.fontSize()+2+"px":null);var a=this._elementDIV.selectAll(".node").data(o.descendants());a.enter().append("div").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",(function(t){if(t){var e="";i.mappings().forEach((function(t){t.column()&&(e=t.column())})),t.origRows?i.click(i.rowToObj(t.origRows[0]),e,i._selection.selected(this)):i.click(t.data,e,i._selection.selected(this))}})).on("dblclick",(function(t){if(t){var e="";i.mappings().forEach((function(t){t.column()&&(e=t.column())})),t.origRows?i.dblclick(i.rowToObj(t.origRows[0]),e,i._selection.selected(this)):i.dblclick(t.data,e,i._selection.selected(this))}})).merge(a).style("left",(function(t){return t.x0+Math.max(0,t.x1-t.x0)/2+"px"})).style("top",(function(t){return t.y0+Math.max(0,t.y1-t.y0)/2+"px"})).style("width",(function(){return"0px"})).style("height",(function(){return"0px"})).style("font-size",(function(t){return(t.children?i.parentFontSize():i.leafFontSize())+"px"})).style("line-height",(function(t){return(t.children?i.parentFontSize():i.leafFontSize())+"px"})).attr("title",(function(t){if(t.children&&!i.enableParentTooltips())return null;var e=t.data.label+" ("+t.value+")";for(;t.parent&&t.parent.parent;)e=t.parent.data.label+" -> "+e,t=t.parent;return e})).html((function(t){return i.showRoot()||0!==t.depth?t.children?i.enableParentLabels()?i.parentWeightHTML(t):null:i.leafWeightHTML(t):null})).style("background",(function(t){if(!i.showRoot()&&0===t.depth)return this.style.color="transparent","transparent";var e,r=i.brighterLeafNodes()?"brighter":"darker";return i.usePaletteOnParentNodes()?e=t.children?i._palette(t.data.label):n.rgb(i._palette(t.parent.data.label))[r](1):(e=t.depth>i.depthColorLimit()?n.rgb(t.parent.color)[r](1):i._palette(t.data.label),t.color=e),this.style.color=n.Palette.textColor(e),e})).transition().duration(this.transitionDuration()).style("pointer-events",(function(t){return i.showRoot()||0!==t.depth?"all":"none"})).style("opacity",(function(t){return t.children?1:null})).style("left",(function(t){return t.x0+"px"})).style("top",(function(t){return t.y0+"px"})).style("width",(function(t){return Math.max(0,t.x1-t.x0)+"px"})).style("height",(function(t){return Math.max(0,t.y1-t.y0)+"px"})).each((function(t){0===t.depth&&(this.style.color=i.showRoot()?"":"transparent",this.style.borderColor=i.showRoot()?"":"transparent")})),a.exit().transition().duration(this.transitionDuration()).style("opacity",0).remove()},r.prototype.exit=function(e,n){t.prototype.exit.call(this,e,n)},r.prototype.nodeWeight=function(t){return t.size||1},r.prototype.parentWeightHTML=function(t){return this.showParentWeight()?'<span class="treemap-parent-label">'.concat(t.data.label,'</span><span class="treemap-parent-value">').concat(t.value).concat(this.weightSuffix(),"</span>"):'<span class="treemap-parent-label">'.concat(t.data.label,"</span>")},r.prototype.leafWeightHTML=function(t){return this.showLeafWeight()?'<span class="treemap-leaf-label">'.concat(t.data.label,'</span><span class="treemap-leaf-value">').concat(t.value).concat(this.weightSuffix(),"</span>"):'<span class="treemap-leaf-label">'.concat(t.data.label,"</span>")},r}(n.HTMLWidget);Lt.prototype._class+=" tree_Treemap",Lt.prototype.implements(e.ITree.prototype),Lt.prototype.mixin(n.Utility.SimpleSelectionMixin),Lt.prototype.Column=Et,Lt.prototype.publish("paletteID","default","set","Color palette for this widget",Lt.prototype._palette.switch(),{tags:["Basic","Shared"]}),Lt.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Lt.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:Et}),Lt.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0}),Lt.prototype.publish("aggrColumn",null,"set","Aggregation Field",(function(){return this.columns()}),{optional:!0,disable:function(t){return!t.aggrType()}}),Lt.prototype.publish("fontSize",null,"number","Font Size",null,{optional:!0}),Lt.prototype.publish("paddingInner",18.6,"number","Pixel spacing between each sibling node"),Lt.prototype.publish("paddingOuter",30,"number","Pixel padding of parent nodes"),Lt.prototype.publish("paddingTop",41.4,"number","Additional top pixel padding of parent nodes"),Lt.prototype.publish("showRoot",!1,"boolean","Show root element"),Lt.prototype.publish("parentFontSize",18,"number","Parent font-size"),Lt.prototype.publish("leafFontSize",16,"number","Leaf font-size"),Lt.prototype.publish("usePaletteOnParentNodes",!1,"boolean","Assign a color from the palette to every parent node"),Lt.prototype.publish("depthColorLimit",1,"number","Assign a color from the palette to node with depth lower than this value",null,{optional:!0,disable:function(t){return t.usePaletteOnParentNodes()}}),Lt.prototype.publish("squarifyRatio",1,"number","Specifies the desired aspect ratio of the generated rectangles (must be >= 1)",null,{optional:!0,disable:function(t){return-1===["treemapSquarify","treemapResquarify"].indexOf(t.tilingMethod())}}),Lt.prototype.publish("showParentWeight",!0,"boolean","Show weight of parent nodes"),Lt.prototype.publish("showLeafWeight",!0,"boolean","Show weight of leaf nodes"),Lt.prototype.publish("weightSuffix","","string","Weight suffix (ex: 'ms')"),Lt.prototype.publish("brighterLeafNodes",!1,"boolean","Brighter/darker leaf node color (false = darker)"),Lt.prototype.publish("enableParentLabels",!0,"boolean","Enable parent labels"),Lt.prototype.publish("enableParentTooltips",!0,"boolean","Enable parent tooltips"),Lt.prototype.publish("transitionDuration",250,"number","Transition Duration"),Lt.prototype.publish("tilingMethod","treemapSquarify","set","Transition Duration",["treemapBinary","treemapDice","treemapResquarify","treemapSlice","treemapSliceDice","treemapSquarify"]),t.BUILD_VERSION="2.104.35",t.CirclePacking=tt,t.Dendrogram=nt,t.DendrogramColumn=et,t.DirectoryTree=rt,t.Indented=ot,t.IndentedColumn=it,t.PKG_NAME="@hpcc-js/tree",t.PKG_VERSION="2.40.14",t.SunburstPartition=Rt,t.Treemap=Lt,t.TreemapColumn=Et,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/api"),require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/api","@hpcc-js/common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/tree"]={},t["@hpcc-js/api"],t["@hpcc-js/common"])}(this,(function(t,e,n){"use strict";var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function o(t,e){return t.parent===e.parent?1:2}function a(t,e){return t+e.x}function l(t,e){return Math.max(t,e.y)}function s(){var t=o,e=1,n=1,r=!1;function i(i){var o,s=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(a,0)/t.length}(n),e.y=function(t){return 1+t.reduce(l,0)}(n)):(e.x=o?s+=t(e,o):0,e.y=0,o=e)}));var u=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),p=u.x-t(u,c)/2,h=c.x+t(c,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-p)/(h-p)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function u(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function c(t,e){var n,r,i,o,a,l=new f(t),s=+t.value&&(l.value=t.value),u=[l];for(null==e&&(e=p);n=u.pop();)if(s&&(n.value=+n.data.value),(i=e(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new f(i[o])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(d)}function p(t){return t.children}function h(t){t.data=t.data.data}function d(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function f(t){this.data=t,this.depth=this.height=0,this.parent=null}"function"==typeof SuppressedError&&SuppressedError,f.prototype=c.prototype={constructor:f,count:function(){return this.eachAfter(u)},each:function(t){var e,n,r,i,o=this,a=[o];do{for(e=a.reverse(),a=[];o=e.pop();)if(t(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(t){for(var e,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n]);for(;i=a.pop();)t(i);return this},eachBefore:function(t){for(var e,n,r=this,i=[r];r=i.pop();)if(t(r),e=r.children)for(n=e.length-1;n>=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(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},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return c(this).eachBefore(h)}};var y=Array.prototype.slice;function g(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(y.call(t))).length,o=[];r<i;)e=t[r],n&&v(n,e)?++r:(n=b(o=m(o,e)),r=0);return n}function m(t,e){var n,r;if(_(e,t))return[e];for(n=0;n<t.length;++n)if(x(e,t[n])&&_(w(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(x(w(t[n],t[r]),e)&&x(w(t[n],e),t[r])&&x(w(t[r],e),t[n])&&_(S(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function x(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function v(t,e){var n=t.r-e.r+1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function _(t,e){for(var n=0;n<e.length;++n)if(!v(t,e[n]))return!1;return!0}function b(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return w(t[0],t[1]);case 3:return S(t[0],t[1],t[2])}var e}function w(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,l=e.r,s=o-n,u=a-r,c=l-i,p=Math.sqrt(s*s+u*u);return{x:(n+o+s/p*c)/2,y:(r+a+u/p*c)/2,r:(p+i+l)/2}}function S(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,l=e.y,s=e.r,u=n.x,c=n.y,p=n.r,h=r-a,d=r-u,f=i-l,y=i-c,g=s-o,m=p-o,x=r*r+i*i-o*o,v=x-a*a-l*l+s*s,_=x-u*u-c*c+p*p,b=d*f-h*y,w=(f*_-y*v)/(2*b)-r,S=(y*g-f*m)/b,k=(d*v-h*_)/(2*b)-i,T=(h*m-d*g)/b,z=S*S+T*T-1,M=2*(o+w*S+k*T),C=w*w+k*k-o*o,D=-(z?(M+Math.sqrt(M*M-4*z*C))/(2*z):C/M);return{x:r+w+S*D,y:i+k+T*D,r:D}}function k(t,e,n){var r,i,o,a,l=t.x-e.x,s=t.y-e.y,u=l*l+s*s;u?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(u+a-i)/(2*u),o=Math.sqrt(Math.max(0,a/u-r*r)),n.x=t.x-r*l-o*s,n.y=t.y-r*s+o*l):(r=(u+i-a)/(2*u),o=Math.sqrt(Math.max(0,i/u-r*r)),n.x=e.x+r*l-o*s,n.y=e.y+r*s+o*l)):(n.x=e.x+n.r,n.y=e.y)}function T(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function z(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function M(t){this._=t,this.next=null,this.previous=null}function C(t){if("function"!=typeof t)throw new Error;return t}function D(){return 0}function I(t){return function(){return t}}function A(t){return Math.sqrt(t.value)}function P(){var t=null,e=1,n=1,r=D;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(R(t)).eachAfter(E(r,.5)).eachBefore(L(1)):i.eachBefore(R(A)).eachAfter(E(D,1)).eachAfter(E(r,i.r/Math.min(e,n))).eachBefore(L(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(n=e)?null:C(n),i):t;var n},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:I(+t),i):r},i}function R(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function E(t,e){return function(n){if(r=n.children){var r,i,o,a=r.length,l=t(n)*e||0;if(l)for(i=0;i<a;++i)r[i].r+=l;if(o=function(t){if(!(i=t.length))return 0;var e,n,r,i,o,a,l,s,u,c,p;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;k(n,e,r=t[2]),e=new M(e),n=new M(n),r=new M(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(l=3;l<i;++l){k(e._,n._,r=t[l]),r=new M(r),s=n.next,u=e.previous,c=n._.r,p=e._.r;do{if(c<=p){if(T(s._,r._)){n=s,e.next=n,n.previous=e,--l;continue t}c+=s._.r,s=s.next}else{if(T(u._,r._)){(e=u).next=n,n.previous=e,--l;continue t}p+=u._.r,u=u.previous}}while(s!==u.next);for(r.previous=e,r.next=n,e.next=n.previous=n=r,o=z(e);(r=r.next)!==n;)(a=z(r))<o&&(e=r,o=a);n=e.next}for(e=[n._],r=n;(r=r.next)!==n;)e.push(r._);for(r=g(e),l=0;l<i;++l)(e=t[l]).x-=r.x,e.y-=r.y;return r.r}(r),l)for(i=0;i<a;++i)r[i].r-=l;n.r=o+l}}}function L(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function B(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 O(t,e,n,r,i){for(var o,a=t.children,l=-1,s=a.length,u=t.value&&(r-e)/t.value;++l<s;)(o=a[l]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*u}function F(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&O(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,l=r.y1-n;a<i&&(i=a=(i+a)/2),l<o&&(o=l=(o+l)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=l}}(e,o)),r&&i.eachBefore(B),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i}function q(t,e){return t.parent===e.parent?1:2}function V(t){var e=t.children;return e?e[0]:t.t}function N(t){var e=t.children;return e?e[e.length-1]:t.t}function W(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 j(t,e,n){return t.a.parent===e.parent?t.a:n}function H(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}function U(){var t=q,e=1,n=1,r=null;function i(i){var s=function(t){for(var e,n,r,i,o,a=new H(t,0),l=[a];e=l.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)l.push(n=e.children[i]=new H(r[i],i)),n.parent=e;return(a.parent=new H(null,0)).children=[a],a}(i);if(s.eachAfter(o),s.parent.m=-s.z,s.eachBefore(a),r)i.eachBefore(l);else{var u=i,c=i,p=i;i.eachBefore((function(t){t.x<u.x&&(u=t),t.x>c.x&&(c=t),t.depth>p.depth&&(p=t)}));var h=u===c?1:t(u,c)/2,d=h-u.x,f=e/(c.x+h+d),y=n/(p.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*f,t.y=t.depth*y}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,l=n,s=o.parent.children[0],u=o.m,c=a.m,p=l.m,h=s.m;l=N(l),o=V(o),l&&o;)s=V(s),(a=N(a)).a=e,(i=l.z+p-o.z-u+t(l._,o._))>0&&(W(j(l,e,r),e,i),u+=i,c+=i),p+=l.m,u+=o.m,h+=s.m,c+=a.m;l&&!N(a)&&(a.t=l,a.m+=p-c),o&&!V(s)&&(s.t=o,s.m+=u-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function G(t,e,n,r,i){for(var o,a=t.children,l=-1,s=a.length,u=t.value&&(i-n)/t.value;++l<s;)(o=a[l]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*u}H.prototype=Object.create(f.prototype);var Z=(1+Math.sqrt(5))/2;function K(t,e,n,r,i,o){for(var a,l,s,u,c,p,h,d,f,y,g,m=[],x=e.children,v=0,_=0,b=x.length,w=e.value;v<b;){s=i-n,u=o-r;do{c=x[_++].value}while(!c&&_<b);for(p=h=c,g=c*c*(y=Math.max(u/s,s/u)/(w*t)),f=Math.max(h/g,g/p);_<b;++_){if(c+=l=x[_].value,l<p&&(p=l),l>h&&(h=l),g=c*c*y,(d=Math.max(h/g,g/p))>f){c-=l;break}f=d}m.push(a={value:c,dice:s<u,children:x.slice(v,_)}),a.dice?O(a,n,r,i,w?r+=u*c/w:o):G(a,n,r,w?n+=s*c/w:i,o),w-=c,v=_}return m}var J=function t(e){function n(t,n,r,i,o){K(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(Z);function Q(t,e,n,r,i){var o,a,l=t.children,s=l.length,u=new Array(s+1);for(u[0]=a=o=0;o<s;++o)u[o+1]=a+=l[o].value;!function t(e,n,r,i,o,a,s){if(e>=n-1){var c=l[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=s)}var p=u[e],h=r/2+p,d=e+1,f=n-1;for(;d<f;){var y=d+f>>>1;u[y]<h?d=y+1:f=y}h-u[d-1]<u[d]-h&&e+1<d&&--d;var g=u[d]-p,m=r-g;if(a-i>s-o){var x=(i*m+a*g)/r;t(e,d,g,i,o,x,s),t(d,n,m,x,o,a,s)}else{var v=(o*m+s*g)/r;t(e,d,g,i,o,a,v),t(d,n,m,i,v,a,s)}}(0,s,t.value,e,n,r,i)}function X(t,e,n,r,i){(1&t.depth?G:O)(t,e,n,r,i)}var Y=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,l,s,u,c,p=-1,h=a.length,d=t.value;++p<h;){for(s=(l=a[p]).children,u=l.value=0,c=s.length;u<c;++u)l.value+=s[u].value;l.dice?O(l,n,r,i,r+=(o-r)*l.value/d):G(l,n,r,n+=(i-n)*l.value/d,o),d-=l.value}else t._squarify=a=K(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(Z);function $(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}$(".tree_CirclePacking circle{fill:#1f77b4;fill-opacity:.25;stroke:#1f77b4;stroke-width:1px}.tree_CirclePacking .leaf circle{fill:#ff7f0e;fill-opacity:1}.tree_CirclePacking .label{fill:#fff;text-anchor:middle}");var tt=function(t){function r(){var n=t.call(this)||this;return e.ITree.call(n),n}return i(r,t),r.prototype.enter=function(t,e){this.diameter=Math.min(this.width(),this.height()),this.pack=P().size([this.diameter-4,this.diameter-4]).padding(1.5),this.svg=e.append("g")},r.prototype.update=function(t,e){var r=this;this.diameter=Math.min(this.width(),this.height()),this.pack.size([this.diameter-4,this.diameter-4]).padding(1.5),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this.svg.selectAll("circle").remove(),this.svg.selectAll("text").remove();var i=c(this.data()).sum((function(t){return t&&t.size?t.size:1})).sort((function(t,e){return t.value<e.value?-1:t.value>e.value?1:0}));this._focus=i,this.pack(i),this.circle=this.svg.selectAll("circle").data(i.descendants()).enter().append("circle").attr("class",(function(t){return t.parent?t.children?"node":"node leaf":"node root"})).style("fill",(function(t){return t.color=r.paletteDepthLevel_exists()&&t.depth>r.paletteDepthLevel()?n.rgb(t.parent.color)[r.paletteDepthVariant()](1):r._palette(t.data.label),t.color})).on("click",(function(t){r.click(t.data,null,null)})).on("dblclick",(function(t){this._focus!==t&&r.zoom(t),n.d3Event().stopPropagation()})),this.circle.append("title").text((function(t){return t.data.label})),this.svg.selectAll("text").data(i.descendants()).enter().append("text").attr("class","label").style("fill-opacity",(function(t){return t.parent===i?1:0})).style("display",(function(t){return t.parent===i?null:"none"})).text((function(t){return t.data.label+(r.showSize()&&void 0!==t.data.size?" "+t.data.size:"")})),this._node=this.svg.selectAll("circle,text"),this.zoomTo([i.x,i.y,2*i.r])},r.prototype.zoom=function(t){this._focus=t;var e=this;function r(t){return t===e._focus&&!t.children||t.parent===e._focus}this.svg.transition().duration(n.d3Event().altKey?7500:750).tween("zoom",(function(){var t=n.interpolateZoom(e.view,[e._focus.x,e._focus.y,2*e._focus.r]);return function(n){e.zoomTo(t(n))}})).selectAll("text").filter((function(t){return r(t)||"inline"===this.style.display})).style("fill-opacity",(function(t){return r(t)?1:0})).on("start",(function(t){r(t)&&(this.style.display="inline")})).on("end",(function(t){r(t)||(this.style.display="none")}))},r.prototype.zoomTo=function(t){var e=this.diameter/t[2];this.view=t,this._node.attr("transform",(function(n){return"translate("+(n.x-t[0])*e+","+(n.y-t[1])*e+")"})),this.circle.attr("r",(function(t){return t.r*e}))},r}(n.SVGWidget);tt.prototype._class+=" tree_CirclePacking",tt.prototype.implements(e.ITree.prototype),tt.prototype.publish("showSize",!0,"boolean","Show size along with label"),tt.prototype.publish("paletteDepthLevel",null,"number","If not null then beyond this depth number the child node colors are based on parent",null,{optional:!0}),tt.prototype.publish("paletteDepthVariant","brighter","set","Determines paletteDepthLevel decendant color shade variant",["brighter","darker"],{disable:function(t){return t.paletteDepthLevel_exists()}}),tt.prototype.publish("paletteID","default","set","Color palette for this widget",tt.prototype._palette.switch(),{tags:["Basic","Shared"]}),tt.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});$(".tree_Dendrogram .node circle{fill:#dcf1ff;stroke:#1f77b4;stroke-width:1px}.tree_Dendrogram .node.selected circle{stroke:red}.tree_Dendrogram .node.over circle{stroke:orange}.tree_Dendrogram .node.selected.over circle{stroke:red}.tree_Dendrogram .node.selected text{fill:red}.tree_Dendrogram .node.over text{fill:orange}.tree_Dendrogram .node.selected.over text{fill:red}.tree_Dendrogram .node text{font-size:14px}.tree_Dendrogram .link{fill:none;stroke:#656565;stroke-width:1px}");var et=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.owner=function(t){return arguments.length?(this._owner=t,this):this._owner},e.prototype.valid=function(){return!!this.column()},e}(n.PropertyExt);et.prototype._class+=" tree_Dendrogram.DendrogramColumn",et.prototype.publish("column",null,"set","Field",(function(){return this._owner?this._owner.columns():[]}),{optional:!0});var nt=function(t){function r(){var r=t.call(this)||this;return e.ITree.call(r),n.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r._d3LayoutCluster=s(),r._d3LayoutTree=U(),r}return i(r,t),r.prototype.dendrogramData=function(){return 0===this.data().length?[]:this.mappings().filter((function(t){return t.valid()})).length?function t(e){return{label:e.key,children:e.values.filter((function(t){return!(t instanceof Array)})).map((function(e){return t(e)})),origRows:e.values}}({key:"root",values:this._db.rollupView(this.mappings().map((function(t){return t.column()}))).entries()}):this.data()},r.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._renderElement.attr("opacity",0).transition().duration(500).attr("opacity",1),this._selection.widgetElement(this._renderElement)},r.prototype.update=function(e,r){t.prototype.update.call(this,e,r);var i=this,o="vertical"===this.orientation();this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._d3Layout=this.dendrogram()?this._d3LayoutCluster:this._d3LayoutTree,this.radial()?(this._d3Layout.size([360,2*this.separation()]),this._d3Layout.separation((function(t,e){return(t.parent===e.parent?1:2)/t.depth}))):(this._d3Layout.nodeSize([14,this.separation()]),this._d3Layout.separation((function(t,e){return t.parent===e.parent?1:2})));var a=c(this.dendrogramData());this._d3Layout(a);var l=a.descendants(),s=a.descendants().slice(1);function u(t){return o?function(t){return"M"+t.parent.x+","+t.parent.y+"C"+t.parent.x+","+(t.parent.y+t.y)/2+" "+t.x+","+(t.parent.y+t.y)/2+" "+t.x+","+t.y}(t):function(t){return"M"+t.y+","+t.x+"C"+(t.y+t.parent.y)/2+","+t.x+" "+(t.y+t.parent.y)/2+","+t.parent.x+" "+t.parent.y+","+t.parent.x}(t)}function p(t,e){var n=(t-90)/180*Math.PI,r=e;return[r*Math.cos(n),r*Math.sin(n)]}function h(t){return"M"+p(t.x,t.y)+"C"+p(t.x,(t.y+t.parent.y)/2)+" "+p(t.parent.x,(t.y+t.parent.y)/2)+" "+p(t.parent.x,t.parent.y)}var d=this._renderCount?500:0,f=this._renderElement.selectAll(".link").data(s);f.enter().append("path").attr("class","link").attr("d",this.radial()?h:u),f.transition().duration(d).attr("d",this.radial()?h:u),f.exit().remove();var y=this.circleRadius()+2;function g(t){return i.radial()?"rotate("+(t.x-90)+")translate("+t.y+")":"horizontal"===i.orientation()?"translate("+t.y+","+t.x+")":"translate("+t.x+","+t.y+")"}var m=this._renderElement.selectAll(".node").data(l);m.transition().duration(d).attr("transform",g);var x=m.enter().append("g").attr("class","node").attr("transform",g).call(this._selection.enter.bind(this._selection)).on("click",(function(t){for(var e=t;e.children;)e=e.children[0];t.depth>0&&(e.origRows?i.click(i.rowToObj(e.origRows[0]),i.mappings()[t.depth-1].column(),!0):i.click(e.data,i.mappings()[t.depth-1].column(),!0))})).on("dblclick",(function(t){for(var e=t;e.children;)e=e.children[0];t.depth>0&&(e.origRows?i.dblclick(i.rowToObj(e.origRows[0]),i.mappings()[t.depth-1].column(),!0):i.dblclick(e.data,i.mappings()[t.depth-1].column(),!0))})).each((function(){var t=n.select(this);t.append("circle"),t.append("text")}));x.merge(m).select("circle").attr("r",this.circleRadius()).style("fill",(function(t){return i._palette(t.data.label)})).append("title").text((function(t){return t.data.label})),x.merge(m).select("text").attr("dx",(function(t){return i.radial()?t.children?t.x<180?-y:y:t.x<180?y:-y:o?t.children?y:-y:t.children?-y:y})).attr("dy","0.25em").style("text-anchor",(function(t){return i.radial()?t.children?t.x<180?"end":"start":t.x<180?"start":"end":o?t.children?"start":"end":t.children?"end":"start"})).attr("transform",(function(t){return i.radial()?t.x<180?null:"rotate(180)":o?"rotate(-66)":null})).text((function(t){return t.data.label})),m.exit().remove(),this._renderCount||i.zoomToFit()},r}(n.SVGZoomWidget);nt.prototype._class+=" tree_Dendrogram",nt.prototype.implements(e.ITree.prototype),nt.prototype.mixin(n.Utility.SimpleSelectionMixin),nt.prototype.Column=et,nt.prototype.publish("paletteID","default","set","Color palette for this widget",nt.prototype._palette.switch(),{tags:["Basic","Shared"]}),nt.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),nt.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:et}),nt.prototype.publish("circleRadius",4.5,"number","Text offset from circle"),nt.prototype.publish("separation",240,"number","Leaf Separation"),nt.prototype.publish("dendrogram",!0,"boolean","Dendrogram"),nt.prototype.publish("radial",!1,"boolean","Radial"),nt.prototype.publish("orientation","horizontal","set","Orientation",["horizontal","vertical"],{tags:["Private"],disable:function(t){return t.radial()}});var rt=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.flattenData=function(t){var e=this,n=c(t),r=[];return this.omitRoot()?n.children&&n.children.forEach(i):i(n),r;function i(t){var n=t.data.markers&&t.data.markers.length?t.data.markers.length:"";r.push({label:t.data.label,depth:t.depth-(e.omitRoot()?1:0),content:t.data.content,isFolder:!!t.data.children,iconClass:t.data.iconClass,color:t.data.color,bold:t.data.bold,weightValue:n,markers:t.data.markers,selected:t.data.selected}),t.children&&t.children.forEach(i)}},e.prototype.iconClass=function(t){return"error"===t.label?"fa fa-exclamation":t.isFolder?this.folderIconOpen():this.textFileIcon()},e.prototype.calcRequiredWidth=function(){var t=this,e=this.flattenData(this.data()),r=0,i=this.rowItemPadding(),o=this.iconSize()+2*i,a=n.Platform.getScrollbarWidth();return e.forEach((function(e){var l=e.depth*o+2*i,s=n.Utility.textSize(e.label,t.fontFamily(),t.fontSize(),!!e.bold).width+2*i+o+l+a;r<s&&(r=s)})),r},e.prototype.rowClick=function(t,e){},e.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),n.style("width","100%").style("height","100%")},e.prototype.update=function(e,r){var i=this;t.prototype.update.call(this,e,r),this._palette=this._palette.switch(this.paletteID()),r.style("overflow-y",this.verticalScroll()?"scroll":null);var o=this.flattenData(this.data()),a=n.max(o,(function(t){return Number(t.weightValue)}));o.forEach((function(t){t.weightValue?t.weightColor=i._palette(t.weightValue,1,a):t.weightColor="transparent"}));var l=this,s=this.rowItemPadding(),u=this.iconSize()+s,c=Math.max(l.iconSize(),l.fontSize()),p=r.selectAll(".directory-row").data(o),h=this.fontFamily(),d=this.fontSize(),f=n.max(o,(function(t){return i.textSize(t.weightValue,h,d).width})),y="".concat(s,"px ").concat(s,"px ").concat(s/2,"px ").concat(s,"px");p.enter().append("div").attr("class",(function(t){return"directory-row directory-row-depth-".concat(t.depth)})).style("display","flex").style("cursor","pointer").each((function(t){var e=n.select(this),i=t.color?t.color:l.fontColor(),o=t.weightColor?t.weightColor:"transparent",a=n.Palette.textColor(o),p=e.append("div").attr("class","row-weight").style("padding",y).style("color",a).style("box-shadow","inset 0 0 100px ".concat(o)).style("font-weight",t.bold?"bold":"normal").style("font-family",h).style("font-size",d+"px").text(t.weightValue).attr("title",t.weightValue).style("overflow","hidden").style("width",f+2*s+"px").style("text-overflow","ellipsis").style("text-align","right").style("line-height",c+"px");e.append("div").attr("class","row-depth").style("width",l.depthSize()*t.depth+"px").style("opacity",1).style("line-height",c+"px");var g=e.append("div").attr("class","row-icon "+(t.iconClass?t.iconClass:l.iconClass(t))).style("width",u+"px").style("height",c+"px").style("color",i).style("background-color",t.selected?l.selectionBackgroundColor():"transparent").style("font-size",l.iconSize()+"px").style("padding",y).style("line-height",c+"px"),m=e.append("div").attr("class","row-label").style("padding",y).style("color",i).style("background-color",t.selected?l.selectionBackgroundColor():"transparent").style("font-weight",t.bold?"bold":"normal").style("font-family",l.fontFamily()).style("font-size",l.fontSize()+"px").text(t.label).attr("title",t.label).style("flex",1).style("overflow","hidden").style("text-overflow","ellipsis").style("line-height",c+"px");e.on("mouseenter",(function(){m.style("font-weight","bold")})).on("mouseleave",(function(){m.style("font-weight",t.bold?"bold":"normal")})),p.on("mouseenter",(function(){l.weight_mouseenter(t)})).on("mouseleave",(function(){l.weight_mouseleave(t)})),t.isFolder?e.on("click",(function(t){var r=this.nextSibling,i=e.classed("folder-closed");for(i?(e.classed("folder-closed",!1),e.classed("folder-open",!0),g.attr("class","row-icon "+l.folderIconOpen())):(e.classed("folder-closed",!0),e.classed("folder-open",!1),g.attr("class","row-icon "+l.folderIconClosed()));null!==r;){n.select(r).datum().depth>t.depth?(r.style.display=i?"flex":"none",r=r.nextSibling):r=null}})):e.on("click",(function(){r.selectAll(".row-label").style("background-color","transparent"),r.selectAll(".row-icon").style("background-color","transparent"),g.style("background-color",l.selectionBackgroundColor()),m.style("background-color",l.selectionBackgroundColor());var e=t.label.split(".").pop().toLowerCase();l.rowClick("json"===e?JSON.stringify(JSON.parse(t.content),null,4):t.content,t.markers)}))})).merge(p).style("background-color",l.backgroundColor()),p.exit().remove()},e.prototype.weight_mouseenter=function(t){},e.prototype.weight_mouseleave=function(t){},e}(n.HTMLWidget);rt.prototype._class+=" tree_DirectoryTree",rt.prototype._palette=n.Palette.rainbow("Blues"),rt.prototype.publish("depthSize",14,"number","Width of indentation per file or folder depth (pixels)"),rt.prototype.publish("paletteID","Blues","set","Color palette for the weight backgrounds",rt.prototype._palette.switch(),{tags:["Basic"]}),rt.prototype.publish("omitRoot",!1,"boolean","If true, root node will not display"),rt.prototype.publish("rowItemPadding",2,"number","Top, bottom, left and right row item padding"),rt.prototype.publish("selectionBackgroundColor","#CCC","html-color","Background color of selected directory rows"),rt.prototype.publish("backgroundColor","#FFF","html-color","Directory item background color"),rt.prototype.publish("fontColor","#000","html-color","Directory item font color"),rt.prototype.publish("fontFamily","Arial","string","Directory item font family"),rt.prototype.publish("fontSize",12,"number","Directory item font size (pixels)"),rt.prototype.publish("iconSize",12,"number","Directory folder and file icon size (pixels)"),rt.prototype.publish("folderIconOpen","fa fa-folder-open","string","Open folder icon class"),rt.prototype.publish("folderIconClosed","fa fa-folder","string","Closed folder icon class"),rt.prototype.publish("textFileIcon","fa fa-file-text-o","string","Text file icon class"),rt.prototype.publish("verticalScroll",!0,"boolean","If true, vertical scroll bar will be shown");$(".tree_Indented .node rect{fill:#fff;stroke:#3182bd;stroke-width:1px;cursor:pointer}.tree_Indented .node text{font:10px sans-serif;pointer-events:none}.tree_Indented path.link{fill:none;stroke:#9ecae1;stroke-width:1.5px}");var it=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.owner=function(t){return arguments.length?(this._owner=t,this):this._owner},e.prototype.valid=function(){return!!this.column()},e}(n.PropertyExt);it.prototype._class+=" tree_Dendrogram.IndentedColumn",it.prototype.publish("column",null,"set","Field",(function(){return this._owner?this._owner.columns():[]}),{optional:!0});var ot=function(t){function r(){var r=t.call(this)||this;return r._collapsed={},e.ITree.call(r),n.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r._d3Tree=U(),r}return i(r,t),r.prototype.xmlToData=function(t,e){return void 0===e&&(e=""),DOMParser?at((new DOMParser).parseFromString(t,"text/xml"),e).children[0]:[]},r.prototype.xml=function(t){return arguments.length?(this._xml=t,this.data(this.xmlToData(this._xml)),this):this._xml},r.prototype.IndentedData=function(){if(0===this.data().length)return[];if(this.xmlColumn_exists()){var t=this.columns().indexOf(this.xmlColumn()),e={label:this.xmlColumn(),children:this.data().map((function(e,n){return this.xmlToData(e[t],"["+n+"]")}),this)};return 1===e.children.length?e.children[0]:e}return this.mappings().filter((function(t){return t.valid()})).length?function t(e){if(e.values instanceof Array){var n=e.values.filter((function(t){return!(t instanceof Array)})).map((function(e){return t(e)})),r={label:e.key};return n.length?r.children=n:r.size=22,r}return{label:e.key,size:e.values.aggregate,origRows:e.values}}({key:"root",values:this._db.rollupView(this.mappings().map((function(t){return t.column()}))).entries()}):this.data()},r.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._svgLinks=this._renderElement.append("g"),this._svgNodes=this._renderElement.append("g"),this._selection.widgetElement(this._svgNodes)},r.prototype.update=function(e,r){var i=this;t.prototype.update.call(this,e,r);var o=this;this._d3Tree.nodeSize([0,this.barHeight()]);var a=this._db.dataChecksum();function l(t){return(t.parent?l(t.parent)+".":"")+t.data.label}this._prevDataChecksum!==a&&(this._treeData=this.IndentedData(),this._prevDataChecksum=a);var s=c(this.data()).sum((function(t){return t.size||50})).each((function(t){i._collapsed[l(t)]&&delete t.children})),u=this._d3Tree(s).descendants(),p=this._d3Tree(s).descendants().slice(1),h=0;s.eachBefore((function(t){t.x=h*o.barHeight(),++h}));var d=this.barHeight()-4,f=this._renderCount?500:0,y=this._svgLinks.selectAll(".link").data(p,(function(t){return l(t)}));function g(t){return"M"+t.parent.y+","+t.parent.x+"V"+t.x+", H"+t.y}y.enter().append("path").attr("class","link").attr("d",g),y.transition().duration(f).attr("d",g),y.exit().remove();var m=this._svgNodes.selectAll(".node").data(u,(function(t){return l(t)}));m.transition().duration(f).attr("transform",(function(t){return"translate("+t.y+","+t.x+")"}));var x=m.enter().append("g").attr("class","node").attr("transform",(function(t){return"translate("+t.y+","+t.x+")"})).call(this._selection.enter.bind(this._selection)).each((function(){var t=n.select(this);t.append("rect").attr("height",d).attr("width",d).on("click",(function(t){o._collapsed[l(t)]?delete o._collapsed[l(t)]:t.children&&(o._collapsed[l(t)]=!0),o.lazyRender()})),t.append("text")})).style("opacity",0);x.transition().style("opacity",1),x.merge(m).select("rect").attr("x",-d/2).attr("y",-d/2).style("fill",(function(t){return o._collapsed[l(t)]?"#3182bd":t.children?"#c6dbef":"#fd8d3c"})),x.merge(m).select("text").attr("dx",d/2+4+"px").attr("dy","0.33em").text((function(t){return t.data.label})),m.exit().transition().style("opacity",0).remove(),this._renderCount||o.zoomToFit()},r}(n.SVGZoomWidget);function at(t,e){void 0===e&&(e="");var n={id:e,label:"",attributes:{},children:[]};if(n.label=t.nodeName,1===t.nodeType){if(t.attributes.length>0)for(var r=0;r<t.attributes.length;r++){var i=t.attributes.item(r);n.attributes[i.nodeName]=i.nodeValue}}else 3===t.nodeType&&(n.label=t.nodeValue);if(t.hasChildNodes())for(var o=0;o<t.childNodes.length;o++){var a=at(t.childNodes.item(o),e+"["+n.children.length+"]");n.children.push(a)}return n}ot.prototype._class+=" tree_Indented",ot.prototype.implements(e.ITree.prototype),ot.prototype.mixin(n.Utility.SimpleSelectionMixin),ot.prototype.Column=it,ot.prototype.publish("xmlColumn",null,"set","Field",(function(){return this.columns()}),{optional:!0}),ot.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:it,disable:function(t){return t.xmlColumn_exists()}}),ot.prototype.publish("barHeight",16,"number","Bar height");var lt=Math.PI,st=2*lt,ut=1e-6,ct=st-ut;function pt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ht(){return new pt}function dt(t){return function(){return t}}pt.prototype=ht.prototype={constructor:pt,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,l=n-t,s=r-e,u=o-t,c=a-e,p=u*u+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(p>ut)if(Math.abs(c*l-s*u)>ut&&i){var h=n-o,d=r-a,f=l*l+s*s,y=h*h+d*d,g=Math.sqrt(f),m=Math.sqrt(p),x=i*Math.tan((lt-Math.acos((f+p-y)/(2*g*m)))/2),v=x/m,_=x/g;Math.abs(v-1)>ut&&(this._+="L"+(t+v*u)+","+(e+v*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>u*d)+","+(this._x1=t+_*l)+","+(this._y1=e+_*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),l=n*Math.sin(r),s=t+a,u=e+l,c=1^o,p=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+u:(Math.abs(this._x1-s)>ut||Math.abs(this._y1-u)>ut)&&(this._+="L"+s+","+u),n&&(p<0&&(p=p%st+st),p>ct?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-l)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=u):p>ut&&(this._+="A"+n+","+n+",0,"+ +(p>=lt)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var ft=Math.abs,yt=Math.atan2,gt=Math.cos,mt=Math.max,xt=Math.min,vt=Math.sin,_t=Math.sqrt,bt=1e-12,wt=Math.PI,St=wt/2,kt=2*wt;function Tt(t){return t>=1?St:t<=-1?-St:Math.asin(t)}function zt(t){return t.innerRadius}function Mt(t){return t.outerRadius}function Ct(t){return t.startAngle}function Dt(t){return t.endAngle}function It(t){return t&&t.padAngle}function At(t,e,n,r,i,o,a){var l=t-n,s=e-r,u=(a?o:-o)/_t(l*l+s*s),c=u*s,p=-u*l,h=t+c,d=e+p,f=n+c,y=r+p,g=(h+f)/2,m=(d+y)/2,x=f-h,v=y-d,_=x*x+v*v,b=i-o,w=h*y-f*d,S=(v<0?-1:1)*_t(mt(0,b*b*_-w*w)),k=(w*v-x*S)/_,T=(-w*x-v*S)/_,z=(w*v+x*S)/_,M=(-w*x+v*S)/_,C=k-g,D=T-m,I=z-g,A=M-m;return C*C+D*D>I*I+A*A&&(k=z,T=M),{cx:k,cy:T,x01:-c,y01:-p,x11:k*(i/b-1),y11:T*(i/b-1)}}function Pt(){var t=zt,e=Mt,n=dt(0),r=null,i=Ct,o=Dt,a=It,l=null;function s(){var s,u,c,p=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-St,f=o.apply(this,arguments)-St,y=ft(f-d),g=f>d;if(l||(l=s=ht()),h<p&&(u=h,h=p,p=u),h>bt)if(y>kt-bt)l.moveTo(h*gt(d),h*vt(d)),l.arc(0,0,h,d,f,!g),p>bt&&(l.moveTo(p*gt(f),p*vt(f)),l.arc(0,0,p,f,d,g));else{var m,x,v=d,_=f,b=d,w=f,S=y,k=y,T=a.apply(this,arguments)/2,z=T>bt&&(r?+r.apply(this,arguments):_t(p*p+h*h)),M=xt(ft(h-p)/2,+n.apply(this,arguments)),C=M,D=M;if(z>bt){var I=Tt(z/p*vt(T)),A=Tt(z/h*vt(T));(S-=2*I)>bt?(b+=I*=g?1:-1,w-=I):(S=0,b=w=(d+f)/2),(k-=2*A)>bt?(v+=A*=g?1:-1,_-=A):(k=0,v=_=(d+f)/2)}var P=h*gt(v),R=h*vt(v),E=p*gt(w),L=p*vt(w);if(M>bt){var B,O=h*gt(_),F=h*vt(_),q=p*gt(b),V=p*vt(b);if(y<wt&&(B=function(t,e,n,r,i,o,a,l){var s=n-t,u=r-e,c=a-i,p=l-o,h=p*s-c*u;if(!(h*h<bt))return[t+(h=(c*(e-o)-p*(t-i))/h)*s,e+h*u]}(P,R,q,V,O,F,E,L))){var N=P-B[0],W=R-B[1],j=O-B[0],H=F-B[1],U=1/vt(((c=(N*j+W*H)/(_t(N*N+W*W)*_t(j*j+H*H)))>1?0:c<-1?wt:Math.acos(c))/2),G=_t(B[0]*B[0]+B[1]*B[1]);C=xt(M,(p-G)/(U-1)),D=xt(M,(h-G)/(U+1))}}k>bt?D>bt?(m=At(q,V,P,R,h,D,g),x=At(O,F,E,L,h,D,g),l.moveTo(m.cx+m.x01,m.cy+m.y01),D<M?l.arc(m.cx,m.cy,D,yt(m.y01,m.x01),yt(x.y01,x.x01),!g):(l.arc(m.cx,m.cy,D,yt(m.y01,m.x01),yt(m.y11,m.x11),!g),l.arc(0,0,h,yt(m.cy+m.y11,m.cx+m.x11),yt(x.cy+x.y11,x.cx+x.x11),!g),l.arc(x.cx,x.cy,D,yt(x.y11,x.x11),yt(x.y01,x.x01),!g))):(l.moveTo(P,R),l.arc(0,0,h,v,_,!g)):l.moveTo(P,R),p>bt&&S>bt?C>bt?(m=At(E,L,O,F,p,-C,g),x=At(P,R,q,V,p,-C,g),l.lineTo(m.cx+m.x01,m.cy+m.y01),C<M?l.arc(m.cx,m.cy,C,yt(m.y01,m.x01),yt(x.y01,x.x01),!g):(l.arc(m.cx,m.cy,C,yt(m.y01,m.x01),yt(m.y11,m.x11),!g),l.arc(0,0,p,yt(m.cy+m.y11,m.cx+m.x11),yt(x.cy+x.y11,x.cx+x.x11),g),l.arc(x.cx,x.cy,C,yt(x.y11,x.x11),yt(x.y01,x.x01),!g))):l.arc(0,0,p,w,b,g):l.lineTo(E,L)}else l.moveTo(0,0);if(l.closePath(),s)return l=null,s+""||null}return s.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-wt/2;return[gt(r)*n,vt(r)*n]},s.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:dt(+e),s):t},s.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:dt(+t),s):e},s.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:dt(+t),s):n},s.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:dt(+t),s):r},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:dt(+t),s):i},s.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:dt(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:dt(+t),s):a},s.context=function(t){return arguments.length?(l=null==t?null:t,s):l},s}$(".tree_Sunburst path{stroke:#fff;stroke-width:.5px;fill-rule:evenodd}");var Rt=function(t){function r(){var n=t.call(this)||this;return e.ITree.call(n),n}return i(r,t),r.prototype.data=function(t){var e=n.SVGWidget.prototype.data.apply(this,arguments);return arguments.length&&(this._resetRoot=!0),e},r.prototype.enter=function(t,e){var r=this;this.radius=Math.min(this.width(),this.height())/2,this._xScale=n.scaleLinear().range([0,2*Math.PI]),this._yScale=n.scaleSqrt().range([0,this.radius]),this.partition=F(),this.arc=Pt().startAngle((function(t){return Math.max(0,Math.min(2*Math.PI,r._xScale(t.x0)))})).endAngle((function(t){return Math.max(0,Math.min(2*Math.PI,r._xScale(t.x1)))})).innerRadius((function(t){return Math.max(0,r._yScale(t.y0))})).outerRadius((function(t){return Math.max(0,r._yScale(t.y1))})),this.svg=e.append("g")},r.prototype.update=function(t,e){var r=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this.radius=Math.min(this.width(),this.height())/2,this._yScale.range([0,this.radius]);var i=c(this.data()).sum((function(t){return void 0!==t.size?t.size:1})),o=this.svg.selectAll("path").data(this.partition(i).descendants(),(function(t,e){return void 0!==t.data.label?t.data.label:e}));o.enter().append("path").on("click",(function(t){r.click(t.data,null,null)})).on("dblclick",(function(t){var e=n.d3Event();e&&e.stopPropagation(),r.zoomTo(t)})).each((function(){n.select(this).append("title")})).merge(o).attr("d",this.arc).style("fill",(function(t){return t.data.__viz_fill?t.data.__viz_fill:r._palette(t.data.label)})).style("stroke",(function(t){return t.value>16?"white":"none"})).select("title").text((function(t){return t.data.label})),o.exit().remove(),this._resetRoot&&(this._resetRoot=!1,this.zoomTo(i))},r.prototype.zoomTo=function(t){var e=this;this.svg.transition().duration(750).tween("scale",(function(){var r=n.interpolate(e._xScale.domain(),[t.x0,t.x1]),i=n.interpolate(e._yScale.domain(),[t.y0,1]),o=n.interpolate(e._yScale.range(),[t.y0?20:0,e.radius]);return function(t){e._xScale.domain(r(t)),e._yScale.domain(i(t)).range(o(t))}})).selectAll("path").attrTween("d",(function(t){return function(){return e.arc(t)}}))},r}(n.SVGWidget);Rt.prototype._class+=" tree_SunburstPartition",Rt.prototype.implements(e.ITree.prototype),Rt.prototype.publish("paletteID","default","set","Color palette for this widget",Rt.prototype._palette.switch(),{tags:["Basic","Shared"]}),Rt.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});$(".tree_Treemap *{box-sizing:border-box}.tree_Treemap .node{border:1px solid #333;overflow:hidden;position:absolute;text-overflow:ellipsis}.tree_Treemap .node.selected{border-color:red}.tree_Treemap .node.over{border-color:orange}.tree_Treemap .node.selected.over{border-color:red}.tree_Treemap .node>span.treemap-parent-label{display:inline-block;font-weight:700;margin:4px 4px 0}.tree_Treemap .node>span.treemap-parent-value{font-style:italic;font-weight:400;margin:4px 0 0}.tree_Treemap .node>span.treemap-singleton-label{display:block;font-weight:400;margin:4px 0 0 4px}.tree_Treemap .node>span.treemap-singleton-value{display:block;font-style:italic;margin:0 0 0 4px}");var Et=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.owner=function(t){return arguments.length?(this._owner=t,this):this._owner},e.prototype.valid=function(){return!!this.column()},e}(n.PropertyExt);Et.prototype._class+=" tree_Dendrogram.TreemapColumn",Et.prototype.publish("column",null,"set","Field",(function(){return this._owner?this._owner.columns():[]}),{optional:!0});var Lt=function(t){function r(){var r=t.call(this)||this;return e.ITree.call(r),n.Utility.SimpleSelectionMixin.call(r,!0),r}return i(r,t),r.prototype.getTilingMethod=function(){switch(this.tilingMethod()){case"treemapBinary":return Q;case"treemapDice":return O;case"treemapSlice":return G;case"treemapSliceDice":return X;case"treemapResquarify":return Y;default:return J}},r.prototype.treemapData=function(){return this.mappings().filter((function(t){return t.valid()})).length?function t(e){if(e.values instanceof Array){var n=e.values.filter((function(t){return!(t instanceof Array)})).map((function(e){return t(e)})),r={label:e.key};return n.length?r.children=n:r.size=22,r}return{label:e.key,size:e.values.aggregate,origRows:e.values}}({key:"root",values:this._db.aggregateView(this.mappings().map((function(t){return t.column()})),this.aggrType(),this.aggrColumn()).entries()}):this.data()},r.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._d3Treemap=function(){var t=J,e=!1,n=1,r=1,i=[0],o=D,a=D,l=D,s=D,u=D;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(p),i=[0],e&&t.eachBefore(B),t}function p(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,p=e.x1-n,h=e.y1-n;p<r&&(r=p=(r+p)/2),h<c&&(c=h=(c+h)/2),e.x0=r,e.y0=c,e.x1=p,e.y1=h,e.children&&(n=i[e.depth+1]=o(e)/2,r+=u(e)-n,c+=a(e)-n,(p-=l(e)-n)<r&&(r=p=(r+p)/2),(h-=s(e)-n)<c&&(c=h=(c+h)/2),t(e,r,c,p,h))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=C(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:I(+t),c):o},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:I(+t),c):a},c.paddingRight=function(t){return arguments.length?(l="function"==typeof t?t:I(+t),c):l},c.paddingBottom=function(t){return arguments.length?(s="function"==typeof t?t:I(+t),c):s},c.paddingLeft=function(t){return arguments.length?(u="function"==typeof t?t:I(+t),c):u},c}(),this._elementDIV=n.append("div"),this._selection.widgetElement(this._elementDIV)},r.prototype.update=function(e,r){t.prototype.update.call(this,e,r);var i=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));var o=c(this.treemapData()).sum(this.nodeWeight);this._d3Treemap.size([this.width(),this.height()]).paddingInner(this.paddingInner()).paddingOuter(this.paddingOuter()).paddingTop(this.paddingTop()),-1!==["treemapSquarify","treemapResquarify"].indexOf(this.tilingMethod())?this._d3Treemap.tile(this.getTilingMethod().ratio(this.squarifyRatio())):this._d3Treemap.tile(this.getTilingMethod()),this._d3Treemap(o),this._elementDIV.style("font-size",this.fontSize_exists()?this.fontSize()+"px":null).style("line-height",this.fontSize_exists()?this.fontSize()+2+"px":null);var a=this._elementDIV.selectAll(".node").data(o.descendants());a.enter().append("div").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",(function(t){if(t){var e="";i.mappings().forEach((function(t){t.column()&&(e=t.column())})),t.origRows?i.click(i.rowToObj(t.origRows[0]),e,i._selection.selected(this)):i.click(t.data,e,i._selection.selected(this))}})).on("dblclick",(function(t){if(t){var e="";i.mappings().forEach((function(t){t.column()&&(e=t.column())})),t.origRows?i.dblclick(i.rowToObj(t.origRows[0]),e,i._selection.selected(this)):i.dblclick(t.data,e,i._selection.selected(this))}})).merge(a).style("left",(function(t){return t.x0+Math.max(0,t.x1-t.x0)/2+"px"})).style("top",(function(t){return t.y0+Math.max(0,t.y1-t.y0)/2+"px"})).style("width",(function(){return"0px"})).style("height",(function(){return"0px"})).style("font-size",(function(t){return(t.children?i.parentFontSize():i.leafFontSize())+"px"})).style("line-height",(function(t){return(t.children?i.parentFontSize():i.leafFontSize())+"px"})).attr("title",(function(t){if(t.children&&!i.enableParentTooltips())return null;var e=t.data.label+" ("+t.value+")";for(;t.parent&&t.parent.parent;)e=t.parent.data.label+" -> "+e,t=t.parent;return e})).html((function(t){return i.showRoot()||0!==t.depth?t.children?i.enableParentLabels()?i.parentWeightHTML(t):null:i.leafWeightHTML(t):null})).style("background",(function(t){if(!i.showRoot()&&0===t.depth)return this.style.color="transparent","transparent";var e,r=i.brighterLeafNodes()?"brighter":"darker";return i.usePaletteOnParentNodes()?e=t.children?i._palette(t.data.label):n.rgb(i._palette(t.parent.data.label))[r](1):(e=t.depth>i.depthColorLimit()?n.rgb(t.parent.color)[r](1):i._palette(t.data.label),t.color=e),this.style.color=n.Palette.textColor(e),e})).transition().duration(this.transitionDuration()).style("pointer-events",(function(t){return i.showRoot()||0!==t.depth?"all":"none"})).style("opacity",(function(t){return t.children?1:null})).style("left",(function(t){return t.x0+"px"})).style("top",(function(t){return t.y0+"px"})).style("width",(function(t){return Math.max(0,t.x1-t.x0)+"px"})).style("height",(function(t){return Math.max(0,t.y1-t.y0)+"px"})).each((function(t){0===t.depth&&(this.style.color=i.showRoot()?"":"transparent",this.style.borderColor=i.showRoot()?"":"transparent")})),a.exit().transition().duration(this.transitionDuration()).style("opacity",0).remove()},r.prototype.exit=function(e,n){t.prototype.exit.call(this,e,n)},r.prototype.nodeWeight=function(t){return t.size||1},r.prototype.parentWeightHTML=function(t){return this.showParentWeight()?'<span class="treemap-parent-label">'.concat(t.data.label,'</span><span class="treemap-parent-value">').concat(t.value).concat(this.weightSuffix(),"</span>"):'<span class="treemap-parent-label">'.concat(t.data.label,"</span>")},r.prototype.leafWeightHTML=function(t){return this.showLeafWeight()?'<span class="treemap-leaf-label">'.concat(t.data.label,'</span><span class="treemap-leaf-value">').concat(t.value).concat(this.weightSuffix(),"</span>"):'<span class="treemap-leaf-label">'.concat(t.data.label,"</span>")},r}(n.HTMLWidget);Lt.prototype._class+=" tree_Treemap",Lt.prototype.implements(e.ITree.prototype),Lt.prototype.mixin(n.Utility.SimpleSelectionMixin),Lt.prototype.Column=Et,Lt.prototype.publish("paletteID","default","set","Color palette for this widget",Lt.prototype._palette.switch(),{tags:["Basic","Shared"]}),Lt.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Lt.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:Et}),Lt.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0}),Lt.prototype.publish("aggrColumn",null,"set","Aggregation Field",(function(){return this.columns()}),{optional:!0,disable:function(t){return!t.aggrType()}}),Lt.prototype.publish("fontSize",null,"number","Font Size",null,{optional:!0}),Lt.prototype.publish("paddingInner",18.6,"number","Pixel spacing between each sibling node"),Lt.prototype.publish("paddingOuter",30,"number","Pixel padding of parent nodes"),Lt.prototype.publish("paddingTop",41.4,"number","Additional top pixel padding of parent nodes"),Lt.prototype.publish("showRoot",!1,"boolean","Show root element"),Lt.prototype.publish("parentFontSize",18,"number","Parent font-size"),Lt.prototype.publish("leafFontSize",16,"number","Leaf font-size"),Lt.prototype.publish("usePaletteOnParentNodes",!1,"boolean","Assign a color from the palette to every parent node"),Lt.prototype.publish("depthColorLimit",1,"number","Assign a color from the palette to node with depth lower than this value",null,{optional:!0,disable:function(t){return t.usePaletteOnParentNodes()}}),Lt.prototype.publish("squarifyRatio",1,"number","Specifies the desired aspect ratio of the generated rectangles (must be >= 1)",null,{optional:!0,disable:function(t){return-1===["treemapSquarify","treemapResquarify"].indexOf(t.tilingMethod())}}),Lt.prototype.publish("showParentWeight",!0,"boolean","Show weight of parent nodes"),Lt.prototype.publish("showLeafWeight",!0,"boolean","Show weight of leaf nodes"),Lt.prototype.publish("weightSuffix","","string","Weight suffix (ex: 'ms')"),Lt.prototype.publish("brighterLeafNodes",!1,"boolean","Brighter/darker leaf node color (false = darker)"),Lt.prototype.publish("enableParentLabels",!0,"boolean","Enable parent labels"),Lt.prototype.publish("enableParentTooltips",!0,"boolean","Enable parent tooltips"),Lt.prototype.publish("transitionDuration",250,"number","Transition Duration"),Lt.prototype.publish("tilingMethod","treemapSquarify","set","Transition Duration",["treemapBinary","treemapDice","treemapResquarify","treemapSlice","treemapSliceDice","treemapSquarify"]),t.BUILD_VERSION="2.104.37",t.CirclePacking=tt,t.Dendrogram=nt,t.DendrogramColumn=et,t.DirectoryTree=rt,t.Indented=ot,t.IndentedColumn=it,t.PKG_NAME="@hpcc-js/tree",t.PKG_VERSION="2.40.15",t.SunburstPartition=Rt,t.Treemap=Lt,t.TreemapColumn=Et,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@hpcc-js/tree", | ||
"version": "2.40.14", | ||
"version": "2.40.15", | ||
"description": "hpcc-js - Viz Tree", | ||
@@ -41,4 +41,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@hpcc-js/api": "^2.12.14", | ||
"@hpcc-js/common": "^2.71.14" | ||
"@hpcc-js/api": "^2.12.15", | ||
"@hpcc-js/common": "^2.71.15" | ||
}, | ||
@@ -67,3 +67,3 @@ "devDependencies": { | ||
"homepage": "https://github.com/hpcc-systems/Visualization", | ||
"gitHead": "afae5cc2bcc06ab57b23af729d18b8b4db0b70db" | ||
"gitHead": "6a9c3dabbcea36fec7d25461ca3149c4846926da" | ||
} |
export const PKG_NAME = "@hpcc-js/tree"; | ||
export const PKG_VERSION = "2.40.14"; | ||
export const BUILD_VERSION = "2.104.35"; | ||
export const PKG_VERSION = "2.40.15"; | ||
export const BUILD_VERSION = "2.104.37"; |
export declare const PKG_NAME = "@hpcc-js/tree"; | ||
export declare const PKG_VERSION = "2.40.14"; | ||
export declare const BUILD_VERSION = "2.104.35"; | ||
export declare const PKG_VERSION = "2.40.15"; | ||
export declare const BUILD_VERSION = "2.104.37"; | ||
//# sourceMappingURL=__package__.d.ts.map |
export declare const PKG_NAME = "@hpcc-js/tree"; | ||
export declare const PKG_VERSION = "2.40.14"; | ||
export declare const BUILD_VERSION = "2.104.35"; | ||
export declare const PKG_VERSION = "2.40.15"; | ||
export declare const BUILD_VERSION = "2.104.37"; | ||
//# sourceMappingURL=__package__.d.ts.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Updated@hpcc-js/api@^2.12.15
Updated@hpcc-js/common@^2.71.15