@d3plus/core 3.0.14 → 3.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /*
2
- @d3plus/core v3.0.14
2
+ @d3plus/core v3.0.15
3
3
  Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.
4
- Copyright (c) 2025 D3plus - https://d3plus.org
4
+ Copyright (c) 2026 D3plus - https://d3plus.org
5
5
  @license MIT
6
6
  */
7
- (t=>{"function"==typeof define&&define.amd?define(t):t()})(function(){if("undefined"!=typeof window){try{if("undefined"==typeof SVGElement||Boolean(SVGElement.prototype.innerHTML))return}catch(t){return}function s(t){switch(t.nodeType){case 1:var i=t,e="";return e+="<"+i.tagName,i.hasAttributes()&&[].forEach.call(i.attributes,function(t){e+=" "+t.name+'="'+t.value+'"'}),e+=">",i.hasChildNodes()&&[].forEach.call(i.childNodes,function(t){e+=s(t)}),e+="</"+i.tagName+">";case 3:return t.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");case 8:return"\x3c!--"+t.nodeValue+"--\x3e"}}Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var i="";return[].forEach.call(this.childNodes,function(t){i+=s(t)}),i},set:function(t){for(;this.firstChild;)this.removeChild(this.firstChild);try{var i=new DOMParser,e=(i.async=!1,"<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+t+"</svg>"),s=i.parseFromString(e,"text/xml").documentElement;[].forEach.call(s.childNodes,function(t){this.appendChild(this.ownerDocument.importNode(t,!0))}.bind(this))}catch(t){throw new Error("Error parsing markup string")}}}),Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(t){this.innerHTML=t}})}}),((t,i)=>{"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@d3plus/dom"),require("@d3plus/locales"),require("d3-array"),require("d3-collection"),require("d3-scale"),require("d3-shape"),require("open-color/open-color.js"),require("@d3plus/color"),require("@d3plus/data"),require("@d3plus/math"),require("@d3plus/format"),require("d3-time-format"),require("d3-selection"),require("d3-transition"),require("@d3plus/text"),require("d3-interpolate"),require("d3-color"),require("textures"),require("d3-interpolate-path"),require("d3-brush"),require("@popperjs/core"),require("d3-queue"),require("d3-zoom"),require("lrucache"),require("d3-geo"),require("d3-geo-projection"),require("d3-composite-projections"),require("d3-tile"),require("topojson-client"),require("d3-force"),require("d3-polygon"),require("d3-hierarchy"),require("d3-sankey")):"function"==typeof define&&define.amd?define("@d3plus/core",["exports","@d3plus/dom","@d3plus/locales","d3-array","d3-collection","d3-scale","d3-shape","open-color/open-color.js","@d3plus/color","@d3plus/data","@d3plus/math","@d3plus/format","d3-time-format","d3-selection","d3-transition","@d3plus/text","d3-interpolate","d3-color","textures","d3-interpolate-path","d3-brush","@popperjs/core","d3-queue","d3-zoom","lrucache","d3-geo","d3-geo-projection","d3-composite-projections","d3-tile","topojson-client","d3-force","d3-polygon","d3-hierarchy","d3-sankey"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).d3plus={},t.dom,t.locales,t.d3Array,t.d3Collection,t.scales,t.paths,t.pkg,t.color,t.data,t.math,t.format,t.d3TimeFormat,t.d3Selection,t.d3Transition,t.text,t.d3Interpolate,t.d3Color,t.textures,t.d3InterpolatePath,t.d3Brush,t.core,t.d3Queue,t.d3Zoom,t.lrucache,t.d3GeoCore,t.d3GeoProjection,t.d3CompositeProjections,t.d3Tile,t.topojsonClient,t.d3Force,t.d3Polygon,t.d3Hierarchy,t.d3Sankey)})(this,function(t,Pt,$,Dt,Ot,S,m,g,A,Lt,E,Tt,N,j,I,H,z,n,c,u,y,x,b,d,v,C,w,k,M,P,D,O,f,e){function L(e){var s=Object.create(null);return e&&Object.keys(e).forEach(function(t){var i;"default"!==t&&(i=Object.getOwnPropertyDescriptor(e,t),Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:function(){return e[t]}}))}),s.default=e,Object.freeze(s)}var $t=L(S),Et=L(m),C=L(C),w=L(w),k=L(k);
7
+ (t=>{"function"==typeof define&&define.amd?define(t):t()})(function(){if("undefined"!=typeof window){try{if("undefined"==typeof SVGElement||Boolean(SVGElement.prototype.innerHTML))return}catch(t){return}function s(t){switch(t.nodeType){case 1:var i=t,e="";return e+="<"+i.tagName,i.hasAttributes()&&[].forEach.call(i.attributes,function(t){e+=" "+t.name+'="'+t.value+'"'}),e+=">",i.hasChildNodes()&&[].forEach.call(i.childNodes,function(t){e+=s(t)}),e+="</"+i.tagName+">";case 3:return t.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");case 8:return"\x3c!--"+t.nodeValue+"--\x3e"}}Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var i="";return[].forEach.call(this.childNodes,function(t){i+=s(t)}),i},set:function(t){for(;this.firstChild;)this.removeChild(this.firstChild);try{var i=new DOMParser,e=(i.async=!1,"<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+t+"</svg>"),s=i.parseFromString(e,"text/xml").documentElement;[].forEach.call(s.childNodes,function(t){this.appendChild(this.ownerDocument.importNode(t,!0))}.bind(this))}catch(t){throw new Error("Error parsing markup string")}}}),Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(t){this.innerHTML=t}})}}),((t,i)=>{"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@d3plus/dom"),require("@d3plus/locales"),require("d3-array"),require("d3-collection"),require("d3-scale"),require("d3-shape"),require("open-color/open-color.js"),require("@d3plus/color"),require("@d3plus/data"),require("@d3plus/math"),require("@d3plus/format"),require("d3-time-format"),require("d3-selection"),require("d3-transition"),require("@d3plus/text"),require("d3-interpolate"),require("d3-color"),require("textures"),require("d3-interpolate-path"),require("d3-brush"),require("@popperjs/core"),require("d3-queue"),require("d3-zoom"),require("lrucache"),require("d3-geo"),require("d3-geo-projection"),require("d3-composite-projections"),require("d3-tile"),require("topojson-client"),require("d3-force"),require("d3-polygon"),require("d3-hierarchy"),require("d3-sankey")):"function"==typeof define&&define.amd?define("@d3plus/core",["exports","@d3plus/dom","@d3plus/locales","d3-array","d3-collection","d3-scale","d3-shape","open-color/open-color.js","@d3plus/color","@d3plus/data","@d3plus/math","@d3plus/format","d3-time-format","d3-selection","d3-transition","@d3plus/text","d3-interpolate","d3-color","textures","d3-interpolate-path","d3-brush","@popperjs/core","d3-queue","d3-zoom","lrucache","d3-geo","d3-geo-projection","d3-composite-projections","d3-tile","topojson-client","d3-force","d3-polygon","d3-hierarchy","d3-sankey"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).d3plus={},t.dom,t.locales,t.d3Array,t.d3Collection,t.scales,t.paths,t.pkg,t.color,t.data,t.math,t.format,t.d3TimeFormat,t.d3Selection,t.d3Transition,t.text,t.d3Interpolate,t.d3Color,t.textures,t.d3InterpolatePath,t.d3Brush,t.core,t.d3Queue,t.d3Zoom,t.lrucache,t.d3GeoCore,t.d3GeoProjection,t.d3CompositeProjections,t.d3Tile,t.topojsonClient,t.d3Force,t.d3Polygon,t.d3Hierarchy,t.d3Sankey)})(this,function(t,Pt,$,Dt,Ot,k,m,g,A,Lt,E,Tt,N,j,I,H,z,n,c,u,y,x,b,d,v,C,w,S,M,P,D,O,f,e){function L(e){var s=Object.create(null);return e&&Object.keys(e).forEach(function(t){var i;"default"!==t&&(i=Object.getOwnPropertyDescriptor(e,t),Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:function(){return e[t]}}))}),s.default=e,Object.freeze(s)}var $t=L(k),Et=L(m),C=L(C),w=L(w),S=L(S);
8
8
  /**
9
9
  @function accessor
10
10
  @desc Wraps an object key in a simple accessor function.
@@ -1260,20 +1260,20 @@ if(R(n[0])&&R(n[n.length-1]))this._d3ScaleNegative=this._d3Scale.copy().domain(n
1260
1260
  /**
1261
1261
  * Pre-calculates the size of the title, if defined, in order
1262
1262
  * to adjust the internal margins.
1263
- */this._title&&({fontFamily:A,fontSize:M,lineHeight:z}=this._titleConfig,M=(A=H.textWrap().fontFamily("function"==typeof A?A():A).fontSize("function"==typeof M?M():M).lineHeight("function"==typeof z?z():z).width(v[v.length-1]-v[0]-2*f).height(this["_"+_]-this._tickSize-2*f))(this._title).lines.length,x[this._orient]=M*A.lineHeight()+f);let k="Circle"===this._shape?"function"==typeof this._shapeConfig.r?this._shapeConfig.r({tick:!0}):this._shapeConfig.r:"Rect"===this._shape?"function"==typeof this._shapeConfig[_]?this._shapeConfig[_]({tick:!0}):this._shapeConfig[_]:this._tickSize,o=y({tick:!0});"function"==typeof k&&(k=Dt.max(C.map(k))),"Rect"===this._shape&&(k/=2),"function"==typeof o&&(o=Dt.max(C.map(o))),"Circle"!==this._shape&&(o/=2)
1263
+ */this._title&&({fontFamily:A,fontSize:M,lineHeight:z}=this._titleConfig,M=(A=H.textWrap().fontFamily("function"==typeof A?A():A).fontSize("function"==typeof M?M():M).lineHeight("function"==typeof z?z():z).width(v[v.length-1]-v[0]-2*f).height(this["_"+_]-this._tickSize-2*f))(this._title).lines.length,x[this._orient]=M*A.lineHeight()+f);let S="Circle"===this._shape?"function"==typeof this._shapeConfig.r?this._shapeConfig.r({tick:!0}):this._shapeConfig.r:"Rect"===this._shape?"function"==typeof this._shapeConfig[_]?this._shapeConfig[_]({tick:!0}):this._shapeConfig[_]:this._tickSize,o=y({tick:!0});"function"==typeof S&&(S=Dt.max(C.map(S))),"Rect"===this._shape&&(S/=2),"function"==typeof o&&(o=Dt.max(C.map(o))),"Circle"!==this._shape&&(o/=2)
1264
1264
  /**
1265
1265
  * Calculates the text wrapping and size of a given textData object.
1266
1266
  * @param {Object} datum
1267
- */;let S=[];function l(t=1){let a=this._shapeConfig.labelConfig.fontSize,r=this._shapeConfig.labelConfig.fontFamily||H.fontFamily,o=this._shapeConfig.labelConfig.padding,e=(
1267
+ */;let k=[];function l(t=1){let a=this._shapeConfig.labelConfig.fontSize,r=this._shapeConfig.labelConfig.fontFamily||H.fontFamily,o=this._shapeConfig.labelConfig.padding,e=(
1268
1268
  /**
1269
1269
  * Calculates the space each label would take up, given
1270
1270
  * the provided this._space size.
1271
- */S=b.map((t,i)=>{var e="function"==typeof r?r(t,i):r,s="function"==typeof o?o(t,i):o,h="function"==typeof a?a(t,i):a,n=this._getPosition(t);return{d:t,i:i,fF:e,fP:s,fS:h,lineHeight:this._shapeConfig.lineHeight?this._shapeConfig.lineHeight(t,i):1.4*h,position:n,rotate:this._labelRotation}}),"band"===this._scale?this._d3Scale.bandwidth():S.reduce((t,i,e)=>{var i=i.position,s=e?i-(i-S[e-1].position):1===S.length?m[0]:i-(S[e+1].position-i),s=Math.abs(i-s),e=e==S.length-1?1===S.length?m[1]:i+(i-S[e-1].position):i-(i-S[e+1].position),i=Math.abs(i-e),e="point"===this._scale?1:2;return Dt.max([Dt.max([s,i])*e,t])},0)),l=(S=S.map(t=>{t.space=e-2*t.fP;var i=function(t){var{d:t,i,fF:e,fP:s,fS:h,rotate:n,space:a}=t,r=n?"width":"height",n=n?"height":"width",o=Dt.min([this._maxSize,this._width]),l=Dt.min([this._maxSize,this._height]);return(e=H.textWrap().fontFamily(e).fontSize(h).lineHeight(this._shapeConfig.lineHeight?this._shapeConfig.lineHeight(t,i):void 0))[n](c?a:o-k-f-this._margin.left-this._margin.right),e[r](c?l-k-f-this._margin.top-this._margin.bottom:a),(h=e(w(t))).lines=h.lines.filter(t=>""!==t),h.width=h.lines.length?Math.ceil(Dt.max(h.widths)):0,h.height=h.lines.length?Math.ceil(h.lines.length*e.lineHeight())+s:0,h}
1272
- /** Calculates label offsets */.bind(this)(t);return Object.assign(i,t)})).slice().reverse();S.forEach(t=>{let{fP:i,i:e,position:s}=t;var h=c?"width":"height";let n=!!e&&l.find(t=>t.i<e&&!t.truncated);if(e===S.length-1)for(;n&&s-t[h]/2-i<n.position+n[h]/2;)n.truncated=!0,n=l.find(t=>t.i<e&&!t.truncated);t.truncated=!!n&&s-t[h]/2-i<n.position+n[h]/2}),1<t&&function(h=[]){let n=0;h.forEach(t=>{var i=h[t.i-1],e=t.rotate&&c||!t.rotate&&!c?"width":"height",s=t.rotate&&c||!t.rotate&&!c?"height":"width";i?i.position+i[s]/2>t.position-t[s]/2&&(n=n?(t.offset=i[e],0):1):n=1})}.bind(this)(S)}l.bind(this)();var z=this._labelOffset&&S.some(t=>t.truncated),M=(z&&l.bind(this)(2)
1271
+ */k=b.map((t,i)=>{var e="function"==typeof r?r(t,i):r,s="function"==typeof o?o(t,i):o,h="function"==typeof a?a(t,i):a,n=this._getPosition(t);return{d:t,i:i,fF:e,fP:s,fS:h,lineHeight:this._shapeConfig.lineHeight?this._shapeConfig.lineHeight(t,i):1.4*h,position:n,rotate:this._labelRotation}}),"band"===this._scale?this._d3Scale.bandwidth():k.reduce((t,i,e)=>{var i=i.position,s=e?i-(i-k[e-1].position):1===k.length?m[0]:i-(k[e+1].position-i),s=Math.abs(i-s),e=e==k.length-1?1===k.length?m[1]:i+(i-k[e-1].position):i-(i-k[e+1].position),i=Math.abs(i-e),e="point"===this._scale?1:2;return Dt.max([Dt.max([s,i])*e,t])},0)),l=(k=k.map(t=>{t.space=e-2*t.fP;var i=function(t){var{d:t,i,fF:e,fP:s,fS:h,rotate:n,space:a}=t,r=n?"width":"height",n=n?"height":"width",o=Dt.min([this._maxSize,this._width]),l=Dt.min([this._maxSize,this._height]);return(e=H.textWrap().fontFamily(e).fontSize(h).lineHeight(this._shapeConfig.lineHeight?this._shapeConfig.lineHeight(t,i):void 0))[n](c?a:o-S-f-this._margin.left-this._margin.right),e[r](c?l-S-f-this._margin.top-this._margin.bottom:a),(h=e(w(t))).lines=h.lines.filter(t=>""!==t),h.width=h.lines.length?Math.ceil(Dt.max(h.widths)):0,h.height=h.lines.length?Math.ceil(h.lines.length*e.lineHeight())+s:0,h}
1272
+ /** Calculates label offsets */.bind(this)(t);return Object.assign(i,t)})).slice().reverse();k.forEach(t=>{let{fP:i,i:e,position:s}=t;var h=c?"width":"height";let n=!!e&&l.find(t=>t.i<e&&!t.truncated);if(e===k.length-1)for(;n&&s-t[h]/2-i<n.position+n[h]/2;)n.truncated=!0,n=l.find(t=>t.i<e&&!t.truncated);t.truncated=!!n&&s-t[h]/2-i<n.position+n[h]/2}),1<t&&function(h=[]){let n=0;h.forEach(t=>{var i=h[t.i-1],e=t.rotate&&c||!t.rotate&&!c?"width":"height",s=t.rotate&&c||!t.rotate&&!c?"height":"width";i?i.position+i[s]/2>t.position-t[s]/2&&(n=n?(t.offset=i[e],0):1):n=1})}.bind(this)(k)}l.bind(this)();var z=this._labelOffset&&k.some(t=>t.truncated),M=(z&&l.bind(this)(2)
1273
1273
  /**
1274
1274
  * "spillover" will contain the pixel spillover of the first and last label,
1275
1275
  * and then adjust the scale range accordingly.
1276
- */,[0,1].map(t=>{var i,e,s,h=S[t?S.length-1:0];return!h||({height:h,position:i,rotate:s,width:e}=h,t=t?m[1]:m[0],s=(s||!c?h:e)/2,Math.abs(i-t)>=s)?0:Math.abs(s-(i-t))})),[A,B]=v,M=[A+M[0],B-M[1]];this._range&&(void 0!==this._range[0]&&(M[0]=this._range[0]),void 0!==this._range[this._range.length-1])&&(M[1]=this._range[this._range.length-1]),M[0]===A&&M[1]===B||(r.bind(this)(M),l.bind(this)(z?2:1));let P=Dt.max(S,t=>t.height)||0,D=(this._labelRotation=c&&void 0===this._labelRotation?S.some(t=>{var{i:t,height:i,position:e,truncated:s}=t,h=S[t-1];return s||t&&h.position+h.height/2>e-i/2}):this._labelRotation,this._labelOffset?Dt.max(S,t=>t.offset||0):0);S.forEach(t=>t.offset=t.offset?D:0);A="Line"===this._shape?0:k;let O=this._outerBounds={[_]:(Dt.max(S,t=>Math.ceil(t[t.rotate||!c?"width":"height"]+t.offset))||0)+(S.length?f:0),[i]:m[m.length-1]-m[0],[d]:m[0]};O[_]=Dt.max([this._minSize,O[_]]),x[this._orient]+=k,x[u]=void 0!==this._gridSize?Dt.max([this._gridSize,A]):this["_"+_]-x[this._orient]-O[_]-f,O[_]+=x[u]+x[this._orient],O[g]="start"===this._align?this._padding:"end"===this._align?this["_"+_]-O[_]-this._padding:this["_"+_]/2-O[_]/2;B=Pt.elem("g#d3plus-Axis-"+this._uuid,{parent:s}),this._group=B,M=Pt.elem("g.grid",{parent:B}).selectAll("line").data((0!==this._gridSize?this._grid||"log"===this._scale&&!this._gridLog?b:C:[]).map(t=>({id:t})),t=>t.id),M.exit().transition(h).attr("opacity",0).call(this._gridPosition.bind(this)).remove(),M.enter().append("line").attr("opacity",0).attr("clip-path",`url(#${e})`).call(this._gridPosition.bind(this),!0).merge(M).transition(h).attr("opacity",1).call(this._gridPosition.bind(this)),z=b.filter((t,i)=>S[i].lines.length&&!C.includes(t));let L=S.some(t=>t.rotate),T=C.concat(z).map(i=>{var t=S.find(t=>t.d===i),e=this._getPosition(i),s=t?t.space:0,h=t?t.lines.length:1,n=t?t.lineHeight:1,a=t?t.fP:0,r=t&&this._labelOffset?t.offset:0,o=c?s:O.width-x[this._position.opposite]-k-x[this._orient]+f,l=x[u],r=(k+r)*(p?-1:1),l=p?O[g]+O[_]-l:O[g]+l;return{id:i,labelBounds:L&&t?{x:-t.width/2+t.fS/4,y:"bottom"===this._orient?r+(t.width-n*h)/2+a:2*r-(t.width+n*h)/2+a,width:t.width,height:t.height}:{x:c?-s/2:"left"===this._orient?-o-f+r:r+f,y:c?"bottom"===this._orient?r+a:r-P-a:-s/2,width:c?s:o,height:c?P:s},rotate:!!t&&t.rotate,size:b.includes(i)||"log"===this._scale&&Math.log10(Math.abs(i))%1==0?r:C.includes(i)?Math.ceil(r/2):this._data.find(t=>+t===i)?Math.ceil(r/4):0,text:!((t||{}).truncated||!b.includes(i))&&w(i),tick:C.includes(i),[d]:e+("band"===this._scale?this._d3Scale.bandwidth()/2:0),[g]:l}});"Line"===this._shape&&(T=T.concat(T.map(t=>{var i=Object.assign({},t);return i[g]+=t.size,i}))),(new Wt[this._shape]).data(T).duration(this._duration).labelConfig({ellipsis:t=>t&&t.length?t+"...":"",rotate:t=>t.rotate?-90:0}).select(Pt.elem("g.ticks",{parent:B}).node()).config(jt.bind(this)(this._shapeConfig)).labelConfig({padding:0}).render();A=B.selectAll("line.bar").data([null]);return A.enter().append("line").attr("class","bar").attr("opacity",0).call(this._barPosition.bind(this)).merge(A).transition(h).attr("opacity",1).call(this._barPosition.bind(this)),this._titleClass.data(this._title?[{text:this._title}]:[]).duration(this._duration).height(x[this._orient]).rotate("left"===this._orient?-90:"right"===this._orient?90:0).select(Pt.elem("g.d3plus-Axis-title",{parent:B}).node()).text(t=>t.text).verticalAlign("middle").width(v[v.length-1]-v[0]).x(c?v[0]:"left"===this._orient?O.x+x.left/2-(v[v.length-1]-v[0])/2:O.x+O.width-x.right/2-(v[v.length-1]-v[0])/2).y(c?"bottom"===this._orient?O.y+O.height-x.bottom:O.y:v[0]+(v[v.length-1]-v[0])/2-x[this._orient]/2).config(jt.bind(this)(this._titleConfig)).render(),this._lastScale=this._getPosition.bind(this),t&&setTimeout(t,this._duration+100),this}
1276
+ */,[0,1].map(t=>{var i,e,s,h=k[t?k.length-1:0];return!h||({height:h,position:i,rotate:s,width:e}=h,t=t?m[1]:m[0],s=(s||!c?h:e)/2,Math.abs(i-t)>=s)?0:Math.abs(s-(i-t))})),[A,B]=v,M=[A+M[0],B-M[1]];this._range&&(void 0!==this._range[0]&&(M[0]=this._range[0]),void 0!==this._range[this._range.length-1])&&(M[1]=this._range[this._range.length-1]),M[0]===A&&M[1]===B||(r.bind(this)(M),l.bind(this)(z?2:1));let P=Dt.max(k,t=>t.height)||0,D=(this._labelRotation=c&&void 0===this._labelRotation?k.some(t=>{var{i:t,height:i,position:e,truncated:s}=t,h=k[t-1];return s||t&&h.position+h.height/2>e-i/2}):this._labelRotation,this._labelOffset?Dt.max(k,t=>t.offset||0):0);k.forEach(t=>t.offset=t.offset?D:0);A="Line"===this._shape?0:S;let O=this._outerBounds={[_]:(Dt.max(k,t=>Math.ceil(t[t.rotate||!c?"width":"height"]+t.offset))||0)+(k.length?f:0),[i]:m[m.length-1]-m[0],[d]:m[0]};O[_]=Dt.max([this._minSize,O[_]]),x[this._orient]+=S,x[u]=void 0!==this._gridSize?Dt.max([this._gridSize,A]):this["_"+_]-x[this._orient]-O[_]-f,O[_]+=x[u]+x[this._orient],O[g]="start"===this._align?this._padding:"end"===this._align?this["_"+_]-O[_]-this._padding:this["_"+_]/2-O[_]/2;B=Pt.elem("g#d3plus-Axis-"+this._uuid,{parent:s}),this._group=B,M=Pt.elem("g.grid",{parent:B}).selectAll("line").data((0!==this._gridSize?this._grid||"log"===this._scale&&!this._gridLog?b:C:[]).map(t=>({id:t})),t=>t.id),M.exit().transition(h).attr("opacity",0).call(this._gridPosition.bind(this)).remove(),M.enter().append("line").attr("opacity",0).attr("clip-path",`url(#${e})`).call(this._gridPosition.bind(this),!0).merge(M).transition(h).attr("opacity",1).call(this._gridPosition.bind(this)),z=b.filter((t,i)=>k[i].lines.length&&!C.includes(t));let L=k.some(t=>t.rotate),T=C.concat(z).map(i=>{var t=k.find(t=>t.d===i),e=this._getPosition(i),s=t?t.space:0,h=t?t.lines.length:1,n=t?t.lineHeight:1,a=t?t.fP:0,r=t&&this._labelOffset?t.offset:0,o=c?s:O.width-x[this._position.opposite]-S-x[this._orient]+f,l=x[u],r=(S+r)*(p?-1:1),l=p?O[g]+O[_]-l:O[g]+l;return{id:i,labelBounds:L&&t?{x:-t.width/2+t.fS/4,y:"bottom"===this._orient?r+(t.width-n*h)/2+a:2*r-(t.width+n*h)/2+a,width:t.width,height:t.height}:{x:c?-s/2:"left"===this._orient?-o-f+r:r+f,y:c?"bottom"===this._orient?r+a:r-P-a:-s/2,width:c?s:o,height:c?P:s},rotate:!!t&&t.rotate,size:b.includes(i)||"log"===this._scale&&Math.log10(Math.abs(i))%1==0?r:C.includes(i)?Math.ceil(r/2):this._data.find(t=>+t===i)?Math.ceil(r/4):0,text:!((t||{}).truncated||!b.includes(i))&&w(i),tick:C.includes(i),[d]:e+("band"===this._scale?this._d3Scale.bandwidth()/2:0),[g]:l}});"Line"===this._shape&&(T=T.concat(T.map(t=>{var i=Object.assign({},t);return i[g]+=t.size,i}))),(new Wt[this._shape]).data(T).duration(this._duration).labelConfig({ellipsis:t=>t&&t.length?t+"...":"",rotate:t=>t.rotate?-90:0}).select(Pt.elem("g.ticks",{parent:B}).node()).config(jt.bind(this)(this._shapeConfig)).labelConfig({padding:0}).render();A=B.selectAll("line.bar").data([null]);return A.enter().append("line").attr("class","bar").attr("opacity",0).call(this._barPosition.bind(this)).merge(A).transition(h).attr("opacity",1).call(this._barPosition.bind(this)),this._titleClass.data(this._title?[{text:this._title}]:[]).duration(this._duration).height(x[this._orient]).rotate("left"===this._orient?-90:"right"===this._orient?90:0).select(Pt.elem("g.d3plus-Axis-title",{parent:B}).node()).text(t=>t.text).verticalAlign("middle").width(v[v.length-1]-v[0]).x(c?v[0]:"left"===this._orient?O.x+x.left/2-(v[v.length-1]-v[0])/2:O.x+O.width-x.right/2-(v[v.length-1]-v[0])/2).y(c?"bottom"===this._orient?O.y+O.height-x.bottom:O.y:v[0]+(v[v.length-1]-v[0])/2-x[this._orient]/2).config(jt.bind(this)(this._titleConfig)).render(),this._lastScale=this._getPosition.bind(this),t&&setTimeout(t,this._duration+100),this}
1277
1277
  /**
1278
1278
  @memberof Axis
1279
1279
  @desc If *value* is specified, sets the horizontal alignment to the specified value and returns the current class instance.
@@ -1669,7 +1669,7 @@ return this._shapes=[],["Circle","Rect"].forEach(i=>{this._shapes.push((new Wt[i
1669
1669
  @chainable
1670
1670
  */render(t){void 0===this._select&&this.select(j.select("body").append("svg").attr("width",this._width+"px").attr("height",this._height+"px").node());var r=["bottom","top"].includes(this._orient),o=r?"height":"width",l=r?"width":"height",_=r?"x":"y",d=r?"y":"x";
1671
1671
  // Shape <g> Group
1672
- this._group=Pt.elem("g.d3plus-ColorScale",{parent:this._select});let s=this._data.map(this._value).filter(t=>null!==t&&"number"==typeof t).sort((t,i)=>t-i);var g=this._domain||Dt.extent(s);let i=g[0]<this._midpoint;var c=g[1]>this._midpoint,u=i&&c;let n=Dt.min([this._buckets instanceof Array?this._buckets.length:this._buckets,u&&"jenks"!==this._scale?2*Math.floor(Lt.unique(s).length/2)-1:Lt.unique(s).length]),p=u&&(!this._color||this._color instanceof Array&&!this._color.includes(this._colorMid))?void 0:this._color,f,m;if(!p||p instanceof Array||(p=Dt.range(0,n,1).map(t=>A.colorLighter(p,(t+1)/n)).reverse()),"jenks"===this._scale){var y=Dt.min([p?p.length:n,n,s.length]);let t=[];m=this._buckets instanceof Array?this._buckets:(t=u&&this._centered?(b=Math.floor(y/2),a=y%2,x=s.filter(t=>t<this._midpoint),k=Dt.deviation(x),C=s.concat(this._midpoint).filter(t=>t>=this._midpoint),v=k<(w=Dt.deviation(C))?1:0,w=E.ckmeans(x,Dt.min([b+a*(w<k?1:0),x.length])),k=E.ckmeans(C,Dt.min([b+a*v,C.length])),w.concat(k)):E.ckmeans(s,y)).map(t=>t[0]);var x=new Set(m);if(m.length!==x.size&&(f=Array.from(x)),!p)if(u){p=[this._colorMin,this._colorMid,this._colorMax];let e=m.slice(0,y).filter((t,i)=>t<this._midpoint&&m[i+1]<=this._midpoint);var b=m.slice(0,y).filter((t,i)=>t<=this._midpoint&&m[i+1]>this._midpoint);let s=m.slice(0,y).filter(t=>t>this._midpoint);var a=e.map((t,i)=>i?A.colorLighter(p[0],i/e.length):p[0]),v=b.map(()=>p[1]),C=s.map((t,i)=>i===s.length-1?p[2]:A.colorLighter(p[2],1-(i+1)/s.length));p=a.concat(v).concat(C)}else p=Dt.range(0,n,1).map(t=>A.colorLighter(this._colorMax,t/n)).reverse();p=[(p=m.length<=y?p.slice(-m.length):p)[0]].concat(p),this._colorScale=S.scaleThreshold().domain(m).range(p)}else{let h=this._buckets instanceof Array?this._buckets:void 0;if(u&&!p){let i=Math.floor(n/2),e=z.interpolateRgb.gamma(2.2)(this._colorMin,this._colorMid);var w=Dt.range(0,i,1).map(t=>e(t/i)),k=(n%2?[0]:[]).map(()=>this._colorMid);let s=z.interpolateRgb.gamma(2.2)(this._colorMax,this._colorMid);var x=Dt.range(0,i,1).map(t=>s(t/i)).reverse();p=w.concat(k).concat(x),h||(b=(p.length-1)/2,h=[g[0],this._midpoint,g[1]],h=Dt.range(g[0],this._midpoint,-(g[0]-this._midpoint)/b).concat(Dt.range(this._midpoint,g[1],(g[1]-this._midpoint)/b)).concat([g[1]]))}else p||("buckets"===this._scale||"quantile"===this._scale?(p=Dt.range(0,n,1).map(t=>A.colorLighter(i?this._colorMin:this._colorMax,t/n)),c&&(p=p.reverse())):p=i?[this._colorMin,A.colorLighter(this._colorMin,.8)]:[A.colorLighter(this._colorMax,.8),this._colorMax]),h=h||("quantile"===this._scale?(a=1/(p.length-1),Dt.range(0,1+a/2,a).map(t=>Dt.quantile(s,t))):u&&this._color&&this._centered?(v=p.indexOf(this._colorMid),C=(this._midpoint-g[0])/v,y=(g[1]-this._midpoint)/(p.length-v),w=Dt.range(g[0],this._midpoint,C),k=Dt.range(this._midpoint,g[1]+y/2,y),w.concat(k)):(x=(g[1]-g[0])/(p.length-1),Dt.range(g[0],g[1]+x/2,x)));if("buckets"===this._scale||"quantile"===this._scale)m=h,p=[p[0]].concat(p);else if("log"===this._scale){b=h.filter(t=>t<0);if(b.length){let i=b[0],e=b.map(t=>-Math.pow(Math.abs(i),t/i));b.forEach((t,i)=>{h[h.indexOf(t)]=e[i]})}c=h.filter(t=>0<t);if(c.length){let i=c[c.length-1],e=c.map(t=>Math.pow(i,t/i));c.forEach((t,i)=>{h[h.indexOf(t)]=e[i]})}h.includes(0)&&(h[h.indexOf(0)]=1)}this._colorScale=("buckets"===this._scale||"quantile"===this._scale?S.scaleThreshold:S.scaleLinear)().domain(h).range(p)}this._colorScale.clamp&&this._colorScale.clamp(!0);a=this._bucketAxis||!["buckets","jenks","quantile"].includes(this._scale),u=I.transition().duration(this._duration),v={enter:{opacity:0},exit:{opacity:0},parent:this._group,transition:u,update:{opacity:1}},C=Pt.elem("g.d3plus-ColorScale-labels",Object.assign({condition:a},v)),y=Pt.elem("g.d3plus-ColorScale-Rect",Object.assign({condition:a},v)),w=Pt.elem("g.d3plus-ColorScale-legend",Object.assign({condition:!a},v));if(a){k={x:0,y:0};let e=g.slice();this._bucketAxis&&(x=e[e.length-1],b=e[e.length-2],u=1<=(c=x?x/10:b/10)||c<=-1?Math.round(c).toString().length-1:-1*c.toString().split(".")[1].replace(/([1-9])[1-9].*$/,"$1").length,g=Math.pow(10,u),e[e.length-1]=x+g);b=Pt.assign({domain:r?e:e.slice().reverse(),duration:this._duration,height:this._height,labels:f||m,orient:this._orient,padding:this._padding,scale:"log"===this._scale?"log":"linear",ticks:m,width:this._width},this._axisConfig),c=Pt.assign({height:this["_"+o]/2,width:this["_"+l]/2},this._labelConfig),u=(this._labelClass.config(c),[]),x=(r&&this._labelMin&&((x={"font-family":this._labelClass.fontFamily()(this._labelMin),"font-size":this._labelClass.fontSize()(this._labelMin),"font-weight":this._labelClass.fontWeight()(this._labelMin)})["font-family"]instanceof Array&&(x["font-family"]=x["font-family"][0]),g=Pt.textWidth(this._labelMin,x))&&g<this["_"+l]/2&&(u.push(this._labelMin),g+=this._padding,r&&(k.x+=g),b[l]-=g),r&&this._labelMax&&((x={"font-family":this._labelClass.fontFamily()(this._labelMax),"font-size":this._labelClass.fontSize()(this._labelMax),"font-weight":this._labelClass.fontWeight()(this._labelMax)})["font-family"]instanceof Array&&(x["font-family"]=x["font-family"][0]),g=Pt.textWidth(this._labelMax,x))&&g<this["_"+l]/2&&(u.push(this._labelMax),g+=this._padding,r||(k.y+=g),b[l]-=g),this._axisTest.select(Pt.elem("g.d3plus-ColorScale-axisTest",{enter:{opacity:0},parent:this._group}).node()).config(b).duration(0).render(),this._axisTest.outerBounds()),g=(this._outerBounds[l]=this["_"+l]-2*this._padding,this._outerBounds[o]=x[o]+this._size,this._outerBounds[_]=this._padding,this._outerBounds[d]=this._padding,"middle"===this._align?this._outerBounds[d]=(this["_"+o]-this._outerBounds[o])/2:"end"===this._align&&(this._outerBounds[d]=this["_"+o]-this._padding-this._outerBounds[o]),this._outerBounds[d]+(["bottom","right"].includes(this._orient)?this._size:0)-(b.padding||this._axisClass.padding())),g=`translate(${k.x+(r?0:g)}, ${k.y+(r?g:0)})`;this._axisClass.select(Pt.elem("g.d3plus-ColorScale-axis",Pt.assign(v,{condition:!0,enter:{transform:g},update:{transform:g}})).node()).config(b).align("start").render();let s=this._axisTest._getPosition.bind(this._axisTest);g=this._axisTest._getRange();let t=this._group.selectAll("defs").data([0]);b=t.enter().append("defs"),b=(b.append("linearGradient").attr("id","gradient-"+this._uuid),(t=b.merge(t)).select("linearGradient").attr(_+"1",r?"0%":"100%").attr(_+"2",r?"100%":"0%").attr(d+"1","0%").attr(d+"2","0%"),t.select("linearGradient").selectAll("stop").data(p));let h=this._colorScale.domain(),n=S.scaleLinear().domain(g).range(r?[0,100]:[100,0]),a=(b.enter().append("stop").merge(b).attr("offset",(t,i)=>`${i<=h.length-1?n(s(h[i])):100}%`).attr("stop-color",String),(t,i)=>{i=m[i+1]||e[e.length-1];return Math.abs(s(i)-s(t))}),i=Pt.assign({duration:this._duration,fill:m?t=>this._colorScale(t):`url(#gradient-${this._uuid})`,[_]:m?(t,i)=>s(t)+a(t,i)/2-(["left","right"].includes(this._orient)?a(t,i):0):g[0]+(g[1]-g[0])/2+k[_],[d]:this._outerBounds[d]+(["top","left"].includes(this._orient)?x[o]:0)+this._size/2+k[d],[l]:m?a:g[1]-g[0],[o]:this._size},this._rectConfig);this._rectClass.data(m||[0]).id((t,i)=>i).select(y.node()).config(i).render(),c.height=this._outerBounds[o],c.width=this._outerBounds[l],this._labelClass.config(c).data(u).select(C.node()).x(t=>t===this._labelMax?i.x+i.width/2+this._padding:this._outerBounds.x).y(t=>i.y-this._labelClass.fontSize()(t)/2).text(t=>t).rotate(r?0:"right"===this._orient?90:-90).render()}else{Pt.elem("g.d3plus-ColorScale-axis",Object.assign({condition:a},v));let t=m.reduce((t,i,e)=>{i=this._bucketFormat.bind(this)(i,e,m,s);return t.push({color:p[e+1],id:i}),t},[]);r||(t=t.reverse());b=Pt.assign({align:r?"center":{start:"left",middle:"center",end:"right"}[this._align],direction:r?"row":"column",duration:this._duration,height:this._height,padding:this._padding,shapeConfig:Pt.assign({duration:this._duration},this._axisConfig.shapeConfig||{}),title:this._axisConfig.title,titleConfig:this._axisConfig.titleConfig||{},width:this._width,verticalAlign:r?{start:"top",middle:"middle",end:"bottom"}[this._align]:"middle"},this._legendConfig);this._legendClass.data(t).select(w.node()).config(b).render(),this._outerBounds=this._legendClass.outerBounds()}return t&&setTimeout(t,this._duration+100),this}
1672
+ this._group=Pt.elem("g.d3plus-ColorScale",{parent:this._select});let s=this._data.map(this._value).filter(t=>null!==t&&"number"==typeof t).sort((t,i)=>t-i);var g=this._domain||Dt.extent(s);let i=g[0]<this._midpoint;var c=g[1]>this._midpoint,u=i&&c;let n=Dt.min([this._buckets instanceof Array?this._buckets.length:this._buckets,u&&"jenks"!==this._scale?2*Math.floor(Lt.unique(s).length/2)-1:Lt.unique(s).length]),p=u&&(!this._color||this._color instanceof Array&&!this._color.includes(this._colorMid))?void 0:this._color,f,m;if(!p||p instanceof Array||(p=Dt.range(0,n,1).map(t=>A.colorLighter(p,(t+1)/n)).reverse()),"jenks"===this._scale){var y=Dt.min([p?p.length:n,n,s.length]);let t=[];m=this._buckets instanceof Array?this._buckets:(t=u&&this._centered?(b=Math.floor(y/2),a=y%2,x=s.filter(t=>t<this._midpoint),S=Dt.deviation(x),C=s.concat(this._midpoint).filter(t=>t>=this._midpoint),v=S<(w=Dt.deviation(C))?1:0,w=E.ckmeans(x,Dt.min([b+a*(w<S?1:0),x.length])),S=E.ckmeans(C,Dt.min([b+a*v,C.length])),w.concat(S)):E.ckmeans(s,y)).map(t=>t[0]);var x=new Set(m);if(m.length!==x.size&&(f=Array.from(x)),!p)if(u){p=[this._colorMin,this._colorMid,this._colorMax];let e=m.slice(0,y).filter((t,i)=>t<this._midpoint&&m[i+1]<=this._midpoint);var b=m.slice(0,y).filter((t,i)=>t<=this._midpoint&&m[i+1]>this._midpoint);let s=m.slice(0,y).filter(t=>t>this._midpoint);var a=e.map((t,i)=>i?A.colorLighter(p[0],i/e.length):p[0]),v=b.map(()=>p[1]),C=s.map((t,i)=>i===s.length-1?p[2]:A.colorLighter(p[2],1-(i+1)/s.length));p=a.concat(v).concat(C)}else p=Dt.range(0,n,1).map(t=>A.colorLighter(this._colorMax,t/n)).reverse();p=[(p=m.length<=y?p.slice(-m.length):p)[0]].concat(p),this._colorScale=k.scaleThreshold().domain(m).range(p)}else{let h=this._buckets instanceof Array?this._buckets:void 0;if(u&&!p){let i=Math.floor(n/2),e=z.interpolateRgb.gamma(2.2)(this._colorMin,this._colorMid);var w=Dt.range(0,i,1).map(t=>e(t/i)),S=(n%2?[0]:[]).map(()=>this._colorMid);let s=z.interpolateRgb.gamma(2.2)(this._colorMax,this._colorMid);var x=Dt.range(0,i,1).map(t=>s(t/i)).reverse();p=w.concat(S).concat(x),h||(b=(p.length-1)/2,h=[g[0],this._midpoint,g[1]],h=Dt.range(g[0],this._midpoint,-(g[0]-this._midpoint)/b).concat(Dt.range(this._midpoint,g[1],(g[1]-this._midpoint)/b)).concat([g[1]]))}else p||("buckets"===this._scale||"quantile"===this._scale?(p=Dt.range(0,n,1).map(t=>A.colorLighter(i?this._colorMin:this._colorMax,t/n)),c&&(p=p.reverse())):p=i?[this._colorMin,A.colorLighter(this._colorMin,.8)]:[A.colorLighter(this._colorMax,.8),this._colorMax]),h=h||("quantile"===this._scale?(a=1/(p.length-1),Dt.range(0,1+a/2,a).map(t=>Dt.quantile(s,t))):u&&this._color&&this._centered?(v=p.indexOf(this._colorMid),C=(this._midpoint-g[0])/v,y=(g[1]-this._midpoint)/(p.length-v),w=Dt.range(g[0],this._midpoint,C),S=Dt.range(this._midpoint,g[1]+y/2,y),w.concat(S)):(x=(g[1]-g[0])/(p.length-1),Dt.range(g[0],g[1]+x/2,x)));if("buckets"===this._scale||"quantile"===this._scale)m=h,p=[p[0]].concat(p);else if("log"===this._scale){b=h.filter(t=>t<0);if(b.length){let i=b[0],e=b.map(t=>-Math.pow(Math.abs(i),t/i));b.forEach((t,i)=>{h[h.indexOf(t)]=e[i]})}c=h.filter(t=>0<t);if(c.length){let i=c[c.length-1],e=c.map(t=>Math.pow(i,t/i));c.forEach((t,i)=>{h[h.indexOf(t)]=e[i]})}h.includes(0)&&(h[h.indexOf(0)]=1)}this._colorScale=("buckets"===this._scale||"quantile"===this._scale?k.scaleThreshold:k.scaleLinear)().domain(h).range(p)}this._colorScale.clamp&&this._colorScale.clamp(!0);a=this._bucketAxis||!["buckets","jenks","quantile"].includes(this._scale),u=I.transition().duration(this._duration),v={enter:{opacity:0},exit:{opacity:0},parent:this._group,transition:u,update:{opacity:1}},C=Pt.elem("g.d3plus-ColorScale-labels",Object.assign({condition:a},v)),y=Pt.elem("g.d3plus-ColorScale-Rect",Object.assign({condition:a},v)),w=Pt.elem("g.d3plus-ColorScale-legend",Object.assign({condition:!a},v));if(a){S={x:0,y:0};let e=g.slice();this._bucketAxis&&(x=e[e.length-1],b=e[e.length-2],u=1<=(c=x?x/10:b/10)||c<=-1?Math.round(c).toString().length-1:-1*c.toString().split(".")[1].replace(/([1-9])[1-9].*$/,"$1").length,g=Math.pow(10,u),e[e.length-1]=x+g);b=Pt.assign({domain:r?e:e.slice().reverse(),duration:this._duration,height:this._height,labels:f||m,orient:this._orient,padding:this._padding,scale:"log"===this._scale?"log":"linear",ticks:m,width:this._width},this._axisConfig),c=Pt.assign({height:this["_"+o]/2,width:this["_"+l]/2},this._labelConfig),u=(this._labelClass.config(c),[]),x=(r&&this._labelMin&&((x={"font-family":this._labelClass.fontFamily()(this._labelMin),"font-size":this._labelClass.fontSize()(this._labelMin),"font-weight":this._labelClass.fontWeight()(this._labelMin)})["font-family"]instanceof Array&&(x["font-family"]=x["font-family"][0]),g=Pt.textWidth(this._labelMin,x))&&g<this["_"+l]/2&&(u.push(this._labelMin),g+=this._padding,r&&(S.x+=g),b[l]-=g),r&&this._labelMax&&((x={"font-family":this._labelClass.fontFamily()(this._labelMax),"font-size":this._labelClass.fontSize()(this._labelMax),"font-weight":this._labelClass.fontWeight()(this._labelMax)})["font-family"]instanceof Array&&(x["font-family"]=x["font-family"][0]),g=Pt.textWidth(this._labelMax,x))&&g<this["_"+l]/2&&(u.push(this._labelMax),g+=this._padding,r||(S.y+=g),b[l]-=g),this._axisTest.select(Pt.elem("g.d3plus-ColorScale-axisTest",{enter:{opacity:0},parent:this._group}).node()).config(b).duration(0).render(),this._axisTest.outerBounds()),g=(this._outerBounds[l]=this["_"+l]-2*this._padding,this._outerBounds[o]=x[o]+this._size,this._outerBounds[_]=this._padding,this._outerBounds[d]=this._padding,"middle"===this._align?this._outerBounds[d]=(this["_"+o]-this._outerBounds[o])/2:"end"===this._align&&(this._outerBounds[d]=this["_"+o]-this._padding-this._outerBounds[o]),this._outerBounds[d]+(["bottom","right"].includes(this._orient)?this._size:0)-(b.padding||this._axisClass.padding())),g=`translate(${S.x+(r?0:g)}, ${S.y+(r?g:0)})`;this._axisClass.select(Pt.elem("g.d3plus-ColorScale-axis",Pt.assign(v,{condition:!0,enter:{transform:g},update:{transform:g}})).node()).config(b).align("start").render();let s=this._axisTest._getPosition.bind(this._axisTest);g=this._axisTest._getRange();let t=this._group.selectAll("defs").data([0]);b=t.enter().append("defs"),b=(b.append("linearGradient").attr("id","gradient-"+this._uuid),(t=b.merge(t)).select("linearGradient").attr(_+"1",r?"0%":"100%").attr(_+"2",r?"100%":"0%").attr(d+"1","0%").attr(d+"2","0%"),t.select("linearGradient").selectAll("stop").data(p));let h=this._colorScale.domain(),n=k.scaleLinear().domain(g).range(r?[0,100]:[100,0]),a=(b.enter().append("stop").merge(b).attr("offset",(t,i)=>`${i<=h.length-1?n(s(h[i])):100}%`).attr("stop-color",String),(t,i)=>{i=m[i+1]||e[e.length-1];return Math.abs(s(i)-s(t))}),i=Pt.assign({duration:this._duration,fill:m?t=>this._colorScale(t):`url(#gradient-${this._uuid})`,[_]:m?(t,i)=>s(t)+a(t,i)/2-(["left","right"].includes(this._orient)?a(t,i):0):g[0]+(g[1]-g[0])/2+S[_],[d]:this._outerBounds[d]+(["top","left"].includes(this._orient)?x[o]:0)+this._size/2+S[d],[l]:m?a:g[1]-g[0],[o]:this._size},this._rectConfig);this._rectClass.data(m||[0]).id((t,i)=>i).select(y.node()).config(i).render(),c.height=this._outerBounds[o],c.width=this._outerBounds[l],this._labelClass.config(c).data(u).select(C.node()).x(t=>t===this._labelMax?i.x+i.width/2+this._padding:this._outerBounds.x).y(t=>i.y-this._labelClass.fontSize()(t)/2).text(t=>t).rotate(r?0:"right"===this._orient?90:-90).render()}else{Pt.elem("g.d3plus-ColorScale-axis",Object.assign({condition:a},v));let t=m.reduce((t,i,e)=>{i=this._bucketFormat.bind(this)(i,e,m,s);return t.push({color:p[e+1],id:i}),t},[]);r||(t=t.reverse());b=Pt.assign({align:r?"center":{start:"left",middle:"center",end:"right"}[this._align],direction:r?"row":"column",duration:this._duration,height:this._height,padding:this._padding,shapeConfig:Pt.assign({duration:this._duration},this._axisConfig.shapeConfig||{}),title:this._axisConfig.title,titleConfig:this._axisConfig.titleConfig||{},width:this._width,verticalAlign:r?{start:"top",middle:"middle",end:"bottom"}[this._align]:"middle"},this._legendConfig);this._legendClass.data(t).select(w.node()).config(b).render(),this._outerBounds=this._legendClass.outerBounds()}return t&&setTimeout(t,this._duration+100),this}
1673
1673
  /**
1674
1674
  @memberof ColorScale
1675
1675
  @desc The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Axis](http://d3plus.org/docs/#Axis). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).
@@ -1878,27 +1878,27 @@ this._group=Pt.elem("g.d3plus-ColorScale",{parent:this._select});let s=this._dat
1878
1878
  @memberof TextBox
1879
1879
  @desc Renders the text boxes. If a *callback* is specified, it will be called once the shapes are done drawing.
1880
1880
  @param {Function} [*callback* = undefined]
1881
- */render(t){void 0===this._select&&this.select(j.select("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").node());let k=this;var i=this._select.selectAll(".d3plus-textBox").data(this._data.reduce((u,p,f)=>{let m=this._text(p,f);if(void 0!==m){m=H.trim(m);let e=this._fontResize(p,f),s=this._lineHeight(p,f)/this._fontSize(p,f),h=e?this._fontMax(p,f):this._fontSize(p,f),n=e?h*s:this._lineHeight(p,f),a=1,r=[],t,o,l={"font-family":Pt.fontExists(this._fontFamily(p,f)),"font-size":h,"font-weight":this._fontWeight(p,f),"line-height":n};var y,x,b,v=Pt.parseSides(this._padding(p,f)),C=this._height(p,f)-(v.top+v.bottom),w=this._width(p,f)-(v.left+v.right);let _=H.textWrap().fontFamily(l["font-family"]).fontSize(h).fontWeight(l["font-weight"]).lineHeight(n).maxLines(this._maxLines(p,f)).height(C).overflow(this._overflow(p,f)).width(w).split(this._split),d=this._fontMax(p,f),g=this._fontMin(p,f),i=this._verticalAlign(p,f),c=this._split(m,f);w>g&&(C>n||e&&C>g*s)&&(e&&(t=Pt.textWidth(c,l),x=1.165+w/C*.1,b=w*C,y=Dt.max(t),x=Dt.sum(t,t=>t*n)*x,(w<y||b<x)&&(b=Math.sqrt(b/x),x=Dt.min([b,w/y]),h=Math.floor(h*x)),b=Math.floor(.8*C),h>b)&&(h=b),
1881
+ */render(t){void 0===this._select&&this.select(j.select("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").node());let S=this;var i=this._select.selectAll(".d3plus-textBox").data(this._data.reduce((u,p,f)=>{let m=this._text(p,f);if(void 0!==m){m=H.trim(m);let e=this._fontResize(p,f),s=this._lineHeight(p,f)/this._fontSize(p,f),h=e?this._fontMax(p,f):this._fontSize(p,f),n=e?h*s:this._lineHeight(p,f),a=1,r=[],t,o,l={"font-family":Pt.fontExists(this._fontFamily(p,f)),"font-size":h,"font-weight":this._fontWeight(p,f),"line-height":n};var y,x,b,v=Pt.parseSides(this._padding(p,f)),C=this._height(p,f)-(v.top+v.bottom),w=this._width(p,f)-(v.left+v.right);let _=H.textWrap().fontFamily(l["font-family"]).fontSize(h).fontWeight(l["font-weight"]).lineHeight(n).maxLines(this._maxLines(p,f)).height(C).overflow(this._overflow(p,f)).width(w).split(this._split),d=this._fontMax(p,f),g=this._fontMin(p,f),i=this._verticalAlign(p,f),c=this._split(m,f);w>g&&(C>n||e&&C>g*s)&&(e&&(t=Pt.textWidth(c,l),x=1.165+w/C*.1,b=w*C,y=Dt.max(t),x=Dt.sum(t,t=>t*n)*x,(w<y||b<x)&&(b=Math.sqrt(b/x),x=Dt.min([b,w/y]),h=Math.floor(h*x)),b=Math.floor(.8*C),h>b)&&(h=b),
1882
1882
  /**
1883
1883
  Figures out the lineData to be used for wrapping.
1884
1884
  @private
1885
- */function t(){var i=()=>{a<1?r=[k._ellipsis("",a)]:r[a-1]=k._ellipsis(r[a-1],a)};
1885
+ */function t(){var i=()=>{a<1?r=[S._ellipsis("",a)]:r[a-1]=S._ellipsis(r[a-1],a)};
1886
1886
  // Constraint the font size
1887
1887
  h=Dt.max([h,g]),h=Dt.min([h,d]),e&&(n=h*s,_.fontSize(h).lineHeight(n),l["font-size"]=h,l["line-height"]=n),o=_(m),r=o.lines.filter(t=>""!==t),a=r.length,o.truncated&&(e?--h<g?(h=g,i):t:i)()}()),r.length&&(y=a*n,b=0!==(x=this._rotate(p,f))||"top"===i?0:"middle"===i?C/2-y/2:C-y,b-=.1*n,u.push({aH:this._ariaHidden(p,f),data:p,i:f,lines:r,fC:this._fontColor(p,f),fStroke:this._fontStroke(p,f),fSW:this._fontStrokeWidth(p,f),fF:l["font-family"],fO:this._fontOpacity(p,f),fW:l["font-weight"],id:this._id(p,f),tA:this._textAnchor(p,f),vA:this._verticalAlign(p,f),widths:o.widths,fS:h,lH:n,w:w,h:C,r:x,x:this._x(p,f)+v.left,y:this._y(p,f)+b+v.top}))}return u},[]),t=>this._id(t.data,t.i));let h=this._select.transition().duration(this._duration);
1888
1888
  /**
1889
1889
  * Applies translate and rotate to a text element.
1890
1890
  * @param {D3Selection} text
1891
1891
  * @private
1892
- */function e(t){t.attr("transform",(t,i)=>{i=k._rotateAnchor(t,i);return`translate(${t.x}, ${t.y}) rotate(${t.r}, ${i[0]}, ${i[1]})`})}0===this._duration?i.exit().remove():(i.exit().transition().delay(this._duration).remove(),i.exit().selectAll("text").transition(h).attr("opacity",0).style("opacity",0));var s=i.enter().append("g").attr("class","d3plus-textBox").attr("id",t=>"d3plus-textBox-"+H.strip(t.id)).call(e).merge(i);let n=Pt.rtl();s.order().style("pointer-events",t=>this._pointerEvents(t.data,t.i)).each(function(e){
1892
+ */function e(t){t.attr("transform",(t,i)=>{i=S._rotateAnchor(t,i);return`translate(${t.x}, ${t.y}) rotate(${t.r}, ${i[0]}, ${i[1]})`})}0===this._duration?i.exit().remove():(i.exit().transition().delay(this._duration).remove(),i.exit().selectAll("text").transition(h).attr("opacity",0).style("opacity",0));var s=i.enter().append("g").attr("class","d3plus-textBox").attr("id",t=>"d3plus-textBox-"+H.strip(t.id)).call(e).merge(i);let n=Pt.rtl();s.order().style("pointer-events",t=>this._pointerEvents(t.data,t.i)).each(function(e){
1893
1893
  /**
1894
1894
  Sets the inner text content of each <text> element.
1895
1895
  @private
1896
- */function t(t){let h=!1;t[k._html?"html":"text"](s=>{let t=H.trimRight(s).replace(/&([^;&]*)/g,(t,i)=>"amp"===i?t:"&amp;"+i).replace(/<([^A-z^/]+)/g,(t,i)=>"&lt;"+i).replace(/<$/g,"&lt;").replace(/(<[^>^/]+>)([^<^>]+)$/g,(t,i,e)=>""+i+e+i.replace("<","</")).replace(/^([^<^>]+)(<\/[^>]+>)/g,(t,i,e)=>""+e.replace("</","<")+i+e);// ands start tag to lines after mid-HTML break
1897
- var i=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(i)?t=t.replace(i,(t,i,e)=>(h=!!k._html[i]&&i)?(i=k._html[h],s.includes(`</${h}>`)&&(h=!1),`<tspan style="${i}">${e}</tspan>`):e):h.length&&(t=`<tspan style="${k._html[h]}">${t}</tspan>`),t})}
1896
+ */function t(t){let h=!1;t[S._html?"html":"text"](s=>{let t=H.trimRight(s).replace(/&([^;&]*)/g,(t,i)=>"amp"===i?t:"&amp;"+i).replace(/<([^A-z^/]+)/g,(t,i)=>"&lt;"+i).replace(/<$/g,"&lt;").replace(/(<[^>^/]+>)([^<^>]+)$/g,(t,i,e)=>""+i+e+i.replace("<","</")).replace(/^([^<^>]+)(<\/[^>]+>)/g,(t,i,e)=>""+e.replace("</","<")+i+e);// ands start tag to lines after mid-HTML break
1897
+ var i=new RegExp(/<([A-z]+)[^>]*>([^<^>]+)<\/[^>]+>/g);return t.match(i)?t=t.replace(i,(t,i,e)=>(h=!!S._html[i]&&i)?(i=S._html[h],s.includes(`</${h}>`)&&(h=!1),`<tspan style="${i}">${e}</tspan>`):e):h.length&&(t=`<tspan style="${S._html[h]}">${t}</tspan>`),t})}
1898
1898
  /**
1899
1899
  Styles to apply to each <text> element.
1900
1900
  @private
1901
- */function i(t){t.attr("aria-hidden",e.aH).attr("dir",n?"rtl":"ltr").attr("fill",e.fC).attr("stroke",e.fStroke).attr("stroke-width",e.fSW).attr("text-anchor",e.tA).attr("font-family",e.fF).style("font-family",e.fF).attr("font-size",e.fS+"px").style("font-size",e.fS+"px").attr("font-weight",e.fW).style("font-weight",e.fW).attr("x",`${"middle"===e.tA?e.w/2:n?"start"===e.tA?e.w:0:"end"===e.tA?e.w:2*Math.sin(Math.PI*e.r/180)}px`).attr("y",(t,i)=>0===e.r||"top"===e.vA?(i+1)*e.lH-(e.lH-e.fS)+"px":"middle"===e.vA?(e.h+e.fS)/2-(e.lH-e.fS)+(i-e.lines.length/2+.5)*e.lH+"px":e.h-2*(e.lH-e.fS)-(e.lines.length-(i+1))*e.lH+2*Math.cos(Math.PI*e.r/180)+"px")}var s=j.select(this).selectAll("text").data(e.lines);(0===k._duration?(s.call(t).call(i),s.exit().remove(),s.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("unicode-bidi","bidi-override").call(t)):(s.call(t).transition(h).call(i),s.exit().transition(h).attr("opacity",0).remove(),s.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("opacity",0).style("opacity",0).call(t).call(i).merge(s).transition(h).delay(k._delay))).call(i).attr("opacity",e.fO).style("opacity",e.fO)}).transition(h).call(e);var a=Object.keys(this._on),r=a.reduce((t,e)=>(t[e]=(t,i)=>this._on[e](t.data,i),t),{});for(let t=0;t<a.length;t++)s.on(a[t],r[a[t]]);return t&&setTimeout(t,this._duration+100),this}
1901
+ */function i(t){t.attr("aria-hidden",e.aH).attr("dir",n?"rtl":"ltr").attr("fill",e.fC).attr("stroke",e.fStroke).attr("stroke-width",e.fSW).attr("text-anchor",e.tA).attr("font-family",e.fF).style("font-family",e.fF).attr("font-size",e.fS+"px").style("font-size",e.fS+"px").attr("font-weight",e.fW).style("font-weight",e.fW).attr("x",`${"middle"===e.tA?e.w/2:n?"start"===e.tA?e.w:0:"end"===e.tA?e.w:2*Math.sin(Math.PI*e.r/180)}px`).attr("y",(t,i)=>0===e.r||"top"===e.vA?(i+1)*e.lH-(e.lH-e.fS)+"px":"middle"===e.vA?(e.h+e.fS)/2-(e.lH-e.fS)+(i-e.lines.length/2+.5)*e.lH+"px":e.h-2*(e.lH-e.fS)-(e.lines.length-(i+1))*e.lH+2*Math.cos(Math.PI*e.r/180)+"px")}var s=j.select(this).selectAll("text").data(e.lines);(0===S._duration?(s.call(t).call(i),s.exit().remove(),s.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("unicode-bidi","bidi-override").call(t)):(s.call(t).transition(h).call(i),s.exit().transition(h).attr("opacity",0).remove(),s.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("opacity",0).style("opacity",0).call(t).call(i).merge(s).transition(h).delay(S._delay))).call(i).attr("opacity",e.fO).style("opacity",e.fO)}).transition(h).call(e);var a=Object.keys(this._on),r=a.reduce((t,e)=>(t[e]=(t,i)=>this._on[e](t.data,i),t),{});for(let t=0;t<a.length;t++)s.on(a[t],r[a[t]]);return t&&setTimeout(t,this._duration+100),this}
1902
1902
  /**
1903
1903
  @memberof TextBox
1904
1904
  @desc If *value* is specified, sets the aria-hidden attribute to the specified function or string and returns the current class instance.
@@ -2186,9 +2186,9 @@ n=+s[0]==+s[1];return"brush"!==i.type&&"end"!==i.type||(this._selection="ticks"=
2186
2186
  @desc Draws the timeline.
2187
2187
  @param {Function} [*callback* = undefined]
2188
2188
  @chainable
2189
- */render(t){var{height:i,y:e}=this._position;this._ticks&&(this._ticks=this._ticks.map(Pt.date)),this._data&&(this._data=this._data.map(Pt.date));let s=this._ticks||this._domain.map(Pt.date),h=(this._ticks||(n=S.scaleTime().domain(s).range([0,this._width]),s=n.ticks()),this._timeLocale||$.locale[this._locale]||$.locale["en-US"]),o=(void 0===this._userFormat&&(this._userFormat=this._tickFormat||!1),this._tickFormat=this._userFormat||(t=>Tt.formatDate(t,s).replace(/^Q/g,h.quarter)));if(
2189
+ */render(t){var{height:i,y:e}=this._position;this._ticks&&(this._ticks=this._ticks.map(Pt.date)),this._data&&(this._data=this._data.map(Pt.date));let s=this._ticks||this._domain.map(Pt.date),h=(this._ticks||(n=k.scaleTime().domain(s).range([0,this._width]),s=n.ticks()),this._timeLocale||$.locale[this._locale]||$.locale["en-US"]),o=(void 0===this._userFormat&&(this._userFormat=this._tickFormat||!1),this._tickFormat=this._userFormat||(t=>Tt.formatDate(t,s).replace(/^Q/g,h.quarter)));if(
2190
2190
  // Measures size of ticks
2191
- this._ticksWidth=this._width,["auto","buttons"].includes(this._buttonBehavior)){let r=0;s.forEach((t,i)=>{var{fontFamily:e,fontSize:s}=this._shapeConfig.labelConfig;let h="function"==typeof e?e(t,i):e,n="function"==typeof s?s(t,i):s;e=H.textWrap().fontFamily(h).fontSize(n).lineHeight(this._shapeConfig.lineHeight?this._shapeConfig.lineHeight(t,i):void 0)(o(t));let a=e.lines.length?Math.ceil(Dt.max(e.lines.map(t=>Pt.textWidth(t,{"font-family":h,"font-size":n}))))+n/4:0;a%2&&a++,r<a&&(r=a+2*this._buttonPadding)}),this._ticksWidth=r*s.length}var n=this._playButton?this._playButtonConfig.width||this._buttonHeight:0,a=this._width-n,a=(this._buttonBehaviorCurrent="auto"===this._buttonBehavior?this._ticksWidth<a?"buttons":"ticks":this._buttonBehavior,this._hiddenHandles="buttons"===this._buttonBehaviorCurrent&&!this._brushing);if("buttons"===this._buttonBehaviorCurrent){this._scale="ordinal";let e=S.scaleTime().domain(this._domain.map(Pt.date)).ticks().map(Number);this._domain=this._ticks||Array.from(Array(e[e.length-1]-e[0]+1),(t,i)=>e[0]+i).map(Pt.date),this._ticks=this._domain;var r=.5*this._ticksWidth/this._ticks.length,l=this._width-this._ticksWidth-n;this._paddingLeft="middle"===this._buttonAlign?l/2+n:"end"===this._buttonAlign?l+n:n,this._range=[this._paddingLeft+r,this._paddingLeft+this._ticksWidth-r]}else this._scale="time",this._domain=Dt.extent(s),this._range=[n?1.5*n:void 0,void 0],this._paddingLeft=n;super.render(t);let _=this._outerBounds[e],d=this._d3Scale.range();l=this._brush=y.brushX().extent([[d[0],_],[d[d.length-1],_+this._outerBounds[i]]]).filter(this._brushFilter).handleSize(a?0:this._handleSize).on("start",this._brushStart.bind(this)).on("brush",this._brushBrush.bind(this)).on("end",this._brushEnd.bind(this)),r="ticks"===this._buttonBehaviorCurrent?this._availableTicks:d,t=[this._brushMin()>r.length?r[0]:r[r.length-this._brushMin()],r[r.length-1]],e=void 0===this._selection?t:this._selection instanceof Array?"buttons"===this._buttonBehaviorCurrent?this._selection.map(Pt.date).map(t=>d[this._ticks.map(Number).indexOf(+t)]):this._selection.map(Pt.date):"buttons"===this._buttonBehaviorCurrent?[d[this._ticks.map(Number).indexOf(+this._selection)]]:[this._selection],1===e.length&&e.push(e[0]),this._updateBrushLimit(e),this._brushGroup=Pt.elem("g.brushGroup",{parent:this._group}),this._brushGroup.call(l).transition(this._transition).call(l.move,"ticks"===this._buttonBehaviorCurrent?this._updateBrushLimit(e):e),this._outerBounds.y-=this._handleSize/2,this._outerBounds.height+=this._handleSize/2,i=Pt.elem("g.d3plus-Timeline-play",{parent:this._group});
2191
+ this._ticksWidth=this._width,["auto","buttons"].includes(this._buttonBehavior)){let r=0;s.forEach((t,i)=>{var{fontFamily:e,fontSize:s}=this._shapeConfig.labelConfig;let h="function"==typeof e?e(t,i):e,n="function"==typeof s?s(t,i):s;e=H.textWrap().fontFamily(h).fontSize(n).lineHeight(this._shapeConfig.lineHeight?this._shapeConfig.lineHeight(t,i):void 0)(o(t));let a=e.lines.length?Math.ceil(Dt.max(e.lines.map(t=>Pt.textWidth(t,{"font-family":h,"font-size":n}))))+n/4:0;a%2&&a++,r<a&&(r=a+2*this._buttonPadding)}),this._ticksWidth=r*s.length}var n=this._playButton?this._playButtonConfig.width||this._buttonHeight:0,a=this._width-n,a=(this._buttonBehaviorCurrent="auto"===this._buttonBehavior?this._ticksWidth<a?"buttons":"ticks":this._buttonBehavior,this._hiddenHandles="buttons"===this._buttonBehaviorCurrent&&!this._brushing);if("buttons"===this._buttonBehaviorCurrent){this._scale="ordinal";let e=k.scaleTime().domain(this._domain.map(Pt.date)).ticks().map(Number);this._domain=this._ticks||Array.from(Array(e[e.length-1]-e[0]+1),(t,i)=>e[0]+i).map(Pt.date),this._ticks=this._domain;var r=.5*this._ticksWidth/this._ticks.length,l=this._width-this._ticksWidth-n;this._paddingLeft="middle"===this._buttonAlign?l/2+n:"end"===this._buttonAlign?l+n:n,this._range=[this._paddingLeft+r,this._paddingLeft+this._ticksWidth-r]}else this._scale="time",this._domain=Dt.extent(s),this._range=[n?1.5*n:void 0,void 0],this._paddingLeft=n;super.render(t);let _=this._outerBounds[e],d=this._d3Scale.range();l=this._brush=y.brushX().extent([[d[0],_],[d[d.length-1],_+this._outerBounds[i]]]).filter(this._brushFilter).handleSize(a?0:this._handleSize).on("start",this._brushStart.bind(this)).on("brush",this._brushBrush.bind(this)).on("end",this._brushEnd.bind(this)),r="ticks"===this._buttonBehaviorCurrent?this._availableTicks:d,t=[this._brushMin()>r.length?r[0]:r[r.length-this._brushMin()],r[r.length-1]],e=void 0===this._selection?t:this._selection instanceof Array?"buttons"===this._buttonBehaviorCurrent?this._selection.map(Pt.date).map(t=>d[this._ticks.map(Number).indexOf(+t)]):this._selection.map(Pt.date):"buttons"===this._buttonBehaviorCurrent?[d[this._ticks.map(Number).indexOf(+this._selection)]]:[this._selection],1===e.length&&e.push(e[0]),this._updateBrushLimit(e),this._brushGroup=Pt.elem("g.brushGroup",{parent:this._group}),this._brushGroup.call(l).transition(this._transition).call(l.move,"ticks"===this._buttonBehaviorCurrent?this._updateBrushLimit(e):e),this._outerBounds.y-=this._handleSize/2,this._outerBounds.height+=this._handleSize/2,i=Pt.elem("g.d3plus-Timeline-play",{parent:this._group});
2192
2192
  // data Array to be used when detecting the default value
2193
2193
  return this._playButtonClass.data(this._playButton?[{x:this._paddingLeft-n,y:"buttons"===this._buttonBehaviorCurrent?"middle"===this._align?this._height/2-this._buttonHeight/2:"start"===this._align?this._margin.top:this._height-this._buttonHeight-this._margin.bottom:this._outerBounds.y,width:n,height:this._buttonHeight}]:[]).select(i.node()).config(jt.bind(this)(this._playButtonConfig)).render(),this}
2194
2194
  /**
@@ -2585,11 +2585,11 @@ if(this._playTimer)clearInterval(this._playTimer),this._playTimer=!1,this._playB
2585
2585
  @name zoomControls
2586
2586
  @desc Sets up initial zoom events and controls.
2587
2587
  @private
2588
- */function bt(){if(this._container&&this._zoomGroup){let t=this._zoomHeight||this._height-this._margin.top-this._margin.bottom,i=this,e=this._zoomWidth||this._width-this._margin.left-this._margin.right,s=(this._zoomBehavior.extent([[0,0],[e,t]]).scaleExtent([1,this._zoomMax]).translateExtent([[0,0],[e,t]]).on("zoom",t=>Ct.bind(this)(t.transform)),this._zoomToBounds=kt.bind(this),j.select(this._select.node().parentNode).selectAll("div.d3plus-zoom-control").data(this._zoom?[0]:[]));var h=s.enter().append("div").attr("class","d3plus-zoom-control"),h=(s.exit().remove(),s=s.merge(h).style("position","absolute").style("top",this._margin.top+"px").style("left",this._margin.left+"px"),h.append("div").attr("class","zoom-control zoom-in"),s.select(".zoom-in").on("click",wt.bind(this,this._zoomFactor)).html("&#65291;"),h.append("div").attr("class","zoom-control zoom-out"),s.select(".zoom-out").on("click",wt.bind(this,1/this._zoomFactor)).html("&#65293;"),h.append("div").attr("class","zoom-control zoom-reset"),s.select(".zoom-reset").on("click",wt.bind(this,0)).html("&#8634"),h.append("div").attr("class","zoom-control zoom-brush"),s.select(".zoom-brush").on("click",function(){j.select(this).classed("active",!xt).call(Pt.stylize,xt?i._zoomControlStyle||{}:i._zoomControlStyleActive||{}),vt.bind(i)(!xt)}).html("&#164"),s.selectAll(".zoom-control").call(Pt.stylize,i._zoomControlStyle).on("mouseenter",function(){j.select(this).call(Pt.stylize,i._zoomControlStyleHover||{})}).on("mouseleave",function(){j.select(this).call(Pt.stylize,j.select(this).classed("active")?i._zoomControlStyleActive||{}:i._zoomControlStyle||{})}),this._zoomBrush.extent([[0,0],[e,t]]).filter(t=>!t.button&&t.detail<2).handleSize(this._zoomBrushHandleSize).on("start",
2588
+ */function bt(){if(this._container&&this._zoomGroup){let t=this._zoomHeight||this._height-this._margin.top-this._margin.bottom,i=this,e=this._zoomWidth||this._width-this._margin.left-this._margin.right,s=(this._zoomBehavior.extent([[0,0],[e,t]]).scaleExtent([1,this._zoomMax]).translateExtent([[0,0],[e,t]]).on("zoom",t=>Ct.bind(this)(t.transform)),this._zoomToBounds=St.bind(this),j.select(this._select.node().parentNode).selectAll("div.d3plus-zoom-control").data(this._zoom?[0]:[]));var h=s.enter().append("div").attr("class","d3plus-zoom-control"),h=(s.exit().remove(),s=s.merge(h).style("position","absolute").style("top",this._margin.top+"px").style("left",this._margin.left+"px"),h.append("div").attr("class","zoom-control zoom-in"),s.select(".zoom-in").on("click",wt.bind(this,this._zoomFactor)).html("&#65291;"),h.append("div").attr("class","zoom-control zoom-out"),s.select(".zoom-out").on("click",wt.bind(this,1/this._zoomFactor)).html("&#65293;"),h.append("div").attr("class","zoom-control zoom-reset"),s.select(".zoom-reset").on("click",wt.bind(this,0)).html("&#8634"),h.append("div").attr("class","zoom-control zoom-brush"),s.select(".zoom-brush").on("click",function(){j.select(this).classed("active",!xt).call(Pt.stylize,xt?i._zoomControlStyle||{}:i._zoomControlStyleActive||{}),vt.bind(i)(!xt)}).html("&#164"),s.selectAll(".zoom-control").call(Pt.stylize,i._zoomControlStyle).on("mouseenter",function(){j.select(this).call(Pt.stylize,i._zoomControlStyleHover||{})}).on("mouseleave",function(){j.select(this).call(Pt.stylize,j.select(this).classed("active")?i._zoomControlStyleActive||{}:i._zoomControlStyle||{})}),this._zoomBrush.extent([[0,0],[e,t]]).filter(t=>!t.button&&t.detail<2).handleSize(this._zoomBrushHandleSize).on("start",
2589
2589
  /**
2590
2590
  @desc Triggered on brush "start".
2591
2591
  @private
2592
- */function(){St.bind(this)()}
2592
+ */function(){kt.bind(this)()}
2593
2593
  /**
2594
2594
  @desc Overrides the default brush styles.
2595
2595
  @private
@@ -2597,12 +2597,12 @@ if(this._playTimer)clearInterval(this._playTimer),this._playTimer=!1,this._playB
2597
2597
  /**
2598
2598
  @desc Triggered on brush "brush".
2599
2599
  @private
2600
- */function(){St.bind(this)()}
2600
+ */function(){kt.bind(this)()}
2601
2601
  /**
2602
2602
  @desc Triggered on brush "end".
2603
2603
  @private
2604
2604
  */.bind(this)).on("end",function(t){t.selection&&(// Only transition after input.
2605
- this._brushGroup.call(this._zoomBrush.move,null),kt.bind(this)(t.selection))}.bind(this)),this._container.selectAll("g.brush").data([0]));this._brushGroup=h.enter().append("g").attr("class","brush").merge(h).call(this._zoomBrush),vt.bind(this)(),this._renderTiles&&this._renderTiles(d.zoomTransform(this._container.node()),0)}}
2605
+ this._brushGroup.call(this._zoomBrush.move,null),St.bind(this)(t.selection))}.bind(this)),this._container.selectAll("g.brush").data([0]));this._brushGroup=h.enter().append("g").attr("class","brush").merge(h).call(this._zoomBrush),vt.bind(this)(),this._renderTiles&&this._renderTiles(d.zoomTransform(this._container.node()),0)}}
2606
2606
  /**
2607
2607
  @name zoomEvents
2608
2608
  @desc Handles adding/removing zoom event listeners.
@@ -2627,7 +2627,7 @@ this._brushGroup.call(this._zoomBrush.move,null),kt.bind(this)(t.selection))}.bi
2627
2627
  @param {Array} *bounds*
2628
2628
  @param {Number} [*duration* = 0]
2629
2629
  @private
2630
- */function kt(s,t=this._duration){var h=this._zoomBehavior.scaleExtent(),n=d.zoomTransform(this._container.node());if(s){var[a,r]=this._zoomBehavior.translateExtent()[1],o=s[1][0]-s[0][0],l=s[1][1]-s[0][1];let t=Math.min(h[1],1/Math.max(o/a,l/r)),i,e;o/l<a/r?(t*=(r-2*this._zoomPadding)/r,i=(a-o*t)/2/t,e=this._zoomPadding/t):(t*=(a-2*this._zoomPadding)/a,e=(r-l*t)/2/t,i=this._zoomPadding/t),n.x=(n.x-s[0][0]+i)*(n.k*t/n.k),n.y=(n.y-s[0][1]+e)*(n.k*t/n.k),n.k*=t,0<n.x?n.x=0:n.x<a*-n.k+a&&(n.x=a*-n.k+a),0<n.y?n.y=0:n.y<r*-n.k+r&&(n.y=r*-n.k+r)}else n.k=h[0],n.x=0,n.y=0;Ct.bind(this)(n,t)}function St(){this._brushGroup.selectAll(".selection").call(Pt.attrize,this._zoomBrushSelectionStyle||{}),this._brushGroup.selectAll(".handle").call(Pt.attrize,this._zoomBrushHandleStyle||{})}
2630
+ */function St(s,t=this._duration){var h=this._zoomBehavior.scaleExtent(),n=d.zoomTransform(this._container.node());if(s){var[a,r]=this._zoomBehavior.translateExtent()[1],o=s[1][0]-s[0][0],l=s[1][1]-s[0][1];let t=Math.min(h[1],1/Math.max(o/a,l/r)),i,e;o/l<a/r?(t*=(r-2*this._zoomPadding)/r,i=(a-o*t)/2/t,e=this._zoomPadding/t):(t*=(a-2*this._zoomPadding)/a,e=(r-l*t)/2/t,i=this._zoomPadding/t),n.x=(n.x-s[0][0]+i)*(n.k*t/n.k),n.y=(n.y-s[0][1]+e)*(n.k*t/n.k),n.k*=t,0<n.x?n.x=0:n.x<a*-n.k+a&&(n.x=a*-n.k+a),0<n.y?n.y=0:n.y<r*-n.k+r&&(n.y=r*-n.k+r)}else n.k=h[0],n.x=0,n.y=0;Ct.bind(this)(n,t)}function kt(){this._brushGroup.selectAll(".selection").call(Pt.attrize,this._zoomBrushSelectionStyle||{}),this._brushGroup.selectAll(".handle").call(Pt.attrize,this._zoomBrushHandleStyle||{})}
2631
2631
  /**
2632
2632
  @name _drawAttribution
2633
2633
  @desc Draws absolute positioned attribution text.
@@ -3275,7 +3275,7 @@ return j.select("body").on("touchstart."+this._uuid,
3275
3275
  @memberof Viz
3276
3276
  @desc Invoked when creating a new class instance, and sets any default parameters.
3277
3277
  @private
3278
- */constructor(){super(),this._aggs={},this._ariaHidden=!0,this._attribution=!1,this._attributionStyle={background:"rgba(255, 255, 255, 0.75)",border:"1px solid rgba(0, 0, 0, 0.25)",color:"rgba(0, 0, 0, 0.75)",display:"block",font:"400 11px/11px "+H.fontFamilyStringify(H.fontFamily),margin:"5px",opacity:.75,padding:"4px 6px 3px"},this._backClass=(new l).on("click",()=>{(this._history.length?this.config(this._history.pop()):this.depth(this._drawDepth-1).filter(!1)).render()}).on("mousemove",()=>this._backClass.select().style("cursor","pointer")),this._backConfig={fontSize:10,padding:5,resize:!1},this._cache=!0,this._color=(t,i)=>this._groupBy[0](t,i),this._colorDefaults={...A.colorDefaults,scale:S.scaleOrdinal().range(A.colorDefaults.scale.range())},this._colorScaleClass=new rt,this._colorScaleConfig={axisConfig:{rounding:"inside"},scale:"jenks"},this._colorScalePadding=At,this._colorScalePosition=()=>this._width>1.5*this._height?"right":"bottom",this._colorScaleMaxSize=600,this._data=[],this._dataCutoff=100,this._detectResize=!0,this._detectResizeDelay=400,this._detectVisible=!0,this._detectVisibleInterval=1e3,this._downloadButton=!1,this._downloadConfig={type:"png"},this._downloadPosition="top",this._duration=600,this._fontFamily=H.fontFamily,this._hidden=[],this._hiddenColor=Ht("#aaa"),this._hiddenOpacity=Ht(.5),this._history=[],this._groupBy=[s("id")],this._legend=(t,i)=>{var e=Dt.max(i,(t,i)=>{t=this._groupBy[this._legendDepth].bind(this)(t,i);return t instanceof Array?t.length:1});return 1<i.length&&e<=2},this._legendClass=new at,this._legendConfig={label:ft.bind(this),shapeConfig:{ariaLabel:ft.bind(this),labelConfig:{fontColor:void 0,fontResize:!1,padding:0}}},this._legendFilterInvert=Ht(!1),this._legendPadding=At,this._legendPosition=()=>this._width>1.5*this._height?"right":"bottom",this._legendSort=(t,i)=>this._drawLabel(t).localeCompare(this._drawLabel(i)),this._legendTooltip={},this._loadingHTML=()=>`
3278
+ */constructor(){super(),this._aggs={},this._ariaHidden=!0,this._attribution=!1,this._attributionStyle={background:"rgba(255, 255, 255, 0.75)",border:"1px solid rgba(0, 0, 0, 0.25)",color:"rgba(0, 0, 0, 0.75)",display:"block",font:"400 11px/11px "+H.fontFamilyStringify(H.fontFamily),margin:"5px",opacity:.75,padding:"4px 6px 3px"},this._backClass=(new l).on("click",()=>{(this._history.length?this.config(this._history.pop()):this.depth(this._drawDepth-1).filter(!1)).render()}).on("mousemove",()=>this._backClass.select().style("cursor","pointer")),this._backConfig={fontSize:10,padding:5,resize:!1},this._cache=!0,this._color=(t,i)=>this._groupBy[0](t,i),this._colorDefaults={...A.colorDefaults,scale:k.scaleOrdinal().range(A.colorDefaults.scale.range())},this._colorScaleClass=new rt,this._colorScaleConfig={axisConfig:{rounding:"inside"},scale:"jenks"},this._colorScalePadding=At,this._colorScalePosition=()=>this._width>1.5*this._height?"right":"bottom",this._colorScaleMaxSize=600,this._data=[],this._dataCutoff=100,this._detectResize=!0,this._detectResizeDelay=400,this._detectVisible=!0,this._detectVisibleInterval=1e3,this._downloadButton=!1,this._downloadConfig={type:"png"},this._downloadPosition="top",this._duration=600,this._fontFamily=H.fontFamily,this._hidden=[],this._hiddenColor=Ht("#aaa"),this._hiddenOpacity=Ht(.5),this._history=[],this._groupBy=[s("id")],this._legend=(t,i)=>{var e=Dt.max(i,(t,i)=>{t=this._groupBy[this._legendDepth].bind(this)(t,i);return t instanceof Array?t.length:1});return 1<i.length&&e<=2},this._legendClass=new at,this._legendConfig={label:ft.bind(this),shapeConfig:{ariaLabel:ft.bind(this),labelConfig:{fontColor:void 0,fontResize:!1,padding:0}}},this._legendFilterInvert=Ht(!1),this._legendPadding=At,this._legendPosition=()=>this._width>1.5*this._height?"right":"bottom",this._legendSort=(t,i)=>this._drawLabel(t).localeCompare(this._drawLabel(i)),this._legendTooltip={},this._loadingHTML=()=>`
3279
3279
  <div style="left: 50%; top: 50%; position: absolute; transform: translate(-50%, -50%);">
3280
3280
  <strong>${this._translate("Loading Visualization")}</strong>
3281
3281
  <sub style="bottom: 0; display: block; line-height: 1; margin-top: 5px;"><a href="https://d3plus.org" target="_blank">${this._translate("Powered by D3plus")}</a></sub>
@@ -3344,7 +3344,7 @@ this._tooltipClass.data([h||e]).footer(!!o&&(r?this._solo.length&&!l||_?s("Click
3344
3344
  /**
3345
3345
  @module numericBuffer
3346
3346
  @private
3347
- */function p(n,a,r,o,t,i,l,_){if(void 0===r||isNaN(i[0])||isNaN(i[1]))return i;if(_&&(i=i.slice().reverse(),t=t.slice().reverse()),i[0]===i[1])i=i.slice(),"log"===a?(i=[Gt(i[0]),Vt(i[0])])[1]<i[0]&&i.reverse():(t=Math.abs(parseFloat(i[0].toPrecision(1).replace(/[0-9]{1}$/,"1"))),i[0]-=t,i[1]+=t),n.domain(_?i.slice().reverse():i);else{var e=i[0]===i[1]?10:Math.abs(Math.log(i[1]-i[0])/100),s=()=>{let e=n.copy(),s=!1;if("log"===a){let t=n.domain().slice(),i=n.range().slice();_&&(t=t.reverse(),i=i.reverse()),(s=t[0]*t[1]<0)&&(h=(h=S.scaleLog().domain([1e-6,Math.abs(t[l])]).range([0,1])(Math.abs(t[l?0:1])))/(h+1)*(i[1]-i[0]),t=(0===l?[t[0],1e-6]:[1e-6,t[1]]).map(Math.abs),i=0===l?[i[0],i[0]+h]:[i[0]+h,i[1]]),e=S.scaleLog().domain(t).range(i)}let t=!1;var h=e.range();let i;return i="log"===a&&s?e(Math.abs(r)):e(r),_?0===l?t=i+o>h[l]:1===l&&(t=i-o<h[l]):0===l?t=i-o<h[l]:1===l&&(t=i+o>h[l]),t};if(n.invert&&s())if("log"===a){let t=0;for(;t<10&&s();){var h=(0===l?-1:1)*(i[l]<0?-1:1);i[l]+=i[l]*e*h,n.domain(_?i.slice().reverse():i),t++}}else 0===l?(t=n.invert(n(r)+(o+10)*(_?1:-1)))<i[l]&&(i[l]=t,n.domain(_?i.slice().reverse():i)):1===l&&(t=n.invert(n(r)+(o+10)*(_?-1:1)))>i[l]&&(i[l]=t,n.domain(_?i.slice().reverse():i))}return _?i.reverse():i}
3347
+ */function p(n,a,r,o,t,i,l,_){if(void 0===r||isNaN(i[0])||isNaN(i[1]))return i;if(_&&(i=i.slice().reverse(),t=t.slice().reverse()),i[0]===i[1])i=i.slice(),"log"===a?(i=[Gt(i[0]),Vt(i[0])])[1]<i[0]&&i.reverse():(t=Math.abs(parseFloat(i[0].toPrecision(1).replace(/[0-9]{1}$/,"1"))),i[0]-=t,i[1]+=t),n.domain(_?i.slice().reverse():i);else{var e=i[0]===i[1]?10:Math.abs(Math.log(i[1]-i[0])/100),s=()=>{let e=n.copy(),s=!1;if("log"===a){let t=n.domain().slice(),i=n.range().slice();_&&(t=t.reverse(),i=i.reverse()),(s=t[0]*t[1]<0)&&(h=(h=k.scaleLog().domain([1e-6,Math.abs(t[l])]).range([0,1])(Math.abs(t[l?0:1])))/(h+1)*(i[1]-i[0]),t=(0===l?[t[0],1e-6]:[1e-6,t[1]]).map(Math.abs),i=0===l?[i[0],i[0]+h]:[i[0]+h,i[1]]),e=k.scaleLog().domain(t).range(i)}let t=!1;var h=e.range();let i;return i="log"===a&&s?e(Math.abs(r)):e(r),_?0===l?t=i+o>h[l]:1===l&&(t=i-o<h[l]):0===l?t=i-o<h[l]:1===l&&(t=i+o>h[l]),t};if(n.invert&&s())if("log"===a){let t=0;for(;t<10&&s();){var h=(0===l?-1:1)*(i[l]<0?-1:1);i[l]+=i[l]*e*h,n.domain(_?i.slice().reverse():i),t++}}else 0===l?(t=n.invert(n(r)+(o+10)*(_?1:-1)))<i[l]&&(i[l]=t,n.domain(_?i.slice().reverse():i)):1===l&&(t=n.invert(n(r)+(o+10)*(_?-1:1)))>i[l]&&(i[l]=t,n.domain(_?i.slice().reverse():i))}return _?i.reverse():i}
3348
3348
  /**
3349
3349
  @module circleBuffer
3350
3350
  @desc Adds a buffer to either side of the non-discrete axis.
@@ -3440,8 +3440,8 @@ this._aggs[i]||this._discrete!==t||(this._aggs[i]=(t,i)=>{t=Array.from(new Set(t
3440
3440
  * Determins default scale type and domain for a given axis.
3441
3441
  * @param {String} axis
3442
3442
  * @private
3443
- */let[I,m,q,G]=Bt.bind(this)("x"),[V,y,Y,K]=Bt.bind(this)("y");ct=(i,t)=>{var e,s=this[`_${i}Config`].scale;return"auto"===s?this._discrete===i?t:(e=r.map(t=>t[i]),3<Dt.deviation(e)/Dt.mean(e)?"log":"linear"):s||t};let n=this._yConfigScale=ct("y",y).toLowerCase(),o=this._y2ConfigScale=ct("y2",K).toLowerCase(),l=this._xConfigScale=ct("x",m).toLowerCase(),_=this._x2ConfigScale=ct("x2",G).toLowerCase(),b=(u={x:I,x2:q||I,y:V,y2:Y||V},Object.keys(u).forEach(i=>{"log"===this[`_${i}ConfigScale`]&&u[i].includes(0)&&(Dt.min(u[i])<0?u[i][1]=Dt.max(a.map(t=>t[i]).filter(t=>![NaN,void 0,!1].includes(t))):u[i][0]=Dt.min(r.map(t=>t[i]).filter(t=>![NaN,void 0,!1].includes(t))))}),W.forEach(t=>{var i;this[`_${t}Config`].domain?(i=this[`_${t}Config`].domain,"x"===this._discrete&&i.reverse(),u[t]=i):t&&void 0!==this._baseline&&(i=this._baseline,u[t]&&u[t][0]>i?u[t][0]=i:u[t]&&u[t][1]<i&&(u[t][1]=i))}),$t["scale"+m]().domain(u.x).range(Dt.range(0,1+x,x/(u.x.length-1)))),U=$t["scale"+G]().domain(u.x2).range(Dt.range(0,1+x,x/(u.x2.length-1))),v=$t["scale"+y]().domain(u.y.reverse()).range(Dt.range(0,1+t,t/(u.y.length-1))),X=$t["scale"+K]().domain(u.y2.reverse()).range(Dt.range(0,1+t,t/(u.y2.length-1)));ct=Ot.nest().key(t=>t.shape).entries(a).sort((t,i)=>this._shapeSort(t.key,i.key));"Point"!==("x"===this._discrete?y:m)&&Ot.nest().key(t=>t.shape).entries(r).forEach(t=>{var i;["Bar","Box"].includes(t.key)&&qt("x"===this._discrete?b:v,a,this._discrete),this._buffer[t.key]&&(i=this._buffer[t.key].bind(this)({data:t.values,x:b,y:v,yScale:n,xScale:l,config:this._shapeConfig[t.key]}),b=i[0],v=i[1],i=this._buffer[t.key].bind(this)({data:t.values,x:U,y:X,yScale:o,xScale:_,x2:!0,y2:!0,config:this._shapeConfig[t.key]}),U=i[0],X=i[1])});let C=b.domain(),J=U.domain(),w=v.domain(),d=X.domain();var ut={barConfig:{"stroke-width":0},gridSize:0,labels:[],title:!1,tickSize:0},_t=rt?{data:_t}:ut,gt=ot?{data:gt}:ut,ut=("x"!==this._discrete||this._width>this._discreteCutoff)&&this._width>this._xCutoff,pt=("y"!==this._discrete||this._height>this._discreteCutoff)&&this._height>this._yCutoff,dt={data:dt,locale:this._locale,rounding:this._yDomain?"none":"outside",scalePadding:v.padding?v.padding():0},ft=(!ut&&pt&&(dt.barConfig={stroke:"transparent"},dt.tickSize=0,dt.shapeConfig={labelBounds:(t,i)=>{var{width:t,y:e}=t.labelBounds,s=this._height/2;return{x:i?-s:0,y:e,width:t,height:s}},labelConfig:{padding:0,rotate:0},labelRotation:!1}),Pt.elem("g.d3plus-plot-test",{enter:{opacity:0},parent:this._select})),mt=jt.bind(this)(this._shapeConfig,"shape","Bar");let Q=void 0!==mt.label?"function"==typeof mt.label?mt.label:Ht(mt.label):this._drawLabel,g=r.map(t=>Q(t.data,t.i)).filter(t=>"number"==typeof t||t).map(String),k=Lt.unique(r.map(t=>t.x2)),S=(k="Point"===G&&k.every(t=>g.includes(""+t))?[]:null,Lt.unique(r.map(t=>t.x))),Z=(S="Point"===m&&S.every(t=>g.includes(""+t))?[]:null,Lt.unique(r.map(t=>t.y2))),z=(Z="Point"===K&&Z.every(t=>g.includes(""+t))?[]:null,Lt.unique(r.map(t=>t.y)));z="Point"===y&&z.every(t=>g.includes(""+t))?[]:null,pt&&this._yTest.domain(w).height(t).maxSize(x/2).range([void 0,void 0]).select(ft.node()).ticks(z).width(x).config(dt).config(this._yConfig).scale(n).render();var mt=this._yTest.outerBounds(),yt=mt.width?mt.width+this._yTest.padding():void 0,xt=(ot&&this._y2Test.domain(d).height(t).range([void 0,void 0]).select(ft.node()).ticks(Z).width(x).config(dt).config(gt).config(this._y2Config).scale(o).render(),this._y2Test.outerBounds()),bt=xt.width?xt.width+this._y2Test.padding():void 0,lt={data:lt,locale:this._locale,rounding:this._xDomain?"none":"outside",scalePadding:b.padding?b.padding():0};!pt&&ut&&(lt.barConfig={stroke:"transparent"},lt.tickSize=0,lt.shapeConfig={labelBounds:(t,i)=>{var{height:t,y:e}=t.labelBounds,s=this._width/2;return{x:i?-s:0,y:e,width:s,height:t}},labelConfig:{padding:0,rotate:0,textAnchor:t=>S&&t.id===S[0]?"start":"end"},labelRotation:!1});let M=void 0;ut&&this._xTest.domain(C).height(t).maxSize(t/2).range([void 0,M]).select(ft.node()).ticks(S).width(x).config(lt).config(this._xConfig).scale(l).render();let tt,A=[],it=this._lineLabels&&!ot;if(it){var vt=a.filter(t=>"Line"===t.shape&&("function"!=typeof this._lineLabels||this._lineLabels(t.data,t.i))),vt=Ot.nest().key(t=>t.id).entries(vt);if(vt.length){var Ct=jt.bind(this)(this._shapeConfig,"shape","Line"),wt=(Kt.config(Ct),Kt.labelConfig());let d=void 0!==wt.fontColor?wt.fontColor:Ut.fontColor(),g=void 0!==wt.fontSize?wt.fontSize:Ut.fontSize(),c=void 0!==wt.fontWeight?wt.fontWeight:Ut.fontWeight(),u=void 0!==wt.fontFamily?wt.fontFamily:Ut.fontFamily(),p=void 0!==wt.padding?wt.padding:Ut.padding(),f=Ct.label||this._drawLabel,m=t=>("log"===l&&0===t&&(t=C[0]<0?this._xTest._d3Scale.domain()[1]:this._xTest._d3Scale.domain()[0]),this._xTest._getPosition.bind(this._xTest)(t)),y=t=>("log"===n&&0===t&&(t=w[0]<0?this._yTest._d3Scale.domain()[1]:this._yTest._d3Scale.domain()[0]),this._yTest._getPosition.bind(this._yTest)(t)),i=(A=vt.map(t=>{let i=t.values[t.values.length-1],e;for(;i.__d3plus__&&i.data;)i=i.data,e=i.i;var s="function"==typeof f?f(i,e):f,h="function"==typeof d?d(i,e):d,n="function"==typeof g?g(i,e):g,a="function"==typeof c?c(i,e):c;let r="function"==typeof u?u(i,e):u;r instanceof Array&&(r=r.map(t=>`'${t}'`).join(", "));var o="function"==typeof p?p(i,e):p,s=Pt.textWidth(s,{"font-size":n,"font-family":r,"font-weight":a}),a=t.values.map(t=>[m(t.x),y(t.y)]);let l=Dt.max(t.values.map(t=>m(t.x)));var _=t.values.find(t=>m(t.x)===l).y;return{id:t.key,labelWidth:s+2*o,spaceNeeded:s+4*o,value:_,yEstimate:y(_),padding:o,fontSize:n,fontColor:h,maxX:l,xValue:Dt.max(t.values,t=>t.x),coords:a}}).sort((t,i)=>w[1]>w[0]?t.value-i.value:i.value-t.value).filter((t,i,e)=>{let{fontSize:s,id:h,labelWidth:n,maxX:a,yEstimate:r}=t;return 0===e.filter(i=>i.id!==h&&i.coords.some(t=>(t[0]>a||t[0]===a&&i.maxX!==a)&&t[0]<=a+n&&t[1]<=r+.75*s&&t[1]>=r-.75*s)).length}),Dt.max(A,t=>t.maxX));tt=Dt.max(A.map(t=>t.labelWidth));wt=i===this._xTest._getRange.bind(this._xTest)()[1]?Dt.max(A.filter(t=>t.maxX===i),t=>t.spaceNeeded):0;wt&&(Ct=Dt.min([wt,x/4]),M=x-Ct-this._margin.right)}}ut&&M&&this._xTest.domain(C).height(t).maxSize(t/2).range([void 0,M]).select(ft.node()).ticks(S).width(x).config(lt).config(this._xConfig).scale(l).render(),rt&&this._x2Test.domain(J).height(t).range([void 0,M]).select(ft.node()).ticks(k).width(x).config(lt).tickSize(0).config(_t).config(this._x2Config).scale(_).render();vt=this._xTest._getRange(),wt=this._x2Test._getRange(),Ct=this._x2Test.outerBounds();let B=rt?Ct.height+this._x2Test.padding():0;var Ct=Dt.max([yt,vt[0],wt[0]]),kt=(ut&&this._xTest.range([Ct,void 0]).render(),pt?this._yTest.shapeConfig().labelConfig.fontSize()/2:0),St=Dt.max([bt,x-vt[1],x-wt[1]]),zt=this._xTest.outerBounds().height+(pt?this._xTest.padding():0),at=(this._padding.left+=Ct,this._padding.right+=St,this._padding.bottom+=zt,this._padding.top+=B+kt,super._draw(at),this._margin.left+this._margin.right),Mt=this._margin.top+this._margin.bottom;let P=[B,t-(zt+kt+Mt)],D=(pt&&this._yTest.domain(w).height(t).maxSize(x/2).range(P).select(ft.node()).ticks(z).width(x).config(dt).config(this._yConfig).scale(n).render(),yt=(mt=this._yTest.outerBounds()).width?mt.width+this._yTest.padding():void 0,Ct=Dt.max([yt,vt[0],wt[0]]),ot&&this._y2Test.config(dt).domain(d).gridSize(0).height(t).range(P).select(ft.node()).width(x-Dt.max([0,St-bt])).title(!1).config(this._y2Config).config(gt).scale(o).render(),bt=(xt=this._y2Test.outerBounds()).width?xt.width+this._y2Test.padding():void 0,St=Dt.max([0,bt,x-vt[1],x-wt[1]]),[Ct,x-(St+at)]);mt=Pt.elem("g.d3plus-plot-background",{parent:i,transition:e}),ft=`translate(${this._margin.left}, ${this._margin.top+B+kt})`,xt=`translate(${this._margin.left}, ${this._margin.top+kt})`,vt=Pt.elem("g.d3plus-plot-x-axis",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft,opacity:ut?1:0}}),wt=rt&&Pt.elem("g.d3plus-plot-x2-axis",{parent:i,transition:e,enter:{transform:xt},update:{transform:xt}}),at=`translate(${this._margin.left+(yt<Ct?Ct-yt:0)}, ${this._margin.top+kt})`,ut=Pt.elem("g.d3plus-plot-y-axis",{parent:i,transition:e,enter:{transform:at},update:{transform:at,opacity:pt?1:0}}),xt=`translate(-${this._margin.right}, ${this._margin.top+kt})`,Ct=ot&&Pt.elem("g.d3plus-plot-y2-axis",{parent:i,transition:e,enter:{transform:xt},update:{transform:xt}});this._xAxis.domain(C).height(t-(B+kt+Mt)).maxSize(t/2).range(D).select(vt.node()).ticks(S).width(x).config(lt).config(this._xConfig).scale(l).render(),rt&&this._x2Axis.domain(J).height(t-(zt+kt+Mt)).range(D).select(wt.node()).ticks(k).width(x).config(lt).config(_t).config(this._x2Config).scale(_).render(),this._xFunc=b=(t,i)=>("x2"===i?("log"===_&&0===t&&(t=J[0]<0?this._x2Axis._d3Scale.domain()[1]:this._x2Axis._d3Scale.domain()[0]),this._x2Axis._getPosition.bind(this._x2Axis)):("log"===l&&0===t&&(t=C[0]<0?this._xAxis._d3Scale.domain()[1]:this._xAxis._d3Scale.domain()[0]),this._xAxis._getPosition.bind(this._xAxis)))(t),P=[this._xAxis.outerBounds().y+B,t-(zt+kt+Mt)],this._yAxis.domain(w).height(t).maxSize(x/2).range(P).select(ut.node()).ticks(z).width(D[D.length-1]).config(dt).config(this._yConfig).scale(n).render(),ot&&this._y2Axis.config(dt).domain(ot?d:w).gridSize(0).height(t).range(P).select(Ct.node()).width(x-Dt.max([0,St-bt])).title(!1).config(this._y2Config).config(gt).scale(o).render();let et={},O=(A&&(Ot.nest().key(t=>t.xValue).entries(A).forEach(({values:t})=>{var i=Dt.max(t.map(t=>t.fontSize));let l=Dt.range(P[0],P[1],i).reverse(),_=(P[1]-P[0])/8;t.forEach(
3444
- /** */function t(e,s,h){if(e.defaultY||(e.defaultY=this._yAxis._getPosition(e.value)),s){var n=h[s-1],{fontSize:a,padding:r}=e,o=e.newY||e.defaultY;let i=n.newY||n.defaultY;o-a/2-r<i&&(o=l.find(t=>t<i),e.defaultY-o<_)&&(n.newY=o,s)&&t(n,s-1,h)}}.bind(this))}),et=A.reduce((t,i)=>(i.newY&&(t[i.id]=i.newY),t),{})),this._yFunc=v=(t,i)=>"y2"===i?("log"===o&&0===t&&(t=d[1]<0?this._y2Axis._d3ScaleNegative.domain()[0]:this._y2Axis._d3Scale.domain()[1]),this._y2Axis._getPosition.bind(this._y2Axis)(t)-B):("log"===n&&0===t&&(t=w[1]<0?this._yAxis._d3ScaleNegative.domain()[0]:this._yAxis._d3Scale.domain()[1]),this._yAxis._getPosition.bind(this._yAxis)(t)-B),this._xAxis.barConfig()["stroke-width"]);O&&(O/=2),(new Ft).data([{}]).select(mt.node()).x(D[0]+(D[1]-D[0])/2).width(D[1]-D[0]).y(this._margin.top+kt+P[0]+(P[1]-P[0])/2).height(P[1]-P[0]).config(this._backgroundConfig).render();yt=A.filter(t=>void 0!==t.newY);if(yt.length){at=Pt.elem("g.d3plus-plot-connectors",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft}}).node();let t=yt.map(t=>Pt.assign({x:this._xAxis._getPosition.bind(this._xAxis)(t.xValue),y:t.defaultY},t)).concat(yt.map(t=>Pt.assign({x:this._xAxis._getPosition.bind(this._xAxis)(t.xValue)+t.padding-1,y:t.newY||t.defaultY},t)));(new It).config({data:t,stroke:t=>t.fontColor,x:t=>t.x,y:t=>t.y}).config(this._labelConnectorConfig).select(at).render()}let st=Pt.elem("g.d3plus-plot-annotations",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft}}).node();pt=Pt.elem("g.d3plus-plot-shapes",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft}}).node();let ht=Pt.elem("g.d3plus-plot-annotations-front",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft}}).node(),L=(Object.keys(this._previousAnnotations).forEach(i=>{let e="front"===i?ht:st;var t=this._annotations.filter(t=>"back"===i&&!t.layer||t.layer===i);let s=t.map(t=>t.shape);t.forEach(t=>{(new Wt[t.shape]).duration(this._duration).config(t).config({x:t=>t.x2?b(t.x2,"x2"):b(t.x),x0:"x"===this._discrete?t=>t.x2?b(t.x2,"x2"):b(t.x):b(u.x[0]),x1:"x"===this._discrete?null:t=>t.x2?b(t.x2,"x2"):b(t.x),y:t=>t.y2?v(t.y2,"y2"):v(t.y),y0:"y"===this._discrete?t=>t.y2?v(t.y2,"y2"):v(t.y):v(u.y[1])-O,y1:"y"===this._discrete?null:t=>t.y2?v(t.y2,"y2"):v(t.y)-O}).select(e).render()}),this._previousAnnotations[i].filter(t=>!s.includes(t)).forEach(t=>{(new Wt[t]).data([]).select(e).render()}),this._previousAnnotations[i]=s}),this._discrete||"x"),T={discrete:this._discrete,duration:this._duration,label:t=>this._drawLabel(t.data,t.i),select:pt,x:t=>void 0!==t.x2?b(t.x2,"x2"):b(t.x),x0:"x"===L?t=>t.x2?b(t.x2,"x2"):b(t.x):b("number"==typeof this._baseline?this._baseline:u.x[0]),x1:"x"===L?null:t=>t.x2?b(t.x2,"x2"):b(t.x),y:t=>void 0!==t.y2?v(t.y2,"y2"):v(t.y),y0:"y"===L?t=>t.y2?v(t.y2,"y2"):v(t.y):v("number"==typeof this._baseline?this._baseline:u.y[1])-O,y1:"y"===L?null:t=>t.y2?v(t.y2,"y2"):v(t.y)-O},nt=Object.keys(this._on),$=(ct.forEach(n=>{var a=Object.assign({},T);if(this._stacked&&["Area","Bar"].includes(n.key)){let s="x"===c?b:v;a[""+c]=a[c+"0"]=t=>{var i=f.indexOf(t.id),e=N.indexOf(t.discrete),t=t[c]<0?1:0;return 0<=i?s(p[i][e][t]):s(u[c]["x"===c?0:1])},a[c+"1"]=t=>{var i=f.indexOf(t.id),e=N.indexOf(t.discrete),t=t[c]<0?0:1;return 0<=i?s(p[i][e][t]):s(u[c]["x"===c?0:1])}}var r=(new Wt[n.key]).config(a).data(n.values);if("Bar"===n.key){let t,i="x"===this._discrete?b:v;var a="x"===this._discrete?m:y,o="x"===this._discrete?C:w,l="x"===this._discrete?D:P;t="Point"!==a&&2===o.length?((a=Array.from(new Set(n.values.map(t=>i(t[this._discrete]))))).unshift(l[0]-a[0]-l[0]),a.push(l[1]+l[1]-a[a.length-1]),a.reduce((t,i,e,s)=>t=e&&(i=Math.abs(i-s[e-1]))<t?i:t,1/0)):1<o.length?i(o[1])-i(o[0]):l[l.length-1]-l[0],this._groupPadding<t&&(t-=this._groupPadding);let s=t||1;a=Ot.nest().key(t=>t[this._discrete]).key(t=>t.group).entries(n.values),o=Dt.merge(a.map(t=>t.values.map(t=>t.key)));let h=Array.from(new Set(o));if(1===Dt.max(a.map(t=>t.values.length)))r[this._discrete]((t,i)=>T[this._discrete](t,i));else{s=(s-this._barPadding*h.length-1)/h.length;l=t/2-s/2;let e=$t.scaleLinear().domain([0,h.length-1]).range([-l,l]);r[this._discrete]((t,i)=>T[this._discrete](t,i)+e(h.indexOf(t.group)))}r.width(s),r.height(s)}else if("Line"===n.key){if(r.duration(1.5*x),this._confidence){o=Object.assign({},T),a=this._discrete||"x";let i="x"===a?"y":"x",e="x"===a?v:b;o[i+"0"]=t=>e(this._confidence[0]?t.lci:t[i]),o[i+"1"]=t=>e(this._confidence[1]?t.hci:t[i]);l=(new Nt).config(o).data(n.values),a=Object.assign(this._shapeConfig,this._confidenceConfig);l.config(Pt.assign(jt.bind(this)(a,"shape","Line"),jt.bind(this)(a,"shape","Area"))).render(),this._shapes.push(l)}r.config({discrete:T.discrete||"x",label:!!it&&((e,t)=>{if("function"!=typeof this._lineLabels||this._lineLabels(e.data,e.i)){var s=A.find(t=>t.id===e.id);if(s){let i=s.newY||s.defaultY;s=A.filter(t=>t.newY===i);return 1<s.length?s[0].id===e.id&&`+${Tt.formatAbbreviate(s.length,this._locale)} `+this._translate("more"):this._drawLabel(e,t)}}return!1}),labelBounds:!!it&&((t,i,e)=>{var[s,h]=e.points[0],[e,n]=e.points[e.points.length-1],a=this._height/4;return{x:e-s,y:n-h-a/2-(et[t.id]?n-et[t.id]:0),width:tt,height:a}})})}let _=nt.filter(t=>t.includes("."+n.key)),d=nt.filter(t=>!t.includes(".")),g=nt.filter(t=>t.includes(".shape"));for(let h=0;h<d.length;h++)r.on(d[h],(t,i,e,s)=>this._on[d[h]](t.data,t.i,e,s));for(let h=0;h<g.length;h++)r.on(g[h],(t,i,e,s)=>this._on[g[h]](t.data,t.i,e,s));for(let h=0;h<_.length;h++)r.on(_[h],(t,i,e,s)=>this._on[_[h]](t.data,t.i,e,s));o=jt.bind(this)(this._shapeConfig,"shape",n.key);if(void 0===this._shapeConfig.duration&&delete o.duration,r.config(o).render(),this._shapes.push(r),"Line"===n.key){var t=(new Rt).data(this._lineMarkers?n.values:[]).config(T).config(this._lineMarkerConfig).id(t=>t.id+"_"+t.discrete);for(let h=0;h<d.length;h++)t.on(d[h],(t,i,e,s)=>this._on[d[h]](t.data,t.i,e,s));for(let h=0;h<g.length;h++)t.on(g[h],(t,i,e,s)=>this._on[g[h]](t.data,t.i,e,s));for(let h=0;h<_.length;h++)t.on(_[h],(t,i,e,s)=>this._on[_[h]](t.data,t.i,e,s));t.render(),this._shapes.push(t)}}),ct.map(t=>t.key));function At(e){let s=this[`_${e}Time`];var t=s?a:r,i=t.filter(t=>![NaN,void 0,!1].includes(t[e]));if(!i.length)return[];let h="number"==typeof i[0][e],n=this._discrete===e?Ot.nest().key(t=>t[e]).rollup(t=>1===t.length?t[0].data:Lt.merge(t.map(t=>t.data),this._aggs)).entries(i).sort((t,i)=>this[`_${e}Sort`]?this[`_${e}Sort`](t.value,i.value):(s||h?parseFloat(t.key,10):t.key)-(s||h?parseFloat(i.key,10):i.key)).map(t=>s?Pt.date(t.key):h?parseFloat(t.key,10):t.key):Lt.unique(i.sort((t,i)=>this[`_${e}Sort`]?this[`_${e}Sort`](t.data,i.data):t[e]-i[e]).map(t=>t[e]),t=>""+t);return n=this._discrete!==e.charAt(0)&&this._confidence&&(this._confidence[0]&&(n=n.concat(t.map(t=>t.lci))),this._confidence[1])?n.concat(t.map(t=>t.hci)):n}function Bt(t){var i=this[`_${t}Time`]?"Time":this._discrete===t||this[`_${t}Sort`]?"Point":"Linear",e=this[`_${t}Domain`]?this[`_${t}Domain`].slice():u[t],s=this[`_${t}2Domain`]?this[`_${t}2Domain`].slice():u[t+"2"];return"Point"!=i&&(e&&void 0===e[0]&&(e[0]=u[t][0]),e&&void 0===e[1]&&(e[1]=u[t][1]),s&&void 0===s[0]&&(s[0]=u[t+"2"][0]),s)&&void 0===s[1]&&(s[1]=u[t+"2"][1]),[e,i,s,i]}$.includes("Line")&&(this._confidence&&$.push("Area"),this._lineMarkers)&&$.push("Circle"),this._previousShapes.filter(t=>!$.includes(t)).forEach(t=>{(new Wt[t]).config(T).data([]).render()}),this._previousShapes=$}return this}
3443
+ */let[I,m,q,G]=Bt.bind(this)("x"),[V,y,Y,K]=Bt.bind(this)("y");ct=(i,t)=>{var e,s=this[`_${i}Config`].scale;return"auto"===s?this._discrete===i?t:(e=r.map(t=>t[i]),3<Dt.deviation(e)/Dt.mean(e)?"log":"linear"):s||t};let n=this._yConfigScale=ct("y",y).toLowerCase(),o=this._y2ConfigScale=ct("y2",K).toLowerCase(),l=this._xConfigScale=ct("x",m).toLowerCase(),_=this._x2ConfigScale=ct("x2",G).toLowerCase(),b=(u={x:I,x2:q||I,y:V,y2:Y||V},Object.keys(u).forEach(i=>{"log"===this[`_${i}ConfigScale`]&&u[i].includes(0)&&(Dt.min(u[i])<0?u[i][1]=Dt.max(a.map(t=>t[i]).filter(t=>![NaN,void 0,!1].includes(t))):u[i][0]=Dt.min(r.map(t=>t[i]).filter(t=>![NaN,void 0,!1].includes(t))))}),W.forEach(t=>{var i;this[`_${t}Config`].domain?(i=this[`_${t}Config`].domain,"x"===this._discrete&&i.reverse(),u[t]=i):t&&void 0!==this._baseline&&(i=this._baseline,u[t]&&u[t][0]>i?u[t][0]=i:u[t]&&u[t][1]<i&&(u[t][1]=i))}),$t["scale"+m]().domain(u.x).range(Dt.range(0,1+x,x/(u.x.length-1)))),U=$t["scale"+G]().domain(u.x2).range(Dt.range(0,1+x,x/(u.x2.length-1))),v=$t["scale"+y]().domain(u.y.reverse()).range(Dt.range(0,1+t,t/(u.y.length-1))),X=$t["scale"+K]().domain(u.y2.reverse()).range(Dt.range(0,1+t,t/(u.y2.length-1)));ct=Ot.nest().key(t=>t.shape).entries(a).sort((t,i)=>this._shapeSort(t.key,i.key));"Point"!==("x"===this._discrete?y:m)&&Ot.nest().key(t=>t.shape).entries(r).forEach(t=>{var i;["Bar","Box"].includes(t.key)&&qt("x"===this._discrete?b:v,a,this._discrete),this._buffer[t.key]&&(i=this._buffer[t.key].bind(this)({data:t.values,x:b,y:v,yScale:n,xScale:l,config:this._shapeConfig[t.key]}),b=i[0],v=i[1],i=this._buffer[t.key].bind(this)({data:t.values,x:U,y:X,yScale:o,xScale:_,x2:!0,y2:!0,config:this._shapeConfig[t.key]}),U=i[0],X=i[1])});let C=b.domain(),J=U.domain(),w=v.domain(),d=X.domain();var ut={barConfig:{"stroke-width":0},gridSize:0,labels:[],title:!1,tickSize:0},_t=rt?{data:_t}:ut,gt=ot?{data:gt}:ut,ut=("x"!==this._discrete||this._width>this._discreteCutoff)&&this._width>this._xCutoff,pt=("y"!==this._discrete||this._height>this._discreteCutoff)&&this._height>this._yCutoff,dt={data:dt,locale:this._locale,rounding:this._yDomain?"none":"outside",scalePadding:v.padding?v.padding():0},ft=(!ut&&pt&&(dt.barConfig={stroke:"transparent"},dt.tickSize=0,dt.shapeConfig={labelBounds:(t,i)=>{var{width:t,y:e}=t.labelBounds,s=this._height/2;return{x:i?-s:0,y:e,width:t,height:s}},labelConfig:{padding:0,rotate:0},labelRotation:!1}),Pt.elem("g.d3plus-plot-test",{enter:{opacity:0},parent:this._select})),mt=jt.bind(this)(this._shapeConfig,"shape","Bar");let Q=void 0!==mt.label?"function"==typeof mt.label?mt.label:Ht(mt.label):this._drawLabel,g=r.map(t=>Q(t.data,t.i)).filter(t=>"number"==typeof t||t).map(String),S=Lt.unique(r.map(t=>t.x2)),k=(S="Point"===G&&S.every(t=>g.includes(""+t))?[]:null,Lt.unique(r.map(t=>t.x))),Z=(k="Point"===m&&k.every(t=>g.includes(""+t))?[]:null,Lt.unique(r.map(t=>t.y2))),z=(Z="Point"===K&&Z.every(t=>g.includes(""+t))?[]:null,Lt.unique(r.map(t=>t.y)));z="Point"===y&&z.every(t=>g.includes(""+t))?[]:null,pt&&this._yTest.domain(w).height(t).maxSize(x/2).range([void 0,void 0]).select(ft.node()).ticks(z).width(x).config(dt).config(this._yConfig).scale(n).render();var mt=this._yTest.outerBounds(),yt=mt.width?mt.width+this._yTest.padding():void 0,xt=(ot&&this._y2Test.domain(d).height(t).range([void 0,void 0]).select(ft.node()).ticks(Z).width(x).config(dt).config(gt).config(this._y2Config).scale(o).render(),this._y2Test.outerBounds()),bt=xt.width?xt.width+this._y2Test.padding():void 0,lt={data:lt,locale:this._locale,rounding:this._xDomain?"none":"outside",scalePadding:b.padding?b.padding():0};!pt&&ut&&(lt.barConfig={stroke:"transparent"},lt.tickSize=0,lt.shapeConfig={labelBounds:(t,i)=>{var{height:t,y:e}=t.labelBounds,s=this._width/2;return{x:i?-s:0,y:e,width:s,height:t}},labelConfig:{padding:0,rotate:0,textAnchor:t=>k&&t.id===k[0]?"start":"end"},labelRotation:!1});let M=void 0;ut&&this._xTest.domain(C).height(t).maxSize(t/2).range([void 0,M]).select(ft.node()).ticks(k).width(x).config(lt).config(this._xConfig).scale(l).render();let tt,A=[],it=this._lineLabels&&!ot;if(it){var vt=a.filter(t=>"Line"===t.shape&&("function"!=typeof this._lineLabels||this._lineLabels(t.data,t.i))),vt=Ot.nest().key(t=>t.id).entries(vt);if(vt.length){var Ct=jt.bind(this)(this._shapeConfig,"shape","Line"),wt=(Kt.config(Ct),Kt.labelConfig());let d=void 0!==wt.fontColor?wt.fontColor:Ut.fontColor(),g=void 0!==wt.fontSize?wt.fontSize:Ut.fontSize(),c=void 0!==wt.fontWeight?wt.fontWeight:Ut.fontWeight(),u=void 0!==wt.fontFamily?wt.fontFamily:Ut.fontFamily(),p=void 0!==wt.padding?wt.padding:Ut.padding(),f=Ct.label||this._drawLabel,m=t=>("log"===l&&0===t&&(t=C[0]<0?this._xTest._d3Scale.domain()[1]:this._xTest._d3Scale.domain()[0]),this._xTest._getPosition.bind(this._xTest)(t)),y=t=>("log"===n&&0===t&&(t=w[0]<0?this._yTest._d3Scale.domain()[1]:this._yTest._d3Scale.domain()[0]),this._yTest._getPosition.bind(this._yTest)(t)),i=(A=vt.map(t=>{let i=t.values[t.values.length-1],e;for(;i.__d3plus__&&i.data;)i=i.data,e=i.i;var s="function"==typeof f?f(i,e):f,h="function"==typeof d?d(i,e):d,n="function"==typeof g?g(i,e):g,a="function"==typeof c?c(i,e):c;let r="function"==typeof u?u(i,e):u;r instanceof Array&&(r=r.map(t=>`'${t}'`).join(", "));var o="function"==typeof p?p(i,e):p,s=Pt.textWidth(s,{"font-size":n,"font-family":r,"font-weight":a}),a=t.values.map(t=>[m(t.x),y(t.y)]);let l=Dt.max(t.values.map(t=>m(t.x)));var _=t.values.find(t=>m(t.x)===l).y;return{id:t.key,labelWidth:s+2*o,spaceNeeded:s+4*o,value:_,yEstimate:y(_),padding:o,fontSize:n,fontColor:h,maxX:l,xValue:Dt.max(t.values,t=>t.x),coords:a}}).sort((t,i)=>w[1]>w[0]?t.value-i.value:i.value-t.value).filter((t,i,e)=>{let{fontSize:s,id:h,labelWidth:n,maxX:a,yEstimate:r}=t;return 0===e.filter(i=>i.id!==h&&i.coords.some(t=>(t[0]>a||t[0]===a&&i.maxX!==a)&&t[0]<=a+n&&t[1]<=r+.75*s&&t[1]>=r-.75*s)).length}),Dt.max(A,t=>t.maxX));tt=Dt.max(A.map(t=>t.labelWidth));wt=i===this._xTest._getRange.bind(this._xTest)()[1]?Dt.max(A.filter(t=>t.maxX===i),t=>t.spaceNeeded):0;wt&&(Ct=Dt.min([wt,x/4]),M=x-Ct-this._margin.right)}}ut&&M&&this._xTest.domain(C).height(t).maxSize(t/2).range([void 0,M]).select(ft.node()).ticks(k).width(x).config(lt).config(this._xConfig).scale(l).render(),rt&&this._x2Test.domain(J).height(t).range([void 0,M]).select(ft.node()).ticks(S).width(x).config(lt).tickSize(0).config(_t).config(this._x2Config).scale(_).render();vt=this._xTest._getRange(),wt=this._x2Test._getRange(),Ct=this._x2Test.outerBounds();let B=rt?Ct.height+this._x2Test.padding():0;var Ct=Dt.max([yt,vt[0],wt[0]]),St=(ut&&this._xTest.range([Ct,void 0]).render(),pt?this._yTest.shapeConfig().labelConfig.fontSize()/2:0),kt=Dt.max([bt,x-vt[1],x-wt[1]]),zt=this._xTest.outerBounds().height+(pt?this._xTest.padding():0),at=(this._padding.left+=Ct,this._padding.right+=kt,this._padding.bottom+=zt,this._padding.top+=B+St,super._draw(at),this._margin.left+this._margin.right),Mt=this._margin.top+this._margin.bottom;let P=[B,t-(zt+St+Mt)],D=(pt&&this._yTest.domain(w).height(t).maxSize(x/2).range(P).select(ft.node()).ticks(z).width(x).config(dt).config(this._yConfig).scale(n).render(),yt=(mt=this._yTest.outerBounds()).width?mt.width+this._yTest.padding():void 0,Ct=Dt.max([yt,vt[0],wt[0]]),ot&&this._y2Test.config(dt).domain(d).gridSize(0).height(t).range(P).select(ft.node()).width(x-Dt.max([0,kt-bt])).title(!1).config(this._y2Config).config(gt).scale(o).render(),bt=(xt=this._y2Test.outerBounds()).width?xt.width+this._y2Test.padding():void 0,kt=Dt.max([0,bt,x-vt[1],x-wt[1]]),[Ct,x-(kt+at)]);mt=Pt.elem("g.d3plus-plot-background",{parent:i,transition:e}),ft=`translate(${this._margin.left}, ${this._margin.top+B+St})`,xt=`translate(${this._margin.left}, ${this._margin.top+St})`,vt=Pt.elem("g.d3plus-plot-x-axis",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft,opacity:ut?1:0}}),wt=rt&&Pt.elem("g.d3plus-plot-x2-axis",{parent:i,transition:e,enter:{transform:xt},update:{transform:xt}}),at=`translate(${this._margin.left+(yt<Ct?Ct-yt:0)}, ${this._margin.top+St})`,ut=Pt.elem("g.d3plus-plot-y-axis",{parent:i,transition:e,enter:{transform:at},update:{transform:at,opacity:pt?1:0}}),xt=`translate(-${this._margin.right}, ${this._margin.top+St})`,Ct=ot&&Pt.elem("g.d3plus-plot-y2-axis",{parent:i,transition:e,enter:{transform:xt},update:{transform:xt}});this._xAxis.domain(C).height(t-(B+St+Mt)).maxSize(t/2).range(D).select(vt.node()).ticks(k).width(x).config(lt).config(this._xConfig).scale(l).render(),rt&&this._x2Axis.domain(J).height(t-(zt+St+Mt)).range(D).select(wt.node()).ticks(S).width(x).config(lt).config(_t).config(this._x2Config).scale(_).render(),this._xFunc=b=(t,i)=>("x2"===i?("log"===_&&0===t&&(t=J[0]<0?this._x2Axis._d3Scale.domain()[1]:this._x2Axis._d3Scale.domain()[0]),this._x2Axis._getPosition.bind(this._x2Axis)):("log"===l&&0===t&&(t=C[0]<0?this._xAxis._d3Scale.domain()[1]:this._xAxis._d3Scale.domain()[0]),this._xAxis._getPosition.bind(this._xAxis)))(t),P=[this._xAxis.outerBounds().y+B,t-(zt+St+Mt)],this._yAxis.domain(w).height(t).maxSize(x/2).range(P).select(ut.node()).ticks(z).width(D[D.length-1]).config(dt).config(this._yConfig).scale(n).render(),ot&&this._y2Axis.config(dt).domain(ot?d:w).gridSize(0).height(t).range(P).select(Ct.node()).width(x-Dt.max([0,kt-bt])).title(!1).config(this._y2Config).config(gt).scale(o).render();let et={},O=(A&&(Ot.nest().key(t=>t.xValue).entries(A).forEach(({values:t})=>{var i=Dt.max(t.map(t=>t.fontSize));let l=Dt.range(P[0],P[1],i).reverse(),_=(P[1]-P[0])/8;t.forEach(
3444
+ /** */function t(e,s,h){if(e.defaultY||(e.defaultY=this._yAxis._getPosition(e.value)),s){var n=h[s-1],{fontSize:a,padding:r}=e,o=e.newY||e.defaultY;let i=n.newY||n.defaultY;o-a/2-r<i&&(o=l.find(t=>t<i),e.defaultY-o<_)&&(n.newY=o,s)&&t(n,s-1,h)}}.bind(this))}),et=A.reduce((t,i)=>(i.newY&&(t[i.id]=i.newY),t),{})),this._yFunc=v=(t,i)=>"y2"===i?("log"===o&&0===t&&(t=d[1]<0?this._y2Axis._d3ScaleNegative.domain()[0]:this._y2Axis._d3Scale.domain()[1]),this._y2Axis._getPosition.bind(this._y2Axis)(t)-B):("log"===n&&0===t&&(t=w[1]<0?this._yAxis._d3ScaleNegative.domain()[0]:this._yAxis._d3Scale.domain()[1]),this._yAxis._getPosition.bind(this._yAxis)(t)-B),this._xAxis.barConfig()["stroke-width"]);O&&(O/=2),(new Ft).data([{}]).select(mt.node()).x(D[0]+(D[1]-D[0])/2).width(D[1]-D[0]).y(this._margin.top+St+P[0]+(P[1]-P[0])/2).height(P[1]-P[0]).config(this._backgroundConfig).render();yt=A.filter(t=>void 0!==t.newY);if(yt.length){at=Pt.elem("g.d3plus-plot-connectors",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft}}).node();let t=yt.map(t=>Pt.assign({x:this._xAxis._getPosition.bind(this._xAxis)(t.xValue),y:t.defaultY},t)).concat(yt.map(t=>Pt.assign({x:this._xAxis._getPosition.bind(this._xAxis)(t.xValue)+t.padding-1,y:t.newY||t.defaultY},t)));(new It).config({data:t,stroke:t=>t.fontColor,x:t=>t.x,y:t=>t.y}).config(this._labelConnectorConfig).select(at).render()}let st=Pt.elem("g.d3plus-plot-annotations",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft}}).node();pt=Pt.elem("g.d3plus-plot-shapes",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft}}).node();let ht=Pt.elem("g.d3plus-plot-annotations-front",{parent:i,transition:e,enter:{transform:ft},update:{transform:ft}}).node(),L=(Object.keys(this._previousAnnotations).forEach(i=>{let e="front"===i?ht:st;var t=this._annotations.filter(t=>"back"===i&&!t.layer||t.layer===i);let s=t.map(t=>t.shape);t.forEach(t=>{(new Wt[t.shape]).duration(this._duration).config(t).config({x:t=>t.x2?b(t.x2,"x2"):b(t.x),x0:"x"===this._discrete?t=>t.x2?b(t.x2,"x2"):b(t.x):b(u.x[0]),x1:"x"===this._discrete?null:t=>t.x2?b(t.x2,"x2"):b(t.x),y:t=>t.y2?v(t.y2,"y2"):v(t.y),y0:"y"===this._discrete?t=>t.y2?v(t.y2,"y2"):v(t.y):v(u.y[1])-O,y1:"y"===this._discrete?null:t=>t.y2?v(t.y2,"y2"):v(t.y)-O}).select(e).render()}),this._previousAnnotations[i].filter(t=>!s.includes(t)).forEach(t=>{(new Wt[t]).data([]).select(e).render()}),this._previousAnnotations[i]=s}),this._discrete||"x"),T={discrete:this._discrete,duration:this._duration,label:t=>this._drawLabel(t.data,t.i),select:pt,x:t=>void 0!==t.x2?b(t.x2,"x2"):b(t.x),x0:"x"===L?t=>t.x2?b(t.x2,"x2"):b(t.x):b("number"==typeof this._baseline?this._baseline:u.x[0]),x1:"x"===L?null:t=>t.x2?b(t.x2,"x2"):b(t.x),y:t=>void 0!==t.y2?v(t.y2,"y2"):v(t.y),y0:"y"===L?t=>t.y2?v(t.y2,"y2"):v(t.y):v("number"==typeof this._baseline?this._baseline:u.y[1])-O,y1:"y"===L?null:t=>t.y2?v(t.y2,"y2"):v(t.y)-O},nt=Object.keys(this._on),$=(ct.forEach(n=>{var a=Object.assign({},T);if(this._stacked&&["Area","Bar"].includes(n.key)){let s="x"===c?b:v;a[""+c]=a[c+"0"]=t=>{var i=f.indexOf(t.id),e=N.indexOf(t.discrete),t=t[c]<0?1:0;return 0<=i?s(p[i][e][t]):s(u[c]["x"===c?0:1])},a[c+"1"]=t=>{var i=f.indexOf(t.id),e=N.indexOf(t.discrete),t=t[c]<0?0:1;return 0<=i?s(p[i][e][t]):s(u[c]["x"===c?0:1])}}var r=(new Wt[n.key]).config(a).data(n.values);if("Bar"===n.key){let t,i="x"===this._discrete?b:v;var a="x"===this._discrete?m:y,o="x"===this._discrete?C:w,l="x"===this._discrete?D:P;t="Point"!==a&&2===o.length?((a=Array.from(new Set(n.values.map(t=>i(t[this._discrete]))))).unshift(l[0]-a[0]-l[0]),a.push(l[1]+l[1]-a[a.length-1]),a.reduce((t,i,e,s)=>t=e&&(i=Math.abs(i-s[e-1]))<t?i:t,1/0)):1<o.length?i(o[1])-i(o[0]):l[l.length-1]-l[0],this._groupPadding<t&&(t-=this._groupPadding);let s=t||1;a=Ot.nest().key(t=>t[this._discrete]).key(t=>t.group).entries(n.values),o=Dt.merge(a.map(t=>t.values.map(t=>t.key)));let h=Array.from(new Set(o));if(1===Dt.max(a.map(t=>t.values.length)))r[this._discrete]((t,i)=>T[this._discrete](t,i));else{s=(s-this._barPadding*h.length-1)/h.length;l=t/2-s/2;let e=$t.scaleLinear().domain([0,h.length-1]).range([-l,l]);r[this._discrete]((t,i)=>T[this._discrete](t,i)+e(h.indexOf(t.group)))}r.width(s),r.height(s)}else if("Line"===n.key){if(r.duration(1.5*x),this._confidence){o=Object.assign({},T),a=this._discrete||"x";let i="x"===a?"y":"x",e="x"===a?v:b;o[i+"0"]=t=>e(this._confidence[0]?t.lci:t[i]),o[i+"1"]=t=>e(this._confidence[1]?t.hci:t[i]);l=(new Nt).config(o).data(n.values),a=Object.assign(this._shapeConfig,this._confidenceConfig);l.config(Pt.assign(jt.bind(this)(a,"shape","Line"),jt.bind(this)(a,"shape","Area"))).render(),this._shapes.push(l)}r.config({discrete:T.discrete||"x",label:!!it&&((e,t)=>{if("function"!=typeof this._lineLabels||this._lineLabels(e.data,e.i)){var s=A.find(t=>t.id===e.id);if(s){let i=s.newY||s.defaultY;s=A.filter(t=>t.newY===i);return 1<s.length?s[0].id===e.id&&`+${Tt.formatAbbreviate(s.length,this._locale)} `+this._translate("more"):this._drawLabel(e,t)}}return!1}),labelBounds:!!it&&((t,i,e)=>{var[s,h]=e.points[0],[e,n]=e.points[e.points.length-1],a=this._height/4;return{x:e-s,y:n-h-a/2-(et[t.id]?n-et[t.id]:0),width:tt,height:a}})})}let _=nt.filter(t=>t.includes("."+n.key)),d=nt.filter(t=>!t.includes(".")),g=nt.filter(t=>t.includes(".shape"));for(let h=0;h<d.length;h++)r.on(d[h],(t,i,e,s)=>this._on[d[h]](t.data,t.i,e,s));for(let h=0;h<g.length;h++)r.on(g[h],(t,i,e,s)=>this._on[g[h]](t.data,t.i,e,s));for(let h=0;h<_.length;h++)r.on(_[h],(t,i,e,s)=>this._on[_[h]](t.data,t.i,e,s));o=jt.bind(this)(this._shapeConfig,"shape",n.key);if(void 0===this._shapeConfig.duration&&delete o.duration,r.config(o).render(),this._shapes.push(r),"Line"===n.key){var t=(new Rt).data(this._lineMarkers?n.values:[]).config(T).config(this._lineMarkerConfig).id(t=>t.id+"_"+t.discrete);for(let h=0;h<d.length;h++)t.on(d[h],(t,i,e,s)=>this._on[d[h]](t.data,t.i,e,s));for(let h=0;h<g.length;h++)t.on(g[h],(t,i,e,s)=>this._on[g[h]](t.data,t.i,e,s));for(let h=0;h<_.length;h++)t.on(_[h],(t,i,e,s)=>this._on[_[h]](t.data,t.i,e,s));t.render(),this._shapes.push(t)}}),ct.map(t=>t.key));function At(e){let s=this[`_${e}Time`];var t=s?a:r,i=t.filter(t=>![NaN,void 0,!1].includes(t[e]));if(!i.length)return[];let h="number"==typeof i[0][e],n=this._discrete===e?Ot.nest().key(t=>t[e]).rollup(t=>1===t.length?t[0].data:Lt.merge(t.map(t=>t.data),this._aggs)).entries(i).sort((t,i)=>this[`_${e}Sort`]?this[`_${e}Sort`](t.value,i.value):(s||h?parseFloat(t.key,10):t.key)-(s||h?parseFloat(i.key,10):i.key)).map(t=>s?Pt.date(t.key):h?parseFloat(t.key,10):t.key):Lt.unique(i.sort((t,i)=>this[`_${e}Sort`]?this[`_${e}Sort`](t.data,i.data):t[e]-i[e]).map(t=>t[e]),t=>""+t);return n=this._discrete!==e.charAt(0)&&this._confidence&&(this._confidence[0]&&(n=n.concat(t.map(t=>t.lci))),this._confidence[1])?n.concat(t.map(t=>t.hci)):n}function Bt(t){var i=this[`_${t}Time`]?"Time":this._discrete===t||this[`_${t}Sort`]?"Point":"Linear",e=this[`_${t}Domain`]?this[`_${t}Domain`].slice():u[t],s=this[`_${t}2Domain`]?this[`_${t}2Domain`].slice():u[t+"2"];return"Point"!=i&&(e&&void 0===e[0]&&(e[0]=u[t][0]),e&&void 0===e[1]&&(e[1]=u[t][1]),s&&void 0===s[0]&&(s[0]=u[t+"2"][0]),s)&&void 0===s[1]&&(s[1]=u[t+"2"][1]),[e,i,s,i]}$.includes("Line")&&(this._confidence&&$.push("Area"),this._lineMarkers)&&$.push("Circle"),this._previousShapes.filter(t=>!$.includes(t)).forEach(t=>{(new Wt[t]).config(T).data([]).render()}),this._previousShapes=$}return this}
3445
3445
  /**
3446
3446
  @memberof Plot
3447
3447
  @desc Allows drawing custom shapes to be used as annotations in the provided x/y plot. This method accepts custom config objects for the [Shape](http://d3plus.org/docs/#Shape) class, either a single config object or an array of config objects. Each config object requires an additional parameter, the "shape", which denotes which [Shape](http://d3plus.org/docs/#Shape) sub-class to use ([Rect](http://d3plus.org/docs/#Rect), [Line](http://d3plus.org/docs/#Line), etc).
@@ -3769,7 +3769,7 @@ this._aggs[i]||this._discrete!==t||(this._aggs[i]=(t,i)=>{t=Array.from(new Set(t
3769
3769
  @memberof Donut
3770
3770
  @desc Invoked when creating a new class instance, and sets any default parameters.
3771
3771
  @private
3772
- */constructor(){super(),this._innerRadius=()=>Dt.min([this._width-this._margin.left-this._margin.right,this._height-this._margin.top-this._margin.bottom])/4,this._padPixel=2}}var _i=[{matches:["cartodb","cartocdn"],text:"© <a href='http://www.openstreetmap.org/copyright' target='_blank'>OpenStreetMap</a> contributors, © <a href='https://carto.com/attribution' target='_blank'>CARTO</a>"},{matches:["opentopomap.org"],text:"© <a href='http://www.openstreetmap.org/copyright' target='_blank'>OpenStreetMap</a> contributors"},{matches:["arcgisonline.com"],text:"Powered by <a href='https://developers.arcgis.com/terms/attribution/' target='_blank'>Esri</a>"},{matches:["/watercolor/"],text:"Map tiles by <a href='http://stamen.com' target='_blank'>Stamen Design</a>, under <a href='http://creativecommons.org/licenses/by/3.0' target='_blank'>CC BY 3.0</a>. Data by <a href='http://openstreetmap.org' target='_blank'>OpenStreetMap</a>, under <a href='http://www.openstreetmap.org/copyright' target='_blank'>ODbL</a>."},{matches:["stamen-tiles","stamen.com"],text:"Map tiles by <a href='http://stamen.com' target='_blank'>Stamen Design</a>, under <a href='http://creativecommons.org/licenses/by/3.0' target='_blank'>CC BY 3.0</a>. Data by <a href='http://openstreetmap.org' target='_blank'>OpenStreetMap</a>, under <a href='http://creativecommons.org/licenses/by-sa/3.0' target='_blank'>CC BY SA</a>."}];let di=Object.assign({},C,w,k);
3772
+ */constructor(){super(),this._innerRadius=()=>Dt.min([this._width-this._margin.left-this._margin.right,this._height-this._margin.top-this._margin.bottom])/4,this._padPixel=2}}var _i=[{matches:["cartodb","cartocdn"],text:"© <a href='http://www.openstreetmap.org/copyright' target='_blank'>OpenStreetMap</a> contributors, © <a href='https://carto.com/attribution' target='_blank'>CARTO</a>"},{matches:["opentopomap.org"],text:"© <a href='http://www.openstreetmap.org/copyright' target='_blank'>OpenStreetMap</a> contributors"},{matches:["arcgisonline.com"],text:"Powered by <a href='https://developers.arcgis.com/terms/attribution/' target='_blank'>Esri</a>"},{matches:["/watercolor/"],text:"Map tiles by <a href='http://stamen.com' target='_blank'>Stamen Design</a>, under <a href='http://creativecommons.org/licenses/by/3.0' target='_blank'>CC BY 3.0</a>. Data by <a href='http://openstreetmap.org' target='_blank'>OpenStreetMap</a>, under <a href='http://www.openstreetmap.org/copyright' target='_blank'>ODbL</a>."},{matches:["stamen-tiles","stamen.com"],text:"Map tiles by <a href='http://stamen.com' target='_blank'>Stamen Design</a>, under <a href='http://creativecommons.org/licenses/by/3.0' target='_blank'>CC BY 3.0</a>. Data by <a href='http://openstreetmap.org' target='_blank'>OpenStreetMap</a>, under <a href='http://creativecommons.org/licenses/by-sa/3.0' target='_blank'>CC BY SA</a>."}];let di=Object.assign({},C,w,S);
3773
3773
  /**
3774
3774
  * @name findAttribution
3775
3775
  * @param {String} url
@@ -4144,7 +4144,7 @@ this._aggs[i]||this._discrete!==t||(this._aggs[i]=(t,i)=>{t=Array.from(new Set(t
4144
4144
  @memberof Priestley
4145
4145
  @desc Extends the render behavior of the abstract Viz class.
4146
4146
  @private
4147
- */_draw(n){if(super._draw(n),this._filteredData){n=this._filteredData.map((t,i)=>({__d3plus__:!0,data:t,end:"time"===this._axisConfig.scale?Pt.date(this._end(t,i)):this._end(t,i),i:i,id:this._id(t,i),start:"time"===this._axisConfig.scale?Pt.date(this._start(t,i)):this._start(t,i)})).filter(t=>0<t.end-t.start).sort((t,i)=>t.start-i.start);let t;if(1<this._groupBy.length&&0<this._drawDepth){var a=Ot.nest();for(let i=0;i<this._drawDepth;i++)a.key(t=>this._groupBy[i](t.data,t.i));t=a.entries(n)}else t=[{values:n}];let s=0;t.forEach(t=>{let e=[];t.values.forEach(i=>{var t=(e=e.map(t=>!(t<=i.start)&&t)).indexOf(!1);t<0?(i.lane=s+e.length,e.push(i.end)):(e[t]=i.end,i.lane=s+t)}),s+=e.length});var r={domain:[Dt.min(n,t=>t.start)||0,Dt.max(n,t=>t.end)||0],height:this._height-this._margin.top-this._margin.bottom,width:this._width-this._margin.left-this._margin.right},o=`translate(${this._margin.left}, ${this._margin.top})`,r=(this._axisTest.config(r).config(this._axisConfig).select(Pt.elem("g.d3plus-priestley-axis-test",{parent:this._select,enter:{opacity:0}}).node()).render(),this._axis.config(r).config(this._axisConfig).select(Pt.elem("g.d3plus-priestley-axis",{parent:this._select,enter:{transform:o},update:{transform:o}}).node()).render(),this._axisTest._padding);let i=this._axis._d3Scale,e=S.scaleBand().domain(Dt.range(0,s,1)).paddingInner(this._paddingInner).paddingOuter(this._paddingOuter).rangeRound([this._height-this._margin.bottom-this._axisTest.outerBounds().height-r,this._margin.top+r]),h=e.bandwidth();this._shapes.push((new Ft).data(n).duration(this._duration).height(h).label((t,i)=>this._drawLabel(t.data,i)).select(Pt.elem("g.d3plus-priestley-shapes",{parent:this._select}).node()).width(t=>{t=Math.abs(i(t.end)-i(t.start));return 2<t?t-2:t}).x(t=>i(t.start)+(i(t.end)-i(t.start))/2).y(t=>e(t.lane)+h/2).config(jt.bind(this)(this._shapeConfig,"shape","Rect")).render())}return this}
4147
+ */_draw(n){if(super._draw(n),this._filteredData){n=this._filteredData.map((t,i)=>({__d3plus__:!0,data:t,end:"time"===this._axisConfig.scale?Pt.date(this._end(t,i)):this._end(t,i),i:i,id:this._id(t,i),start:"time"===this._axisConfig.scale?Pt.date(this._start(t,i)):this._start(t,i)})).filter(t=>0<t.end-t.start).sort((t,i)=>t.start-i.start);let t;if(1<this._groupBy.length&&0<this._drawDepth){var a=Ot.nest();for(let i=0;i<this._drawDepth;i++)a.key(t=>this._groupBy[i](t.data,t.i));t=a.entries(n)}else t=[{values:n}];let s=0;t.forEach(t=>{let e=[];t.values.forEach(i=>{var t=(e=e.map(t=>!(t<=i.start)&&t)).indexOf(!1);t<0?(i.lane=s+e.length,e.push(i.end)):(e[t]=i.end,i.lane=s+t)}),s+=e.length});var r={domain:[Dt.min(n,t=>t.start)||0,Dt.max(n,t=>t.end)||0],height:this._height-this._margin.top-this._margin.bottom,width:this._width-this._margin.left-this._margin.right},o=`translate(${this._margin.left}, ${this._margin.top})`,r=(this._axisTest.config(r).config(this._axisConfig).select(Pt.elem("g.d3plus-priestley-axis-test",{parent:this._select,enter:{opacity:0}}).node()).render(),this._axis.config(r).config(this._axisConfig).select(Pt.elem("g.d3plus-priestley-axis",{parent:this._select,enter:{transform:o},update:{transform:o}}).node()).render(),this._axisTest._padding);let i=this._axis._d3Scale,e=k.scaleBand().domain(Dt.range(0,s,1)).paddingInner(this._paddingInner).paddingOuter(this._paddingOuter).rangeRound([this._height-this._margin.bottom-this._axisTest.outerBounds().height-r,this._margin.top+r]),h=e.bandwidth();this._shapes.push((new Ft).data(n).duration(this._duration).height(h).label((t,i)=>this._drawLabel(t.data,i)).select(Pt.elem("g.d3plus-priestley-shapes",{parent:this._select}).node()).width(t=>{t=Math.abs(i(t.end)-i(t.start));return 2<t?t-2:t}).x(t=>i(t.start)+(i(t.end)-i(t.start))/2).y(t=>e(t.lane)+h/2).config(jt.bind(this)(this._shapeConfig,"shape","Rect")).render())}return this}
4148
4148
  /**
4149
4149
  @memberof Priestley
4150
4150
  @desc If *value* is specified, sets the config method for the axis and returns the current class instance. If *value* is not specified, returns the current axis configuration.
@@ -4179,11 +4179,11 @@ this._aggs[i]||this._discrete!==t||(this._aggs[i]=(t,i)=>{t=Array.from(new Set(t
4179
4179
  @memberof Priestley
4180
4180
  @desc Invoked when creating a new class instance, and sets any default parameters.
4181
4181
  @private
4182
- */constructor(){super(),this._axis=(new o).align("end").orient("bottom"),this._axisConfig={scale:"time"},this._axisTest=(new o).align("end").gridSize(0).orient("bottom"),this.end("end"),this._paddingInner=.05,this._paddingOuter=.05,this._shapeConfig=Pt.assign({},this._shapeConfig,{ariaLabel:(t,i)=>`${this._drawLabel(t,i)}, ${this._start(t,i)} - ${this._end(t,i)}.`}),this.start("start")}}let ki=2*Math.PI;class Si extends _{
4182
+ */constructor(){super(),this._axis=(new o).align("end").orient("bottom"),this._axisConfig={scale:"time"},this._axisTest=(new o).align("end").gridSize(0).orient("bottom"),this.end("end"),this._paddingInner=.05,this._paddingOuter=.05,this._shapeConfig=Pt.assign({},this._shapeConfig,{ariaLabel:(t,i)=>`${this._drawLabel(t,i)}, ${this._start(t,i)} - ${this._end(t,i)}.`}),this.start("start")}}let Si=2*Math.PI;class ki extends _{
4183
4183
  /**
4184
4184
  Extends the draw behavior of the abstract Viz class.
4185
4185
  @private
4186
- */_draw(t){super._draw(t);let l=this._height-this._margin.top-this._margin.bottom,_=this._width-this._margin.left-this._margin.right,d=Dt.min([l,_])/2-this._outerPadding,i=`translate(${_/2}, ${l/2})`;var t=Ot.nest().key(this._metric).entries(this._filteredData),e=Ot.nest().key(this._id).key(this._metric).entries(this._filteredData);let s=Dt.max(e.map(t=>t.values.map(t=>Dt.sum(t.values,(t,i)=>this._value(t,i)))).flat());var h=Array.from(Array(this._levels).keys()).map(t=>({id:t,r:d*((t+1)/this._levels)})),n=jt.bind(this)(this._axisConfig.shapeConfig,"shape","Circle");delete n.label,(new Rt).data(h).select(Pt.elem("g.d3plus-Radar-radial-circles",{parent:this._select,enter:{transform:i},update:{transform:i}}).node()).config(n).render();let g=t.length;var h=t.map((t,i)=>{var e=this._outerPadding,s=2*(1.4*(this._shapeConfig.labelConfig.fontSize&&this._shapeConfig.labelConfig.fontSize(t,i)||11)),h=parseInt(360-360/g*i/90,10)%4+1,n=ki/g*i;let a=360/g*i,r="start",o=10;2!=h&&3!=h||(o=-e-10,r="end",a+=180);h={x:o,y:-s/2,width:e,height:s};return{__d3plus__:!0,data:Lt.merge(t.values,this._aggs),i:i,id:t.key,angle:a,textAnchor:r,labelBounds:h,rotateAnchor:[-o,s/2],x:d*Math.cos(n),y:d*Math.sin(n)}}).sort((t,i)=>t.key-i.key),n=((new Ft).data(h).rotate(t=>t.angle||0).width(0).height(0).x(t=>t.x).y(t=>t.y).label(t=>t.id).labelBounds(t=>t.labelBounds).labelConfig(this._axisConfig.shapeConfig.labelConfig).select(Pt.elem("g.d3plus-Radar-text",{parent:this._select,enter:{transform:i},update:{transform:i}}).node()).render(),(new B).data(h).d(t=>`M0,0 ${-t.x},`+-t.y).select(Pt.elem("g.d3plus-Radar-axis",{parent:this._select,enter:{transform:i},update:{transform:i}}).node()).config(jt.bind(this)(this._axisConfig.shapeConfig,"shape","Path")).render(),e.map(t=>{var i=t.values.map((t,i)=>{t=Dt.sum(t.values,(t,i)=>this._value(t,i))/s*d,i=ki/g*i;return{x:t*Math.cos(i),y:t*Math.sin(i)}}),e=`M ${i[0].x} ${i[0].y} ${i.map(t=>`L ${t.x} `+t.y).join(" ")} L ${i[0].x} `+i[0].y;return{arr:t.values.map(t=>Lt.merge(t.values,this._aggs)),id:t.key,points:i,d:e,__d3plus__:!0,data:Lt.merge(t.values.map(t=>Lt.merge(t.values,this._aggs)),this._aggs)}})),a=jt.bind(this)(this._shapeConfig,"shape","Path"),r=Object.keys(a.on);a.on={};for(let t=0;t<r.length;t++){let o=r[t];a.on[o]=(t,i,e,s)=>{var h=t.points.map(t=>t.x+_/2),n=t.points.map(t=>t.y+l/2);let a=j.pointer(s,this._select.node());h=h.map(t=>Math.abs(t-a[0]));let r=n.map(t=>Math.abs(t-a[1]));n=h.map((t,i)=>t+r[i]);this._on[o].bind(this)(t.arr[n.indexOf(Dt.min(n))],i,e,s)}}return this._shapes.push((new B).data(n).d(t=>t.d).select(Pt.elem("g.d3plus-Radar-items",{parent:this._select,enter:{transform:i},update:{transform:i}}).node()).config(a).render()),this}
4186
+ */_draw(t){super._draw(t);let l=this._height-this._margin.top-this._margin.bottom,_=this._width-this._margin.left-this._margin.right,d=Dt.min([l,_])/2-this._outerPadding,i=`translate(${_/2}, ${l/2})`;var t=Ot.nest().key(this._metric).entries(this._filteredData),e=Ot.nest().key(this._id).key(this._metric).entries(this._filteredData);let s=Dt.max(e.map(t=>t.values.map(t=>Dt.sum(t.values,(t,i)=>this._value(t,i)))).flat());var h=Array.from(Array(this._levels).keys()).map(t=>({id:t,r:d*((t+1)/this._levels)})),n=jt.bind(this)(this._axisConfig.shapeConfig,"shape","Circle");delete n.label,(new Rt).data(h).select(Pt.elem("g.d3plus-Radar-radial-circles",{parent:this._select,enter:{transform:i},update:{transform:i}}).node()).config(n).render();let g=t.length;var h=t.map((t,i)=>{var e=this._outerPadding,s=2*(1.4*(this._shapeConfig.labelConfig.fontSize&&this._shapeConfig.labelConfig.fontSize(t,i)||11)),h=parseInt(360-360/g*i/90,10)%4+1,n=Si/g*i;let a=360/g*i,r="start",o=10;2!=h&&3!=h||(o=-e-10,r="end",a+=180);h={x:o,y:-s/2,width:e,height:s};return{__d3plus__:!0,data:Lt.merge(t.values,this._aggs),i:i,id:t.key,angle:a,textAnchor:r,labelBounds:h,rotateAnchor:[-o,s/2],x:d*Math.cos(n),y:d*Math.sin(n)}}).sort((t,i)=>t.key-i.key),n=((new Ft).data(h).rotate(t=>t.angle||0).width(0).height(0).x(t=>t.x).y(t=>t.y).label(t=>t.id).labelBounds(t=>t.labelBounds).labelConfig(this._axisConfig.shapeConfig.labelConfig).select(Pt.elem("g.d3plus-Radar-text",{parent:this._select,enter:{transform:i},update:{transform:i}}).node()).render(),(new B).data(h).d(t=>`M0,0 ${-t.x},`+-t.y).select(Pt.elem("g.d3plus-Radar-axis",{parent:this._select,enter:{transform:i},update:{transform:i}}).node()).config(jt.bind(this)(this._axisConfig.shapeConfig,"shape","Path")).render(),e.map(t=>{var i=t.values.map((t,i)=>{t=Dt.sum(t.values,(t,i)=>this._value(t,i))/s*d,i=Si/g*i;return{x:t*Math.cos(i),y:t*Math.sin(i)}}),e=`M ${i[0].x} ${i[0].y} ${i.map(t=>`L ${t.x} `+t.y).join(" ")} L ${i[0].x} `+i[0].y;return{arr:t.values.map(t=>Lt.merge(t.values,this._aggs)),id:t.key,points:i,d:e,__d3plus__:!0,data:Lt.merge(t.values.map(t=>Lt.merge(t.values,this._aggs)),this._aggs)}})),a=jt.bind(this)(this._shapeConfig,"shape","Path"),r=Object.keys(a.on);a.on={};for(let t=0;t<r.length;t++){let o=r[t];a.on[o]=(t,i,e,s)=>{var h=t.points.map(t=>t.x+_/2),n=t.points.map(t=>t.y+l/2);let a=j.pointer(s,this._select.node());h=h.map(t=>Math.abs(t-a[0]));let r=n.map(t=>Math.abs(t-a[1]));n=h.map((t,i)=>t+r[i]);this._on[o].bind(this)(t.arr[n.indexOf(Dt.min(n))],i,e,s)}}return this._shapes.push((new B).data(n).d(t=>t.d).select(Pt.elem("g.d3plus-Radar-items",{parent:this._select,enter:{transform:i},update:{transform:i}}).node()).config(a).render()),this}
4187
4187
  /**
4188
4188
  @memberof Radar
4189
4189
  @desc Sets the config method used for the radial spokes, circles, and labels.
@@ -4299,7 +4299,7 @@ this._aggs[i]||this._discrete!==t||(this._aggs[i]=(t,i)=>{t=Array.from(new Set(t
4299
4299
  /**
4300
4300
  Extends the draw behavior of the abstract Viz class.
4301
4301
  @private
4302
- */_draw(e){super._draw(e);let h=this._filteredData.reduce((t,i,e)=>(t[this._id(i,e)]=i,t),{}),o=this._nodes;!this._nodes.length&&this._links.length&&(e=Array.from(new Set(this._links.reduce((t,i)=>t.concat([i.source,i.target]),[]))),o=e.map(t=>"object"==typeof t?t:{id:t})),o=o.reduce((t,i,e)=>(t[this._nodeGroupBy?this._nodeGroupBy[this._drawDepth](i,e):this._id(i,e)]=i,t),{}),o=Array.from(new Set(Object.keys(h).concat(Object.keys(o)))).map((t,i)=>{var e=h[t],s=o[t];return void 0!==s&&{__d3plus__:!0,data:e||s,i:i,id:t,node:s,shape:void 0!==e&&void 0!==this._shape(e)?this._shape(e):this._shape(s)}}).filter(t=>t);let s=this._nodeLookup=o.reduce((t,i)=>(t[i.id]=i,t),{});e=this._links.map(e=>{var t=["source","target"].reduce((t,i)=>(t[i]="number"==typeof e[i]?o[e[i]]:s[e[i].id||e[i]],t),{});return t.size=this._linkSize(e),t});let n=e.reduce((t,i)=>(t[i.source.id]||(t[i.source.id]=[]),t[i.source.id].push(i),t[i.target.id]||(t[i.target.id]=[]),t[i.target.id].push(i),t),{}),t=this._duration,l=this._height-this._margin.top-this._margin.bottom,i=`translate(${this._margin.left}, ${this._margin.top})`,_=this._width-this._margin.left-this._margin.right,d=[],a=Dt.min([l,_])/2,g=a/3,c=g,u=2*g,p=s[this._center],r=(p.x=_/2,p.y=l/2,p.r=this._sizeMin?Dt.max([this._sizeMin,.65*c]):this._sizeMax?Dt.min([this._sizeMax,.65*c]):.65*c,[p]),f=[],m=(n[this._center].forEach(t=>{var i=t.source.id===this._center?t.target:t.source;i.edges=n[i.id].filter(t=>t.source.id!==this._center||t.target.id!==this._center),i.edge=t,r.push(i),f.push(i)}),f.sort((t,i)=>t.edges.length-i.edges.length),[]),y=0,x=(f.forEach(t=>{let e=t.id;t.edges=t.edges.filter(t=>!r.includes(t.source)&&t.target.id===e||!r.includes(t.target)&&t.source.id===e),y+=t.edges.length||1,t.edges.forEach(t=>{var{source:t,target:i}=t,t=i.id===e?t:i;r.push(t)})}),2*Math.PI),b=0;f.forEach((s,t)=>{let h=s.edges.length||1;var i=x/y*h;0===t&&(b-=i/2);let n=b+i/2-x/4;s.radians=n,s.x=_/2+c*Math.cos(n),s.y=l/2+c*Math.sin(n),b+=i,s.edges.forEach((t,i)=>{var t=t.source.id===s.id?t.target:t.source,e=x/y,e=n-e*h/2+e/2+e*i;t.radians=e,t.x=_/2+u*Math.cos(e),t.y=l/2+u*Math.sin(e),m.push(t)})});var v=g/2,C=g/4;let w=v/2-4,k=(v/2-4<8&&(w=Dt.min([v/2,8])),C/2-4);(k=(k=C/2-4<4?Dt.min([C/2,4]):k)>g/10?g/10:k)>w&&10<k&&(k=.75*w),w>1.5*k&&(w=1.5*k),w=Math.floor(w),k=Math.floor(k);let S;this._size?((v=Dt.extent(h,t=>t.size))[0]===v[1]&&(v[0]=0),S=$t.scaleLinear().domain(v).rangeRound([3,Dt.min([w,k])]),C=p.size,p.r=S(C)):S=$t.scaleLinear().domain([1,2]).rangeRound([w,k]),m.forEach(t=>{t.ring=2;var i=this._size?t.size:2;t.r=this._sizeMin?Dt.max([this._sizeMin,S(i)]):this._sizeMax?Dt.min([this._sizeMax,S(i)]):S(i)}),f.forEach(t=>{t.ring=1;var i=this._size?t.size:1;t.r=this._sizeMin?Dt.max([this._sizeMin,S(i)]):this._sizeMax?Dt.min([this._sizeMax,S(i)]):S(i)}),o=[p].concat(f).concat(m),f.forEach(r=>{let e=r.edge;["source","target"].forEach(i=>{e[i]=o.find(t=>t.id===e[i].id)}),d.push(e),n[r.id].forEach(a=>{let i=a.source.id===r.id?a.target:a.source;if(i.id!==p.id){let n=m.find(t=>t.id===i.id);if(n=n||f.find(t=>t.id===i.id)){a.spline=!0;let e=_/2,s=l/2,h=c+.5*(u-c);["source","target"].forEach((i,t)=>{a[i+"X"]=a[i].x+Math.cos(2===a[i].ring?a[i].radians+Math.PI:a[i].radians)*a[i].r,a[i+"Y"]=a[i].y+Math.sin(2===a[i].ring?a[i].radians+Math.PI:a[i].radians)*a[i].r,a[i+"BisectX"]=e+h*Math.cos(a[i].radians),a[i+"BisectY"]=s+h*Math.sin(a[i].radians),a[i]=o.find(t=>t.id===a[i].id),void 0===a[i].edges&&(a[i].edges={});t=(0===t?a.target:a.source).id;a[i].id===r.id?a[i].edges[t]={angle:r.radians+Math.PI,radius:g/2}:a[i].edges[t]={angle:n.radians,radius:g/2}}),d.push(a)}}})}),o.forEach(s=>{if(s.id!==this._center){var h=1.4*(this._shapeConfig.labelConfig.fontSize&&this._shapeConfig.labelConfig.fontSize(s)||11),n=2*h,a=g-s.r;let t=s.radians*(180/Math.PI),i=s.r+5,e="start";(t<-90||90<t)&&(i=-s.r-a-5,e="end",t+=180),s.labelBounds={x:i,y:-h/2,width:a,height:n},s.rotate=t,s.textAnchor=e}else s.labelBounds={x:-c/2,y:-c/2,width:c,height:c}}),this._linkLookup=e.reduce((t,i)=>(t[i.source.id]||(t[i.source.id]=[]),t[i.source.id].push(i.target),t[i.target.id]||(t[i.target.id]=[]),t[i.target.id].push(i.source),t),{});v=Dt.extent(e,t=>t.size);if(v[0]!==v[1]){let t=Dt.min(o,t=>t.r),i=$t["scale"+this._linkSizeScale.charAt(0).toUpperCase()+this._linkSizeScale.slice(1)]().domain(v).range([this._linkSizeMin,t]);e.forEach(t=>{t.size=i(t.size)})}C=jt.bind(this)(this._shapeConfig,"edge","Path");delete C.on,this._shapes.push((new B).config(C).strokeWidth(t=>t.size).id(t=>t.source.id+"_"+t.target.id).d(t=>t.spline?`M${t.sourceX},${t.sourceY}C${t.sourceBisectX},${t.sourceBisectY} ${t.targetBisectX},${t.targetBisectY} ${t.targetX},`+t.targetY:`M${t.source.x},${t.source.y} ${t.target.x},`+t.target.y).data(d).select(Pt.elem("g.d3plus-rings-links",{parent:this._select,duration:t,enter:{transform:i},update:{transform:i}}).node()).render());let z=this,M={label:t=>!!(o.length<=this._dataCutoff||this._hover&&this._hover(t)||this._active&&this._active(t))&&this._drawLabel(t.data||t.node,t.i),labelBounds:t=>t.labelBounds,labelConfig:{fontColor:t=>t.id===this._center?jt.bind(z)(z._shapeConfig,"shape",t.key).labelConfig.fontColor(t):A.colorLegible(jt.bind(z)(z._shapeConfig,"shape",t.key).fill(t)),fontResize:t=>t.id===this._center,padding:0,textAnchor:t=>s[t.id].textAnchor||jt.bind(z)(z._shapeConfig,"shape",t.key).labelConfig.textAnchor,verticalAlign:t=>t.id===this._center?"middle":"top"},rotate:t=>s[t.id].rotate||0,select:Pt.elem("g.d3plus-rings-nodes",{parent:this._select,duration:t,enter:{transform:i},update:{transform:i}}).node()};return Ot.nest().key(t=>t.shape).entries(o).forEach(t=>{this._shapes.push((new Wt[t.key]).config(jt.bind(this)(this._shapeConfig,"shape",t.key)).config(M).data(t.values).render())}),this}
4302
+ */_draw(e){super._draw(e);let h=this._filteredData.reduce((t,i,e)=>(t[this._id(i,e)]=i,t),{}),o=this._nodes;!this._nodes.length&&this._links.length&&(e=Array.from(new Set(this._links.reduce((t,i)=>t.concat([i.source,i.target]),[]))),o=e.map(t=>"object"==typeof t?t:{id:t})),o=o.reduce((t,i,e)=>(t[this._nodeGroupBy?this._nodeGroupBy[this._drawDepth](i,e):this._id(i,e)]=i,t),{}),o=Array.from(new Set(Object.keys(h).concat(Object.keys(o)))).map((t,i)=>{var e=h[t],s=o[t];return void 0!==s&&{__d3plus__:!0,data:e||s,i:i,id:t,node:s,shape:void 0!==e&&void 0!==this._shape(e)?this._shape(e):this._shape(s)}}).filter(t=>t);let s=this._nodeLookup=o.reduce((t,i)=>(t[i.id]=i,t),{});e=this._links.map(e=>{var t=["source","target"].reduce((t,i)=>(t[i]="number"==typeof e[i]?o[e[i]]:s[e[i].id||e[i]],t),{});return t.size=this._linkSize(e),t});let n=e.reduce((t,i)=>(t[i.source.id]||(t[i.source.id]=[]),t[i.source.id].push(i),t[i.target.id]||(t[i.target.id]=[]),t[i.target.id].push(i),t),{}),t=this._duration,l=this._height-this._margin.top-this._margin.bottom,i=`translate(${this._margin.left}, ${this._margin.top})`,_=this._width-this._margin.left-this._margin.right,d=[],a=Dt.min([l,_])/2,g=a/3,c=g,u=2*g,p=s[this._center],r=(p.x=_/2,p.y=l/2,p.r=this._sizeMin?Dt.max([this._sizeMin,.65*c]):this._sizeMax?Dt.min([this._sizeMax,.65*c]):.65*c,[p]),f=[],m=(n[this._center].forEach(t=>{var i=t.source.id===this._center?t.target:t.source;i.edges=n[i.id].filter(t=>t.source.id!==this._center||t.target.id!==this._center),i.edge=t,r.push(i),f.push(i)}),f.sort((t,i)=>t.edges.length-i.edges.length),[]),y=0,x=(f.forEach(t=>{let e=t.id;t.edges=t.edges.filter(t=>!r.includes(t.source)&&t.target.id===e||!r.includes(t.target)&&t.source.id===e),y+=t.edges.length||1,t.edges.forEach(t=>{var{source:t,target:i}=t,t=i.id===e?t:i;r.push(t)})}),2*Math.PI),b=0;f.forEach((s,t)=>{let h=s.edges.length||1;var i=x/y*h;0===t&&(b-=i/2);let n=b+i/2-x/4;s.radians=n,s.x=_/2+c*Math.cos(n),s.y=l/2+c*Math.sin(n),b+=i,s.edges.forEach((t,i)=>{var t=t.source.id===s.id?t.target:t.source,e=x/y,e=n-e*h/2+e/2+e*i;t.radians=e,t.x=_/2+u*Math.cos(e),t.y=l/2+u*Math.sin(e),m.push(t)})});var v=g/2,C=g/4;let w=v/2-4,S=(v/2-4<8&&(w=Dt.min([v/2,8])),C/2-4);(S=(S=C/2-4<4?Dt.min([C/2,4]):S)>g/10?g/10:S)>w&&10<S&&(S=.75*w),w>1.5*S&&(w=1.5*S),w=Math.floor(w),S=Math.floor(S);let k;this._size?((v=Dt.extent(h,t=>t.size))[0]===v[1]&&(v[0]=0),k=$t.scaleLinear().domain(v).rangeRound([3,Dt.min([w,S])]),C=p.size,p.r=k(C)):k=$t.scaleLinear().domain([1,2]).rangeRound([w,S]),m.forEach(t=>{t.ring=2;var i=this._size?t.size:2;t.r=this._sizeMin?Dt.max([this._sizeMin,k(i)]):this._sizeMax?Dt.min([this._sizeMax,k(i)]):k(i)}),f.forEach(t=>{t.ring=1;var i=this._size?t.size:1;t.r=this._sizeMin?Dt.max([this._sizeMin,k(i)]):this._sizeMax?Dt.min([this._sizeMax,k(i)]):k(i)}),o=[p].concat(f).concat(m),f.forEach(r=>{let e=r.edge;["source","target"].forEach(i=>{e[i]=o.find(t=>t.id===e[i].id)}),d.push(e),n[r.id].forEach(a=>{let i=a.source.id===r.id?a.target:a.source;if(i.id!==p.id){let n=m.find(t=>t.id===i.id);if(n=n||f.find(t=>t.id===i.id)){a.spline=!0;let e=_/2,s=l/2,h=c+.5*(u-c);["source","target"].forEach((i,t)=>{a[i+"X"]=a[i].x+Math.cos(2===a[i].ring?a[i].radians+Math.PI:a[i].radians)*a[i].r,a[i+"Y"]=a[i].y+Math.sin(2===a[i].ring?a[i].radians+Math.PI:a[i].radians)*a[i].r,a[i+"BisectX"]=e+h*Math.cos(a[i].radians),a[i+"BisectY"]=s+h*Math.sin(a[i].radians),a[i]=o.find(t=>t.id===a[i].id),void 0===a[i].edges&&(a[i].edges={});t=(0===t?a.target:a.source).id;a[i].id===r.id?a[i].edges[t]={angle:r.radians+Math.PI,radius:g/2}:a[i].edges[t]={angle:n.radians,radius:g/2}}),d.push(a)}}})}),o.forEach(s=>{if(s.id!==this._center){var h=1.4*(this._shapeConfig.labelConfig.fontSize&&this._shapeConfig.labelConfig.fontSize(s)||11),n=2*h,a=g-s.r;let t=s.radians*(180/Math.PI),i=s.r+5,e="start";(t<-90||90<t)&&(i=-s.r-a-5,e="end",t+=180),s.labelBounds={x:i,y:-h/2,width:a,height:n},s.rotate=t,s.textAnchor=e}else s.labelBounds={x:-c/2,y:-c/2,width:c,height:c}}),this._linkLookup=e.reduce((t,i)=>(t[i.source.id]||(t[i.source.id]=[]),t[i.source.id].push(i.target),t[i.target.id]||(t[i.target.id]=[]),t[i.target.id].push(i.source),t),{});v=Dt.extent(e,t=>t.size);if(v[0]!==v[1]){let t=Dt.min(o,t=>t.r),i=$t["scale"+this._linkSizeScale.charAt(0).toUpperCase()+this._linkSizeScale.slice(1)]().domain(v).range([this._linkSizeMin,t]);e.forEach(t=>{t.size=i(t.size)})}C=jt.bind(this)(this._shapeConfig,"edge","Path");delete C.on,this._shapes.push((new B).config(C).strokeWidth(t=>t.size).id(t=>t.source.id+"_"+t.target.id).d(t=>t.spline?`M${t.sourceX},${t.sourceY}C${t.sourceBisectX},${t.sourceBisectY} ${t.targetBisectX},${t.targetBisectY} ${t.targetX},`+t.targetY:`M${t.source.x},${t.source.y} ${t.target.x},`+t.target.y).data(d).select(Pt.elem("g.d3plus-rings-links",{parent:this._select,duration:t,enter:{transform:i},update:{transform:i}}).node()).render());let z=this,M={label:t=>!!(o.length<=this._dataCutoff||this._hover&&this._hover(t)||this._active&&this._active(t))&&this._drawLabel(t.data||t.node,t.i),labelBounds:t=>t.labelBounds,labelConfig:{fontColor:t=>t.id===this._center?jt.bind(z)(z._shapeConfig,"shape",t.key).labelConfig.fontColor(t):A.colorLegible(jt.bind(z)(z._shapeConfig,"shape",t.key).fill(t)),fontResize:t=>t.id===this._center,padding:0,textAnchor:t=>s[t.id].textAnchor||jt.bind(z)(z._shapeConfig,"shape",t.key).labelConfig.textAnchor,verticalAlign:t=>t.id===this._center?"middle":"top"},rotate:t=>s[t.id].rotate||0,select:Pt.elem("g.d3plus-rings-nodes",{parent:this._select,duration:t,enter:{transform:i},update:{transform:i}}).node()};return Ot.nest().key(t=>t.shape).entries(o).forEach(t=>{this._shapes.push((new Wt[t.key]).config(jt.bind(this)(this._shapeConfig,"shape",t.key)).config(M).data(t.values).render())}),this}
4303
4303
  /**
4304
4304
  @memberof Rings
4305
4305
  @desc Sets the center node to be the node with the given id.
@@ -4393,13 +4393,19 @@ this._margin={bottom:0,left:0,right:0,top:0},this._padding={bottom:0,left:0,righ
4393
4393
  /**
4394
4394
  Extends the draw behavior of the abstract Viz class.
4395
4395
  @private
4396
- */_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,i=this._width-this._margin.left-this._margin.right,e=(Array.isArray(this._nodes)?this._nodes:this._links.reduce((t,i)=>(t.includes(i[this._linksSource])||t.push(i[this._linksSource]),t.includes(i[this._linksTarget])||t.push(i[this._linksTarget]),t),[]).map(t=>({id:t}))).map((t,i)=>({__d3plus__:!0,data:t,i:i,id:this._nodeId(t,i),node:t,shape:"Rect"}));let s=this._nodeLookup=e.reduce((t,i,e)=>(t[i.id]=e,t),{});var h=this._links.map((e,t)=>{var i=[this._linksSource,this._linksTarget].reduce((t,i)=>(t[i]=s[e[i]],t),{});return{source:i[this._linksSource],target:i[this._linksTarget],value:this._value(e,t)}});this._linkLookup=h.reduce((t,i)=>(t[i.source]||(t[i.source]=[]),t[i.source].push(i.target),t[i.target]||(t[i.target]=[]),t[i.target].push(i.source),t),{});let n=`translate(${this._margin.left}, ${this._margin.top})`;return this._sankey.nodeAlign(this._nodeAlign).nodePadding(this._nodePadding).nodeWidth(this._nodeWidth).nodes(e).links(h).size([i,t])(),this._shapes.push((new B).config(this._shapeConfig.Path).data(h).d(this._path).select(Pt.elem("g.d3plus-Links",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).render()),Ot.nest().key(t=>t.shape).entries(e).forEach(t=>{this._shapes.push((new Wt[t.key]).data(t.values).height(t=>t.y1-t.y0).width(t=>t.x1-t.x0).x(t=>(t.x1+t.x0)/2).y(t=>(t.y1+t.y0)/2).select(Pt.elem("g.d3plus-sankey-nodes",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).config(jt.bind(this)(this._shapeConfig,"shape",t.key)).render())}),this}
4396
+ */_draw(t){super._draw(t);var t=this._height-this._margin.top-this._margin.bottom,i=this._width-this._margin.left-this._margin.right,e=(Array.isArray(this._nodes)?this._nodes:this._links.reduce((t,i)=>(t.includes(i[this._linksSource])||t.push(i[this._linksSource]),t.includes(i[this._linksTarget])||t.push(i[this._linksTarget]),t),[]).map(t=>({id:t}))).map((t,i)=>({__d3plus__:!0,data:t,i:i,id:this._nodeId(t,i),node:t,shape:"Rect"}));let s=this._nodeLookup=e.reduce((t,i,e)=>(t[i.id]=e,t),{});var h=this._links.map((e,t)=>{var i=[this._linksSource,this._linksTarget].reduce((t,i)=>(t[i]=s[e[i]],t),{});return{source:i[this._linksSource],target:i[this._linksTarget],value:this._value(e,t)}});this._linkLookup=h.reduce((t,i)=>(t[i.source]||(t[i.source]=[]),t[i.source].push(i.target),t[i.target]||(t[i.target]=[]),t[i.target].push(i.source),t),{});let n=`translate(${this._margin.left}, ${this._margin.top})`;return this._sankey.nodeAlign(this._nodeAlign).nodePadding(this._nodePadding).nodeWidth(this._nodeWidth).nodes(e).nodeSort(this._nodeSort).links(h).linkSort(this._linkSort).iterations(this._iterations).size([i,t])(),this._shapes.push((new B).config(this._shapeConfig.Path).data(h).d(this._path).select(Pt.elem("g.d3plus-Links",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).render()),Ot.nest().key(t=>t.shape).entries(e).forEach(t=>{this._shapes.push((new Wt[t.key]).data(t.values).height(t=>t.y1-t.y0).width(t=>t.x1-t.x0).x(t=>(t.x1+t.x0)/2).y(t=>(t.y1+t.y0)/2).select(Pt.elem("g.d3plus-sankey-nodes",{parent:this._select,enter:{transform:n},update:{transform:n}}).node()).config(jt.bind(this)(this._shapeConfig,"shape",t.key)).render())}),this}
4397
4397
  /**
4398
4398
  @memberof Sankey
4399
4399
  @desc If *value* is specified, sets the hover method to the specified function and returns the current class instance.
4400
4400
  @param {Function} [*value*]
4401
4401
  @chainable
4402
4402
  */hover(i){return this._hover=i,this._shapes.forEach(t=>t.hover(i)),this._legend&&this._legendClass.hover(i),this}
4403
+ /**
4404
+ @memberof Sankey
4405
+ @desc A pass-through for the d3-sankey [iterations](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_iterations) function.
4406
+ @param {Number} [*value* = 6]
4407
+ @chainable
4408
+ */iterations(t){return arguments.length?(this._iterations=t,this):this._iterations}
4403
4409
  /**
4404
4410
  @memberof Sankey
4405
4411
  @desc A predefined *Array* of edges that connect each object passed to the [node](#Sankey.node) method. The `source` and `target` keys in each link need to map to the nodes in one of one way:
@@ -4409,6 +4415,12 @@ this._margin={bottom:0,left:0,right:0,top:0},this._padding={bottom:0,left:0,righ
4409
4415
  @param {Array} *links* = []
4410
4416
  @chainable
4411
4417
  */links(t,i){return arguments.length?(Lt.addToQueue.bind(this)(t,i,"links"),this):this._links}
4418
+ /**
4419
+ @memberof Sankey
4420
+ @desc A pass-through for the d3-sankey [linkSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_linkSort) function.
4421
+ @param {Function|undefined} [*value* = undefined]
4422
+ @chainable
4423
+ */linkSort(t){return arguments.length?(this._linkSort=t,this):this._linkSort}
4412
4424
  /**
4413
4425
  @memberof Sankey
4414
4426
  @desc The key inside of each link Object that references the source node.
@@ -4447,6 +4459,12 @@ this._margin={bottom:0,left:0,right:0,top:0},this._padding={bottom:0,left:0,righ
4447
4459
  @param {Number} [*value* = 8]
4448
4460
  @chainable
4449
4461
  */nodePadding(t){return arguments.length?(this._nodePadding=t,this):this._nodePadding}
4462
+ /**
4463
+ @memberof Sankey
4464
+ @desc A pass-through for the d3-sankey [nodeSort](https://github.com/d3/d3-sankey?tab=readme-ov-file#sankey_nodeSort) function.
4465
+ @param {Function|undefined} [*value* = undefined]
4466
+ @chainable
4467
+ */nodeSort(t){return arguments.length?(this._nodeSort=t,this):this._nodeSort}
4450
4468
  /**
4451
4469
  @memberof Sankey
4452
4470
  @desc If *value* is specified, sets the width of the node and returns the current class instance. If *value* is not specified, returns the current nodeWidth. By default, the nodeWidth size is 30.
@@ -4466,7 +4484,7 @@ this._margin={bottom:0,left:0,right:0,top:0},this._padding={bottom:0,left:0,righ
4466
4484
  @memberof Sankey
4467
4485
  @desc Invoked when creating a new class instance, and sets any default parameters.
4468
4486
  @private
4469
- */constructor(){super(),this._nodeId=s("id"),this._links=s("links"),this._linksSource="source",this._linksTarget="target",this._noDataMessage=!1,this._nodes=s("nodes"),this._nodeAlign=Bi.justify,this._nodePadding=8,this._nodeWidth=30,this._on.mouseenter=()=>{},this._on["mouseleave.shape"]=()=>{this.hover(!1)};let i=this._on["mousemove.shape"];this._on["mousemove.shape"]=(h,n,a,t)=>{if(i(h,n,a,t),this._focus&&this._focus===h.id)this.hover(!1),this._on.mouseenter.bind(this)(h,n,a,t),this._focus=void 0;else{let e=this._nodeId(h,n),t=this._nodeLookup[e],i=Object.keys(this._nodeLookup).reduce((t,i)=>(t[this._nodeLookup[i]]=isNaN(i)?i:parseInt(i,10),t),{});a=this._linkLookup[t];let s=[e];a.forEach(t=>{s.push(i[t])}),this.hover((t,i)=>t.source&&t.target?t.source.id===e||t.target.id===e:s.includes(this._nodeId(t,i)))}},this._path=e.sankeyLinkHorizontal(),this._sankey=e.sankey(),this._shape=Ht("Rect"),this._shapeConfig=Pt.assign(this._shapeConfig,{Path:{fill:"none",hoverStyle:{"stroke-width":t=>Math.max(1,Math.abs(t.source.y1-t.source.y0)*(t.value/t.source.value)-2)},label:!1,stroke:"#DBDBDB",strokeOpacity:.5,strokeWidth:t=>Math.max(1,Math.abs(t.source.y1-t.source.y0)*(t.value/t.source.value)-2)},Rect:{}}),this._value=Ht(1)}}class Di extends hi{
4487
+ */constructor(){super(),this._iterations=6,this._nodeId=s("id"),this._nodeSort=void 0,this._links=s("links"),this._linkSort=void 0,this._linksSource="source",this._linksTarget="target",this._noDataMessage=!1,this._nodes=s("nodes"),this._nodeAlign=Bi.justify,this._nodePadding=8,this._nodeWidth=30,this._on.mouseenter=()=>{},this._on["mouseleave.shape"]=()=>{this.hover(!1)};let i=this._on["mousemove.shape"];this._on["mousemove.shape"]=(h,n,a,t)=>{if(i(h,n,a,t),this._focus&&this._focus===h.id)this.hover(!1),this._on.mouseenter.bind(this)(h,n,a,t),this._focus=void 0;else{let e=this._nodeId(h,n),t=this._nodeLookup[e],i=Object.keys(this._nodeLookup).reduce((t,i)=>(t[this._nodeLookup[i]]=isNaN(i)?i:parseInt(i,10),t),{});a=this._linkLookup[t];let s=[e];a.forEach(t=>{s.push(i[t])}),this.hover((t,i)=>t.source&&t.target?t.source.id===e||t.target.id===e:s.includes(this._nodeId(t,i)))}},this._path=e.sankeyLinkHorizontal(),this._sankey=e.sankey(),this._shape=Ht("Rect"),this._shapeConfig=Pt.assign(this._shapeConfig,{Path:{fill:"none",hoverStyle:{"stroke-width":t=>Math.max(1,Math.abs(t.source.y1-t.source.y0)*(t.value/t.source.value)-2)},label:!1,stroke:"#DBDBDB",strokeOpacity:.5,strokeWidth:t=>Math.max(1,Math.abs(t.source.y1-t.source.y0)*(t.value/t.source.value)-2)},Rect:{}}),this._value=Ht(1)}}class Di extends hi{
4470
4488
  /**
4471
4489
  @memberof StackedArea
4472
4490
  @desc Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
@@ -4479,7 +4497,7 @@ this._margin={bottom:0,left:0,right:0,top:0},this._padding={bottom:0,left:0,righ
4479
4497
  /**
4480
4498
  Merges the values of a given nest branch.
4481
4499
  @private
4482
- */t.forEach((t,i)=>{t.data.key&&t.data.values&&(t.data=function i(t){return Lt.merge(t.values.map(t=>t.key&&t.values?i(t):t),e._aggs)}(t.data)),t.__d3plus__=!0,t.i=i});let h=this._shapeConfig.r;"function"!=typeof h&&(h=Ht(h));var l=Dt.max(t,t=>1===t.depth?h(t.data,t.i):0),_=Dt.max(t,t=>t.children?0:h(t.data,t.i)),d=Dt.extent(t,t=>t.y);this._labelHeight=Dt.min([a?50:100,(d[1]-l-_)/(this._groupBy.length+1)]),this._labelWidths=Lt.nest(t,t=>t.depth).map(h=>h.values.reduce((t,i,e)=>{var s=e<h.values.length-1?h.values[e+1].x:o+this._margin[r],e=e?h.values[e-1].x:this._margin[r];return Dt.min([t,s-i.x,i.x-e])},o));let g=S.scaleLinear().domain(d).range([l+this._labelHeight,i-_-this._labelHeight]),c=(t.forEach(t=>{var i=g(t.y);n?(t.y=t.x,t.x=i):t.y=i}),{parent:this._select,enter:{transform:s},update:{transform:s}}),u=(this._shapes.push((new B).data(t.filter(t=>1<t.depth).map(t=>Pt.assign({},t))).select(Pt.elem("g.d3plus-Tree-Links",c).node()).config(jt.bind(this)(this._shapeConfig,"shape","Path")).config({d:t=>{let i=this._shapeConfig.r;"function"==typeof i&&(i=i(t.data,t.i));var e=t.parent.x-t.x+(a?0:i),t=t.parent.y-t.y+(a?i:0),s=a?0:-i,h=a?-i:0;return a?`M${s},${h}C${s},${(h+t)/2} ${e},${(h+t)/2} ${e},`+t:`M${s},${h}C${(s+e)/2},${h} ${(s+e)/2},${t} ${e},`+t},id:(t,i)=>this._ids(t,i)[t.depth-1]}).render()),{id:(t,i)=>this._ids(t,i)[t.depth-1],label:(t,i)=>this._label?this._label(t.data,i):(i=this._ids(t,i).slice(0,t.depth))[i.length-1],labelConfig:{textAnchor:(t,i,e)=>a?"middle":e.children&&e.depth!==this._drawDepth+1?"end":"start",verticalAlign:(t,i,e)=>a?1===e.depth?"bottom":"top":"middle"},hitArea:(t,i,e)=>{var s=this._labelHeight,e=e.r||(a?e.height/2:e.width/2),h=this._labelWidths[t.depth-1];return{width:a?h:2*e+h,height:n?s:2*e+s,x:a?-h/2:t.children&&t.depth!==this._groupBy.length?-(e+h):-e,y:n?-s/2:t.children&&t.depth!==this._groupBy.length?-(e+this._labelHeight):-e}},labelBounds:(t,i,e)=>{var s=this._labelHeight,h=a?"height":"width",e=e.r||(a?e.height/2:e.width/2),n=this._labelWidths[t.depth-1];return{[a?"width":"height"]:n,[h]:s,[a?"x":"y"]:-n/2,[a?"y":"x"]:t.children&&t.depth!==this._groupBy.length?-(e+s):e}}});d=Lt.nest(t,t=>this._shape(t.data));let p=d.map(t=>t.key);l=this._previousShapes.filter(t=>!p.includes(t));return d.concat(l.map(t=>({key:t,values:[]}))).forEach(({key:t,values:i})=>{this._shapes.push((new Wt[t]).data(i).select(Pt.elem("g.d3plus-Tree-"+t,c).node()).config(jt.bind(this)(this._shapeConfig,"shape",t)).config(u).render())}),this._previousShapes=p,this}
4500
+ */t.forEach((t,i)=>{t.data.key&&t.data.values&&(t.data=function i(t){return Lt.merge(t.values.map(t=>t.key&&t.values?i(t):t),e._aggs)}(t.data)),t.__d3plus__=!0,t.i=i});let h=this._shapeConfig.r;"function"!=typeof h&&(h=Ht(h));var l=Dt.max(t,t=>1===t.depth?h(t.data,t.i):0),_=Dt.max(t,t=>t.children?0:h(t.data,t.i)),d=Dt.extent(t,t=>t.y);this._labelHeight=Dt.min([a?50:100,(d[1]-l-_)/(this._groupBy.length+1)]),this._labelWidths=Lt.nest(t,t=>t.depth).map(h=>h.values.reduce((t,i,e)=>{var s=e<h.values.length-1?h.values[e+1].x:o+this._margin[r],e=e?h.values[e-1].x:this._margin[r];return Dt.min([t,s-i.x,i.x-e])},o));let g=k.scaleLinear().domain(d).range([l+this._labelHeight,i-_-this._labelHeight]),c=(t.forEach(t=>{var i=g(t.y);n?(t.y=t.x,t.x=i):t.y=i}),{parent:this._select,enter:{transform:s},update:{transform:s}}),u=(this._shapes.push((new B).data(t.filter(t=>1<t.depth).map(t=>Pt.assign({},t))).select(Pt.elem("g.d3plus-Tree-Links",c).node()).config(jt.bind(this)(this._shapeConfig,"shape","Path")).config({d:t=>{let i=this._shapeConfig.r;"function"==typeof i&&(i=i(t.data,t.i));var e=t.parent.x-t.x+(a?0:i),t=t.parent.y-t.y+(a?i:0),s=a?0:-i,h=a?-i:0;return a?`M${s},${h}C${s},${(h+t)/2} ${e},${(h+t)/2} ${e},`+t:`M${s},${h}C${(s+e)/2},${h} ${(s+e)/2},${t} ${e},`+t},id:(t,i)=>this._ids(t,i)[t.depth-1]}).render()),{id:(t,i)=>this._ids(t,i)[t.depth-1],label:(t,i)=>this._label?this._label(t.data,i):(i=this._ids(t,i).slice(0,t.depth))[i.length-1],labelConfig:{textAnchor:(t,i,e)=>a?"middle":e.children&&e.depth!==this._drawDepth+1?"end":"start",verticalAlign:(t,i,e)=>a?1===e.depth?"bottom":"top":"middle"},hitArea:(t,i,e)=>{var s=this._labelHeight,e=e.r||(a?e.height/2:e.width/2),h=this._labelWidths[t.depth-1];return{width:a?h:2*e+h,height:n?s:2*e+s,x:a?-h/2:t.children&&t.depth!==this._groupBy.length?-(e+h):-e,y:n?-s/2:t.children&&t.depth!==this._groupBy.length?-(e+this._labelHeight):-e}},labelBounds:(t,i,e)=>{var s=this._labelHeight,h=a?"height":"width",e=e.r||(a?e.height/2:e.width/2),n=this._labelWidths[t.depth-1];return{[a?"width":"height"]:n,[h]:s,[a?"x":"y"]:-n/2,[a?"y":"x"]:t.children&&t.depth!==this._groupBy.length?-(e+s):e}}});d=Lt.nest(t,t=>this._shape(t.data));let p=d.map(t=>t.key);l=this._previousShapes.filter(t=>!p.includes(t));return d.concat(l.map(t=>({key:t,values:[]}))).forEach(({key:t,values:i})=>{this._shapes.push((new Wt[t]).data(i).select(Pt.elem("g.d3plus-Tree-"+t,c).node()).config(jt.bind(this)(this._shapeConfig,"shape",t)).config(u).render())}),this._previousShapes=p,this}
4483
4501
  /**
4484
4502
  @memberof Tree
4485
4503
  @desc Changes the orientation of the entire Tree, either "vertical" (top to bottom) or "horizontal" (left to right).
@@ -4558,5 +4576,5 @@ this._margin={bottom:0,left:0,right:0,top:0},this._padding={bottom:0,left:0,righ
4558
4576
  @memberof Treemap
4559
4577
  @desc Invoked when creating a new class instance, and sets any default parameters.
4560
4578
  @private
4561
- */constructor(){super(),this._layoutPadding=1;let e=this._legend,h=(this._legend=(t,i)=>i.length!==this._filteredData.length&&e.bind(this)(t,i),this._legendSort=(t,i)=>this._sum(i)-this._sum(t),this._legendTooltip=Pt.assign({},this._legendTooltip,{tbody:[]}),this._shapeConfig=Pt.assign({},this._shapeConfig,{ariaLabel:(t,i)=>(this._rankData?this._rankData.indexOf(t)+1+". ":"")+this._drawLabel(t,i)+`, ${this._sum(t,i)}.`,labelConfig:{fontMax:32,fontMin:8,fontResize:!0,padding:5}}),this._sort=(t,i)=>{var e=h(t),s=h(i);return e&&!s?1:!e&&s?-1:i.value-t.value},this._sum=s("value"),this._thresholdKey=this._sum,this._tile=f.treemapSquarify,this._tooltipConfig=Pt.assign({},this._tooltipConfig,{tbody:[[()=>this._translate("Share"),(t,i,e)=>Tt.formatAbbreviate(100*e.share,this._locale)+"%"]]}),this._treemap=f.treemap().round(!0),t=>t.children&&1===t.children.length&&t.children[0].data._isAggregation)}}t.Area=Nt,t.AreaPlot=hi,t.Axis=o,t.AxisBottom=et,t.AxisLeft=st,t.AxisRight=ht,t.AxisTop=nt,t.Bar=K,t.BarChart=ni,t.BaseClass=h,t.Box=Q,t.BoxWhisker=ai,t.BumpChart=ri,t.Circle=Rt,t.ColorScale=rt,t.Donut=li,t.Geomap=ui,t.Image=V,t.Legend=at,t.Line=It,t.LinePlot=pi,t.Matrix=yi,t.Message=ot,t.Network=bi,t.Pack=Ci,t.Path=B,t.Pie=oi,t.Plot=si,t.Priestley=wi,t.RESET=T,t.Radar=Si,t.RadialMatrix=Mi,t.Rect=Ft,t.Rings=Ai,t.Sankey=Pi,t.Shape=a,t.StackedArea=Di,t.TextBox=l,t.Timeline=dt,t.Tooltip=ct,t.Tree=Oi,t.Treemap=Ti,t.Viz=_,t.Whisker=X,t.accessor=s,t.configPrep=jt,t.constant=Ht,t.uuid=q});
4579
+ */constructor(){super(),this._layoutPadding=1;let e=this._legend,h=(this._legend=(t,i)=>i.length!==this._filteredData.length&&e.bind(this)(t,i),this._legendSort=(t,i)=>this._sum(i)-this._sum(t),this._legendTooltip=Pt.assign({},this._legendTooltip,{tbody:[]}),this._shapeConfig=Pt.assign({},this._shapeConfig,{ariaLabel:(t,i)=>(this._rankData?this._rankData.indexOf(t)+1+". ":"")+this._drawLabel(t,i)+`, ${this._sum(t,i)}.`,labelConfig:{fontMax:32,fontMin:8,fontResize:!0,padding:5}}),this._sort=(t,i)=>{var e=h(t),s=h(i);return e&&!s?1:!e&&s?-1:i.value-t.value},this._sum=s("value"),this._thresholdKey=this._sum,this._tile=f.treemapSquarify,this._tooltipConfig=Pt.assign({},this._tooltipConfig,{tbody:[[()=>this._translate("Share"),(t,i,e)=>Tt.formatAbbreviate(100*e.share,this._locale)+"%"]]}),this._treemap=f.treemap().round(!0),t=>t.children&&1===t.children.length&&t.children[0].data._isAggregation)}}t.Area=Nt,t.AreaPlot=hi,t.Axis=o,t.AxisBottom=et,t.AxisLeft=st,t.AxisRight=ht,t.AxisTop=nt,t.Bar=K,t.BarChart=ni,t.BaseClass=h,t.Box=Q,t.BoxWhisker=ai,t.BumpChart=ri,t.Circle=Rt,t.ColorScale=rt,t.Donut=li,t.Geomap=ui,t.Image=V,t.Legend=at,t.Line=It,t.LinePlot=pi,t.Matrix=yi,t.Message=ot,t.Network=bi,t.Pack=Ci,t.Path=B,t.Pie=oi,t.Plot=si,t.Priestley=wi,t.RESET=T,t.Radar=ki,t.RadialMatrix=Mi,t.Rect=Ft,t.Rings=Ai,t.Sankey=Pi,t.Shape=a,t.StackedArea=Di,t.TextBox=l,t.Timeline=dt,t.Tooltip=ct,t.Tree=Oi,t.Treemap=Ti,t.Viz=_,t.Whisker=X,t.accessor=s,t.configPrep=jt,t.constant=Ht,t.uuid=q});
4562
4580
  //# sourceMappingURL=d3plus-core.js.map