@carbon/charts 1.13.13 → 1.13.14

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.
@@ -81,4 +81,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
81
81
  <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"/>
82
82
  <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"/>
83
83
  </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=A(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:Et(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(w.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(w.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=A(this);t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=A(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=A(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");A(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,_r)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");A(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,_r),n.stopPropagation()}t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function UI(e,t){const n=Hr(this._current,e);return r=>(this._current=n(r),t(this._current))}class Tm extends ot{constructor(){super(...arguments),this.type="pie",this.renderType=Z.SVG,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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return _t.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie,o=this.model.getDisplayData().filter(L=>L[a]>0),l=this.computeRadius();this.arc=di().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=di().innerRadius(this.getInnerRadius()).outerRadius(l+_t.hoverArc.outerRadiusOffset);const u=US().value(L=>L[a]).sort(x(i,"pie","sortFunction")).padAngle(_t.padAngle)(o),h=C.appendOrSelect(r,"g.slices").attr("role",it.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,L=>L.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",L=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:L.data[s],originalClassName:"slice"})).style("fill",L=>n.model.getFillColor(L.data[s])).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[a]}, ${hc(L.data[a],o,a)+"%"}`).attrTween("d",function(L){return UI.bind(this)(L,n.arc)});const g=i.pie.labels.enabled,v=g?u.filter(L=>L.data[a]>0):[],y=C.appendOrSelect(r,"g.labels").attr("role",it.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(v,L=>L.data[s]);y.exit().attr("opacity",0).remove();const b=y.enter().append("text").classed("pie-label",!0),S=[];b.merge(y).style("text-anchor","middle").text(L=>i.pie.labels.formatter?i.pie.labels.formatter({...L,percentageValue:hc(L.data[a],o,a,!0)}):hc(L.data[a],o,a)+"%").datum(function(L){const R=l+7,k=(L.endAngle-L.startAngle)/2+L.startAngle,T=k/Math.PI*180,U=this.getComputedTextLength();return L.textOffsetX=U/2,L.textOffsetY=T>90&&T<270?10:0,L.xPosition=(L.textOffsetX+R)*Math.sin(k),L.yPosition=(L.textOffsetY+R)*-Math.cos(k),L}).attr("transform",function(L,R){const k=v.length,T=(L.endAngle-L.startAngle)*(180/Math.PI);if(R>=k-2&&T<_t.callout.minSliceDegree){let U,N;return L.index===k-1?(U=L.xPosition+_t.callout.offsetX+_t.callout.textMargin+L.textOffsetX,N=L.yPosition-_t.callout.offsetY,L.direction=Mi.RIGHT,S.push(L)):(U=L.xPosition-_t.callout.offsetX-L.textOffsetX-_t.callout.textMargin,N=L.yPosition-_t.callout.offsetY,L.direction=Mi.LEFT,S.push(L)),`translate(${U}, ${N})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(S);const _=x(i,"donut")?"donut":"pie",E=x(i,_,"alignment"),{width:M}=C.getSVGElementSize(this.getParent(),{useAttrs:!0}),D=g?_t.xOffset:0,H=g?_t.yOffset:0;let I=l+D;E===Rt.CENTER?I=M/2:E===Rt.RIGHT&&(I=M-l-_t.xOffset);let O=l+H;S.length>0&&(O+=_t.yOffsetCallout),r.attr("x",I+7).attr("y",O),this.addEventListeners()}renderCallouts(t){const n=C.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",it.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",it.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===Mi.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+_t.callout.offsetX,y:c-_t.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-_t.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-_t.callout.offsetX,y:c-_t.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+_t.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return A(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 A(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=A(this);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(w.Pie.SLICE_MOUSEOVER,{event:n,element:A(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=A(this);t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Pie.SLICE_CLICK,{event:n,element:A(this),datum:r})}).on("mouseout",function(n,r){const i=A(this);i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc),t.services.events.dispatchEvent(w.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=C.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+_t.radiusOffset:i}}class HI extends Tm{constructor(){super(...arguments),this.type="donut",this.renderType=Z.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=C.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");C.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(A(this))}),a!==null&&a!==""&&C.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=Iu:s=se;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Mm="4,10 8,6 12,10",Cm="12,6 8,10 4,6";class FI extends ot{constructor(){super(...arguments),this.type="gauge",this.renderType=Z.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return up(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")===Un.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 pa.UP:return Mm;case pa.DOWN:return Cm;default:return t>0?Mm:Cm}}render(t=!0){const n=this.getComponentContainer().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=di().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=di().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),C.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:[Q.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=x(r,"gauge","alignment"),{width:v}=C.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;g===Rt.CENTER?m=v/2:g===Rt.RIGHT&&(m=v-d),n.attr("x",m).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===Un.FULL&&!s?d=l(a):r===Un.SEMI&&s&&(d=-(l(a)+c));const h=C.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=C.appendOrSelect(h,"g.gauge-value-number"),g=x(n,"gauge","numberFormatter"),v=p.selectAll("text.gauge-value-number").data([i]);v.enter().append("text").attr("class","gauge-value-number").merge(v).style("font-size",`${f}px`).attr("text-anchor","middle").text(M=>g(M));const{width:m}=C.getSVGElementSize(C.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,b=u?"%":"",S=C.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",m/2).text(b),{width:_,height:E}=C.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${E/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?x(r,"gauge","deltaFontSize"):()=>0,o=i?x(r,"gauge","numberFormatter"):()=>null,l=x(r,"gauge","deltaArrow","size"),c=x(r,"gauge","numberSpacing"),u=x(r,"gauge","showPercentageSymbol"),d=C.appendOrSelect(n,"g.gauge-numbers"),h=C.appendOrSelect(d,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=C.appendOrSelect(h,"text.gauge-delta-number"),p=u?"%":"";f.data(i===null?[]:[i]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(y=>`${o(y)}${p}`);const{width:g}=C.getSVGElementSize(C.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),v=x(r,"gauge","deltaArrow","enabled"),m=h.selectAll("svg.gauge-delta-arrow").data(i!==null&&v?[i]:[]);m.enter().append("svg").merge(m).attr("class","gauge-delta-arrow").attr("x",-l(s)-g/2).attr("y",-l(s)/2-a(s)*.35).attr("width",l(s)).attr("height",l(s)).attr("viewBox","0 0 16 16").each(function(){const y=A(this);C.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=x(r,"gauge","status");C.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),m.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.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(w.Gauge.ARC_MOUSEOVER,{event:n,element:A(this),datum:r})}).on("mousemove",function(n,r){const i=A(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Gauge.ARC_CLICK,{event:n,element:A(this),datum:r})}).on("mouseout",function(n,r){const i=A(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=C.getSVGElementSize(this.parent,{useAttrs:!0});return n===Un.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Am extends Jc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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({withinChartClip:!0}),a=Ti(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",it.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()===$t.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:[Q.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[i])).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,v=f+p,m=this.services.cartesianScales.getRangeAxisPosition({datum:h}),y=this.services.cartesianScales.getValueThroughAxisPosition(m,0),b=this.services.cartesianScales.getRangeValue(h),S=this.services.cartesianScales.getDomainValue(h)-p/2,_=S+p;if(!this.isOutsideZoomedDomain(S,_))return qt({x0:g,x1:v,y0:y,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",it.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=A(this);i.classed("hovered",!0),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=A(this);t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:n,element:A(this),datum:r})}).on("mouseout",function(n,r){const i=A(this);i.classed("hovered",!1),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.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=ai().domain(t).rangeRound([0,this.getGroupWidth()])}}class GI extends ot{constructor(){super(...arguments),this.type="heatmap",this.renderType=Z.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)}, ${ln(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${ln(l.range())},${c(r)})`),this.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n.event,hoveredElement:A(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(w.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(w.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(w.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(w.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(w.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({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=>g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value))).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=C.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);C.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),C.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),C.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),C.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!==Sr.OFF&&(t===Sr.AUTO&&tg.minCellDividerDimension<=this.xBandwidth&&tg.minCellDividerDimension<=this.yBandwidth||t===Sr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=Et(r,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=A(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=Ri(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(w.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i||"Total",value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:A(this),datum:u}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_CLICK,{event:c,element:A(this),datum:u})}).on("mouseout",function(c,u){const h=A(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class zI extends ot{constructor(){super(...arguments),this.type="histogram",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),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=>Et(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",it.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:[Q.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const d=Et(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 v=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(v-g)>0&&Math.abs(v-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===$t.VERTICAL?v+=1:v-=1),qt({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",it.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,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=A(this);a.classed("hovered",!0);const o=parseFloat(Et(s,"data.x0")),l=parseFloat(Et(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:Et(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:s[n]})},{label:u,value:Et(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("mouseout",function(){A(this).classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class WI extends He{constructor(){super(...arguments),this.type="lollipop",this.renderType=Z.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]?en.weight.unselected:en.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",en.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?en.opacity.unselected:en.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",en.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,f]=rn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);p.exit().attr("opacity",0).remove();const v=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===$t.HORIZONTAL?v.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>f(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class YI extends ot{constructor(){super(...arguments),this.type="meter",this.renderType=Z.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)-Vt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Vt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=C.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(x(i,"meter","proportional")===null)u=100;else{const b=x(i,"meter","proportional","total");u=b||this.model.getMaximumDomain(this.model.getDisplayData())}const d=_e().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=x(i,"meter","height");C.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Vt.height.proportional:Vt.height.default)),C.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Vt.height.proportional:Vt.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",b=>b.x).attr("y",0).attr("height",()=>f||(s?Vt.height.proportional:Vt.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:b[c],originalClassName:g})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):b.width).style("fill",b=>n.model.getFillColor(b[c])).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const v=x(i,"meter","peak");let m=v;v!==null&&(v>u?m=u:v<a[0].value&&(m=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(m==null?[]:[m]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?Vt.height.proportional:Vt.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),y.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=A(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=A(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.Meter.METER_CLICK,{event:s,element:A(this),datum:a})}).on("mouseout",function(s,a){const o=A(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function Dm(e){const t=qI(Lm(e),360);return mn(t,[0,10])||mn(t,[350,0])?{textAnchor:Ne.START,dominantBaseline:Be.MIDDLE}:mn(t,[10,80])?{textAnchor:Ne.START,dominantBaseline:Be.HANGING}:mn(t,[80,100])?{textAnchor:Ne.MIDDLE,dominantBaseline:Be.HANGING}:mn(t,[100,170])?{textAnchor:Ne.END,dominantBaseline:Be.HANGING}:mn(t,[170,190])?{textAnchor:Ne.END,dominantBaseline:Be.MIDDLE}:mn(t,[190,260])?{textAnchor:Ne.END,dominantBaseline:Be.BASELINE}:mn(t,[260,280])?{textAnchor:Ne.MIDDLE,dominantBaseline:Be.BASELINE}:{textAnchor:Ne.START,dominantBaseline:Be.BASELINE}}function qI(e,t){return(e%t+t)%t}function mn(e,[t,n]){return e>=t&&e<=n}function Lm(e){return e*(180/Math.PI)}function Dt(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 XI(e,t){return t*Math.sin(e-Math.PI/2)}class jI extends ot{constructor(){super(...arguments),this.type="radar",this.renderType=Z.SVG,this.getLabelDimensions=t=>{const n=C.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=C.appendOrSelect(n,"text").text(t),{width:i,height:s}=C.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=SD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return tt(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:tt(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?Hn.opacity.unselected:Hn.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?Hn.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",Hn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=C.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:v}=Hn;this.uniqueKeys=Array.from(new Set(s.map(V=>V[u]))),this.uniqueGroups=Array.from(new Set(s.map(V=>V[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),_=(Math.min(r,i)-y)/2;if(_<=0)return;const E=ai().domain(this.fullDataNormalized.map(V=>V[u])).range([0,2*Math.PI].map(V=>V-Math.PI/2)),M=ln(this.fullDataNormalized.map(V=>V[d])),D=_e().domain([M>=0?0:M,bn(this.fullDataNormalized.map(V=>V[d]))]).range([g,_]).nice(p),H=D.ticks(p),I=V=>this.model.getFillColor(V),O=GS().angle(V=>E(V[u])+Math.PI/2).radius(V=>D(V[d])).curve(Qd),L=this.uniqueKeys.map(V=>{const F=this.getLabelDimensions(V).width,P=XI(E(V),_);return F+P}),k={x:bn(L)+h,y:i/2},U=C.appendOrSelect(n,"g.y-axes").attr("role",it.GROUP).selectAll("path").data(H,V=>V),N=V=>this.uniqueKeys.map(F=>({[u]:F,[d]:V}));U.join(V=>V.append("path").attr("opacity",0).attr("transform",`translate(${k.x}, ${k.y})`).attr("fill","none").call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",P=>O(N(P)))),V=>V.call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",P=>O(N(P)))),V=>V.call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_axes_exit",animate:t})).attr("d",P=>O(N(P))).attr("opacity",0).remove())),C.appendOrSelect(n,"g.x-axes").attr("role",it.GROUP).selectAll("line").data(this.uniqueKeys,V=>V).join(V=>V.append("line").attr("opacity",0).attr("class",F=>`x-axis-${vr(F)}`).attr("stroke-dasharray","0").attr("x1",F=>Dt(E(F),0,k).x).attr("y1",F=>Dt(E(F),0,k).y).attr("x2",F=>Dt(E(F),0,k).x).attr("y2",F=>Dt(E(F),0,k).y).call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",P=>Dt(E(P),D.range()[0],k).x).attr("y1",P=>Dt(E(P),D.range()[0],k).y).attr("x2",P=>Dt(E(P),D.range()[1],k).x).attr("y2",P=>Dt(E(P),D.range()[1],k).y)),V=>V.call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",P=>Dt(E(P),D.range()[0],k).x).attr("y1",P=>Dt(E(P),D.range()[0],k).y).attr("x2",P=>Dt(E(P),D.range()[1],k).x).attr("y2",P=>Dt(E(P),D.range()[1],k).y)),V=>V.call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),C.appendOrSelect(n,"g.x-labels").attr("role",it.GROUP).selectAll("text").data(this.uniqueKeys).join(V=>V.append("text").text(F=>F).attr("opacity",0).attr("x",F=>Dt(E(F),D.range()[1]+h,k).x).attr("y",F=>Dt(E(F),D.range()[1]+h,k).y).style("text-anchor",F=>Dm(E(F)).textAnchor).style("dominant-baseline",F=>Dm(E(F)).dominantBaseline).call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",P=>Dt(E(P),D.range()[1]+h,k).x).attr("y",P=>Dt(E(P),D.range()[1]+h,k).y).end().finally(()=>{const P=x(o,"radar","alignment"),ft=this.getAlignmentXOffset(P,n,this.getParent());n.attr("x",ft)})),V=>V.call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),C.appendOrSelect(n,"g.blobs").attr("role",it.GROUP).selectAll("path").data(this.groupedDataNormalized,V=>V.name).join(V=>V.append("path").attr("class",F=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:F.name,originalClassName:"blob"})).attr("role",it.GRAPHICS_SYMBOL).attr("aria-label",F=>F.name).attr("opacity",0).attr("transform",t?()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`:`translate(${k.x}, ${k.y})`).style("fill",F=>I(F.name)).style("fill-opacity",Hn.opacity.selected).style("stroke",F=>I(F.name)).call(F=>{const P=F.transition().call(ft=>this.services.transitions.setupTransition({transition:ft,name:"radar_blobs_enter",animate:t}));t&&P.delay(()=>Math.random()*30).attr("transform",`translate(${k.x}, ${k.y})`),P.attr("opacity",1).attr("d",ft=>O(ft.data))}),V=>(V.attr("class",F=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:F.name,originalClassName:"blob"})).style("fill",F=>I(F.name)).style("stroke",F=>I(F.name)),V.call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",P=>O(P.data))),V),V=>V.call(F=>{const P=F.transition().call(ft=>this.services.transitions.setupTransition({transition:ft,name:"radar_blobs_exit",animate:t}));t&&P.delay(()=>Math.random()*30).attr("transform",()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`),P.attr("opacity",0).remove()})),C.appendOrSelect(n,"g.dots").attr("role",it.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(V=>x(V,d)!==null)).join(V=>V.append("circle").attr("role",it.GRAPHICS_SYMBOL).attr("aria-label",F=>F[c]),V=>V,V=>V.remove()).attr("class",V=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:V[l],originalClassName:vr(V[u])})).attr("cx",V=>Dt(E(V[u]),D(V[d]),k).x).attr("cy",V=>Dt(E(V[u]),D(V[d]),k).y).attr("r",0).attr("opacity",0).style("fill",V=>I(V[l])),C.appendOrSelect(n,"g.x-axes-rect").attr("role",it.GROUP).selectAll("rect").data(this.uniqueKeys).join(V=>V.append("rect"),V=>V,V=>V.remove()).attr("x",k.x).attr("y",k.y-v/2).attr("width",D.range()[1]).attr("height",v).style("fill","red").style("fill-opacity",0).attr("transform",V=>`rotate(${Lm(E(V))}, ${k.x}, ${k.y})`),C.appendOrSelect(n,"g.y-labels").attr("role",it.GROUP).selectAll("text").data(ye(H)).join(V=>V.append("text").attr("opacity",0).text(F=>F).attr("x",F=>Dt(-Math.PI/2,D(F),k).x+f).attr("y",F=>Dt(-Math.PI/2,D(F),k).y).style("text-anchor","start").style("dominant-baseline","middle").call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_labels_update",animate:t})).text(P=>P).attr("opacity",1).attr("x",P=>Dt(-Math.PI/2,D(P),k).x+f).attr("y",P=>Dt(-Math.PI/2,D(P),k).y)),V=>V.call(F=>F.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=C.getSVGElementSize(n,{useBBox:!0}),{width:s}=C.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Rt.CENTER?a=Math.floor((s-i.width)/2):t===Rt.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.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=A(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${vr(i)}`),o=t.parent.selectAll(`.dots circle.${vr(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",Hn.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(w.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]),class:t.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=A(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(w.Radar.X_AXIS_CLICK,{event:r,element:A(this),datum:i})}).on("mouseout",function(r,i){const s=A(this),a=t.parent.select(`.x-axes .x-axis-${vr(i)}`),o=t.parent.selectAll(`.dots circle.${vr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.HIDE)})}}class Rm extends Jc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({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:[Q.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r])).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,v;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),v=this.services.cartesianScales.getRangeValue(h[1]);else{const b=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,b)),v=this.services.cartesianScales.getRangeValue(c)}const m=Math.abs(v-g);if(m!==0&&m<2&&(h>0&&a===$t.VERTICAL||h<0&&a===$t.HORIZONTAL?v=g-2:v=g+2),!this.isOutsideZoomedDomain(f,p))return qt({x0:f,x1:p,y0:g,y1:v},a)}).attr("opacity",1).attr("role",it.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=A(this);i.classed("hovered",!0),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:A(this),datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:n,element:A(this),datum:r})}).on("mouseout",function(n,r){const i=A(this);i.classed("hovered",!1),t.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ZI extends jt{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=C.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=C.appendOrSelect(t,"svg.chart-skeleton.DAII"),C.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class km extends ot{constructor(){super(...arguments),this.type="area-stacked",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({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=dl().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:[Q.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s))).attr("role",it.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 Im extends Jc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({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",it.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:[Q.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).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 v=c[0]<0&&c[1]<=0;v&&a.length>1?this.services.cartesianScales.getOrientation()===$t.VERTICAL?g+=c[1]===0?2:1:g-=1:v||(this.services.cartesianScales.getOrientation()===$t.VERTICAL?g+=1:g-=1)}return qt({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",it.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=A(this);a.classed("hovered",!0),r.services.events.dispatchEvent(w.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(w.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=A(this);r.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(w.Bar.BAR_CLICK,{event:i,element:A(this),datum:s})}).on("mouseout",function(i,s){const a=A(this);a.classed("hovered",!1),r.services.events.dispatchEvent(w.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.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=C.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Pm extends He{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=Z.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({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",it.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),v=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[v]: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],v=this.services.cartesianScales.getDomainIdentifier(u),m=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,[v]:f,[m]: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 kr=6;class KI extends ot{constructor(){super(...arguments),this.type="tree",this.renderType=Z.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}=C.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=C.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+kr:30-kr},h=ri({name:o,children:a}),f=10,p=r/6,g=E=>{const M=h.descendants().reverse(),D=h.links();let H=h,I=h;h.eachBefore($=>{$.x<H.x&&(H=$),$.x>I.x&&(I=$)});const O=I.x-H.x,L=n.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,H.x,r,O].join(" ")),R=_.selectAll("g").data(M,$=>$.id),k=this,T=R.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",$=>$.depth!==0&&$.children&&$.children.length>0?"clickable":null).on("mouseover",function($,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOVER,{event:$,element:A(this),datum:B})}).on("click",function($,B){B.depth!==0&&(B.children=B.children?null:B._children,g(B)),k.services.events.dispatchEvent(w.Tree.NODE_CLICK,{event:$,element:A(this),datum:B})}).on("mouseout",function($,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOUT,{event:$,element:A(this),datum:B})});T.append("circle").attr("r",2.5).attr("class",$=>$._children?"parent":"child").attr("stroke-width",10),T.append("text").attr("dy","0.31em").attr("x",$=>$._children?-kr:kr).attr("text-anchor",$=>$._children?"end":"start").text($=>$.data.name).clone(!0).attr("class","text-stroke").lower(),R.merge(T).transition(L).attr("transform",$=>`translate(${$.y},${$.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),R.exit().transition(L).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=S.selectAll("path").data(D,$=>$.target.id),N=U.enter().append("path").attr("d",()=>{const $={x:E.x0,y:E.y0};return b({source:$,target:$})});U.merge(N).transition(L).attr("d",b),U.exit().transition(L).remove().attr("d",()=>{const $={x:E.x,y:E.y};return b({source:$,target:$})}),h.eachBefore($=>{$.x0=$.x,$.y0=$.y})},v=h.descendants(),m=v[v.length-1].depth,y=x(s,"tree","type")===fa.DENDROGRAM?ub().size([i,r-u-m*kr-l]):Kb().nodeSize([f,p]).size([i,r-u-m*kr-l]),b=jS().x(E=>E.y).y(E=>E.x);h.x0=p/2,h.y0=0,h.descendants().forEach((E,M)=>{E.id=M,E._children=E.children}),y(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");g(h)}}var QI="#000000",JI="#ffffff",tP="#fcf4d6",eP="#fddc69",nP="#f1c21b",rP="#d2a106",iP="#b28600",sP="#8e6a00",aP="#684e00",oP="#483700",lP="#302400",cP="#1c1500",uP={10:tP,20:eP,30:nP,40:rP,50:iP,60:sP,70:aP,80:oP,90:lP,100:cP},hP="#fff2e8",dP="#ffd9be",fP="#ffb784",pP="#ff832b",gP="#eb6200",mP="#ba4e00",vP="#8a3800",yP="#5e2900",xP="#3e1a00",bP="#231000",EP={10:hP,20:dP,30:fP,40:pP,50:gP,60:mP,70:vP,80:yP,90:xP,100:bP},SP="#fff1f1",_P="#ffd7d9",wP="#ffb3b8",OP="#ff8389",TP="#fa4d56",MP="#da1e28",CP="#a2191f",AP="#750e13",DP="#520408",LP="#2d0709",RP={10:SP,20:_P,30:wP,40:OP,50:TP,60:MP,70:CP,80:AP,90:DP,100:LP},kP="#fff0f7",IP="#ffd6e8",PP="#ffafd2",$P="#ff7eb6",NP="#ee5396",BP="#d02670",VP="#9f1853",UP="#740937",HP="#510224",FP="#2a0a18",GP={10:kP,20:IP,30:PP,40:$P,50:NP,60:BP,70:VP,80:UP,90:HP,100:FP},zP="#f6f2ff",WP="#e8daff",YP="#d4bbff",qP="#be95ff",XP="#a56eff",jP="#8a3ffc",ZP="#6929c4",KP="#491d8b",QP="#31135e",JP="#1c0f30",t$={10:zP,20:WP,30:YP,40:qP,50:XP,60:jP,70:ZP,80:KP,90:QP,100:JP},e$="#edf5ff",n$="#d0e2ff",r$="#a6c8ff",i$="#78a9ff",s$="#4589ff",a$="#0f62fe",o$="#0043ce",l$="#002d9c",c$="#001d6c",u$="#001141",h$={10:e$,20:n$,30:r$,40:i$,50:s$,60:a$,70:o$,80:l$,90:c$,100:u$},d$="#e5f6ff",f$="#bae6ff",p$="#82cfff",g$="#33b1ff",m$="#1192e8",v$="#0072c3",y$="#00539a",x$="#003a6d",b$="#012749",E$="#061727",S$={10:d$,20:f$,30:p$,40:g$,50:m$,60:v$,70:y$,80:x$,90:b$,100:E$},_$="#d9fbfb",w$="#9ef0f0",O$="#3ddbd9",T$="#08bdba",M$="#009d9a",C$="#007d79",A$="#005d5d",D$="#004144",L$="#022b30",R$="#081a1c",k$={10:_$,20:w$,30:O$,40:T$,50:M$,60:C$,70:A$,80:D$,90:L$,100:R$},I$="#defbe6",P$="#a7f0ba",$$="#6fdc8c",N$="#42be65",B$="#24a148",V$="#198038",U$="#0e6027",H$="#044317",F$="#022d0d",G$="#071908",z$={10:I$,20:P$,30:$$,40:N$,50:B$,60:V$,70:U$,80:H$,90:F$,100:G$},W$="#f2f4f8",Y$="#dde1e6",q$="#c1c7cd",X$="#a2a9b0",j$="#878d96",Z$="#697077",K$="#4d5358",Q$="#343a3f",J$="#21272a",tN="#121619",eN={10:W$,20:Y$,30:q$,40:X$,50:j$,60:Z$,70:K$,80:Q$,90:J$,100:tN},nN="#f4f4f4",rN="#e0e0e0",iN="#c6c6c6",sN="#a8a8a8",aN="#8d8d8d",oN="#6f6f6f",lN="#525252",cN="#393939",uN="#262626",hN="#161616",dN={10:nN,20:rN,30:iN,40:sN,50:aN,60:oN,70:lN,80:cN,90:uN,100:hN},fN="#f7f3f2",pN="#e5e0df",gN="#cac5c4",mN="#ada8a8",vN="#8f8b8b",yN="#726e6e",xN="#565151",bN="#3c3838",EN="#272525",SN="#171414",_N={10:fN,20:pN,30:gN,40:mN,50:vN,60:yN,70:xN,80:bN,90:EN,100:SN},$m={black:{100:QI},blue:h$,coolGray:eN,cyan:S$,gray:dN,green:z$,magenta:GP,orange:EP,purple:t$,red:RP,teal:k$,warmGray:_N,white:{0:JI},yellow:uP};const wN=e=>{if(!e)return null;for(const t of Object.keys($m)){const n=$m[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Nm=function(){const e=A(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=Fe(t);let r;if(n&&(r=wN(n?n.hex():null)),r==null){const i=eo(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let ON=0;class TN extends ot{constructor(){super(...arguments),this.type="treemap",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=C.getSVGElementSize(n,{useAttrs:!0}),l=ri({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,v)=>v.value-g.value),c=nE().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",()=>ON++).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=A(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:[Q.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)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const v=A(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${v}`}).append("use").attr("xlink:href",function(){const v=A(this.parentNode.parentNode).attr("data-uid"),m=`${i.style.prefix}-leaf-${v}`;return new URL(`#${m}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let v=g;for(;v.depth>1;)v=v.parent;const m=eo(this.model.getFillColor(v.data.name));return[{text:g.data.name,color:m.l<.5?"white":"black"}]},g=>g).join(g=>{const v=g.append("text").text(m=>m.text).style("fill",Nm).attr("x",7).attr("y",18);return s&&v.attr("clip-path",function(){const m=A(this.parentNode).attr("data-uid"),y=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${y}`,s)+""})`}),v},g=>g.text(v=>v.text).style("fill",Nm),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=A(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);return l&&(s=l),Fe(s).darker(.7).toString()}),t.services.events.dispatchEvent(w.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(w.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=A(this);t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Treemap.LEAF_CLICK,{event:n,element:A(this),datum:r})}).on("mouseout",function(n,r){const i=A(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)),t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}}var MN={value:function(){}};function Bm(){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 $a(n)}function $a(e){this._=e}function CN(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}})}$a.prototype=Bm.prototype={constructor:$a,on:function(e,t){var n=this._,r=CN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=AN(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]=Vm(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Vm(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 $a(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 AN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Vm(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=MN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const DN=sk(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Bm},Symbol.toStringTag,{value:"Module"}))).dispatch,tu=Math.PI/180,LN={archimedean:Hm,rectangular:FN},Gi=64,Na=2048;var RN=function(){var e=[256,256],t=kN,n=IN,r=PN,i=Um,s=Um,a=$N,o=NN,l=Hm,c=[],u=1/0,d=DN("word","end"),h=null,f=Math.random,p={},g=zN;p.canvas=function(y){return arguments.length?(g=vn(y),p):g},p.start=function(){var y=v(g()),b=GN((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,M=[],D=c.map(function(I,O){return I.text=t.call(this,I,O),I.font=n.call(this,I,O),I.style=i.call(this,I,O),I.weight=s.call(this,I,O),I.rotate=a.call(this,I,O),I.size=~~r.call(this,I,O),I.padding=o.call(this,I,O),I}).sort(function(I,O){return O.size-I.size});return h&&clearInterval(h),h=setInterval(H,0),H(),p;function H(){for(var I=Date.now();Date.now()-I<u&&++E<_&&h;){var O=D[E];O.x=e[0]*(f()+.5)>>1,O.y=e[1]*(f()+.5)>>1,BN(y,O,D,E),O.hasText&&m(b,O,S)&&(M.push(O),d.call("word",p,O),S?UN(S,O):S=[{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)}E>=_&&(p.stop(),d.call("end",p,M,S))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const y of c)delete y.sprite;return p};function v(y){const b=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const S=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return y.width=(Gi<<5)/S,y.height=Na/S,b.fillStyle=b.strokeStyle="red",{context:b,ratio:S}}function m(y,b,S){e[0],e[1];for(var _=b.x,E=b.y,M=Math.sqrt(e[0]*e[0]+e[1]*e[1]),D=l(e),H=f()<.5?1:-1,I=-H,O,L,R;(O=D(I+=H))&&(L=~~O[0],R=~~O[1],!(Math.min(Math.abs(L),Math.abs(R))>=M));)if(b.x=_+L,b.y=E+R,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!S||HN(b,S))&&!VN(b,y,e[0])){for(var k=b.sprite,T=b.width>>5,U=e[0]>>5,N=b.x-(T<<4),$=N&127,B=32-$,Y=b.y1-b.y0,X=(b.y+b.y0)*U+(N>>5),J,lt=0;lt<Y;lt++){J=0;for(var W=0;W<=T;W++)y[X+W]|=J<<B|(W<T?(J=k[lt*T+W])>>>$:0);X+=U}return!0}return!1}return p.timeInterval=function(y){return arguments.length?(u=y??1/0,p):u},p.words=function(y){return arguments.length?(c=y,p):c},p.size=function(y){return arguments.length?(e=[+y[0],+y[1]],p):e},p.font=function(y){return arguments.length?(n=vn(y),p):n},p.fontStyle=function(y){return arguments.length?(i=vn(y),p):i},p.fontWeight=function(y){return arguments.length?(s=vn(y),p):s},p.rotate=function(y){return arguments.length?(a=vn(y),p):a},p.text=function(y){return arguments.length?(t=vn(y),p):t},p.spiral=function(y){return arguments.length?(l=LN[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=vn(y),p):r},p.padding=function(y){return arguments.length?(o=vn(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=d.on.apply(d,arguments);return y===d?p:y},p};function kN(e){return e.text}function IN(){return"serif"}function Um(){return"normal"}function PN(e){return Math.sqrt(e.value)}function $N(){return(~~(random()*6)-3)*30}function NN(){return 1}function BN(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Gi<<5)/s,Na/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),L=-Math.floor(O.width/2);let R=(O.width+1)*s,k=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*tu),d=Math.cos(t.rotate*tu),h=R*d,f=R*u,p=k*d,g=k*u;R=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,k=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else R=R+31>>5<<5;if(k>l&&(l=k),a+R>=Gi<<5&&(a=0,o+=l,l=0),o+k>=Na)break;i.translate((a+(R>>1))/s,(o+(k>>1))/s),t.rotate&&i.rotate(t.rotate*tu),i.fillText(t.text,L,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,L,0)),i.restore(),t.width=R,t.height=k,t.xoff=a,t.yoff=o,t.x1=R>>1,t.y1=k>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=R}for(var v=i.getImageData(0,0,(Gi<<5)/s,Na/s).data,m=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,b=y>>5,S=t.y1-t.y0,_=0;_<S*b;_++)m[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,M=-1,D=0;D<S;D++){for(var _=0;_<y;_++){var H=b*D+(_>>5),I=v[(o+D)*(Gi<<5)+(a+_)<<2]?1<<31-_%32:0;m[H]|=I,E|=I}E?M=D:(t.y0++,S--,D--,o++)}t.y1=t.y0+M,t.sprite=m.slice(0,(t.y1-t.y0)*b)}}}function VN(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 UN(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 HN(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 Hm(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function FN(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 GN(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function zN(){return document.createElement("canvas")}function vn(e){return typeof e=="function"?e:function(){return e}}const WN=ik(RN);class YN extends ot{constructor(){super(...arguments),this.type="wordcloud",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().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}=C.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=WN().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=C.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const v=g.selectAll("text").data(p,y=>`${y[c]}-${y.text}`);v.exit().attr("opacity",0).remove(),v.enter().append("text").attr("opacity",0).merge(v).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.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=C.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?ye(i):[1,1];return _e().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=da(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(w.WordCloud.WORD_MOUSEOVER,{event:s,element:A(this),datum:a}),r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:t.tooltip.groupLabel,value:a[n],class:r.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=A(this);r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.WordCloud.WORD_CLICK,{event:s,element:A(this),datum:a})}).on("mouseout",function(s,a){const o=A(this);i(null),r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o})})}}class qN extends ot{constructor(){super(...arguments),this.type="geo",this.renderType=Z.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=C.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(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=PI(s,Object.values(l)),u=RI(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=$x().projection(d);C.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=C.appendOrSelect(t,"defs");C.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",fi()([[0,0],[0,10]]));const v=C.appendOrSelect(t,"g.missing-data");C.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case Ve.geoEqualEarth:t=eb();break;case Ve.geoAlbers:t=Xx();break;case Ve.geoConicEqualArea:t=Jh();break;case Ve.geoConicEquidistant:t=Jx();break;case Ve.geoEquirectangular:t=Kx();break;case Ve.geoMercator:t=jx();break;case Ve.geoNaturalEarth1:t=nb();break;default:throw new Error("Projection is not supported.")}return t}}class XN extends qN{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({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=A(this);t.services.events.dispatchEvent(xr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(yr.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(xr.CHOROPLETH_MOUSEMOVE,{event:r,element:A(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(yr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(xr.CHOROPLETH_CLICK,{event:r,element:A(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=A(this);t.services.events.dispatchEvent(xr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(yr.HIDE,{event:r,hoveredElement:s})})}}class jN extends De{constructor(t,n){super(t,n),this.model=new CI(this.services),this.model.setOptions(Mt(bt.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 Ui(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Cr(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new Xt(this.model,this.services,[a,...i?[o]:[]],{direction:xt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new Om(this.model,this.services,{chartType:"choropleth"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=xt.COLUMN_REVERSE,f={id:"spacer",components:[new on(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new Xt(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new on(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new Vc(this.model,this.services),new La(this.model,this.services),new Xt(this.model,this.services,g,{direction:xt.COLUMN})]}getComponents(){const t=[new XN(this.model,this.services)];return this.getChartComponents(t)}}class ZN extends Ue{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=tt({},t,this.getZoomOptions(t));dc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:tt(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:It.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(),n=[["Child","Parent","Value"]];return t.forEach(r=>{let i=r.value?r.value:0;r.children&&(i+=this.getChildrenDatums(r.children,r.name,n,0)),n.push(["&ndash;",r.name,i])}),n}getChildrenDatums(t,n,r=[],i=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(i+=a.value),l+=this.getChildrenDatums(a.children,o,r,l),r.push([o,s,l]),i+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,i+=a.value),r.push([a.name,s,c])}}),i}}class KN extends De{constructor(t,n){super(t,n),this.model=new ZN(this.services),this.model.setOptions(Mt(bt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new VI(this.model,this.services)];return this.getChartComponents(t)}}const Fm={[oe.LINE]:[Lr,He],[oe.SCATTER]:[He],[oe.AREA]:[xm,Lr,He],[oe.STACKED_AREA]:[km,Lr,Pm,Pa],[oe.SIMPLE_BAR]:[Rm],[oe.GROUPED_BAR]:[Am,Rr],[oe.STACKED_BAR]:[Im,Pa]};class QN extends ne{constructor(t,n){super(t,n);const r=Mt(bt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:oe.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(Fm).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=`${LM(i.type)}Chart`;return a=tt({},bt[l],this.model.getOptions(),i.options),i.type===oe.STACKED_AREA&&(o=!0),Fm[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=tt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Nf(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===oe.STACKED_BAR||s.type===oe.STACKED_AREA),r=[new re(this.model,this.services),new ue(this.model,this.services),new jt(this.model,this.services,{skeleton:kt.GRID}),...n?[]:[new gn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class JN extends Ue{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;return[["Group","Value"],...t.map(a=>[a[r],a[i]===null?"&ndash;":a[i].toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Gm extends De{constructor(t,n,r=!1){super(t,n),this.model=new JN(this.services),!r&&(this.model.setOptions(Mt(bt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Tm(this.model,this.services),new jt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}class tB extends Gm{constructor(t,n){super(t,n,!0),this.model.setOptions(Mt(bt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new HI(this.model,this.services),new jt(this.model,this.services,{skeleton:kt.DONUT})];return this.getChartComponents(t)}}class eB extends Ue{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;return[["Group","Value"],...t.map(s=>[s[r],s.value===null?"&ndash;":s.value.toLocaleString()])]}}class nB extends De{constructor(t,n){super(t,n),this.model=new eB(this.services),this.model.setOptions(Mt(bt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new FI(this.model,this.services)];return this.getChartComponents(t)}}class rB extends ne{constructor(t,n){super(t,n),this.model.setOptions(Mt(bt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new Am(this.model,this.services),new Rr(this.model,this.services),new jt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class iB extends zn{constructor(t){super(t),this.axisFlavor=Li.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")!==j.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==j.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==j.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==j.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=ye(this.getDisplayData(),r=>r.value),n=_e().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(Te(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(Te(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(Te(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]=Je(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(Je(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Te(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();return[[n.label,r.label,"Value"],...t.map(s=>[s[n.identifier]===null?"&ndash;":s[n.identifier],s[r.identifier]===null?"&ndash;":s[r.identifier].toLocaleString(),s.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!Te(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=Qo().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=_m(this.getDisplayData(),l)}}class sB extends ne{constructor(t,n){super(t,n),this.model=new iB(this.services),this.model.setOptions(Mt(bt.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 Ui(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Cr(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new Xt(this.model,this.services,[a,...i?[o]:[]],{direction:xt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new Om(this.model,this.services,{chartType:"heatmap"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=xt.COLUMN_REVERSE,f={id:"spacer",components:[new on(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new Xt(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new on(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new um(this.model,this.services),new La(this.model,this.services),new Xt(this.model,this.services,g,{direction:xt.COLUMN})]}getComponents(){const t=[new re(this.model,this.services),new GI(this.model,this.services)];return this.getAxisChartComponents(t)}}class aB extends zn{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[Et(t,"bins.rangeLabel")||"Range",...r.map(s=>Et(s,`0.${n}`))],...Et(r,0).map((s,a)=>[`${Et(s,"data.x0")} – ${Et(s,"data.x1")}`,...r.map(o=>Et(o[a],`data.${Et(o[a],n)}`))])]}}class oB extends ne{constructor(t,n){super(t,n),this.model=new aB(this.services),this.model.setOptions(Mt(bt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new NI(this.model,this.services),new zI(this.model,this.services)];return this.getAxisChartComponents(t)}}class lB extends ne{constructor(t,n){super(t,n),this.model.setOptions(Mt(bt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new gn(this.model,this.services),new Lr(this.model,this.services),new He(this.model,this.services,{handleThresholds:!0}),new ZI(this.model,this.services),new Rr(this.model,this.services)];return this.getAxisChartComponents(t)}}class cB extends ne{constructor(t,n){super(t,n),this.model.setOptions(Mt(bt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new gn(this.model,this.services),new WI(this.model,this.services),new He(this.model,this.services),new jt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class uB extends Ue{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");let a=[],o;if(s===null){o=100;const l=t[0];a=[["Group","Value",...i?["Status"]:[]],[l[r],l.value,...i?[i]:[]]]}else{const l=x(s,"total");o=l||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[r],c.value,(c.value/o*100).toFixed(2)+" %"])]}return a}}class hB extends De{constructor(t,n){var i;super(t,n),this.model=new uB(this.services);const r=(i=n.options.meter)!=null&&i.proportional?tt(Je(bt.proportionalMeterChart),n.options):tt(Je(bt.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 BI(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG},{id:"spacer",components:[new on(this.model,this.services,{size:8})],growth:nt.STRETCH}]:[],{id:"meter-graph",components:[new YI(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG}],r=[new Xt(this.model,this.services,n,{direction:xt.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:Z.HTML})}}class dB extends zn{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),s=x(n,"0","data").map(o=>o[r]);return[["Group",...s],...n.map(o=>[o.name,...s.map((l,c)=>x(o,"data",c,i)!==null?x(o,"data",c,i).toLocaleString():"&ndash;")])]}}class fB extends De{constructor(t,n){super(t,n),this.model=new dB(this.services),this.model.setOptions(Mt(bt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new jI(this.model,this.services)];return this.getChartComponents(t)}}class pB extends ne{constructor(t,n){super(t,n),this.model.setOptions(Mt(bt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new gn(this.model,this.services),new He(this.model,this.services),new jt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class gB extends Ue{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"&ndash;"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class mB extends De{constructor(t,n){super(t,n),this.model=new gB(this.services),this.model.setOptions(Mt(bt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new KI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class vB extends Ue{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(r=>{Array.isArray(r.children)?r.children.forEach(i=>{n.push([i.name,r.name,i.value])}):x(r.name)!==null&&x(r.value)&&n.push(["–",r.name,r.value])}),n}}class yB extends De{constructor(t,n){super(t,n),this.model=new vB(this.services),this.model.setOptions(Mt(bt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new TN(this.model,this.services)];return this.getChartComponents(t)}}class xB extends ne{constructor(t,n){super(t,n),this.model.setOptions(Mt(bt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new Rm(this.model,this.services),new Rr(this.model,this.services),new jt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class bB extends ne{constructor(t,n){super(t,n),this.model.setOptions(Mt(bt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new Pa(this.model,this.services),new km(this.model,this.services),new Lr(this.model,this.services,{stacked:!0}),new Pm(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new jt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class EB extends ne{constructor(t,n){super(t,n),this.model.setOptions(Mt(bt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new Pa(this.model,this.services),new Im(this.model,this.services),new jt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ}),new Rr(this.model,this.services)];return this.getAxisChartComponents(t)}}class SB extends Ue{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data;return[[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],...t.map(o=>[o[i],o[s],o[r]])]}}class _B extends De{constructor(t,n){super(t,n),this.model=new SB(this.services),this.model.setOptions(Mt(bt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new YN(this.model,this.services),new jt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}z.Alignments=Rt,z.AlluvialChart=jk,z.AreaChart=xI,z.AreaEvent=Ql,z.ArrowDirections=pa,z.AxisEvent=Kl,z.AxisFlavor=Li,z.AxisPositions=G,z.AxisTitleOrientations=ga,z.BarEvent=nc,z.BoxplotChart=SI,z.BoxplotEvent=rc,z.BubbleChart=wI,z.BulletChart=MI,z.CalloutDirections=Mi,z.CanvasZoomEvent=Zl,z.CartesianOrientations=$t,z.ChartEvent=Wl,z.ChartTheme=uc,z.ChartTypes=oe,z.CirclePackChart=KN,z.ColorClassNameTypes=Q,z.ColorLegendType=Di,z.ComboChart=QN,z.DividerStatus=Sr,z.DominantBaseline=Be,z.DonutChart=tB,z.ExperimentalChoroplethChart=jN,z.GaugeChart=nB,z.GaugeEvent=ec,z.GaugeTypes=Un,z.GroupedBarChart=rB,z.HeatmapChart=sB,z.HistogramChart=oB,z.LayoutAlignItems=Vn,z.LayoutDirection=xt,z.LayoutGrowth=nt,z.LegendItemType=It,z.LegendOrientations=Er,z.LegendPositions=br,z.LineChart=lB,z.LineEvent=sc,z.LollipopChart=cB,z.MeterChart=hB,z.ModalEvent=Yl,z.ModelEvent=ql,z.PieChart=Gm,z.PieEvent=tc,z.Projection=Ve,z.RadarChart=fB,z.RadarEvent=ac,z.RenderTypes=Z,z.ScaleTypes=j,z.ScatterChart=pB,z.ScatterEvent=ic,z.SimpleBarChart=xB,z.Skeletons=kt,z.StackedAreaChart=bB,z.StackedBarChart=EB,z.Statuses=Ci,z.TextAnchor=Ne,z.ThresholdEvent=cc,z.TickRotations=Ai,z.ToolbarControlTypes=Tt,z.TooltipEvent=yr,z.TreeChart=mB,z.TreeEvent=oc,z.TreeTypes=fa,z.TreemapChart=yB,z.TreemapEvent=lc,z.TruncationTypes=ge,z.WordCloudChart=_B,z.WordCloudEvent=Jl,z.ZoomBarTypes=Me,z.ZoomDomainEvent=jl,z.ZoombarEvent=Xl,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
84
- //# sourceMappingURL=bundle.umd.js.map
84
+ //# sourceMappingURL=bundle.umd.cjs.map