@hpcc-js/tree
Advanced tools
Comparing version 2.25.0 to 2.28.0
@@ -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=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])})(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),h=u.x-t(u,c)/2,p=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-h)/(p-h)*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=h);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 h(t){return t.children}function p(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 y(t){this._=t,this.next=null}function x(t){return function t(e,n){var r,i,o,a=null,l=e.head;switch(n.length){case 1:s=n[0],r={x:s.x,y:s.y,r:s.r};break;case 2:r=function(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,h=Math.sqrt(s*s+u*u);return{x:(n+o+s/h*c)/2,y:(r+a+u/h*c)/2,r:(h+i+l)/2}}(n[0],n[1]);break;case 3:r=function(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,h=n.r,p=2*(r-a),d=2*(i-l),f=2*(s-o),y=r*r+i*i-o*o-a*a-l*l+s*s,x=2*(r-u),g=2*(i-c),m=2*(h-o),_=r*r+i*i-o*o-u*u-c*c+h*h,v=x*d-p*g,b=(d*_-g*y)/v-r,w=(g*f-d*m)/v,S=(x*y-p*_)/v-i,T=(p*m-x*f)/v,k=w*w+T*T-1,z=2*(b*w+S*T+o),M=b*b+S*S-o*o,C=(-z-Math.sqrt(z*z-4*k*M))/(2*k);return{x:b+w*C+r,y:S+T*C+i,r:C}}(n[0],n[1],n[2])}var s;for(;l;)o=l._,i=l.next,r&&g(r,o)?a=l:(a?(e.tail=a,a.next=null):e.head=e.tail=null,n.push(o),r=t(e,n),n.pop(),e.head?(l.next=e.head,e.head=l):(l.next=null,e.head=e.tail=l),(a=e.tail).next=i),l=i;e.tail=a;return r}(function(t){for(var e=(t=t.slice()).length,n=null,r=n;e;){var i=new y(t[e-1]);r=r?r.next=i:n=i,t[void 0]=t[--e]}return{head:n,tail:r}}(t),[])}function g(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r-e.r;return i*i+1e-6>n*n+r*r}function m(t,e,n){var r=t.x,i=t.y,o=e.r+n.r,a=t.r+n.r,l=e.x-r,s=e.y-i,u=l*l+s*s;if(u){var c=.5+((a*=a)-(o*=o))/(2*u),h=Math.sqrt(Math.max(0,2*o*(a+u)-(a-=u)*a-o*o))/(2*u);n.x=r+c*l+h*s,n.y=i+c*s-h*l}else n.x=r+a,n.y=i}function _(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return i*i-1e-6>n*n+r*r}function v(t,e,n){var r=t._,i=t.next._,o=r.r+i.r,a=(r.x*i.r+i.x*r.r)/o-e,l=(r.y*i.r+i.y*r.r)/o-n;return a*a+l*l}function b(t){this._=t,this.next=null,this.previous=null}function w(t){if("function"!=typeof t)throw new Error;return t}function S(){return 0}function T(t){return function(){return t}}function k(t){return Math.sqrt(t.value)}function z(){var t=null,e=1,n=1,r=S;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(M(t)).eachAfter(C(r,.5)).eachBefore(D(1)):i.eachBefore(M(k)).eachAfter(C(S,1)).eachAfter(C(r,i.r/Math.min(e,n))).eachBefore(D(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(n=e)?null:w(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:T(+t),i):r},i}function M(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function C(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;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;m(n,e,r=t[2]);var o,a,l,s,u,c,h,p=e.r*e.r,d=n.r*n.r,f=r.r*r.r,y=p+d+f,g=p*e.x+d*n.x+f*r.x,w=p*e.y+d*n.y+f*r.y;e=new b(e),n=new b(n),r=new b(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(l=3;l<i;++l){m(e._,n._,r=t[l]),r=new b(r),s=n.next,u=e.previous,c=n._.r,h=e._.r;do{if(c<=h){if(_(s._,r._)){n=s,e.next=n,n.previous=e,--l;continue t}c+=s._.r,s=s.next}else{if(_(u._,r._)){(e=u).next=n,n.previous=e,--l;continue t}h+=u._.r,u=u.previous}}while(s!==u.next);for(r.previous=e,r.next=n,e.next=n.previous=n=r,y+=f=r._.r*r._.r,p=v(e,o=(g+=f*r._.x)/y,a=(w+=f*r._.y)/y);(r=r.next)!==n;)(f=v(r,o,a))<p&&(e=r,p=f);n=e.next}for(e=[n._],r=n;(r=r.next)!==n;)e.push(r._);for(r=x(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 D(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 I(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 P(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 A(){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&&P(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(I),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 E(t,e){return t.parent===e.parent?1:2}function R(t){var e=t.children;return e?e[0]:t.t}function L(t){var e=t.children;return e?e[e.length-1]:t.t}function B(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 O(t,e,n){return t.a.parent===e.parent?t.a:n}function N(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 F(){var t=E,e=1,n=1,r=null;function i(i){var s=function(t){for(var e,n,r,i,o,a=new N(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 N(r[i],i)),n.parent=e;return(a.parent=new N(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,h=i;i.eachBefore(function(t){t.x<u.x&&(u=t),t.x>c.x&&(c=t),t.depth>h.depth&&(h=t)});var p=u===c?1:t(u,c)/2,d=p-u.x,f=e/(c.x+p+d),y=n/(h.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,h=l.m,p=s.m;l=L(l),o=R(o),l&&o;)s=R(s),(a=L(a)).a=e,(i=l.z+h-o.z-u+t(l._,o._))>0&&(B(O(l,e,r),e,i),u+=i,c+=i),h+=l.m,u+=o.m,p+=s.m,c+=a.m;l&&!L(a)&&(a.t=l,a.m+=h-c),o&&!R(s)&&(s.t=o,s.m+=u-p,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 q(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}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;for(t=n.pop(),e=r.pop();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(p)}},N.prototype=Object.create(f.prototype);var V=(1+Math.sqrt(5))/2;function W(t,e,n,r,i,o){for(var a,l,s,u,c,h,p,d,f,y,x,g=[],m=e.children,_=0,v=0,b=m.length,w=e.value;_<b;){s=i-n,u=o-r;do{c=m[v++].value}while(!c&&v<b);for(h=p=c,x=c*c*(y=Math.max(u/s,s/u)/(w*t)),f=Math.max(p/x,x/h);v<b;++v){if(c+=l=m[v].value,l<h&&(h=l),l>p&&(p=l),x=c*c*y,(d=Math.max(p/x,x/h))>f){c-=l;break}f=d}g.push(a={value:c,dice:s<u,children:m.slice(_,v)}),a.dice?P(a,n,r,i,w?r+=u*c/w:o):q(a,n,r,w?n+=s*c/w:i,o),w-=c,_=v}return g}var j=function t(e){function n(t,n,r,i,o){W(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(V);function H(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 h=u[e],p=r/2+h,d=e+1,f=n-1;for(;d<f;){var y=d+f>>>1;u[y]<p?d=y+1:f=y}p-u[d-1]<u[d]-p&&e+1<d&&--d;var x=u[d]-h,g=r-x;if(a-i>s-o){var m=(i*g+a*x)/r;t(e,d,x,i,o,m,s),t(d,n,g,m,o,a,s)}else{var _=(o*g+s*x)/r;t(e,d,x,i,o,a,_),t(d,n,g,i,_,a,s)}}(0,s,t.value,e,n,r,i)}function U(t,e,n,r,i){(1&t.depth?q:P)(t,e,n,r,i)}var G=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,l,s,u,c,h=-1,p=a.length,d=t.value;++h<p;){for(s=(l=a[h]).children,u=l.value=0,c=s.length;u<c;++u)l.value+=s[u].value;l.dice?P(l,n,r,i,r+=(o-r)*l.value/d):q(l,n,r,n+=(i-n)*l.value/d,o),d-=l.value}else t._squarify=a=W(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(V);function Z(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))}}Z(".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 K=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=z().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);K.prototype._class+=" tree_CirclePacking",K.prototype.implements(e.ITree.prototype),K.prototype.publish("showSize",!0,"boolean","Show size along with label"),K.prototype.publish("paletteDepthLevel",null,"number","If not null then beyond this depth number the child node colors are based on parent",null,{optional:!0}),K.prototype.publish("paletteDepthVariant","brighter","set","Determines paletteDepthLevel decendant color shade variant",["brighter","darker"],{disable:function(t){return t.paletteDepthLevel_exists()}}),K.prototype.publish("paletteID","default","set","Color palette for this widget",K.prototype._palette.switch(),{tags:["Basic","Shared"]}),K.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});Z(".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 J=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);J.prototype._class+=" tree_Dendrogram.DendrogramColumn",J.prototype.publish("column",null,"set","Field",function(){return this._owner?this._owner.columns():[]},{optional:!0});var Q=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=F(),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 h(t,e){var n=(t-90)/180*Math.PI,r=e;return[r*Math.cos(n),r*Math.sin(n)]}function p(t){return"M"+h(t.x,t.y)+"C"+h(t.x,(t.y+t.parent.y)/2)+" "+h(t.parent.x,(t.y+t.parent.y)/2)+" "+h(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()?p:u),f.transition().duration(d).attr("d",this.radial()?p:u),f.exit().remove();var y=this.circleRadius()+2;function x(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 g=this._renderElement.selectAll(".node").data(l);g.transition().duration(d).attr("transform",x);var m=g.enter().append("g").attr("class","node").attr("transform",x).call(this._selection.enter.bind(this._selection)).on("click",function(t){for(var e=t;e.children;)e=e.children[0];t.depth>0&&i.click(i.rowToObj(e.origRows[0]),i.mappings()[t.depth-1].column(),!0)}).on("dblclick",function(t){for(var e=t;e.children;)e=e.children[0];t.depth>0&&i.dblclick(i.rowToObj(e.origRows[0]),i.mappings()[t.depth-1].column(),!0)}).each(function(){var t=n.select(this);t.append("circle"),t.append("text")});m.merge(g).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}),m.merge(g).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}),g.exit().remove(),this._renderCount||i.zoomToFit()},r}(n.SVGZoomWidget);Q.prototype._class+=" tree_Dendrogram",Q.prototype.implements(e.ITree.prototype),Q.prototype.mixin(n.Utility.SimpleSelectionMixin),Q.prototype.Column=J,Q.prototype.publish("paletteID","default","set","Color palette for this widget",Q.prototype._palette.switch(),{tags:["Basic","Shared"]}),Q.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Q.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:J}),Q.prototype.publish("circleRadius",4.5,"number","Text offset from circle"),Q.prototype.publish("separation",240,"number","Leaf Separation"),Q.prototype.publish("dendrogram",!0,"boolean","Dendrogram"),Q.prototype.publish("radial",!1,"boolean","Radial"),Q.prototype.publish("orientation","horizontal","set","Orientation",["horizontal","vertical"],{tags:["Private"],disable:function(t){return t.radial()}});var X=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()),h=r.selectAll(".directory-row").data(o),p=this.fontFamily(),d=this.fontSize(),f=n.max(o,function(t){return i.textSize(t.weightValue,p,d).width}),y=s+"px "+s+"px "+s/2+"px "+s+"px";h.enter().append("div").attr("class",function(t){return"directory-row directory-row-depth-"+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),h=e.append("div").attr("class","row-weight").style("padding",y).style("color",a).style("box-shadow","inset 0 0 100px "+o).style("font-weight",t.bold?"bold":"normal").style("font-family",p).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 x=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"),g=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(){g.style("font-weight","bold")}).on("mouseleave",function(){g.style("font-weight",t.bold?"bold":"normal")}),h.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),x.attr("class","row-icon "+l.folderIconOpen())):(e.classed("folder-closed",!0),e.classed("folder-open",!1),x.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"),x.style("background-color",l.selectionBackgroundColor()),g.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(h).style("background-color",l.backgroundColor()),h.exit().remove()},e.prototype.weight_mouseenter=function(t){},e.prototype.weight_mouseleave=function(t){},e}(n.HTMLWidget);X.prototype._class+=" tree_DirectoryTree",X.prototype._palette=n.Palette.rainbow("Blues"),X.prototype.publish("depthSize",14,"number","Width of indentation per file or folder depth (pixels)"),X.prototype.publish("paletteID","Blues","set","Color palette for the weight backgrounds",X.prototype._palette.switch(),{tags:["Basic"]}),X.prototype.publish("omitRoot",!1,"boolean","If true, root node will not display"),X.prototype.publish("rowItemPadding",2,"number","Top, bottom, left and right row item padding"),X.prototype.publish("selectionBackgroundColor","#CCC","html-color","Background color of selected directory rows"),X.prototype.publish("backgroundColor","#FFF","html-color","Directory item background color"),X.prototype.publish("fontColor","#000","html-color","Directory item font color"),X.prototype.publish("fontFamily","Arial","string","Directory item font family"),X.prototype.publish("fontSize",12,"number","Directory item font size (pixels)"),X.prototype.publish("iconSize",12,"number","Directory folder and file icon size (pixels)"),X.prototype.publish("folderIconOpen","fa fa-folder-open","string","Open folder icon class"),X.prototype.publish("folderIconClosed","fa fa-folder","string","Closed folder icon class"),X.prototype.publish("textFileIcon","fa fa-file-text-o","string","Text file icon class"),X.prototype.publish("verticalScroll",!0,"boolean","If true, vertical scroll bar will be shown");Z(".tree_Indented .node rect{cursor:pointer;fill:#fff;stroke:#3182bd;stroke-width:1px}.tree_Indented .node text{font:10px sans-serif;pointer-events:none}.tree_Indented path.link{fill:none;stroke:#9ecae1;stroke-width:1.5px}");var Y=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);Y.prototype._class+=" tree_Dendrogram.IndentedColumn",Y.prototype.publish("column",null,"set","Field",function(){return this._owner?this._owner.columns():[]},{optional:!0});var $=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=F(),r}return i(r,t),r.prototype.xmlToData=function(t,e){return void 0===e&&(e=""),DOMParser?function t(e,n){void 0===n&&(n="");var r={id:n,label:"",attributes:{},children:[]};r.label=e.nodeName;if(1===e.nodeType){if(e.attributes.length>0)for(var i=0;i<e.attributes.length;i++){var o=e.attributes.item(i);r.attributes[o.nodeName]=o.nodeValue}}else 3===e.nodeType&&(r.label=e.nodeValue);if(e.hasChildNodes())for(var a=0;a<e.childNodes.length;a++){var l=e.childNodes.item(a),s=t(l,n+"["+r.children.length+"]");r.children.push(s)}return r}((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(),h=this._d3Tree(s).descendants().slice(1),p=0;s.eachBefore(function(t){t.x=p*o.barHeight(),++p});var d=this.barHeight()-4,f=this._renderCount?500:0,y=this._svgLinks.selectAll(".link").data(h,function(t){return l(t)});function x(t){return"M"+t.parent.y+","+t.parent.x+"V"+t.x+", H"+t.y}y.enter().append("path").attr("class","link").attr("d",x),y.transition().duration(f).attr("d",x),y.exit().remove();var g=this._svgNodes.selectAll(".node").data(u,function(t){return l(t)});g.transition().duration(f).attr("transform",function(t){return"translate("+t.y+","+t.x+")"});var m=g.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);m.transition().style("opacity",1),m.merge(g).select("rect").attr("x",-d/2).attr("y",-d/2).style("fill",function(t){return o._collapsed[l(t)]?"#3182bd":t.children?"#c6dbef":"#fd8d3c"}),m.merge(g).select("text").attr("dx",d/2+4+"px").attr("dy","0.33em").text(function(t){return t.data.label}),g.exit().transition().style("opacity",0).remove(),this._renderCount||o.zoomToFit()},r}(n.SVGZoomWidget);$.prototype._class+=" tree_Indented",$.prototype.implements(e.ITree.prototype),$.prototype.mixin(n.Utility.SimpleSelectionMixin),$.prototype.Column=Y,$.prototype.publish("xmlColumn",null,"set","Field",function(){return this.columns()},{optional:!0}),$.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:Y,disable:function(t){return t.xmlColumn_exists()}}),$.prototype.publish("barHeight",16,"number","Bar height");var tt=Math.PI,et=2*tt,nt=et-1e-6;function rt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function it(){return new rt}function ot(t){return function(){return t}}rt.prototype=it.prototype={constructor:rt,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,h=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(h>1e-6)if(Math.abs(c*l-s*u)>1e-6&&i){var p=n-o,d=r-a,f=l*l+s*s,y=p*p+d*d,x=Math.sqrt(f),g=Math.sqrt(h),m=i*Math.tan((tt-Math.acos((f+h-y)/(2*x*g)))/2),_=m/g,v=m/x;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*u)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*p>u*d)+","+(this._x1=t+v*l)+","+(this._y1=e+v*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e;var a=(n=+n)*Math.cos(r),l=n*Math.sin(r),s=t+a,u=e+l,c=1^o,h=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)>1e-6||Math.abs(this._y1-u)>1e-6)&&(this._+="L"+s+","+u),n&&(h<0&&(h=h%et+et),h>nt?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-l)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=u):h>1e-6&&(this._+="A"+n+","+n+",0,"+ +(h>=tt)+","+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 at=Math.abs,lt=Math.atan2,st=Math.cos,ut=Math.max,ct=Math.min,ht=Math.sin,pt=Math.sqrt,dt=1e-12,ft=Math.PI,yt=ft/2,xt=2*ft;function gt(t){return t>=1?yt:t<=-1?-yt:Math.asin(t)}function mt(t){return t.innerRadius}function _t(t){return t.outerRadius}function vt(t){return t.startAngle}function bt(t){return t.endAngle}function wt(t){return t&&t.padAngle}function St(t,e,n,r,i,o,a){var l=t-n,s=e-r,u=(a?o:-o)/pt(l*l+s*s),c=u*s,h=-u*l,p=t+c,d=e+h,f=n+c,y=r+h,x=(p+f)/2,g=(d+y)/2,m=f-p,_=y-d,v=m*m+_*_,b=i-o,w=p*y-f*d,S=(_<0?-1:1)*pt(ut(0,b*b*v-w*w)),T=(w*_-m*S)/v,k=(-w*m-_*S)/v,z=(w*_+m*S)/v,M=(-w*m+_*S)/v,C=T-x,D=k-g,I=z-x,P=M-g;return C*C+D*D>I*I+P*P&&(T=z,k=M),{cx:T,cy:k,x01:-c,y01:-h,x11:T*(i/b-1),y11:k*(i/b-1)}}function Tt(){var t=mt,e=_t,n=ot(0),r=null,i=vt,o=bt,a=wt,l=null;function s(){var s,u,c,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-yt,f=o.apply(this,arguments)-yt,y=at(f-d),x=f>d;if(l||(l=s=it()),p<h&&(u=p,p=h,h=u),p>dt)if(y>xt-dt)l.moveTo(p*st(d),p*ht(d)),l.arc(0,0,p,d,f,!x),h>dt&&(l.moveTo(h*st(f),h*ht(f)),l.arc(0,0,h,f,d,x));else{var g,m,_=d,v=f,b=d,w=f,S=y,T=y,k=a.apply(this,arguments)/2,z=k>dt&&(r?+r.apply(this,arguments):pt(h*h+p*p)),M=ct(at(p-h)/2,+n.apply(this,arguments)),C=M,D=M;if(z>dt){var I=gt(z/h*ht(k)),P=gt(z/p*ht(k));(S-=2*I)>dt?(b+=I*=x?1:-1,w-=I):(S=0,b=w=(d+f)/2),(T-=2*P)>dt?(_+=P*=x?1:-1,v-=P):(T=0,_=v=(d+f)/2)}var A=p*st(_),E=p*ht(_),R=h*st(w),L=h*ht(w);if(M>dt){var B=p*st(v),O=p*ht(v),N=h*st(b),F=h*ht(b);if(y<ft){var q=S>dt?function(t,e,n,r,i,o,a,l){var s=n-t,u=r-e,c=a-i,h=l-o,p=(c*(e-o)-h*(t-i))/(h*s-c*u);return[t+p*s,e+p*u]}(A,E,N,F,B,O,R,L):[R,L],V=A-q[0],W=E-q[1],j=B-q[0],H=O-q[1],U=1/ht(((c=(V*j+W*H)/(pt(V*V+W*W)*pt(j*j+H*H)))>1?0:c<-1?ft:Math.acos(c))/2),G=pt(q[0]*q[0]+q[1]*q[1]);C=ct(M,(h-G)/(U-1)),D=ct(M,(p-G)/(U+1))}}T>dt?D>dt?(g=St(N,F,A,E,p,D,x),m=St(B,O,R,L,p,D,x),l.moveTo(g.cx+g.x01,g.cy+g.y01),D<M?l.arc(g.cx,g.cy,D,lt(g.y01,g.x01),lt(m.y01,m.x01),!x):(l.arc(g.cx,g.cy,D,lt(g.y01,g.x01),lt(g.y11,g.x11),!x),l.arc(0,0,p,lt(g.cy+g.y11,g.cx+g.x11),lt(m.cy+m.y11,m.cx+m.x11),!x),l.arc(m.cx,m.cy,D,lt(m.y11,m.x11),lt(m.y01,m.x01),!x))):(l.moveTo(A,E),l.arc(0,0,p,_,v,!x)):l.moveTo(A,E),h>dt&&S>dt?C>dt?(g=St(R,L,B,O,h,-C,x),m=St(A,E,N,F,h,-C,x),l.lineTo(g.cx+g.x01,g.cy+g.y01),C<M?l.arc(g.cx,g.cy,C,lt(g.y01,g.x01),lt(m.y01,m.x01),!x):(l.arc(g.cx,g.cy,C,lt(g.y01,g.x01),lt(g.y11,g.x11),!x),l.arc(0,0,h,lt(g.cy+g.y11,g.cx+g.x11),lt(m.cy+m.y11,m.cx+m.x11),x),l.arc(m.cx,m.cy,C,lt(m.y11,m.x11),lt(m.y01,m.x01),!x))):l.arc(0,0,h,w,b,x):l.lineTo(R,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-ft/2;return[st(r)*n,ht(r)*n]},s.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ot(+e),s):t},s.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ot(+t),s):e},s.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:ot(+t),s):n},s.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ot(+t),s):r},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:ot(+t),s):i},s.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:ot(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:ot(+t),s):a},s.context=function(t){return arguments.length?(l=null==t?null:t,s):l},s}function kt(t){return t<0?-1:1}function zt(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),l=(o*i+a*r)/(r+i);return(kt(o)+kt(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(l))||0}function Mt(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Ct(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,l=(o-r)/3;t._context.bezierCurveTo(r+l,i+l*e,o-l,a-l*n,o,a)}function Dt(t){this._context=t}function It(t){this._context=t}Dt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ct(this,this._t0,Mt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Ct(this,Mt(this,n=zt(this,t,e)),n);break;default:Ct(this,this._t0,n=zt(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(function(t){this._context=new It(t)}.prototype=Object.create(Dt.prototype)).point=function(t,e){Dt.prototype.point.call(this,e,t)},It.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};Z(".tree_Sunburst path{stroke:#fff;stroke-width:.5px;fill-rule:evenodd}");var Pt=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=A(),this.arc=Tt().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);Pt.prototype._class+=" tree_SunburstPartition",Pt.prototype.implements(e.ITree.prototype),Pt.prototype.publish("paletteID","default","set","Color palette for this widget",Pt.prototype._palette.switch(),{tags:["Basic","Shared"]}),Pt.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});Z(".tree_Treemap *{box-sizing:border-box}.tree_Treemap .node{border:1px solid #333;overflow:hidden;text-overflow:ellipsis;position:absolute}.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{font-weight:700;display:inline-block;margin:4px 4px 0}.tree_Treemap .node>span.treemap-parent-value{font-weight:400;font-style:italic;margin:4px 0 0}.tree_Treemap .node>span.treemap-singleton-label{font-weight:400;display:block;margin:4px 0 0 4px}.tree_Treemap .node>span.treemap-singleton-value{font-style:italic;display:block;margin:0 0 0 4px}");var At=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);At.prototype._class+=" tree_Dendrogram.TreemapColumn",At.prototype.publish("column",null,"set","Field",function(){return this._owner?this._owner.columns():[]},{optional:!0});var Et=function(t){function r(){var r=t.call(this)||this;return e.ITree.call(r),n.Utility.SimpleSelectionMixin.call(r),r}return i(r,t),r.prototype.getTilingMethod=function(){switch(this.tilingMethod()){case"treemapBinary":return H;case"treemapDice":return P;case"treemapSlice":return q;case"treemapSliceDice":return U;case"treemapResquarify":return G;case"treemapSquarify":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=S,a=S,l=S,s=S,u=S;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(h),i=[0],e&&t.eachBefore(I),t}function h(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,h=e.x1-n,p=e.y1-n;h<r&&(r=h=(r+h)/2),p<c&&(c=p=(c+p)/2),e.x0=r,e.y0=c,e.x1=h,e.y1=p,e.children&&(n=i[e.depth+1]=o(e)/2,r+=u(e)-n,c+=a(e)-n,(h-=l(e)-n)<r&&(r=h=(r+h)/2),(p-=s(e)-n)<c&&(c=p=(c+p)/2),t(e,r,c,h,p))}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=w(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:T(+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:T(+t),c):a},c.paddingRight=function(t){return arguments.length?(l="function"==typeof t?t:T(+t),c):l},c.paddingBottom=function(t){return arguments.length?(s="function"==typeof t?t:T(+t),c):s},c.paddingLeft=function(t){return arguments.length?(u="function"==typeof t?t:T(+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&&t.origRows){var e="";i.mappings().forEach(function(t){t.column()&&(e=t.column())}),i.click(i.rowToObj(t.origRows[0]),e,i._selection.selected(this))}}).on("dblclick",function(t){if(t&&t.origRows){var e="";i.mappings().forEach(function(t){t.column()&&(e=t.column())}),i.dblclick(i.rowToObj(t.origRows[0]),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">'+t.data.label+'</span><span class="treemap-parent-value">'+t.value+this.weightSuffix()+"</span>":'<span class="treemap-parent-label">'+t.data.label+"</span>"},r.prototype.leafWeightHTML=function(t){return this.showLeafWeight()?'<span class="treemap-leaf-label">'+t.data.label+'</span><span class="treemap-leaf-value">'+t.value+this.weightSuffix()+"</span>":'<span class="treemap-leaf-label">'+t.data.label+"</span>"},r}(n.HTMLWidget);Et.prototype._class+=" tree_Treemap",Et.prototype.implements(e.ITree.prototype),Et.prototype.mixin(n.Utility.SimpleSelectionMixin),Et.prototype.Column=At,Et.prototype.publish("paletteID","default","set","Color palette for this widget",Et.prototype._palette.switch(),{tags:["Basic","Shared"]}),Et.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Et.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:At}),Et.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0}),Et.prototype.publish("aggrColumn",null,"set","Aggregation Field",function(){return this.columns()},{optional:!0,disable:function(t){return!t.aggrType()}}),Et.prototype.publish("fontSize",null,"number","Font Size",null,{optional:!0}),Et.prototype.publish("paddingInner",18.6,"number","Pixel spacing between each sibling node"),Et.prototype.publish("paddingOuter",30,"number","Pixel padding of parent nodes"),Et.prototype.publish("paddingTop",41.4,"number","Additional top pixel padding of parent nodes"),Et.prototype.publish("showRoot",!1,"boolean","Show root element"),Et.prototype.publish("parentFontSize",18,"number","Parent font-size"),Et.prototype.publish("leafFontSize",16,"number","Leaf font-size"),Et.prototype.publish("usePaletteOnParentNodes",!1,"boolean","Assign a color from the palette to every parent node"),Et.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()}}),Et.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())}}),Et.prototype.publish("showParentWeight",!0,"boolean","Show weight of parent nodes"),Et.prototype.publish("showLeafWeight",!0,"boolean","Show weight of leaf nodes"),Et.prototype.publish("weightSuffix","","string","Weight suffix (ex: 'ms')"),Et.prototype.publish("brighterLeafNodes",!1,"boolean","Brighter/darker leaf node color (false = darker)"),Et.prototype.publish("enableParentLabels",!0,"boolean","Enable parent labels"),Et.prototype.publish("enableParentTooltips",!0,"boolean","Enable parent tooltips"),Et.prototype.publish("transitionDuration",250,"number","Transition Duration"),Et.prototype.publish("tilingMethod","treemapSquarify","set","Transition Duration",["treemapBinary","treemapDice","treemapResquarify","treemapSlice","treemapSliceDice","treemapSquarify"]),t.BUILD_VERSION="2.76.0",t.CirclePacking=K,t.Dendrogram=Q,t.DendrogramColumn=J,t.DirectoryTree=X,t.Indented=$,t.IndentedColumn=Y,t.PKG_NAME="@hpcc-js/tree",t.PKG_VERSION="2.25.0",t.SunburstPartition=Pt,t.Treemap=Et,t.TreemapColumn=At,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=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])})(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}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;for(t=n.pop(),e=r.pop();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,z=(d*v-h*_)/(2*b)-i,T=(h*m-d*g)/b,k=S*S+T*T-1,M=2*(o+w*S+z*T),C=w*w+z*z-o*o,D=-(k?(M+Math.sqrt(M*M-4*k*C))/(2*k):C/M);return{x:r+w+S*D,y:i+z+T*D,r:D}}function z(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 k(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;z(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){z(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=k(e);(r=r.next)!==n;)(a=k(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 q(){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 F(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=F,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&&i.click(i.rowToObj(e.origRows[0]),i.mappings()[t.depth-1].column(),!0)}).on("dblclick",function(t){for(var e=t;e.children;)e=e.children[0];t.depth>0&&i.dblclick(i.rowToObj(e.origRows[0]),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=s+"px "+s+"px "+s/2+"px "+s+"px";p.enter().append("div").attr("class",function(t){return"directory-row directory-row-depth-"+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 "+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{cursor:pointer;fill:#fff;stroke:#3182bd;stroke-width:1px}.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?function t(e,n){void 0===n&&(n="");var r={id:n,label:"",attributes:{},children:[]};r.label=e.nodeName;if(1===e.nodeType){if(e.attributes.length>0)for(var i=0;i<e.attributes.length;i++){var o=e.attributes.item(i);r.attributes[o.nodeName]=o.nodeValue}}else 3===e.nodeType&&(r.label=e.nodeValue);if(e.hasChildNodes())for(var a=0;a<e.childNodes.length;a++){var l=e.childNodes.item(a),s=t(l,n+"["+r.children.length+"]");r.children.push(s)}return r}((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);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 at=Math.PI,lt=2*at,st=lt-1e-6;function ut(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ct(){return new ut}function pt(t){return function(){return t}}ut.prototype=ct.prototype={constructor:ut,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>1e-6)if(Math.abs(c*l-s*u)>1e-6&&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((at-Math.acos((f+p-y)/(2*g*m)))/2),v=x/m,_=x/g;Math.abs(v-1)>1e-6&&(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)>1e-6||Math.abs(this._y1-u)>1e-6)&&(this._+="L"+s+","+u),n&&(p<0&&(p=p%lt+lt),p>st?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-l)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=u):p>1e-6&&(this._+="A"+n+","+n+",0,"+ +(p>=at)+","+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 ht=Math.abs,dt=Math.atan2,ft=Math.cos,yt=Math.max,gt=Math.min,mt=Math.sin,xt=Math.sqrt,vt=1e-12,_t=Math.PI,bt=_t/2,wt=2*_t;function St(t){return t>=1?bt:t<=-1?-bt:Math.asin(t)}function zt(t){return t.innerRadius}function Tt(t){return t.outerRadius}function kt(t){return t.startAngle}function Mt(t){return t.endAngle}function Ct(t){return t&&t.padAngle}function Dt(t,e,n,r,i,o,a){var l=t-n,s=e-r,u=(a?o:-o)/xt(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)*xt(yt(0,b*b*_-w*w)),z=(w*v-x*S)/_,T=(-w*x-v*S)/_,k=(w*v+x*S)/_,M=(-w*x+v*S)/_,C=z-g,D=T-m,I=k-g,A=M-m;return C*C+D*D>I*I+A*A&&(z=k,T=M),{cx:z,cy:T,x01:-c,y01:-p,x11:z*(i/b-1),y11:T*(i/b-1)}}function It(){var t=zt,e=Tt,n=pt(0),r=null,i=kt,o=Mt,a=Ct,l=null;function s(){var s,u,c,p=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-bt,f=o.apply(this,arguments)-bt,y=ht(f-d),g=f>d;if(l||(l=s=ct()),h<p&&(u=h,h=p,p=u),h>vt)if(y>wt-vt)l.moveTo(h*ft(d),h*mt(d)),l.arc(0,0,h,d,f,!g),p>vt&&(l.moveTo(p*ft(f),p*mt(f)),l.arc(0,0,p,f,d,g));else{var m,x,v=d,_=f,b=d,w=f,S=y,z=y,T=a.apply(this,arguments)/2,k=T>vt&&(r?+r.apply(this,arguments):xt(p*p+h*h)),M=gt(ht(h-p)/2,+n.apply(this,arguments)),C=M,D=M;if(k>vt){var I=St(k/p*mt(T)),A=St(k/h*mt(T));(S-=2*I)>vt?(b+=I*=g?1:-1,w-=I):(S=0,b=w=(d+f)/2),(z-=2*A)>vt?(v+=A*=g?1:-1,_-=A):(z=0,v=_=(d+f)/2)}var P=h*ft(v),R=h*mt(v),E=p*ft(w),L=p*mt(w);if(M>vt){var B,O=h*ft(_),q=h*mt(_),F=p*ft(b),V=p*mt(b);if(y<_t&&(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<vt))return[t+(h=(c*(e-o)-p*(t-i))/h)*s,e+h*u]}(P,R,F,V,O,q,E,L))){var N=P-B[0],W=R-B[1],j=O-B[0],H=q-B[1],U=1/mt(((c=(N*j+W*H)/(xt(N*N+W*W)*xt(j*j+H*H)))>1?0:c<-1?_t:Math.acos(c))/2),G=xt(B[0]*B[0]+B[1]*B[1]);C=gt(M,(p-G)/(U-1)),D=gt(M,(h-G)/(U+1))}}z>vt?D>vt?(m=Dt(F,V,P,R,h,D,g),x=Dt(O,q,E,L,h,D,g),l.moveTo(m.cx+m.x01,m.cy+m.y01),D<M?l.arc(m.cx,m.cy,D,dt(m.y01,m.x01),dt(x.y01,x.x01),!g):(l.arc(m.cx,m.cy,D,dt(m.y01,m.x01),dt(m.y11,m.x11),!g),l.arc(0,0,h,dt(m.cy+m.y11,m.cx+m.x11),dt(x.cy+x.y11,x.cx+x.x11),!g),l.arc(x.cx,x.cy,D,dt(x.y11,x.x11),dt(x.y01,x.x01),!g))):(l.moveTo(P,R),l.arc(0,0,h,v,_,!g)):l.moveTo(P,R),p>vt&&S>vt?C>vt?(m=Dt(E,L,O,q,p,-C,g),x=Dt(P,R,F,V,p,-C,g),l.lineTo(m.cx+m.x01,m.cy+m.y01),C<M?l.arc(m.cx,m.cy,C,dt(m.y01,m.x01),dt(x.y01,x.x01),!g):(l.arc(m.cx,m.cy,C,dt(m.y01,m.x01),dt(m.y11,m.x11),!g),l.arc(0,0,p,dt(m.cy+m.y11,m.cx+m.x11),dt(x.cy+x.y11,x.cx+x.x11),g),l.arc(x.cx,x.cy,C,dt(x.y11,x.x11),dt(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-_t/2;return[ft(r)*n,mt(r)*n]},s.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:pt(+e),s):t},s.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:pt(+t),s):e},s.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:pt(+t),s):n},s.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:pt(+t),s):r},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:pt(+t),s):i},s.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:pt(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:pt(+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 At=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=q(),this.arc=It().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);At.prototype._class+=" tree_SunburstPartition",At.prototype.implements(e.ITree.prototype),At.prototype.publish("paletteID","default","set","Color palette for this widget",At.prototype._palette.switch(),{tags:["Basic","Shared"]}),At.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;text-overflow:ellipsis;position:absolute}.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{font-weight:700;display:inline-block;margin:4px 4px 0}.tree_Treemap .node>span.treemap-parent-value{font-weight:400;font-style:italic;margin:4px 0 0}.tree_Treemap .node>span.treemap-singleton-label{font-weight:400;display:block;margin:4px 0 0 4px}.tree_Treemap .node>span.treemap-singleton-value{font-style:italic;display:block;margin:0 0 0 4px}");var Pt=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);Pt.prototype._class+=" tree_Dendrogram.TreemapColumn",Pt.prototype.publish("column",null,"set","Field",function(){return this._owner?this._owner.columns():[]},{optional:!0});var Rt=function(t){function r(){var r=t.call(this)||this;return e.ITree.call(r),n.Utility.SimpleSelectionMixin.call(r),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;case"treemapSquarify":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&&t.origRows){var e="";i.mappings().forEach(function(t){t.column()&&(e=t.column())}),i.click(i.rowToObj(t.origRows[0]),e,i._selection.selected(this))}}).on("dblclick",function(t){if(t&&t.origRows){var e="";i.mappings().forEach(function(t){t.column()&&(e=t.column())}),i.dblclick(i.rowToObj(t.origRows[0]),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">'+t.data.label+'</span><span class="treemap-parent-value">'+t.value+this.weightSuffix()+"</span>":'<span class="treemap-parent-label">'+t.data.label+"</span>"},r.prototype.leafWeightHTML=function(t){return this.showLeafWeight()?'<span class="treemap-leaf-label">'+t.data.label+'</span><span class="treemap-leaf-value">'+t.value+this.weightSuffix()+"</span>":'<span class="treemap-leaf-label">'+t.data.label+"</span>"},r}(n.HTMLWidget);Rt.prototype._class+=" tree_Treemap",Rt.prototype.implements(e.ITree.prototype),Rt.prototype.mixin(n.Utility.SimpleSelectionMixin),Rt.prototype.Column=Pt,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"]}),Rt.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:Pt}),Rt.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0}),Rt.prototype.publish("aggrColumn",null,"set","Aggregation Field",function(){return this.columns()},{optional:!0,disable:function(t){return!t.aggrType()}}),Rt.prototype.publish("fontSize",null,"number","Font Size",null,{optional:!0}),Rt.prototype.publish("paddingInner",18.6,"number","Pixel spacing between each sibling node"),Rt.prototype.publish("paddingOuter",30,"number","Pixel padding of parent nodes"),Rt.prototype.publish("paddingTop",41.4,"number","Additional top pixel padding of parent nodes"),Rt.prototype.publish("showRoot",!1,"boolean","Show root element"),Rt.prototype.publish("parentFontSize",18,"number","Parent font-size"),Rt.prototype.publish("leafFontSize",16,"number","Leaf font-size"),Rt.prototype.publish("usePaletteOnParentNodes",!1,"boolean","Assign a color from the palette to every parent node"),Rt.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()}}),Rt.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())}}),Rt.prototype.publish("showParentWeight",!0,"boolean","Show weight of parent nodes"),Rt.prototype.publish("showLeafWeight",!0,"boolean","Show weight of leaf nodes"),Rt.prototype.publish("weightSuffix","","string","Weight suffix (ex: 'ms')"),Rt.prototype.publish("brighterLeafNodes",!1,"boolean","Brighter/darker leaf node color (false = darker)"),Rt.prototype.publish("enableParentLabels",!0,"boolean","Enable parent labels"),Rt.prototype.publish("enableParentTooltips",!0,"boolean","Enable parent tooltips"),Rt.prototype.publish("transitionDuration",250,"number","Transition Duration"),Rt.prototype.publish("tilingMethod","treemapSquarify","set","Transition Duration",["treemapBinary","treemapDice","treemapResquarify","treemapSlice","treemapSliceDice","treemapSquarify"]),t.BUILD_VERSION="2.79.0",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.28.0",t.SunburstPartition=At,t.Treemap=Rt,t.TreemapColumn=Pt,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@hpcc-js/tree", | ||
"version": "2.25.0", | ||
"version": "2.28.0", | ||
"description": "hpcc-js - Viz Tree", | ||
@@ -40,4 +40,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@hpcc-js/api": "^2.8.47", | ||
"@hpcc-js/common": "^2.52.0" | ||
"@hpcc-js/api": "^2.8.50", | ||
"@hpcc-js/common": "^2.55.0" | ||
}, | ||
@@ -49,3 +49,3 @@ "devDependencies": { | ||
"@rollup/plugin-node-resolve": "8.0.0", | ||
"@types/d3-transition": "^1", | ||
"@types/d3-transition": "1.3.2", | ||
"@typescript-eslint/eslint-plugin": "^3.2.0", | ||
@@ -82,3 +82,3 @@ "@typescript-eslint/parser": "^3.2.0", | ||
"homepage": "https://github.com/hpcc-systems/Visualization", | ||
"gitHead": "46e18c87d100c33f80d4cb4b4327229b1a48a4f9" | ||
"gitHead": "c58fa51e404478369774f77344bda25750155963" | ||
} |
export const PKG_NAME = "@hpcc-js/tree"; | ||
export const PKG_VERSION = "2.25.0"; | ||
export const BUILD_VERSION = "2.76.0"; | ||
export const PKG_VERSION = "2.28.0"; | ||
export const BUILD_VERSION = "2.79.0"; |
export declare const PKG_NAME = "@hpcc-js/tree"; | ||
export declare const PKG_VERSION = "2.25.0"; | ||
export declare const BUILD_VERSION = "2.76.0"; | ||
export declare const PKG_VERSION = "2.28.0"; | ||
export declare const BUILD_VERSION = "2.79.0"; | ||
//# sourceMappingURL=__package__.d.ts.map |
export declare const PKG_NAME = "@hpcc-js/tree"; | ||
export declare const PKG_VERSION = "2.25.0"; | ||
export declare const BUILD_VERSION = "2.76.0"; | ||
export declare const PKG_VERSION = "2.28.0"; | ||
export declare const BUILD_VERSION = "2.79.0"; | ||
//# 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
1038413
46
7459
Updated@hpcc-js/api@^2.8.50
Updated@hpcc-js/common@^2.55.0