@carbon/charts 1.22.6 → 1.22.7
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.
- package/CHANGELOG.md +13 -0
- package/dist/{choropleth-SzpEKqur.mjs → choropleth-BLX5stP5.mjs} +2 -2
- package/dist/{choropleth-SzpEKqur.mjs.map → choropleth-BLX5stP5.mjs.map} +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/umd/bundle.umd.cjs +1 -1
- package/dist/umd/bundle.umd.cjs.map +1 -1
- package/dist/umd/bundle.umd.js +1 -1
- package/package.json +2 -2
package/dist/umd/bundle.umd.js
CHANGED
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
|
71
71
|
<polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
|
|
72
72
|
<path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
|
|
73
|
-
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=R(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=R(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Xr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Xr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function x2(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class hv extends pt{constructor(){super(...arguments),this.type="pie",this.renderType=tt.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=G_().value(M=>M[a]).sort(x(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=I.appendOrSelect(r,"g.slices").attr("role",ht.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>`${M[a]}, ${Zc(M.data[a],o,a)+"%"}`).attrTween("d",function(M){return x2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=x(i,"locale"),v=i.pie.labels.enabled,E=v?u.filter(M=>M.data[a]>0):[],b=I.appendOrSelect(r,"g.labels").attr("role",ht.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(E,M=>M.data[s]);b.exit().attr("opacity",0).remove();const _=b.enter().append("text").classed("pie-label",!0),S=[];_.merge(b).style("text-anchor","middle").text(M=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const w=l+7,U=(M.endAngle-M.startAngle)/2+M.startAngle,$=U/Math.PI*180,N=this.getComputedTextLength();return M.textOffsetX=N/2,M.textOffsetY=$>90&&$<270?10:0,M.xPosition=(M.textOffsetX+w)*Math.sin(U),M.yPosition=(M.textOffsetY+w)*-Math.cos(U),M}).attr("transform",function(M,w){const U=E.length,$=(M.endAngle-M.startAngle)*(180/Math.PI);if(w>=U-2&&$<Lt.callout.minSliceDegree){let N,F;return M.index===U-1?(N=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,F=M.yPosition-Lt.callout.offsetY,M.direction=es.RIGHT,S.push(M)):(N=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,F=M.yPosition-Lt.callout.offsetY,M.direction=es.LEFT,S.push(M)),`translate(${N}, ${F})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(S);const C=x(i,"donut")?"donut":"pie",L=x(i,C,"alignment"),{width:B}=I.getSVGElementSize(this.getParent(),{useAttrs:!0}),k=v?Lt.xOffset:0,O=v?Lt.yOffset:0;let H=l+k;L===Ht.CENTER?H=B/2:L===Ht.RIGHT&&(H=B-l-Lt.xOffset);let P=l+O;S.length>0&&(P+=Lt.yOffsetCallout),r.attr("x",H+7).attr("y",P),this.addEventListeners()}renderCallouts(t){const n=I.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ht.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ht.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===es.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return R(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return R(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=R(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:R(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);BD(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=I.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class b2 extends hv{constructor(){super(...arguments),this.type="donut",this.renderType=tt.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=I.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");I.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(R(this))}),a!==null&&a!==""&&I.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=gh:s=ye;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=x(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const dv="4,10 8,6 12,10",fv="12,6 8,10 4,6";class S2 extends pt{constructor(){super(...arguments),this.type="gauge",this.renderType=tt.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return Bp(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===lr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case Ya.UP:return dv;case Ya.DOWN:return fv;default:return t>0?dv:fv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Bi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Bi().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),I.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=x(r,"gauge","alignment"),{width:m}=I.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Ht.CENTER?v=m/2:g===Ht.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let d=0;r===lr.FULL&&!s?d=l(a):r===lr.SEMI&&s&&(d=-(l(a)+c));const h=I.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=I.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=x(n,"locale"),v=x(n,"gauge","numberFormatter"),E=p.selectAll("text.gauge-value-number").data([i]);E.enter().append("text").attr("class","gauge-value-number").merge(E).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let k;return B!=null?k=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():k=0,v?v(k):m(Number(k),g)});const{width:y}=I.getSVGElementSize(I.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,_=u?"%":"",S=I.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",y/2).text(_),{width:C,height:L}=I.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${L/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=x(r,"locale");if(i){const o=this.computeRadius(),l=i?x(r,"gauge","deltaFontSize"):()=>0,c=i?x(r,"gauge","numberFormatter"):()=>null,u=x(r,"gauge","deltaArrow","size"),d=x(r,"gauge","numberSpacing"),h=x(r,"gauge","showPercentageSymbol"),f=I.appendOrSelect(n,"g.gauge-numbers"),p=I.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=I.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let _;return b!=null?_=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():_=0,c?`${c(_)}${m}`:`${a(Number(_),s)}${m}`});const{width:v}=I.getSVGElementSize(I.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),E=x(r,"gauge","deltaArrow","enabled"),y=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&E?[i]:[]);y.enter().append("svg").merge(y).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=R(this);I.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const _=x(r,"gauge","status");I.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",_!==null?`gauge-delta-arrow status--${_}`:"").attr("points",t.getArrow(i))}),y.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:R(this),datum:r})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=I.getSVGElementSize(this.parent,{useAttrs:!0});return n===lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class pv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=tt.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=ts(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Bt.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),E=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,E),b=this.services.cartesianScales.getRangeValue(h),_=this.services.cartesianScales.getDomainValue(h)-p/2,S=_+p;if(!this.isOutsideZoomedDomain(_,S))return ie({x0:g,x1:m,y0:y,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=R(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=ki().domain(t).rangeRound([0,this.getGroupWidth()])}}class _2 extends pt{constructor(){super(...arguments),this.type="heatmap",this.renderType=tt.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${In(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${In(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:R(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=I.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);I.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),I.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),I.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),I.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=x(this.getOptions(),"heatmap","divider","state");return t!==qr.OFF&&(t===qr.AUTO&&Rg.minCellDividerDimension<=this.xBandwidth&&Rg.minCellDividerDimension<=this.yBandwidth||t===qr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=R(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=as(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:R(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:R(this),datum:u})}).on("mouseout",function(c,u){const h=R(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class T2 extends pt{constructor(){super(...arguments),this.type="histogram",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ht.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Bt.VERTICAL?m+=1:m-=1),ie({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=x(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=R(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){R(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class O2 extends on{constructor(){super(...arguments),this.type="lollipop",this.renderType=tt.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?On.weight.unselected:On.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",On.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",On.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Mn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[i]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:v[i],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[i],v[l],v)).attr("opacity",1);d===Bt.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class w2 extends pt{constructor(){super(...arguments),this.type="meter",this.renderType=tt.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=I.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(x(i,"meter","proportional")===null)u=100;else{const y=x(i,"meter","proportional","total");u=y||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Be().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=x(i,"meter","height");I.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Zt.height.proportional:Zt.height.default)),I.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Zt.height.proportional:Zt.height.default));const p=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",y=>y.x).attr("y",0).attr("height",()=>f||(s?Zt.height.proportional:Zt.height.default)).attr("class",y=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:y[c],originalClassName:g})).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"meter-bar-update",animate:t})).attr("width",y=>y.value>u?d(u):Math.max(y.width,2)).style("fill",y=>n.model.getFillColor(y[c],null,y)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y.value),p.exit().remove();const m=x(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<a[0].value&&(v=a[0].value>u?u:a[0].value));const E=r.selectAll("line.peak").data(v==null?[]:[v]);E.enter().append("line").classed("peak",!0).merge(E).attr("y1",0).attr("y2",()=>f||(s?Zt.height.proportional:Zt.height.default)).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"peak-line-update",animate:t})).attr("x1",y=>d(y)).attr("x2",y=>d(y)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",y=>y),E.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=R(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=R(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function gv(e){const t=M2(mv(e),360);return Bn(t,[0,10])||Bn(t,[350,0])?{textAnchor:en.START,dominantBaseline:nn.MIDDLE}:Bn(t,[10,80])?{textAnchor:en.START,dominantBaseline:nn.HANGING}:Bn(t,[80,100])?{textAnchor:en.MIDDLE,dominantBaseline:nn.HANGING}:Bn(t,[100,170])?{textAnchor:en.END,dominantBaseline:nn.HANGING}:Bn(t,[170,190])?{textAnchor:en.END,dominantBaseline:nn.MIDDLE}:Bn(t,[190,260])?{textAnchor:en.END,dominantBaseline:nn.BASELINE}:Bn(t,[260,280])?{textAnchor:en.MIDDLE,dominantBaseline:nn.BASELINE}:{textAnchor:en.START,dominantBaseline:nn.BASELINE}}function M2(e,t){return(e%t+t)%t}function Bn(e,[t,n]){return e>=t&&e<=n}function mv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function C2(e,t){return t*Math.sin(e-Math.PI/2)}class A2 extends pt{constructor(){super(...arguments),this.type="radar",this.renderType=tt.SVG,this.getLabelDimensions=t=>{const n=I.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=I.appendOrSelect(n,"text").text(t),{width:i,height:s}=I.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=zD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return lt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:lt(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:cr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",cr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=I.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=cr;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const E=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),_=(Math.min(r,i)-E)/2;if(_<=0)return;const S=ki().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=In(this.fullDataNormalized.map(A=>A[d])),L=Be().domain([C>=0?0:C,Vn(this.fullDataNormalized.map(A=>A[d]))]).range([g,_]).nice(p),B=L.ticks(p),k=(A,z,V)=>this.model.getFillColor(A,z,V),O=W_().angle(A=>S(A[u])+Math.PI/2).radius(A=>L(A[d])).curve(Lf),H=this.uniqueKeys.map(A=>{const z=this.getLabelDimensions(A).width,V=C2(S(A),_);return z+V}),M={x:Vn(H)+h,y:i/2},U=I.appendOrSelect(n,"g.y-axes").attr("role",ht.GROUP).selectAll("path").data(B,A=>A),$=A=>this.uniqueKeys.map(z=>({[u]:z,[d]:A}));U.join(A=>A.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>O($(V)))),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>O($(V)))),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>O($(V))).attr("opacity",0).remove())),I.appendOrSelect(n,"g.x-axes").attr("role",ht.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",z=>`x-axis-${Gr(z)}`).attr("stroke-dasharray","0").attr("x1",z=>Ft(S(z),0,M).x).attr("y1",z=>Ft(S(z),0,M).y).attr("x2",z=>Ft(S(z),0,M).x).attr("y2",z=>Ft(S(z),0,M).y).call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ft(S(V),L.range()[0],M).x).attr("y1",V=>Ft(S(V),L.range()[0],M).y).attr("x2",V=>Ft(S(V),L.range()[1],M).x).attr("y2",V=>Ft(S(V),L.range()[1],M).y)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ft(S(V),L.range()[0],M).x).attr("y1",V=>Ft(S(V),L.range()[0],M).y).attr("x2",V=>Ft(S(V),L.range()[1],M).x).attr("y2",V=>Ft(S(V),L.range()[1],M).y)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),I.appendOrSelect(n,"g.x-labels").attr("role",ht.GROUP).selectAll("text").data(this.uniqueKeys).join(A=>A.append("text").text(z=>z).attr("opacity",0).attr("x",z=>Ft(S(z),L.range()[1]+h,M).x).attr("y",z=>Ft(S(z),L.range()[1]+h,M).y).style("text-anchor",z=>gv(S(z)).textAnchor).style("dominant-baseline",z=>gv(S(z)).dominantBaseline).call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ft(S(V),L.range()[1]+h,M).x).attr("y",V=>Ft(S(V),L.range()[1]+h,M).y).end().finally(()=>{const V=x(o,"radar","alignment"),Ct=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",Ct)})),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),I.appendOrSelect(n,"g.blobs").attr("role",ht.GROUP).selectAll("path").data(this.groupedDataNormalized,A=>A.name).join(A=>A.append("path").attr("class",z=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:z.name,originalClassName:"blob"})).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",z=>z.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",z=>k(z.name,null,z.data)).style("fill-opacity",cr.opacity.selected).style("stroke",z=>k(z.name,null,z.data)).call(z=>{const V=z.transition().call(Ct=>this.services.transitions.setupTransition({transition:Ct,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),V.attr("opacity",1).attr("d",Ct=>O(Ct.data))}),A=>(A.attr("class",z=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:z.name,originalClassName:"blob"})).style("fill",z=>k(z.name,null,z.data)).style("stroke",z=>k(z.name,null,z.data)),A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>O(V.data))),A),A=>A.call(z=>{const V=z.transition().call(Ct=>this.services.transitions.setupTransition({transition:Ct,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),I.appendOrSelect(n,"g.dots").attr("role",ht.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(A=>x(A,d)!==null)).join(A=>A.append("circle").attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",z=>z[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:A[l],originalClassName:Gr(A[u])})).attr("cx",A=>Ft(S(A[u]),L(A[d]),M).x).attr("cy",A=>Ft(S(A[u]),L(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>k(A[l])),I.appendOrSelect(n,"g.x-axes-rect").attr("role",ht.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",L.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",A=>`rotate(${mv(S(A))}, ${M.x}, ${M.y})`);const{code:vt,number:Y}=x(o,"locale");I.appendOrSelect(n,"g.y-labels").attr("role",ht.GROUP).selectAll("text").data(Ne(B)).join(A=>A.append("text").attr("opacity",0).text(z=>Y(z,vt)).attr("x",z=>Ft(-Math.PI/2,L(z),M).x+f).attr("y",z=>Ft(-Math.PI/2,L(z),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ft(-Math.PI/2,L(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,L(V),M).y)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=I.getSVGElementSize(n,{useBBox:!0}),{width:s}=I.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Ht.CENTER?a=Math.floor((s-i.width)/2):t===Ht.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=R(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Gr(i)}`),o=t.parent.selectAll(`.dots circle.${Gr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",cr.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=R(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:R(this),datum:i})}).on("mouseout",function(r,i){const s=R(this),a=t.parent.select(`.x-axes .x-axis-${Gr(i)}`),o=t.parent.selectAll(`.dots circle.${Gr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class vv extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],c[u],c)}).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,y)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Bt.VERTICAL||h<0&&a===Bt.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return ie({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=R(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:R(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class D2 extends le{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=I.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=I.appendOrSelect(t,"svg.chart-skeleton.DAII"),I.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class yv extends pt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?Tn.opacity.unselected:Tn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Tn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>x(p,0,s));this.areaGenerator=Yl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>x(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s),null,p)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>x(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Tn.opacity.selected).attr("d",this.areaGenerator)}}class Ev extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Bt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Bt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=R(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=R(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=I.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xv extends on{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=tt.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>x(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ht.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const ni=6;class L2 extends pt{constructor(){super(...arguments),this.type="tree",this.renderType=tt.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=I.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=I.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+ni:30-ni},h=Li({name:o,children:a}),f=10,p=r/6,g=S=>{const C=h.descendants().reverse(),L=h.links();let B=h,k=h;h.eachBefore(N=>{N.x<B.x&&(B=N),N.x>k.x&&(k=N)});const O=k.x-B.x,H=n.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,O].join(" ")),P=_.selectAll("g").data(C,N=>N.id),M=this,w=P.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",N=>N.depth!==0&&N.children&&N.children.length>0?"clickable":null).on("mouseover",function(N,F){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:N,element:R(this),datum:F})}).on("click",function(N,F){F.depth!==0&&(F.children=F.children?null:F._children,g(F)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:N,element:R(this),datum:F})}).on("mouseout",function(N,F){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:N,element:R(this),datum:F})});w.append("circle").attr("r",2.5).attr("class",N=>N._children?"parent":"child").attr("stroke-width",10),w.append("text").attr("dy","0.31em").attr("x",N=>N._children?-ni:ni).attr("text-anchor",N=>N._children?"end":"start").text(N=>N.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(w).transition(H).attr("transform",N=>`translate(${N.y},${N.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(H).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=b.selectAll("path").data(L,N=>N.target.id),$=U.enter().append("path").attr("d",()=>{const N={x:S.x0,y:S.y0};return y({source:N,target:N})});U.merge($).transition(H).attr("d",y),U.exit().transition(H).remove().attr("d",()=>{const N={x:S.x,y:S.y};return y({source:N,target:N})}),h.eachBefore(N=>{N.x0=N.x,N.y0=N.y})},m=h.descendants(),v=m[m.length-1].depth,E=x(s,"tree","type")===Wa.DENDROGRAM?db().size([i,r-u-v*ni-l]):Jb().nodeSize([f,p]).size([i,r-u-v*ni-l]),y=K_().x(S=>S.y).y(S=>S.x);h.x0=p/2,h.y0=0,h.descendants().forEach((S,C)=>{S.id=C,S._children=S.children}),E(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const b=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");g(h)}}var R2="#000000",I2="#ffffff",k2="#fcf4d6",P2="#fddc69",N2="#f1c21b",$2="#d2a106",F2="#b28600",U2="#8e6a00",B2="#684e00",H2="#483700",G2="#302400",V2="#1c1500",z2={10:k2,20:P2,30:N2,40:$2,50:F2,60:U2,70:B2,80:H2,90:G2,100:V2},W2="#fff2e8",Y2="#ffd9be",q2="#ffb784",X2="#ff832b",Z2="#eb6200",j2="#ba4e00",K2="#8a3800",Q2="#5e2900",J2="#3e1a00",tP="#231000",eP={10:W2,20:Y2,30:q2,40:X2,50:Z2,60:j2,70:K2,80:Q2,90:J2,100:tP},nP="#fff1f1",rP="#ffd7d9",iP="#ffb3b8",sP="#ff8389",aP="#fa4d56",oP="#da1e28",lP="#a2191f",cP="#750e13",uP="#520408",hP="#2d0709",dP={10:nP,20:rP,30:iP,40:sP,50:aP,60:oP,70:lP,80:cP,90:uP,100:hP},fP="#fff0f7",pP="#ffd6e8",gP="#ffafd2",mP="#ff7eb6",vP="#ee5396",yP="#d02670",EP="#9f1853",xP="#740937",bP="#510224",SP="#2a0a18",_P={10:fP,20:pP,30:gP,40:mP,50:vP,60:yP,70:EP,80:xP,90:bP,100:SP},TP="#f6f2ff",OP="#e8daff",wP="#d4bbff",MP="#be95ff",CP="#a56eff",AP="#8a3ffc",DP="#6929c4",LP="#491d8b",RP="#31135e",IP="#1c0f30",kP={10:TP,20:OP,30:wP,40:MP,50:CP,60:AP,70:DP,80:LP,90:RP,100:IP},PP="#edf5ff",NP="#d0e2ff",$P="#a6c8ff",FP="#78a9ff",UP="#4589ff",BP="#0f62fe",HP="#0043ce",GP="#002d9c",VP="#001d6c",zP="#001141",WP={10:PP,20:NP,30:$P,40:FP,50:UP,60:BP,70:HP,80:GP,90:VP,100:zP},YP="#e5f6ff",qP="#bae6ff",XP="#82cfff",ZP="#33b1ff",jP="#1192e8",KP="#0072c3",QP="#00539a",JP="#003a6d",tN="#012749",eN="#061727",nN={10:YP,20:qP,30:XP,40:ZP,50:jP,60:KP,70:QP,80:JP,90:tN,100:eN},rN="#d9fbfb",iN="#9ef0f0",sN="#3ddbd9",aN="#08bdba",oN="#009d9a",lN="#007d79",cN="#005d5d",uN="#004144",hN="#022b30",dN="#081a1c",fN={10:rN,20:iN,30:sN,40:aN,50:oN,60:lN,70:cN,80:uN,90:hN,100:dN},pN="#defbe6",gN="#a7f0ba",mN="#6fdc8c",vN="#42be65",yN="#24a148",EN="#198038",xN="#0e6027",bN="#044317",SN="#022d0d",_N="#071908",TN={10:pN,20:gN,30:mN,40:vN,50:yN,60:EN,70:xN,80:bN,90:SN,100:_N},ON="#f2f4f8",wN="#dde1e6",MN="#c1c7cd",CN="#a2a9b0",AN="#878d96",DN="#697077",LN="#4d5358",RN="#343a3f",IN="#21272a",kN="#121619",PN={10:ON,20:wN,30:MN,40:CN,50:AN,60:DN,70:LN,80:RN,90:IN,100:kN},NN="#f4f4f4",$N="#e0e0e0",FN="#c6c6c6",UN="#a8a8a8",BN="#8d8d8d",HN="#6f6f6f",GN="#525252",VN="#393939",zN="#262626",WN="#161616",YN={10:NN,20:$N,30:FN,40:UN,50:BN,60:HN,70:GN,80:VN,90:zN,100:WN},qN="#f7f3f2",XN="#e5e0df",ZN="#cac5c4",jN="#ada8a8",KN="#8f8b8b",QN="#726e6e",JN="#565151",t$="#3c3838",e$="#272525",n$="#171414",r$={10:qN,20:XN,30:ZN,40:jN,50:KN,60:QN,70:JN,80:t$,90:e$,100:n$},bv={black:{100:R2},blue:WP,coolGray:PN,cyan:nN,gray:YN,green:TN,magenta:_P,orange:eP,purple:kP,red:dP,teal:fN,warmGray:r$,white:{0:I2},yellow:z2};const i$=e=>{if(!e)return null;for(const t of Object.keys(bv)){const n=bv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Sv=function(e){const t=R(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=hn(n);let i;if(r&&(i=i$(r?r.hex():null)),i==null){const s=hh(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let s$=0;class a$ extends pt{constructor(){super(...arguments),this.type="treemap",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=I.getSVGElementSize(n,{useAttrs:!0}),l=Li({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=iS().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>s$++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=R(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=R(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=R(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",Sv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=R(this.parentNode).attr("data-uid"),E=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${E}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Sv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=R(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),hn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function o$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function l$(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var c$={value:function(){}};function _v(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new fo(n)}function fo(e){this._=e}function u$(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}fo.prototype=_v.prototype={constructor:fo,on:function(e,t){var n=this._,r=u$(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=h$(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Tv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Tv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new fo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function h$(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Tv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=c$,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const d$=l$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:_v},Symbol.toStringTag,{value:"Module"}))).dispatch,Au=Math.PI/180,f$={archimedean:wv,rectangular:T$},bs=64,po=2048;var p$=function(){var e=[256,256],t=g$,n=m$,r=v$,i=Ov,s=Ov,a=y$,o=E$,l=wv,c=[],u=1/0,d=d$("word","end"),h=null,f=Math.random,p={},g=w$;p.canvas=function(E){return arguments.length?(g=Hn(E),p):g},p.start=function(){var E=m(g()),y=O$((e[0]>>5)*e[1]),b=null,_=c.length,S=-1,C=[],L=c.map(function(k,O){return k.text=t.call(this,k,O),k.font=n.call(this,k,O),k.style=i.call(this,k,O),k.weight=s.call(this,k,O),k.rotate=a.call(this,k,O),k.size=~~r.call(this,k,O),k.padding=o.call(this,k,O),k}).sort(function(k,O){return O.size-k.size});return h&&clearInterval(h),h=setInterval(B,0),B(),p;function B(){for(var k=Date.now();Date.now()-k<u&&++S<_&&h;){var O=L[S];O.x=e[0]*(f()+.5)>>1,O.y=e[1]*(f()+.5)>>1,x$(E,O,L,S),O.hasText&&v(y,O,b)&&(C.push(O),d.call("word",p,O),b?S$(b,O):b=[{x:O.x+O.x0,y:O.y+O.y0},{x:O.x+O.x1,y:O.y+O.y1}],O.x-=e[0]>>1,O.y-=e[1]>>1)}S>=_&&(p.stop(),d.call("end",p,C,b))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const E of c)delete E.sprite;return p};function m(E){const y=E.getContext("2d",{willReadFrequently:!0});E.width=E.height=1;const b=Math.sqrt(y.getImageData(0,0,1,1).data.length>>2);return E.width=(bs<<5)/b,E.height=po/b,y.fillStyle=y.strokeStyle="red",{context:y,ratio:b}}function v(E,y,b){e[0],e[1];for(var _=y.x,S=y.y,C=Math.sqrt(e[0]*e[0]+e[1]*e[1]),L=l(e),B=f()<.5?1:-1,k=-B,O,H,P;(O=L(k+=B))&&(H=~~O[0],P=~~O[1],!(Math.min(Math.abs(H),Math.abs(P))>=C));)if(y.x=_+H,y.y=S+P,!(y.x+y.x0<0||y.y+y.y0<0||y.x+y.x1>e[0]||y.y+y.y1>e[1])&&(!b||_$(y,b))&&!b$(y,E,e[0])){for(var M=y.sprite,w=y.width>>5,U=e[0]>>5,$=y.x-(w<<4),N=$&127,F=32-N,Z=y.y1-y.y0,q=(y.y+y.y0)*U+($>>5),ot,it=0;it<Z;it++){ot=0;for(var mt=0;mt<=w;mt++)E[q+mt]|=ot<<F|(mt<w?(ot=M[it*w+mt])>>>N:0);q+=U}return!0}return!1}return p.timeInterval=function(E){return arguments.length?(u=E??1/0,p):u},p.words=function(E){return arguments.length?(c=E,p):c},p.size=function(E){return arguments.length?(e=[+E[0],+E[1]],p):e},p.font=function(E){return arguments.length?(n=Hn(E),p):n},p.fontStyle=function(E){return arguments.length?(i=Hn(E),p):i},p.fontWeight=function(E){return arguments.length?(s=Hn(E),p):s},p.rotate=function(E){return arguments.length?(a=Hn(E),p):a},p.text=function(E){return arguments.length?(t=Hn(E),p):t},p.spiral=function(E){return arguments.length?(l=f$[E]||E,p):l},p.fontSize=function(E){return arguments.length?(r=Hn(E),p):r},p.padding=function(E){return arguments.length?(o=Hn(E),p):o},p.random=function(E){return arguments.length?(f=E,p):f},p.on=function(){var E=d.on.apply(d,arguments);return E===d?p:E},p};function g$(e){return e.text}function m$(){return"serif"}function Ov(){return"normal"}function v$(e){return Math.sqrt(e.value)}function y$(){return(~~(random()*6)-3)*30}function E$(){return 1}function x$(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(bs<<5)/s,po/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;const O=i.measureText(t.text),H=-Math.floor(O.width/2);let P=(O.width+1)*s,M=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Au),d=Math.cos(t.rotate*Au),h=P*d,f=P*u,p=M*d,g=M*u;P=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,M=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else P=P+31>>5<<5;if(M>l&&(l=M),a+P>=bs<<5&&(a=0,o+=l,l=0),o+M>=po)break;i.translate((a+(P>>1))/s,(o+(M>>1))/s),t.rotate&&i.rotate(t.rotate*Au),i.fillText(t.text,H,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,H,0)),i.restore(),t.width=P,t.height=M,t.xoff=a,t.yoff=o,t.x1=P>>1,t.y1=M>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=P}for(var m=i.getImageData(0,0,(bs<<5)/s,po/s).data,v=[];--r>=0;)if(t=n[r],!!t.hasText){for(var E=t.width,y=E>>5,b=t.y1-t.y0,_=0;_<b*y;_++)v[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var S=0,C=-1,L=0;L<b;L++){for(var _=0;_<E;_++){var B=y*L+(_>>5),k=m[(o+L)*(bs<<5)+(a+_)<<2]?1<<31-_%32:0;v[B]|=k,S|=k}S?C=L:(t.y0++,b--,L--,o++)}t.y1=t.y0+C,t.sprite=v.slice(0,(t.y1-t.y0)*y)}}}function b$(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function S$(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function _$(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function wv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function T$(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function O$(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function w$(){return document.createElement("canvas")}function Hn(e){return typeof e=="function"?e:function(){return e}}const M$=o$(p$);class C$ extends pt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=I.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=M$().size([u,d]).words(i.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=I.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,E=>`${E[c]}-${E.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",E=>`${E.size}px`).text(function(E){return E.text}).attr("class",E=>n.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:E[c],originalClassName:`word ${E.size>32?"light":""}`})).style("fill",E=>n.model.getFillColor(E[c],E.text,E)).attr("text-anchor","middle").transition().call(E=>n.services.transitions.setupTransition({transition:E,name:"wordcloud-text-update-enter",animate:t})).attr("transform",E=>`translate(${E.x}, ${E.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=I.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Ne(i):[1,1];return Be().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=za(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:R(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=R(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class A$ extends pt{constructor(){super(...arguments),this.type="geo",this.renderType=tt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=I.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=g2(s,Object.values(l)),u=d2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=Fx().projection(d);I.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=I.appendOrSelect(t,"defs");I.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Hi()([[0,0],[0,10]]));const m=I.appendOrSelect(t,"g.missing-data");I.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case rn.geoEqualEarth:t=rb();break;case rn.geoAlbers:t=jx();break;case rn.geoConicEqualArea:t=Ld();break;case rn.geoConicEquidistant:t=eb();break;case rn.geoEquirectangular:t=Jx();break;case rn.geoMercator:t=Kx();break;case rn.geoNaturalEarth1:t=ib();break;default:throw new Error("Projection is not supported.")}return t}}class D$ extends A${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",s=>this.model.getColorClassName({value:n[s.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=R(this);t.services.events.dispatchEvent(zr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Vr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(zr.CHOROPLETH_MOUSEMOVE,{event:r,element:R(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Vr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(zr.CHOROPLETH_CLICK,{event:r,element:R(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=R(this);t.services.events.dispatchEvent(zr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Vr.HIDE,{event:r,hoveredElement:s})})}}class Mv extends qe{constructor(t,n){super(t,n),this.model=new l2(this.services),this.model.setOptions(It(Mt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new ys(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new Qr(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new oe(this.model,this.services,[a,...i?[o]:[]],{direction:wt.ROW,alignItems:or.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"choropleth"})],growth:ct.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:tt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=wt.COLUMN_REVERSE,f={id:"spacer",components:[new Dn(this.model,this.services,{size:15})],growth:ct.PREFERRED},p={id:"full-frame",components:[new oe(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Dn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new oo(this.model,this.services),new oe(this.model,this.services,g,{direction:wt.COLUMN})]}getComponents(){const t=[new D$(this.model,this.services)];return this.getChartComponents(t)}}class L$ extends sn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=lt({},t,this.getZoomOptions(t));jc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","depth");this.set({options:lt(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&x(n,0,"children")?x(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),x(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Vt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=x(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class R$ extends qe{constructor(t,n){super(t,n),this.model=new L$(this.services),this.model.setOptions(It(Mt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new E2(this.model,this.services)];return this.getChartComponents(t)}}const Cv={[xe.LINE]:[ti,on],[xe.SCATTER]:[on],[xe.AREA]:[iv,ti,on],[xe.STACKED_AREA]:[yv,ti,xv,ho],[xe.SIMPLE_BAR]:[vv],[xe.GROUPED_BAR]:[pv,ei],[xe.STACKED_BAR]:[Ev,ho]};class I$ extends pe{constructor(t,n){super(t,n);const r=It(Mt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:xe.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Cv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${uC(i.type)}Chart`;return a=lt({},Mt[l],this.model.getOptions(),i.options),i.type===xe.STACKED_AREA&&(o=!0),Cv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=lt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return fc(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===xe.STACKED_BAR||s.type===xe.STACKED_AREA),r=[new ge(this.model,this.services),new Te(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.GRID}),...n?[]:[new Un(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class k$ extends sn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=x(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"–":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Av extends qe{constructor(t,n,r=!1){super(t,n),this.model=new k$(this.services),!r&&(this.model.setOptions(It(Mt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new hv(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.PIE})];return this.getChartComponents(t)}}class P$ extends Av{constructor(t,n){super(t,n,!0),this.model.setOptions(It(Mt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new b2(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.DONUT})];return this.getChartComponents(t)}}class N$ extends sn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=x(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class $$ extends qe{constructor(t,n){super(t,n),this.model=new N$(this.services),this.model.setOptions(It(Mt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new S2(this.model,this.services)];return this.getChartComponents(t)}}class F$ extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new pv(this.model,this.services),new ei(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class U$ extends pr{constructor(t){super(t),this.axisFlavor=ss.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=x(this.getOptions(),"axes");if(x(n,"left","scaleType")&&x(n,"left","scaleType")!==Q.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==Q.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==Q.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==Q.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ne(this.getDisplayData(),r=>r.value),n=Be().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ve(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(Ve(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(Ve(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=_n(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(_n(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ve(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=x(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[r.identifier]===null?"–":l[r.identifier],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!Ve(n);let i=x(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=lv(this.getDisplayData(),l)}}class B$ extends pe{constructor(t,n){super(t,n),this.model=new U$(this.services),this.model.setOptions(It(Mt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new ys(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new Qr(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new oe(this.model,this.services,[a,...i?[o]:[]],{direction:wt.ROW,alignItems:or.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"heatmap"})],growth:ct.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:tt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=wt.COLUMN_REVERSE,f={id:"spacer",components:[new Dn(this.model,this.services,{size:15})],growth:ct.PREFERRED},p={id:"full-frame",components:[new oe(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Dn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(p),[new qm(this.model,this.services),new oo(this.model,this.services),new oe(this.model,this.services,g,{direction:wt.COLUMN})]}getComponents(){const t=[new ge(this.model,this.services),new _2(this.model,this.services)];return this.getAxisChartComponents(t)}}class H$ extends pr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=x(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class G$ extends pe{constructor(t,n){super(t,n),this.model=new H$(this.services),this.model.setOptions(It(Mt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new v2(this.model,this.services),new T2(this.model,this.services)];return this.getAxisChartComponents(t)}}class V$ extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new Un(this.model,this.services),new ti(this.model,this.services),new on(this.model,this.services,{handleThresholds:!0}),new D2(this.model,this.services),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class z$ extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new Un(this.model,this.services),new O2(this.model,this.services),new on(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class W$ extends sn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=x(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=x(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=x(t,"meter","proportional")?r:r>100?100:r,s=x(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=x(n,"meter","proportional"),{number:a,code:o}=x(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"–":a(d.value,o),...i?[i]:[]]]}else{const d=x(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"–":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class Y$ extends qe{constructor(t,n){var i;super(t,n),this.model=new W$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?lt(_n(Mt.proportionalMeterChart),n.options):lt(_n(Mt.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new y2(this.model,this.services)],growth:ct.STRETCH,renderType:tt.SVG},{id:"spacer",components:[new Dn(this.model,this.services,{size:8})],growth:ct.STRETCH}]:[],{id:"meter-graph",components:[new w2(this.model,this.services)],growth:ct.STRETCH,renderType:tt.SVG}],r=[new oe(this.model,this.services,n,{direction:wt.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:tt.HTML})}}class q$ extends pr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),{number:s,code:a}=x(t,"locale"),o=x(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>x(u,"data",h,i)!==null?s(x(u,"data",h,i),a):"–")])];return super.formatTable({headers:l,cells:c})}}class X$ extends qe{constructor(t,n){super(t,n),this.model=new q$(this.services),this.model.setOptions(It(Mt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new A2(this.model,this.services)];return this.getChartComponents(t)}}class Z$ extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new Un(this.model,this.services),new on(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class j$ extends sn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"–"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class K$ extends qe{constructor(t,n){super(t,n),this.model=new j$(this.services),this.model.setOptions(It(Mt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new L2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class Q$ extends sn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,r)])}):x(a.name)!==null&&x(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class J$ extends qe{constructor(t,n){super(t,n),this.model=new Q$(this.services),this.model.setOptions(It(Mt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new a$(this.model,this.services)];return this.getChartComponents(t)}}class tF extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new vv(this.model,this.services),new ei(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class eF extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new yv(this.model,this.services),new ti(this.model,this.services,{stacked:!0}),new xv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new le(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class nF extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new Ev(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ}),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class rF extends sn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=x(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class iF extends qe{constructor(t,n){super(t,n),this.model=new rF(this.services),this.model.setOptions(It(Mt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new C$(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.PIE})];return this.getChartComponents(t)}}W.Alignments=Ht,W.AlluvialChart=Ak,W.AreaChart=Jk,W.AreaEvent=Nc,W.ArrowDirections=Ya,W.AxisEvent=Pc,W.AxisFlavor=ss,W.AxisPositions=G,W.AxisTitleOrientations=qa,W.BarEvent=Bc,W.BoxplotChart=n2,W.BoxplotEvent=Hc,W.BubbleChart=i2,W.BulletChart=o2,W.CalloutDirections=es,W.CanvasZoomEvent=kc,W.CartesianOrientations=Bt,W.ChartEvent=Ac,W.ChartTheme=Xc,W.ChartTypes=xe,W.ChoroplethChart=Mv,W.CirclePackChart=R$,W.ColorClassNameTypes=at,W.ColorLegendType=is,W.ComboChart=I$,W.DividerStatus=qr,W.DominantBaseline=nn,W.DonutChart=P$,W.ExperimentalChoroplethChart=Mv,W.GaugeChart=$$,W.GaugeEvent=Uc,W.GaugeTypes=lr,W.GroupedBarChart=F$,W.HeatmapChart=B$,W.HistogramChart=G$,W.LayoutAlignItems=or,W.LayoutDirection=wt,W.LayoutGrowth=ct,W.LegendItemType=Vt,W.LegendOrientations=Yr,W.LegendPositions=Wr,W.LineChart=V$,W.LineEvent=Vc,W.LollipopChart=z$,W.MeterChart=Y$,W.ModalEvent=Dc,W.ModelEvent=Lc,W.PieChart=Av,W.PieEvent=Fc,W.Projection=rn,W.RadarChart=X$,W.RadarEvent=zc,W.RenderTypes=tt,W.ScaleTypes=Q,W.ScatterChart=Z$,W.ScatterEvent=Gc,W.SimpleBarChart=tF,W.Skeletons=Gt,W.StackedAreaChart=eF,W.StackedBarChart=nF,W.Statuses=ns,W.TextAnchor=en,W.ThresholdEvent=qc,W.TickRotations=rs,W.ToolbarControlTypes=bt,W.TooltipEvent=Vr,W.TreeChart=K$,W.TreeEvent=Wc,W.TreeTypes=Wa,W.TreemapChart=J$,W.TreemapEvent=Yc,W.TruncationTypes=Le,W.WordCloudChart=iF,W.WordCloudEvent=$c,W.ZoomBarTypes=ze,W.ZoomDomainEvent=Ic,W.ZoombarEvent=Rc,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
73
|
+
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=R(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=R(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Xr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Xr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function x2(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class hv extends pt{constructor(){super(...arguments),this.type="pie",this.renderType=tt.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=G_().value(M=>M[a]).sort(x(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=I.appendOrSelect(r,"g.slices").attr("role",ht.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>`${M[a]}, ${Zc(M.data[a],o,a)+"%"}`).attrTween("d",function(M){return x2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=x(i,"locale"),v=i.pie.labels.enabled,E=v?u.filter(M=>M.data[a]>0):[],b=I.appendOrSelect(r,"g.labels").attr("role",ht.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(E,M=>M.data[s]);b.exit().attr("opacity",0).remove();const _=b.enter().append("text").classed("pie-label",!0),S=[];_.merge(b).style("text-anchor","middle").text(M=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const w=l+7,U=(M.endAngle-M.startAngle)/2+M.startAngle,$=U/Math.PI*180,N=this.getComputedTextLength();return M.textOffsetX=N/2,M.textOffsetY=$>90&&$<270?10:0,M.xPosition=(M.textOffsetX+w)*Math.sin(U),M.yPosition=(M.textOffsetY+w)*-Math.cos(U),M}).attr("transform",function(M,w){const U=E.length,$=(M.endAngle-M.startAngle)*(180/Math.PI);if(w>=U-2&&$<Lt.callout.minSliceDegree){let N,F;return M.index===U-1?(N=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,F=M.yPosition-Lt.callout.offsetY,M.direction=es.RIGHT,S.push(M)):(N=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,F=M.yPosition-Lt.callout.offsetY,M.direction=es.LEFT,S.push(M)),`translate(${N}, ${F})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(S);const C=x(i,"donut")?"donut":"pie",L=x(i,C,"alignment"),{width:B}=I.getSVGElementSize(this.getParent(),{useAttrs:!0}),k=v?Lt.xOffset:0,O=v?Lt.yOffset:0;let H=l+k;L===Ht.CENTER?H=B/2:L===Ht.RIGHT&&(H=B-l-Lt.xOffset);let P=l+O;S.length>0&&(P+=Lt.yOffsetCallout),r.attr("x",H+7).attr("y",P),this.addEventListeners()}renderCallouts(t){const n=I.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ht.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ht.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===es.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return R(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return R(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=R(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:R(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);BD(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=I.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class b2 extends hv{constructor(){super(...arguments),this.type="donut",this.renderType=tt.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=I.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");I.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(R(this))}),a!==null&&a!==""&&I.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=gh:s=ye;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=x(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const dv="4,10 8,6 12,10",fv="12,6 8,10 4,6";class S2 extends pt{constructor(){super(...arguments),this.type="gauge",this.renderType=tt.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return Bp(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===lr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case Ya.UP:return dv;case Ya.DOWN:return fv;default:return t>0?dv:fv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Bi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Bi().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),I.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=x(r,"gauge","alignment"),{width:m}=I.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Ht.CENTER?v=m/2:g===Ht.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let d=0;r===lr.FULL&&!s?d=l(a):r===lr.SEMI&&s&&(d=-(l(a)+c));const h=I.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=I.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=x(n,"locale"),v=x(n,"gauge","numberFormatter"),E=p.selectAll("text.gauge-value-number").data([i]);E.enter().append("text").attr("class","gauge-value-number").merge(E).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let k;return B!=null?k=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():k=0,v?v(k):m(Number(k),g)});const{width:y}=I.getSVGElementSize(I.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,_=u?"%":"",S=I.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",y/2).text(_),{width:C,height:L}=I.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${L/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=x(r,"locale");if(i){const o=this.computeRadius(),l=i?x(r,"gauge","deltaFontSize"):()=>0,c=i?x(r,"gauge","numberFormatter"):()=>null,u=x(r,"gauge","deltaArrow","size"),d=x(r,"gauge","numberSpacing"),h=x(r,"gauge","showPercentageSymbol"),f=I.appendOrSelect(n,"g.gauge-numbers"),p=I.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=I.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let _;return b!=null?_=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():_=0,c?`${c(_)}${m}`:`${a(Number(_),s)}${m}`});const{width:v}=I.getSVGElementSize(I.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),E=x(r,"gauge","deltaArrow","enabled"),y=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&E?[i]:[]);y.enter().append("svg").merge(y).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=R(this);I.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const _=x(r,"gauge","status");I.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",_!==null?`gauge-delta-arrow status--${_}`:"").attr("points",t.getArrow(i))}),y.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:R(this),datum:r})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=I.getSVGElementSize(this.parent,{useAttrs:!0});return n===lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class pv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=tt.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=ts(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Bt.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),E=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,E),b=this.services.cartesianScales.getRangeValue(h),_=this.services.cartesianScales.getDomainValue(h)-p/2,S=_+p;if(!this.isOutsideZoomedDomain(_,S))return ie({x0:g,x1:m,y0:y,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=R(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=ki().domain(t).rangeRound([0,this.getGroupWidth()])}}class _2 extends pt{constructor(){super(...arguments),this.type="heatmap",this.renderType=tt.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${In(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${In(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:R(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=I.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);I.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),I.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),I.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),I.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=x(this.getOptions(),"heatmap","divider","state");return t!==qr.OFF&&(t===qr.AUTO&&Rg.minCellDividerDimension<=this.xBandwidth&&Rg.minCellDividerDimension<=this.yBandwidth||t===qr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=R(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=as(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:R(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:R(this),datum:u})}).on("mouseout",function(c,u){const h=R(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class T2 extends pt{constructor(){super(...arguments),this.type="histogram",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ht.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Bt.VERTICAL?m+=1:m-=1),ie({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=x(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=R(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){R(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class O2 extends on{constructor(){super(...arguments),this.type="lollipop",this.renderType=tt.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?On.weight.unselected:On.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",On.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",On.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Mn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[i]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:v[i],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[i],v[l],v)).attr("opacity",1);d===Bt.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class w2 extends pt{constructor(){super(...arguments),this.type="meter",this.renderType=tt.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=I.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(x(i,"meter","proportional")===null)u=100;else{const y=x(i,"meter","proportional","total");u=y||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Be().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=x(i,"meter","height");I.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Zt.height.proportional:Zt.height.default)),I.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Zt.height.proportional:Zt.height.default));const p=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",y=>y.x).attr("y",0).attr("height",()=>f||(s?Zt.height.proportional:Zt.height.default)).attr("class",y=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:y[c],originalClassName:g})).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"meter-bar-update",animate:t})).attr("width",y=>y.value>u?d(u):Math.max(y.width,2)).style("fill",y=>n.model.getFillColor(y[c],null,y)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y.value),p.exit().remove();const m=x(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const E=r.selectAll("line.peak").data(v==null?[]:[v]);E.enter().append("line").classed("peak",!0).merge(E).attr("y1",0).attr("y2",()=>f||(s?Zt.height.proportional:Zt.height.default)).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"peak-line-update",animate:t})).attr("x1",y=>d(y)).attr("x2",y=>d(y)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",y=>y),E.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=R(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=R(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function gv(e){const t=M2(mv(e),360);return Bn(t,[0,10])||Bn(t,[350,0])?{textAnchor:en.START,dominantBaseline:nn.MIDDLE}:Bn(t,[10,80])?{textAnchor:en.START,dominantBaseline:nn.HANGING}:Bn(t,[80,100])?{textAnchor:en.MIDDLE,dominantBaseline:nn.HANGING}:Bn(t,[100,170])?{textAnchor:en.END,dominantBaseline:nn.HANGING}:Bn(t,[170,190])?{textAnchor:en.END,dominantBaseline:nn.MIDDLE}:Bn(t,[190,260])?{textAnchor:en.END,dominantBaseline:nn.BASELINE}:Bn(t,[260,280])?{textAnchor:en.MIDDLE,dominantBaseline:nn.BASELINE}:{textAnchor:en.START,dominantBaseline:nn.BASELINE}}function M2(e,t){return(e%t+t)%t}function Bn(e,[t,n]){return e>=t&&e<=n}function mv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function C2(e,t){return t*Math.sin(e-Math.PI/2)}class A2 extends pt{constructor(){super(...arguments),this.type="radar",this.renderType=tt.SVG,this.getLabelDimensions=t=>{const n=I.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=I.appendOrSelect(n,"text").text(t),{width:i,height:s}=I.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=zD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return lt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:lt(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:cr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",cr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=I.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=cr;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const E=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),_=(Math.min(r,i)-E)/2;if(_<=0)return;const S=ki().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=In(this.fullDataNormalized.map(A=>A[d])),L=Be().domain([C>=0?0:C,Vn(this.fullDataNormalized.map(A=>A[d]))]).range([g,_]).nice(p),B=L.ticks(p),k=(A,z,V)=>this.model.getFillColor(A,z,V),O=W_().angle(A=>S(A[u])+Math.PI/2).radius(A=>L(A[d])).curve(Lf),H=this.uniqueKeys.map(A=>{const z=this.getLabelDimensions(A).width,V=C2(S(A),_);return z+V}),M={x:Vn(H)+h,y:i/2},U=I.appendOrSelect(n,"g.y-axes").attr("role",ht.GROUP).selectAll("path").data(B,A=>A),$=A=>this.uniqueKeys.map(z=>({[u]:z,[d]:A}));U.join(A=>A.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>O($(V)))),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>O($(V)))),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>O($(V))).attr("opacity",0).remove())),I.appendOrSelect(n,"g.x-axes").attr("role",ht.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",z=>`x-axis-${Gr(z)}`).attr("stroke-dasharray","0").attr("x1",z=>Ft(S(z),0,M).x).attr("y1",z=>Ft(S(z),0,M).y).attr("x2",z=>Ft(S(z),0,M).x).attr("y2",z=>Ft(S(z),0,M).y).call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ft(S(V),L.range()[0],M).x).attr("y1",V=>Ft(S(V),L.range()[0],M).y).attr("x2",V=>Ft(S(V),L.range()[1],M).x).attr("y2",V=>Ft(S(V),L.range()[1],M).y)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ft(S(V),L.range()[0],M).x).attr("y1",V=>Ft(S(V),L.range()[0],M).y).attr("x2",V=>Ft(S(V),L.range()[1],M).x).attr("y2",V=>Ft(S(V),L.range()[1],M).y)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),I.appendOrSelect(n,"g.x-labels").attr("role",ht.GROUP).selectAll("text").data(this.uniqueKeys).join(A=>A.append("text").text(z=>z).attr("opacity",0).attr("x",z=>Ft(S(z),L.range()[1]+h,M).x).attr("y",z=>Ft(S(z),L.range()[1]+h,M).y).style("text-anchor",z=>gv(S(z)).textAnchor).style("dominant-baseline",z=>gv(S(z)).dominantBaseline).call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ft(S(V),L.range()[1]+h,M).x).attr("y",V=>Ft(S(V),L.range()[1]+h,M).y).end().finally(()=>{const V=x(o,"radar","alignment"),Ct=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",Ct)})),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),I.appendOrSelect(n,"g.blobs").attr("role",ht.GROUP).selectAll("path").data(this.groupedDataNormalized,A=>A.name).join(A=>A.append("path").attr("class",z=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:z.name,originalClassName:"blob"})).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",z=>z.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",z=>k(z.name,null,z.data)).style("fill-opacity",cr.opacity.selected).style("stroke",z=>k(z.name,null,z.data)).call(z=>{const V=z.transition().call(Ct=>this.services.transitions.setupTransition({transition:Ct,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),V.attr("opacity",1).attr("d",Ct=>O(Ct.data))}),A=>(A.attr("class",z=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:z.name,originalClassName:"blob"})).style("fill",z=>k(z.name,null,z.data)).style("stroke",z=>k(z.name,null,z.data)),A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>O(V.data))),A),A=>A.call(z=>{const V=z.transition().call(Ct=>this.services.transitions.setupTransition({transition:Ct,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),I.appendOrSelect(n,"g.dots").attr("role",ht.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(A=>x(A,d)!==null)).join(A=>A.append("circle").attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",z=>z[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:A[l],originalClassName:Gr(A[u])})).attr("cx",A=>Ft(S(A[u]),L(A[d]),M).x).attr("cy",A=>Ft(S(A[u]),L(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>k(A[l])),I.appendOrSelect(n,"g.x-axes-rect").attr("role",ht.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",L.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",A=>`rotate(${mv(S(A))}, ${M.x}, ${M.y})`);const{code:vt,number:Y}=x(o,"locale");I.appendOrSelect(n,"g.y-labels").attr("role",ht.GROUP).selectAll("text").data(Ne(B)).join(A=>A.append("text").attr("opacity",0).text(z=>Y(z,vt)).attr("x",z=>Ft(-Math.PI/2,L(z),M).x+f).attr("y",z=>Ft(-Math.PI/2,L(z),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ft(-Math.PI/2,L(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,L(V),M).y)),A=>A.call(z=>z.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=I.getSVGElementSize(n,{useBBox:!0}),{width:s}=I.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Ht.CENTER?a=Math.floor((s-i.width)/2):t===Ht.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=R(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Gr(i)}`),o=t.parent.selectAll(`.dots circle.${Gr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",cr.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=R(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:R(this),datum:i})}).on("mouseout",function(r,i){const s=R(this),a=t.parent.select(`.x-axes .x-axis-${Gr(i)}`),o=t.parent.selectAll(`.dots circle.${Gr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class vv extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],c[u],c)}).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,y)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Bt.VERTICAL||h<0&&a===Bt.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return ie({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=R(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:R(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class D2 extends le{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=I.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=I.appendOrSelect(t,"svg.chart-skeleton.DAII"),I.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class yv extends pt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?Tn.opacity.unselected:Tn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Tn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>x(p,0,s));this.areaGenerator=Yl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>x(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s),null,p)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>x(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Tn.opacity.selected).attr("d",this.areaGenerator)}}class Ev extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Bt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Bt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=R(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=R(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=I.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xv extends on{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=tt.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>x(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ht.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const ni=6;class L2 extends pt{constructor(){super(...arguments),this.type="tree",this.renderType=tt.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=I.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=I.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+ni:30-ni},h=Li({name:o,children:a}),f=10,p=r/6,g=S=>{const C=h.descendants().reverse(),L=h.links();let B=h,k=h;h.eachBefore(N=>{N.x<B.x&&(B=N),N.x>k.x&&(k=N)});const O=k.x-B.x,H=n.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,O].join(" ")),P=_.selectAll("g").data(C,N=>N.id),M=this,w=P.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",N=>N.depth!==0&&N.children&&N.children.length>0?"clickable":null).on("mouseover",function(N,F){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:N,element:R(this),datum:F})}).on("click",function(N,F){F.depth!==0&&(F.children=F.children?null:F._children,g(F)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:N,element:R(this),datum:F})}).on("mouseout",function(N,F){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:N,element:R(this),datum:F})});w.append("circle").attr("r",2.5).attr("class",N=>N._children?"parent":"child").attr("stroke-width",10),w.append("text").attr("dy","0.31em").attr("x",N=>N._children?-ni:ni).attr("text-anchor",N=>N._children?"end":"start").text(N=>N.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(w).transition(H).attr("transform",N=>`translate(${N.y},${N.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(H).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=b.selectAll("path").data(L,N=>N.target.id),$=U.enter().append("path").attr("d",()=>{const N={x:S.x0,y:S.y0};return y({source:N,target:N})});U.merge($).transition(H).attr("d",y),U.exit().transition(H).remove().attr("d",()=>{const N={x:S.x,y:S.y};return y({source:N,target:N})}),h.eachBefore(N=>{N.x0=N.x,N.y0=N.y})},m=h.descendants(),v=m[m.length-1].depth,E=x(s,"tree","type")===Wa.DENDROGRAM?db().size([i,r-u-v*ni-l]):Jb().nodeSize([f,p]).size([i,r-u-v*ni-l]),y=K_().x(S=>S.y).y(S=>S.x);h.x0=p/2,h.y0=0,h.descendants().forEach((S,C)=>{S.id=C,S._children=S.children}),E(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const b=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");g(h)}}var R2="#000000",I2="#ffffff",k2="#fcf4d6",P2="#fddc69",N2="#f1c21b",$2="#d2a106",F2="#b28600",U2="#8e6a00",B2="#684e00",H2="#483700",G2="#302400",V2="#1c1500",z2={10:k2,20:P2,30:N2,40:$2,50:F2,60:U2,70:B2,80:H2,90:G2,100:V2},W2="#fff2e8",Y2="#ffd9be",q2="#ffb784",X2="#ff832b",Z2="#eb6200",j2="#ba4e00",K2="#8a3800",Q2="#5e2900",J2="#3e1a00",tP="#231000",eP={10:W2,20:Y2,30:q2,40:X2,50:Z2,60:j2,70:K2,80:Q2,90:J2,100:tP},nP="#fff1f1",rP="#ffd7d9",iP="#ffb3b8",sP="#ff8389",aP="#fa4d56",oP="#da1e28",lP="#a2191f",cP="#750e13",uP="#520408",hP="#2d0709",dP={10:nP,20:rP,30:iP,40:sP,50:aP,60:oP,70:lP,80:cP,90:uP,100:hP},fP="#fff0f7",pP="#ffd6e8",gP="#ffafd2",mP="#ff7eb6",vP="#ee5396",yP="#d02670",EP="#9f1853",xP="#740937",bP="#510224",SP="#2a0a18",_P={10:fP,20:pP,30:gP,40:mP,50:vP,60:yP,70:EP,80:xP,90:bP,100:SP},TP="#f6f2ff",OP="#e8daff",wP="#d4bbff",MP="#be95ff",CP="#a56eff",AP="#8a3ffc",DP="#6929c4",LP="#491d8b",RP="#31135e",IP="#1c0f30",kP={10:TP,20:OP,30:wP,40:MP,50:CP,60:AP,70:DP,80:LP,90:RP,100:IP},PP="#edf5ff",NP="#d0e2ff",$P="#a6c8ff",FP="#78a9ff",UP="#4589ff",BP="#0f62fe",HP="#0043ce",GP="#002d9c",VP="#001d6c",zP="#001141",WP={10:PP,20:NP,30:$P,40:FP,50:UP,60:BP,70:HP,80:GP,90:VP,100:zP},YP="#e5f6ff",qP="#bae6ff",XP="#82cfff",ZP="#33b1ff",jP="#1192e8",KP="#0072c3",QP="#00539a",JP="#003a6d",tN="#012749",eN="#061727",nN={10:YP,20:qP,30:XP,40:ZP,50:jP,60:KP,70:QP,80:JP,90:tN,100:eN},rN="#d9fbfb",iN="#9ef0f0",sN="#3ddbd9",aN="#08bdba",oN="#009d9a",lN="#007d79",cN="#005d5d",uN="#004144",hN="#022b30",dN="#081a1c",fN={10:rN,20:iN,30:sN,40:aN,50:oN,60:lN,70:cN,80:uN,90:hN,100:dN},pN="#defbe6",gN="#a7f0ba",mN="#6fdc8c",vN="#42be65",yN="#24a148",EN="#198038",xN="#0e6027",bN="#044317",SN="#022d0d",_N="#071908",TN={10:pN,20:gN,30:mN,40:vN,50:yN,60:EN,70:xN,80:bN,90:SN,100:_N},ON="#f2f4f8",wN="#dde1e6",MN="#c1c7cd",CN="#a2a9b0",AN="#878d96",DN="#697077",LN="#4d5358",RN="#343a3f",IN="#21272a",kN="#121619",PN={10:ON,20:wN,30:MN,40:CN,50:AN,60:DN,70:LN,80:RN,90:IN,100:kN},NN="#f4f4f4",$N="#e0e0e0",FN="#c6c6c6",UN="#a8a8a8",BN="#8d8d8d",HN="#6f6f6f",GN="#525252",VN="#393939",zN="#262626",WN="#161616",YN={10:NN,20:$N,30:FN,40:UN,50:BN,60:HN,70:GN,80:VN,90:zN,100:WN},qN="#f7f3f2",XN="#e5e0df",ZN="#cac5c4",jN="#ada8a8",KN="#8f8b8b",QN="#726e6e",JN="#565151",t$="#3c3838",e$="#272525",n$="#171414",r$={10:qN,20:XN,30:ZN,40:jN,50:KN,60:QN,70:JN,80:t$,90:e$,100:n$},bv={black:{100:R2},blue:WP,coolGray:PN,cyan:nN,gray:YN,green:TN,magenta:_P,orange:eP,purple:kP,red:dP,teal:fN,warmGray:r$,white:{0:I2},yellow:z2};const i$=e=>{if(!e)return null;for(const t of Object.keys(bv)){const n=bv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Sv=function(e){const t=R(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=hn(n);let i;if(r&&(i=i$(r?r.hex():null)),i==null){const s=hh(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let s$=0;class a$ extends pt{constructor(){super(...arguments),this.type="treemap",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=I.getSVGElementSize(n,{useAttrs:!0}),l=Li({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=iS().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>s$++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=R(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=R(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=R(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",Sv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=R(this.parentNode).attr("data-uid"),E=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${E}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Sv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=R(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),hn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=R(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function o$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function l$(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var c$={value:function(){}};function _v(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new fo(n)}function fo(e){this._=e}function u$(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}fo.prototype=_v.prototype={constructor:fo,on:function(e,t){var n=this._,r=u$(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=h$(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Tv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Tv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new fo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function h$(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Tv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=c$,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const d$=l$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:_v},Symbol.toStringTag,{value:"Module"}))).dispatch,Au=Math.PI/180,f$={archimedean:wv,rectangular:T$},bs=64,po=2048;var p$=function(){var e=[256,256],t=g$,n=m$,r=v$,i=Ov,s=Ov,a=y$,o=E$,l=wv,c=[],u=1/0,d=d$("word","end"),h=null,f=Math.random,p={},g=w$;p.canvas=function(E){return arguments.length?(g=Hn(E),p):g},p.start=function(){var E=m(g()),y=O$((e[0]>>5)*e[1]),b=null,_=c.length,S=-1,C=[],L=c.map(function(k,O){return k.text=t.call(this,k,O),k.font=n.call(this,k,O),k.style=i.call(this,k,O),k.weight=s.call(this,k,O),k.rotate=a.call(this,k,O),k.size=~~r.call(this,k,O),k.padding=o.call(this,k,O),k}).sort(function(k,O){return O.size-k.size});return h&&clearInterval(h),h=setInterval(B,0),B(),p;function B(){for(var k=Date.now();Date.now()-k<u&&++S<_&&h;){var O=L[S];O.x=e[0]*(f()+.5)>>1,O.y=e[1]*(f()+.5)>>1,x$(E,O,L,S),O.hasText&&v(y,O,b)&&(C.push(O),d.call("word",p,O),b?S$(b,O):b=[{x:O.x+O.x0,y:O.y+O.y0},{x:O.x+O.x1,y:O.y+O.y1}],O.x-=e[0]>>1,O.y-=e[1]>>1)}S>=_&&(p.stop(),d.call("end",p,C,b))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const E of c)delete E.sprite;return p};function m(E){const y=E.getContext("2d",{willReadFrequently:!0});E.width=E.height=1;const b=Math.sqrt(y.getImageData(0,0,1,1).data.length>>2);return E.width=(bs<<5)/b,E.height=po/b,y.fillStyle=y.strokeStyle="red",{context:y,ratio:b}}function v(E,y,b){e[0],e[1];for(var _=y.x,S=y.y,C=Math.sqrt(e[0]*e[0]+e[1]*e[1]),L=l(e),B=f()<.5?1:-1,k=-B,O,H,P;(O=L(k+=B))&&(H=~~O[0],P=~~O[1],!(Math.min(Math.abs(H),Math.abs(P))>=C));)if(y.x=_+H,y.y=S+P,!(y.x+y.x0<0||y.y+y.y0<0||y.x+y.x1>e[0]||y.y+y.y1>e[1])&&(!b||_$(y,b))&&!b$(y,E,e[0])){for(var M=y.sprite,w=y.width>>5,U=e[0]>>5,$=y.x-(w<<4),N=$&127,F=32-N,Z=y.y1-y.y0,q=(y.y+y.y0)*U+($>>5),ot,it=0;it<Z;it++){ot=0;for(var mt=0;mt<=w;mt++)E[q+mt]|=ot<<F|(mt<w?(ot=M[it*w+mt])>>>N:0);q+=U}return!0}return!1}return p.timeInterval=function(E){return arguments.length?(u=E??1/0,p):u},p.words=function(E){return arguments.length?(c=E,p):c},p.size=function(E){return arguments.length?(e=[+E[0],+E[1]],p):e},p.font=function(E){return arguments.length?(n=Hn(E),p):n},p.fontStyle=function(E){return arguments.length?(i=Hn(E),p):i},p.fontWeight=function(E){return arguments.length?(s=Hn(E),p):s},p.rotate=function(E){return arguments.length?(a=Hn(E),p):a},p.text=function(E){return arguments.length?(t=Hn(E),p):t},p.spiral=function(E){return arguments.length?(l=f$[E]||E,p):l},p.fontSize=function(E){return arguments.length?(r=Hn(E),p):r},p.padding=function(E){return arguments.length?(o=Hn(E),p):o},p.random=function(E){return arguments.length?(f=E,p):f},p.on=function(){var E=d.on.apply(d,arguments);return E===d?p:E},p};function g$(e){return e.text}function m$(){return"serif"}function Ov(){return"normal"}function v$(e){return Math.sqrt(e.value)}function y$(){return(~~(random()*6)-3)*30}function E$(){return 1}function x$(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(bs<<5)/s,po/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;const O=i.measureText(t.text),H=-Math.floor(O.width/2);let P=(O.width+1)*s,M=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Au),d=Math.cos(t.rotate*Au),h=P*d,f=P*u,p=M*d,g=M*u;P=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,M=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else P=P+31>>5<<5;if(M>l&&(l=M),a+P>=bs<<5&&(a=0,o+=l,l=0),o+M>=po)break;i.translate((a+(P>>1))/s,(o+(M>>1))/s),t.rotate&&i.rotate(t.rotate*Au),i.fillText(t.text,H,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,H,0)),i.restore(),t.width=P,t.height=M,t.xoff=a,t.yoff=o,t.x1=P>>1,t.y1=M>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=P}for(var m=i.getImageData(0,0,(bs<<5)/s,po/s).data,v=[];--r>=0;)if(t=n[r],!!t.hasText){for(var E=t.width,y=E>>5,b=t.y1-t.y0,_=0;_<b*y;_++)v[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var S=0,C=-1,L=0;L<b;L++){for(var _=0;_<E;_++){var B=y*L+(_>>5),k=m[(o+L)*(bs<<5)+(a+_)<<2]?1<<31-_%32:0;v[B]|=k,S|=k}S?C=L:(t.y0++,b--,L--,o++)}t.y1=t.y0+C,t.sprite=v.slice(0,(t.y1-t.y0)*y)}}}function b$(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function S$(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function _$(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function wv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function T$(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function O$(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function w$(){return document.createElement("canvas")}function Hn(e){return typeof e=="function"?e:function(){return e}}const M$=o$(p$);class C$ extends pt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=tt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=I.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=M$().size([u,d]).words(i.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=I.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,E=>`${E[c]}-${E.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",E=>`${E.size}px`).text(function(E){return E.text}).attr("class",E=>n.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:E[c],originalClassName:`word ${E.size>32?"light":""}`})).style("fill",E=>n.model.getFillColor(E[c],E.text,E)).attr("text-anchor","middle").transition().call(E=>n.services.transitions.setupTransition({transition:E,name:"wordcloud-text-update-enter",animate:t})).attr("transform",E=>`translate(${E.x}, ${E.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=I.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Ne(i):[1,1];return Be().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=za(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:R(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=R(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class A$ extends pt{constructor(){super(...arguments),this.type="geo",this.renderType=tt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=I.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=g2(s,Object.values(l)),u=d2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=Fx().projection(d);I.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=I.appendOrSelect(t,"defs");I.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Hi()([[0,0],[0,10]]));const m=I.appendOrSelect(t,"g.missing-data");I.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case rn.geoEqualEarth:t=rb();break;case rn.geoAlbers:t=jx();break;case rn.geoConicEqualArea:t=Ld();break;case rn.geoConicEquidistant:t=eb();break;case rn.geoEquirectangular:t=Jx();break;case rn.geoMercator:t=Kx();break;case rn.geoNaturalEarth1:t=ib();break;default:throw new Error("Projection is not supported.")}return t}}class D$ extends A${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",s=>this.model.getColorClassName({value:n[s.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=R(this);t.services.events.dispatchEvent(zr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Vr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(zr.CHOROPLETH_MOUSEMOVE,{event:r,element:R(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Vr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(zr.CHOROPLETH_CLICK,{event:r,element:R(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=R(this);t.services.events.dispatchEvent(zr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Vr.HIDE,{event:r,hoveredElement:s})})}}class Mv extends qe{constructor(t,n){super(t,n),this.model=new l2(this.services),this.model.setOptions(It(Mt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new ys(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new Qr(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new oe(this.model,this.services,[a,...i?[o]:[]],{direction:wt.ROW,alignItems:or.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"choropleth"})],growth:ct.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:tt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=wt.COLUMN_REVERSE,f={id:"spacer",components:[new Dn(this.model,this.services,{size:15})],growth:ct.PREFERRED},p={id:"full-frame",components:[new oe(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Dn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new oo(this.model,this.services),new oe(this.model,this.services,g,{direction:wt.COLUMN})]}getComponents(){const t=[new D$(this.model,this.services)];return this.getChartComponents(t)}}class L$ extends sn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=lt({},t,this.getZoomOptions(t));jc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","depth");this.set({options:lt(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&x(n,0,"children")?x(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),x(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Vt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=x(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class R$ extends qe{constructor(t,n){super(t,n),this.model=new L$(this.services),this.model.setOptions(It(Mt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new E2(this.model,this.services)];return this.getChartComponents(t)}}const Cv={[xe.LINE]:[ti,on],[xe.SCATTER]:[on],[xe.AREA]:[iv,ti,on],[xe.STACKED_AREA]:[yv,ti,xv,ho],[xe.SIMPLE_BAR]:[vv],[xe.GROUPED_BAR]:[pv,ei],[xe.STACKED_BAR]:[Ev,ho]};class I$ extends pe{constructor(t,n){super(t,n);const r=It(Mt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:xe.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Cv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${uC(i.type)}Chart`;return a=lt({},Mt[l],this.model.getOptions(),i.options),i.type===xe.STACKED_AREA&&(o=!0),Cv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=lt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return fc(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===xe.STACKED_BAR||s.type===xe.STACKED_AREA),r=[new ge(this.model,this.services),new Te(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.GRID}),...n?[]:[new Un(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class k$ extends sn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=x(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"–":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Av extends qe{constructor(t,n,r=!1){super(t,n),this.model=new k$(this.services),!r&&(this.model.setOptions(It(Mt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new hv(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.PIE})];return this.getChartComponents(t)}}class P$ extends Av{constructor(t,n){super(t,n,!0),this.model.setOptions(It(Mt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new b2(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.DONUT})];return this.getChartComponents(t)}}class N$ extends sn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=x(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class $$ extends qe{constructor(t,n){super(t,n),this.model=new N$(this.services),this.model.setOptions(It(Mt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new S2(this.model,this.services)];return this.getChartComponents(t)}}class F$ extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new pv(this.model,this.services),new ei(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class U$ extends pr{constructor(t){super(t),this.axisFlavor=ss.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=x(this.getOptions(),"axes");if(x(n,"left","scaleType")&&x(n,"left","scaleType")!==Q.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==Q.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==Q.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==Q.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ne(this.getDisplayData(),r=>r.value),n=Be().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ve(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(Ve(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(Ve(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=_n(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(_n(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ve(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=x(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[r.identifier]===null?"–":l[r.identifier],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!Ve(n);let i=x(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=lv(this.getDisplayData(),l)}}class B$ extends pe{constructor(t,n){super(t,n),this.model=new U$(this.services),this.model.setOptions(It(Mt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new ys(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new Qr(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new oe(this.model,this.services,[a,...i?[o]:[]],{direction:wt.ROW,alignItems:or.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"heatmap"})],growth:ct.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:tt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=wt.COLUMN_REVERSE,f={id:"spacer",components:[new Dn(this.model,this.services,{size:15})],growth:ct.PREFERRED},p={id:"full-frame",components:[new oe(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Dn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(p),[new qm(this.model,this.services),new oo(this.model,this.services),new oe(this.model,this.services,g,{direction:wt.COLUMN})]}getComponents(){const t=[new ge(this.model,this.services),new _2(this.model,this.services)];return this.getAxisChartComponents(t)}}class H$ extends pr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=x(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class G$ extends pe{constructor(t,n){super(t,n),this.model=new H$(this.services),this.model.setOptions(It(Mt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new v2(this.model,this.services),new T2(this.model,this.services)];return this.getAxisChartComponents(t)}}class V$ extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new Un(this.model,this.services),new ti(this.model,this.services),new on(this.model,this.services,{handleThresholds:!0}),new D2(this.model,this.services),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class z$ extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new Un(this.model,this.services),new O2(this.model,this.services),new on(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class W$ extends sn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=x(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=x(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=x(t,"meter","proportional")?r:r>100?100:r,s=x(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=x(n,"meter","proportional"),{number:a,code:o}=x(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"–":a(d.value,o),...i?[i]:[]]]}else{const d=x(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"–":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class Y$ extends qe{constructor(t,n){var i;super(t,n),this.model=new W$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?lt(_n(Mt.proportionalMeterChart),n.options):lt(_n(Mt.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new y2(this.model,this.services)],growth:ct.STRETCH,renderType:tt.SVG},{id:"spacer",components:[new Dn(this.model,this.services,{size:8})],growth:ct.STRETCH}]:[],{id:"meter-graph",components:[new w2(this.model,this.services)],growth:ct.STRETCH,renderType:tt.SVG}],r=[new oe(this.model,this.services,n,{direction:wt.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:tt.HTML})}}class q$ extends pr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),{number:s,code:a}=x(t,"locale"),o=x(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>x(u,"data",h,i)!==null?s(x(u,"data",h,i),a):"–")])];return super.formatTable({headers:l,cells:c})}}class X$ extends qe{constructor(t,n){super(t,n),this.model=new q$(this.services),this.model.setOptions(It(Mt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new A2(this.model,this.services)];return this.getChartComponents(t)}}class Z$ extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new Un(this.model,this.services),new on(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class j$ extends sn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"–"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class K$ extends qe{constructor(t,n){super(t,n),this.model=new j$(this.services),this.model.setOptions(It(Mt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new L2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class Q$ extends sn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=x(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,r)])}):x(a.name)!==null&&x(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class J$ extends qe{constructor(t,n){super(t,n),this.model=new Q$(this.services),this.model.setOptions(It(Mt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new a$(this.model,this.services)];return this.getChartComponents(t)}}class tF extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new vv(this.model,this.services),new ei(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class eF extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new yv(this.model,this.services),new ti(this.model,this.services,{stacked:!0}),new xv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new le(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class nF extends pe{constructor(t,n){super(t,n),this.model.setOptions(It(Mt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ge(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new Ev(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ}),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class rF extends sn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=x(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class iF extends qe{constructor(t,n){super(t,n),this.model=new rF(this.services),this.model.setOptions(It(Mt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new C$(this.model,this.services),new le(this.model,this.services,{skeleton:Gt.PIE})];return this.getChartComponents(t)}}W.Alignments=Ht,W.AlluvialChart=Ak,W.AreaChart=Jk,W.AreaEvent=Nc,W.ArrowDirections=Ya,W.AxisEvent=Pc,W.AxisFlavor=ss,W.AxisPositions=G,W.AxisTitleOrientations=qa,W.BarEvent=Bc,W.BoxplotChart=n2,W.BoxplotEvent=Hc,W.BubbleChart=i2,W.BulletChart=o2,W.CalloutDirections=es,W.CanvasZoomEvent=kc,W.CartesianOrientations=Bt,W.ChartEvent=Ac,W.ChartTheme=Xc,W.ChartTypes=xe,W.ChoroplethChart=Mv,W.CirclePackChart=R$,W.ColorClassNameTypes=at,W.ColorLegendType=is,W.ComboChart=I$,W.DividerStatus=qr,W.DominantBaseline=nn,W.DonutChart=P$,W.ExperimentalChoroplethChart=Mv,W.GaugeChart=$$,W.GaugeEvent=Uc,W.GaugeTypes=lr,W.GroupedBarChart=F$,W.HeatmapChart=B$,W.HistogramChart=G$,W.LayoutAlignItems=or,W.LayoutDirection=wt,W.LayoutGrowth=ct,W.LegendItemType=Vt,W.LegendOrientations=Yr,W.LegendPositions=Wr,W.LineChart=V$,W.LineEvent=Vc,W.LollipopChart=z$,W.MeterChart=Y$,W.ModalEvent=Dc,W.ModelEvent=Lc,W.PieChart=Av,W.PieEvent=Fc,W.Projection=rn,W.RadarChart=X$,W.RadarEvent=zc,W.RenderTypes=tt,W.ScaleTypes=Q,W.ScatterChart=Z$,W.ScatterEvent=Gc,W.SimpleBarChart=tF,W.Skeletons=Gt,W.StackedAreaChart=eF,W.StackedBarChart=nF,W.Statuses=ns,W.TextAnchor=en,W.ThresholdEvent=qc,W.TickRotations=rs,W.ToolbarControlTypes=bt,W.TooltipEvent=Vr,W.TreeChart=K$,W.TreeEvent=Wc,W.TreeTypes=Wa,W.TreemapChart=J$,W.TreemapEvent=Yc,W.TruncationTypes=Le,W.WordCloudChart=iF,W.WordCloudEvent=$c,W.ZoomBarTypes=ze,W.ZoomDomainEvent=Ic,W.ZoombarEvent=Rc,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
74
74
|
//# sourceMappingURL=bundle.umd.cjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/charts",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.7",
|
|
4
4
|
"description": "Carbon Charts component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"url": "https://github.com/theiliad"
|
|
158
158
|
}
|
|
159
159
|
],
|
|
160
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "6aae55386567ac5d812089d14cefc0bd4dd44de5"
|
|
161
161
|
}
|