@orbcharts/plugins-basic 3.0.0-alpha.53 → 3.0.0-alpha.54
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/orbcharts-plugins-basic.es.js +1 -1
- package/dist/orbcharts-plugins-basic.umd.js +1 -1
- package/dist/src/multiGrid/multiGridObservables.d.ts +1 -1
- package/dist/src/multiGrid/types.d.ts +9 -9
- package/package.json +2 -2
- package/src/multiGrid/multiGridObservables.ts +6 -1
- package/src/multiGrid/types.ts +9 -9
@@ -19870,7 +19870,7 @@ const cI = le(Da, jx)(({ selection: t, rootSelection: e, name: n, subject: r, ob
|
|
19870
19870
|
multiGridEachDetail: t.multiGridEachDetail$,
|
19871
19871
|
gridIndexes: e
|
19872
19872
|
}).pipe(
|
19873
|
-
O((n) => n.gridIndexes.map((r) => n.multiGridEachDetail[r] ?? n.multiGridEachDetail[0]))
|
19873
|
+
O((n) => n.gridIndexes === "all" ? n.multiGridEachDetail : n.gridIndexes.map((r) => n.multiGridEachDetail[r] ?? n.multiGridEachDetail[0]))
|
19874
19874
|
);
|
19875
19875
|
}, Uc = "MultiBars", u0 = ot(Uc, "grid"), pI = be(Uc, tR)(({ selection: t, name: e, subject: n, observer: r }) => {
|
19876
19876
|
const i = new et(), o = [];
|
@@ -12,4 +12,4 @@
|
|
12
12
|
`})}function BR({defsSelection:t,clipPathData:e,transitionDuration:n,transitionEase:r}){t.selectAll("clipPath").data(e).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{X(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(ko(r)).tween("tween",(l,c,f)=>h=>{const p=l.width*h;u.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),u},s=>s.attr("x",0).attr("y",0).attr("width",u=>u.width).attr("height",u=>u.height),s=>s.remove())})}const o2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,layout$:b,event$:x})=>{const v=new et,y=$n(t,"clipPath-box"),w=at(t,"path"),{seriesSelection$:D,axesSelection$:P,defsSelection$:S,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:y,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),T=p.pipe(I(v),O(C=>-C.translate[1]/C.scale[1])),$=new pt(C=>{const k=B({fullParams:l,valueAxisStart:T}).pipe(I(v)).subscribe(E=>{const G=FR(E.fullParams.lineCurve,E.valueAxisStart);C.next(G)});return()=>{k.unsubscribe()}}),N=f.pipe(O(C=>C.transitionDuration),rt()),R=f.pipe(O(C=>C.transitionEase),rt());B({defsSelection:S,seriesLabels:a,axisSize:d,transitionDuration:N,transitionEase:R}).pipe(I(v),Y(async C=>C)).subscribe(C=>{const E=[{id:y,width:C.axisSize.width,height:C.axisSize.height}].concat(C.seriesLabels.map(G=>({id:`orbcharts__clipPath_${G}`,width:C.axisSize.width,height:C.axisSize.height})));BR({defsSelection:C.defsSelection,clipPathData:E,transitionDuration:C.transitionDuration,transitionEase:C.transitionEase})});const A=n.pipe(O(C=>{const k=new Map;return C.flat().forEach(E=>k.set(E.id,E)),k})),L=Lh({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f}),M=f.pipe(I(v),O(C=>C.highlightTarget),rt()),z=a.pipe(I(v),O(C=>C.map((k,E)=>$n(t,`lineargradient-${k}`)))),U=B({graphicGSelection:_,defsSelection:S,visibleComputedLayoutData:o,linearGradientIds:z,areaPath:$,params:l}).pipe(I(v),Y(async C=>C),O(C=>{let k=[];return C.graphicGSelection.each((E,G,j)=>{const Q=GR(C.visibleComputedLayoutData[G]??[]);k[G]=zR({selection:X(j[G]),pathClassName:w,areaPath:C.areaPath,segmentData:Q,linearGradientIds:C.linearGradientIds,params:C.params}),UR({defsSelection:C.defsSelection,computedData:C.visibleComputedLayoutData,linearGradientIds:C.linearGradientIds,params:C.params})}),k}));return B({pathSelectionArr:U,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:M,gridGroupPositionFn:L}).pipe(I(v),Y(async C=>C)).subscribe(C=>{C.pathSelectionArr.forEach(k=>{k.on("mouseover",(E,G)=>{const j=G[0]?G[0].seriesLabel:"",{groupIndex:Q,groupLabel:F}=C.gridGroupPositionFn(E),K=C.GroupDataMap.get(F).find(W=>W.seriesLabel===j)??G[0];x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:C.highlightTarget,datum:K,gridIndex:K.gridIndex,series:C.SeriesDataMap.get(K.seriesLabel),seriesIndex:K.seriesIndex,seriesLabel:K.seriesLabel,groups:C.GroupDataMap.get(K.groupLabel),groupIndex:K.groupIndex,groupLabel:K.groupLabel,event:E,data:C.computedData})}).on("mousemove",(E,G)=>{const j=G[0]?G[0].seriesLabel:"",{groupIndex:Q,groupLabel:F}=C.gridGroupPositionFn(E),K=C.GroupDataMap.get(F).find(W=>W.seriesLabel===j)??G[0];x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:C.highlightTarget,datum:K,gridIndex:K.gridIndex,series:C.SeriesDataMap.get(K.seriesLabel),seriesIndex:K.seriesIndex,seriesLabel:K.seriesLabel,groups:C.GroupDataMap.get(K.groupLabel),groupIndex:K.groupIndex,groupLabel:K.groupLabel,event:E,data:C.computedData})}).on("mouseout",(E,G)=>{const j=G[0]?G[0].seriesLabel:"",{groupIndex:Q,groupLabel:F}=C.gridGroupPositionFn(E),K=C.GroupDataMap.get(F).find(W=>W.seriesLabel===j)??G[0];x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:C.highlightTarget,datum:K,gridIndex:K.gridIndex,series:C.SeriesDataMap.get(K.seriesLabel),seriesIndex:K.seriesIndex,seriesLabel:K.seriesLabel,groups:C.GroupDataMap.get(K.groupLabel),groupIndex:K.groupIndex,groupLabel:K.groupLabel,event:E,data:C.computedData})}).on("click",(E,G)=>{const j=G[0]?G[0].seriesLabel:"",{groupIndex:Q,groupLabel:F}=C.gridGroupPositionFn(E),K=C.GroupDataMap.get(F).find(W=>W.seriesLabel===j)??G[0];x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:C.highlightTarget,datum:K,gridIndex:K.gridIndex,series:C.SeriesDataMap.get(K.seriesLabel),seriesIndex:K.seriesIndex,seriesLabel:K.seriesLabel,groups:C.GroupDataMap.get(K.groupLabel),groupIndex:K.groupIndex,groupLabel:K.groupLabel,event:E,data:C.computedData})})})}),f.pipe(I(v),li(C=>C.highlightTarget==="series"),Y(C=>B({graphicGSelection:_,gridHighlight:g,DataMap:A,fullChartParams:f}).pipe(I(v),Y(async k=>k)))).subscribe(C=>{const k=C.gridHighlight[0]?C.gridHighlight[0].seriesLabel:null;OR({selection:C.graphicGSelection,seriesLabel:k,fullChartParams:C.fullChartParams})}),()=>{v.next(void 0)}},a2="LineAreas",YR=se(a2,Qh)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=o2(a2,{selection:t,computedData$:n.computedData$,visibleComputedData$:n.visibleComputedData$,computedLayoutData$:n.computedLayoutData$,visibleComputedLayoutData$:n.visibleComputedLayoutData$,seriesLabels$:n.seriesLabels$,SeriesDataMap$:n.SeriesDataMap$,GroupDataMap$:n.GroupDataMap$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridGraphicTransform$:n.gridGraphicTransform$,gridAxesSize$:n.gridAxesSize$,gridHighlight$:n.gridHighlight$,gridContainerPosition$:n.gridContainerPosition$,layout$:n.layout$,event$:r.event$});return()=>{i.next(void 0),o()}}),s2=.3;function u2({axisWidth:t,groupAmount:e,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=((e>1?t/(e-1):t)-i)/n-r;return a>1?a:1}function HR(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Kf().domain(e).range([-i/2+r,i/2-r])}function WR(t,e){return t<=1?0:e/(t-1)*s2}function VR(t,e){return t<=1?e:e*(1-s2)}function jR({graphicGSelection:t,rectClassName:e,visibleComputedLayoutData:n,zeroYArr:r,groupLabels:i,barScale:o,params:a,chartParams:s,barWidth:u,transformedBarRadius:l,delayGroup:c,transitionItem:f,isSeriesSeprate:h}){const p=u/2;return t.each((g,m,b)=>{X(b[m]).selectAll(`rect.${e}`).data(n[m]??[],x=>x.id).join(x=>x.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",v=>0),x=>x,x=>x.remove()).attr("transform",(x,v)=>`translate(${(x?x.axisX:0)-p}, 0)`).attr("fill",x=>x.color).attr("y",x=>x.axisY<r[m]?x.axisY:r[m]).attr("x",x=>h?0:o(x.seriesLabel)).attr("width",u).attr("rx",l[m][0]??1).attr("ry",l[m][1]??1).transition().duration(f).ease(ko(s.transitionEase)).delay((x,v)=>x.groupIndex*c).attr("height",x=>Math.abs(x.axisYFromZero))}),t.selectAll(`rect.${e}`)}function qR({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function XR({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const Ch=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,isSeriesSeprate$:b,event$:x})=>{const v=new et,y=$n(t,"clipPath-box"),w=at(t,"rect"),{seriesSelection$:D,axesSelection$:P,defsSelection$:S,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:y,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),T=o.pipe(I(v),O(k=>k.map(E=>E[0]?E[0].axisY-E[0].axisYFromZero:0)),rt()),$=B({computedData:n,visibleComputedData:i,params:l,gridAxesSize:d,isSeriesSeprate:b}).pipe(I(v),Y(async k=>k),O(k=>k.params.barWidth?k.params.barWidth:k.isSeriesSeprate?u2({axisWidth:k.gridAxesSize.width,groupAmount:k.computedData[0]?k.computedData[0].length:0,barAmountOfGroup:1,barPadding:k.params.barPadding,barGroupPadding:k.params.barGroupPadding}):u2({axisWidth:k.gridAxesSize.width,groupAmount:k.computedData[0]?k.computedData[0].length:0,barAmountOfGroup:k.visibleComputedData.length,barPadding:k.params.barPadding,barGroupPadding:k.params.barGroupPadding})),rt()),N=B({computedData:n,barWidth:$,params:l,gridGraphicReverseScale:p}).pipe(I(v),Y(async k=>k),O(k=>{const E=k.barWidth/2,G=k.params.barRadius===!0?E:k.params.barRadius===!1?0:typeof k.params.barRadius=="number"?k.params.barRadius:0;return k.computedData.map((j,Q)=>{const F=k.gridGraphicReverseScale[Q]??k.gridGraphicReverseScale[0];let q=G*F[0],V=G*F[1];if(q>E){const K=E/q;q=q*K,V=V*K}return[q,V]})})),R=i.pipe(I(v),O(k=>{const E=new Set;return k.forEach(G=>{G.forEach(j=>{E.add(j.groupLabel)})}),Array.from(E)})),A=B({seriesLabels:a,barWidth:$,params:l}).pipe(I(v),Y(async k=>k),O(k=>HR(k.barWidth,k.seriesLabels,k.params))),L=c.pipe(I(v),O(k=>k.transitionDuration),rt()),M=new pt(k=>{B({groupLabels:R,transitionDuration:L}).pipe(Y(async E=>E)).subscribe(E=>{const G=WR(E.groupLabels.length,E.transitionDuration);k.next(G)})}).pipe(I(v),rt()),z=new pt(k=>{B({groupLabels:R,transitionDuration:L}).pipe(Y(async E=>E)).subscribe(E=>{const G=VR(E.groupLabels.length,E.transitionDuration);k.next(G)})}).pipe(I(v),rt());B({defsSelection:S,gridAxesSize:d}).pipe(I(v),Y(async k=>k)).subscribe(k=>{const E=[{id:y,width:k.gridAxesSize.width,height:k.gridAxesSize.height}];qR({defsSelection:k.defsSelection,clipPathData:E})});const U=c.pipe(I(v),O(k=>k.highlightTarget),rt()),C=B({graphicGSelection:_,visibleComputedLayoutData:o,zeroYArr:T,groupLabels:R,barScale:A,params:l,chartParams:c,highlightTarget:U,barWidth:$,transformedBarRadius:N,delayGroup:M,transitionItem:z,isSeriesSeprate:b}).pipe(I(v),Y(async k=>k),O(k=>jR({graphicGSelection:k.graphicGSelection,rectClassName:w,visibleComputedLayoutData:k.visibleComputedLayoutData,zeroYArr:k.zeroYArr,groupLabels:k.groupLabels,barScale:k.barScale,params:k.params,chartParams:k.chartParams,barWidth:k.barWidth,transformedBarRadius:k.transformedBarRadius,delayGroup:k.delayGroup,transitionItem:k.transitionItem,isSeriesSeprate:k.isSeriesSeprate})));return B({barSelection:C,computedData:n,highlightTarget:U,SeriesDataMap:s,GroupDataMap:u}).pipe(I(v),Y(async k=>k)).subscribe(k=>{k.barSelection.on("mouseover",(E,G)=>{E.stopPropagation(),x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:k.highlightTarget,datum:G,gridIndex:G.gridIndex,series:k.SeriesDataMap.get(G.seriesLabel),seriesIndex:G.seriesIndex,seriesLabel:G.seriesLabel,groups:k.GroupDataMap.get(G.groupLabel),groupIndex:G.groupIndex,groupLabel:G.groupLabel,event:E,data:k.computedData})}).on("mousemove",(E,G)=>{E.stopPropagation(),x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:k.highlightTarget,datum:G,gridIndex:G.gridIndex,series:k.SeriesDataMap.get(G.seriesLabel),seriesIndex:G.seriesIndex,seriesLabel:G.seriesLabel,groups:k.GroupDataMap.get(G.groupLabel),groupIndex:G.groupIndex,groupLabel:G.groupLabel,event:E,data:k.computedData})}).on("mouseout",(E,G)=>{E.stopPropagation(),x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:k.highlightTarget,datum:G,gridIndex:G.gridIndex,series:k.SeriesDataMap.get(G.seriesLabel),seriesIndex:G.seriesIndex,seriesLabel:G.seriesLabel,groups:k.GroupDataMap.get(G.groupLabel),groupIndex:G.groupIndex,groupLabel:G.groupLabel,event:E,data:k.computedData})}).on("click",(E,G)=>{E.stopPropagation(),x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:k.highlightTarget,datum:G,gridIndex:G.gridIndex,series:k.SeriesDataMap.get(G.seriesLabel),seriesIndex:G.seriesIndex,seriesLabel:G.seriesLabel,groups:k.GroupDataMap.get(G.groupLabel),groupIndex:G.groupIndex,groupLabel:G.groupLabel,event:E,data:k.computedData})})}),B({barSelection:C,highlight:g.pipe(O(k=>k.map(E=>E.id))),fullChartParams:c}).pipe(I(v),Y(async k=>k)).subscribe(k=>{XR({selection:k.barSelection,ids:k.highlight,fullChartParams:k.fullChartParams})}),()=>{v.next(void 0)}},l2="Bars",ZR=se(l2,Fo)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=Ch(l2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),c2="BarsPN",KR=se(c2,Fo)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=Ch(c2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:Bo(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),f2=.3;function QR({axisWidth:t,groupAmount:e,barGroupPadding:n=0}){const i=t/(e-1)-n;return i>1?i:1}function JR(t,e){return t<=1?0:e/(t-1)*f2}function tk(t,e){return t<=1?e:e*(1-f2)}function ek({graphicGSelection:t,rectClassName:e,barData:n,zeroY:r,groupLabels:i,params:o,chartParams:a,barWidth:s,transformedBarRadius:u,delayGroup:l,transitionItem:c,isSeriesSeprate:f}){const h=s/2;return t.each((d,g,m)=>{X(m[g]).selectAll(`rect.${e}`).data(n[g]??[],b=>b.id).join(b=>b.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",x=>0),b=>b,b=>b.remove()).attr("transform",(b,x)=>`translate(${(b?b.axisX:0)-h}, 0)`).attr("fill",b=>b.color).attr("y",b=>r).attr("x",b=>0).attr("width",s).attr("rx",u[g][0]??1).attr("ry",u[g][1]??1).transition().duration(c).ease(ko(a.transitionEase)).delay((b,x)=>b.groupIndex*l).attr("y",b=>b._barStartY).attr("height",b=>Math.abs(b._barHeight))}),t.selectAll(`rect.${e}`)}function nk({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function rk({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const h2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridGraphicReverseScale$:d,gridAxesSize$:g,gridHighlight$:m,gridContainerPosition$:b,isSeriesSeprate$:x,event$:v})=>{const y=new et,w=$n(t,"clipPath-box"),D=at(t,"rect"),{seriesSelection$:P,axesSelection$:S,defsSelection$:_,graphicGSelection$:T}=ar({selection:e,pluginName:t,clipPathID:w,seriesLabels$:a,gridContainerPosition$:b,gridAxesTransform$:h,gridGraphicTransform$:p}),$=o.pipe(I(y),O(F=>F[0]&&F[0][0]?F[0][0].axisY-F[0][0].axisYFromZero:0),rt()),N=B({computedData:n,params:l,axisSize:g,isSeriesSeprate:x}).pipe(I(y),Y(async F=>F),O(F=>F.params.barWidth?F.params.barWidth:QR({axisWidth:F.axisSize.width,groupAmount:F.computedData[0]?F.computedData[0].length:0,barGroupPadding:F.params.barGroupPadding})),rt()),R=B({computedData:n,barWidth:N,params:l,gridGraphicReverseScale:d}).pipe(I(y),Y(async F=>F),O(F=>{const q=F.barWidth/2,V=F.params.barRadius===!0?q:F.params.barRadius===!1?0:typeof F.params.barRadius=="number"?F.params.barRadius:0;return F.computedData.map((K,W)=>{const nt=F.gridGraphicReverseScale[W]??F.gridGraphicReverseScale[0],ut=V*nt[0],H=V*nt[1];return[ut,H]})})),A=i.pipe(I(y),O(F=>{const q=new Set;return F.forEach(V=>{V.forEach(K=>{q.add(K.groupLabel)})}),Array.from(q)}),Pt(1)),L=f.pipe(I(y),O(F=>F.transitionDuration),rt()),M=new pt(F=>{B({groupLabels:A,transitionDuration:L}).pipe(Y(async q=>q)).subscribe(q=>{const V=JR(q.groupLabels.length,q.transitionDuration);F.next(V)})}).pipe(I(y),rt()),z=new pt(F=>{B({groupLabels:A,transitionDuration:L}).pipe(Y(async q=>q)).subscribe(q=>{const V=tk(q.groupLabels.length,q.transitionDuration);F.next(V)})}).pipe(I(y),rt()),U=B({computedData:n,dataFormatter:c}).pipe(I(y),Y(async F=>F),O(F=>{const V=F.computedData[0]?F.computedData[0].length-1:0,K=F.dataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0:F.dataFormatter.grid.groupAxis.scaleDomain[0],W=F.dataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?V:F.dataFormatter.grid.groupAxis.scaleDomain[1];return[K,W]})),C=B({visibleComputedLayoutData:o,groupScaleDomain:U}).pipe(I(y),Y(async F=>F),O(F=>{const q=F.groupScaleDomain[0],V=F.groupScaleDomain[1],W=F.visibleComputedLayoutData.map(mt=>mt.filter((ht,Yt)=>ht.groupIndex>=q&&ht.groupIndex<=V)).flat();if(W.length<=1)return 1;const nt=W.reduce((mt,ht)=>ht.value>mt.value?ht:mt,W[0]),ut=nt.groupIndex,H=W.filter(mt=>mt.groupIndex===ut).reduce((mt,ht)=>mt+ht.value,0);return nt.value/H})),k=B({computedLayoutData:r,yRatio:C,zeroY:$}).pipe(I(y),O(F=>{let q=F.computedLayoutData[0]?F.computedLayoutData[0].map(()=>F.zeroY):[];return F.computedLayoutData.map((V,K)=>V.map((W,nt)=>{const ut=q[nt];let H=0;return W.visible&&(H=W.axisYFromZero*F.yRatio,q[nt]=q[nt]+H),{...W,_barStartY:ut,_barHeight:H}}))})),E=B({computedLayoutData:r,zeroY:$}).pipe(I(y),O(F=>F.computedLayoutData.map((q,V)=>q.map((K,W)=>({...K,_barStartY:F.zeroY,_barHeight:K.axisYFromZero}))))),G=x.pipe(Y(F=>y_(()=>F,E,k)));B({defsSelection:_,gridAxesSize:g}).pipe(I(y),Y(async F=>F)).subscribe(F=>{const q=[{id:w,width:F.gridAxesSize.width,height:F.gridAxesSize.height}];nk({defsSelection:F.defsSelection,clipPathData:q})});const j=f.pipe(I(y),O(F=>F.highlightTarget),rt()),Q=B({graphicGSelection:T,graphicData:G,zeroY:$,groupLabels:A,params:l,chartParams:f,highlightTarget:j,barWidth:N,transformedBarRadius:R,delayGroup:M,transitionItem:z,isSeriesSeprate:x}).pipe(I(y),Y(async F=>F),O(F=>ek({graphicGSelection:F.graphicGSelection,rectClassName:D,barData:F.graphicData,zeroY:F.zeroY,groupLabels:F.groupLabels,params:F.params,chartParams:F.chartParams,barWidth:F.barWidth,transformedBarRadius:F.transformedBarRadius,delayGroup:F.delayGroup,transitionItem:F.transitionItem,isSeriesSeprate:F.isSeriesSeprate})));return B({barSelection:Q,computedData:n,highlightTarget:j,SeriesDataMap:s,GroupDataMap:u}).subscribe(F=>{F.barSelection.on("mouseover",(q,V)=>{q.stopPropagation(),v.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:F.highlightTarget,datum:V,gridIndex:V.gridIndex,series:F.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:F.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:q,data:F.computedData})}).on("mousemove",(q,V)=>{q.stopPropagation(),v.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:F.highlightTarget,datum:V,gridIndex:V.gridIndex,series:F.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:F.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:q,data:F.computedData})}).on("mouseout",(q,V)=>{q.stopPropagation(),v.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:F.highlightTarget,datum:V,gridIndex:V.gridIndex,series:F.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:F.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:q,data:F.computedData})}).on("click",(q,V)=>{q.stopPropagation(),v.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:F.highlightTarget,datum:V,gridIndex:V.gridIndex,series:F.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:F.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:q,data:F.computedData})})}),B({barSelection:Q,highlight:m.pipe(O(F=>F.map(q=>q.id))),fullChartParams:f}).pipe(I(y),Y(async F=>F)).subscribe(F=>{rk({selection:F.barSelection,ids:F.highlight,fullChartParams:F.fullChartParams})}),()=>{y.next(void 0)}},p2="BarStack",ik=se(p2,ep)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=h2(p2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:r.fullDataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),d2=.3;function g2({axisWidth:t,groupAmount:e,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=(t/(e-1)-i)/n-r;return a>1?a:1}function ok(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Kf().domain(e).range([-i/2+r,i/2-r])}function ak(t,e){return t<=1?0:e/(t-1)*d2}function sk(t,e){return t<=1?e:e*(1-d2)}function uk({graphicGSelection:t,pathGClassName:e,pathClassName:n,visibleComputedLayoutData:r,linearGradientIds:i,zeroYArr:o,groupLabels:a,barScale:s,params:u,chartParams:l,barWidth:c,delayGroup:f,transitionItem:h,isSeriesSeprate:p}){const d=c/2;return t.each((m,b,x)=>{X(x[b]).selectAll(`g.${e}`).data(r[b]??[]).join(y=>{const w=y.append("g").classed(e,!0).attr("cursor","pointer");return w.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",D=>{const P=-d,S=o[b],_=o[b];return`M${P},${S} L${P+c/2},${_} ${P+c},${S}`}),w},y=>y,y=>y.remove()).attr("transform",y=>`translate(${p?0:s(y.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",y=>Math.abs(y.axisYFromZero)).attr("y",y=>y.axisY<o[b]?y.axisY:o[b]).attr("x",y=>p?0:s(y.seriesLabel)).style("fill",y=>`url(#${i[y.seriesIndex]})`).attr("stroke",y=>y.color).attr("transform",y=>`translate(${y?y.axisX:0}, 0)`).transition().duration(h).ease(ko(l.transitionEase)).delay((y,w)=>y.groupIndex*f).attr("d",y=>{const w=-d,D=o[b],P=y.axisY;return`M${w},${D} L${w+c/2},${P} ${w+c},${D}`})}),t.selectAll(`path.${n}`)}function lk({defsSelection:t,computedData:e,linearGradientIds:n,params:r}){t.selectAll("linearGradient").data(e??[]).join(i=>i.append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad"),i=>i,i=>i.remove()).attr("id",(i,o)=>i[0]?n[i[0].seriesIndex]:"").html((i,o)=>{const a=i[0]?i[0].color:"";return`
|
13
13
|
<stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
|
14
14
|
<stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
|
15
|
-
`})}function ck({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function fk({selection:t,ids:e,fullChartParams:n}){t.interrupt("highlight");const r=()=>{t.transition("highlight").duration(200).style("opacity",1)};if(!e.length){r();return}t.each((i,o,a)=>{e.includes(i.id)?X(a[o]).style("opacity",1):X(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const m2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,fullDataFormatter$:a,seriesLabels$:s,SeriesDataMap$:u,GroupDataMap$:l,fullParams$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,isSeriesSeprate$:b,event$:x})=>{const v=new et,y=$n(t,"clipPath-box"),w=at(t,"pathG"),D=at(t,"path"),{seriesSelection$:P,axesSelection$:S,defsSelection$:_,graphicGSelection$:T}=ar({selection:e,pluginName:t,clipPathID:y,seriesLabels$:s,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(I(v),O(E=>-E.translate[1]/E.scale[1]));const $=o.pipe(O(E=>E.map(G=>G[0]?G[0].axisY-G[0].axisYFromZero:0)),rt()),N=B({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:b}).pipe(I(v),Y(async E=>E),O(E=>E.params.barWidth?E.params.barWidth:E.isSeriesSeprate?g2({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):g2({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:E.visibleComputedData.length,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}))),R=i.pipe(I(v),O(E=>{const G=new Set;return E.forEach(j=>{j.forEach(Q=>{G.add(Q.groupLabel)})}),Array.from(G)})),A=new pt(E=>{B({seriesLabels:s,barWidth:N,params:c}).pipe(I(v),Y(async G=>G)).subscribe(G=>{const j=ok(G.barWidth,G.seriesLabels,G.params);E.next(j)})}),L=f.pipe(I(v),O(E=>E.transitionDuration),rt()),M=new pt(E=>{B({groupLabels:R,transitionDuration:L}).pipe(Y(async G=>G)).subscribe(G=>{const j=ak(G.groupLabels.length,G.transitionDuration);E.next(j)})}).pipe(I(v),rt()),z=new pt(E=>{B({groupLabels:R,transitionDuration:L}).pipe(Y(async G=>G)).subscribe(G=>{const j=sk(G.groupLabels.length,G.transitionDuration);E.next(j)})}).pipe(I(v),rt());B({defsSelection:_,gridAxesSize:d}).pipe(I(v),Y(async E=>E)).subscribe(E=>{const G=[{id:y,width:E.gridAxesSize.width,height:E.gridAxesSize.height}];ck({defsSelection:E.defsSelection,clipPathData:G})});const U=f.pipe(I(v),O(E=>E.highlightTarget),rt()),C=s.pipe(I(v),O(E=>E.map((G,j)=>$n(t,`lineargradient-${G}`)))),k=B({graphicGSelection:T,defsSelection:_,computedData:n,visibleComputedLayoutData:o,linearGradientIds:C,zeroYArr:$,groupLabels:R,barScale:A,params:c,chartParams:f,barWidth:N,delayGroup:M,transitionItem:z,isSeriesSeprate:b}).pipe(I(v),Y(async E=>E),O(E=>(lk({defsSelection:E.defsSelection,computedData:E.computedData,linearGradientIds:E.linearGradientIds,params:E.params}),uk({graphicGSelection:E.graphicGSelection,pathGClassName:w,pathClassName:D,visibleComputedLayoutData:E.visibleComputedLayoutData,linearGradientIds:E.linearGradientIds,zeroYArr:E.zeroYArr,groupLabels:E.groupLabels,barScale:E.barScale,params:E.params,chartParams:E.chartParams,barWidth:E.barWidth,delayGroup:E.delayGroup,transitionItem:E.transitionItem,isSeriesSeprate:E.isSeriesSeprate}))));return B({barSelection:k,computedData:n,highlightTarget:U,SeriesDataMap:u,GroupDataMap:l}).subscribe(E=>{E.barSelection.on("mouseover",(G,j)=>{G.stopPropagation(),x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:G,data:E.computedData})}).on("mousemove",(G,j)=>{G.stopPropagation(),x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:G,data:E.computedData})}).on("mouseout",(G,j)=>{G.stopPropagation(),x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:G,data:E.computedData})}).on("click",(G,j)=>{G.stopPropagation(),x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:G,data:E.computedData})})}),B({barSelection:k,highlight:g.pipe(O(E=>E.map(G=>G.id))),fullChartParams:f}).pipe(I(v),Y(async E=>E)).subscribe(E=>{fk({selection:E.barSelection,ids:E.highlight,fullChartParams:E.fullChartParams})}),()=>{v.next(void 0)}},y2="BarsTriangle",hk=se(y2,np)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=m2(y2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,fullDataFormatter$:r.fullDataFormatter$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}});function pk({graphicGSelection:t,circleGClassName:e,circleClassName:n,visibleComputedLayoutData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let u=0;return t.each((c,f,h)=>{X(h[f]).selectAll("g").data(r[f],p=>p.id).join(p=>(u=s(p),p.append("g").classed(e,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,g)=>{X(g[d]).selectAll("circle").data([p]).join(m=>m.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((b,x)=>d*u).attr("opacity",1),m=>m.transition().duration(50).attr("opacity",1),m=>m.remove()).attr("r",i.radius).attr("fill",(m,b)=>Lu({datum:m,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(m,b)=>Lu({datum:m,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),t.selectAll(`circle.${n}`)}function dk({selection:t,ids:e,onlyShowHighlighted:n,fullChartParams:r}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",n===!0?0:1);return}t.each((i,o,a)=>{e.includes(i.id)?X(a[o]).style("opacity",1).transition("highlight").duration(200):X(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function gk({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const b2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,event$:b})=>{const x=new et,v=$n(t,"clipPath-box"),y=at(t,"circleG"),w=at(t,"circle"),{seriesSelection$:D,axesSelection$:P,defsSelection$:S,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),T=B({computedData:n,gridGraphicReverseScale:p}).pipe(I(x),Y(async A=>A),O(A=>A.computedData.map((L,M)=>A.gridGraphicReverseScale[M])));B({defsSelection:S,gridAxesSize:d}).pipe(I(x),Y(async A=>A)).subscribe(A=>{const L=[{id:v,width:A.gridAxesSize.width,height:A.gridAxesSize.height}];gk({defsSelection:A.defsSelection,clipPathData:L})});const $=c.pipe(I(x),O(A=>A.highlightTarget),rt()),N=B({graphicGSelection:_,visibleComputedLayoutData:o,graphicReverseScale:T,fullChartParams:c,fullParams:l}).pipe(I(x),Y(async A=>A),O(A=>pk({graphicGSelection:A.graphicGSelection,circleGClassName:y,circleClassName:w,visibleComputedLayoutData:A.visibleComputedLayoutData,fullParams:A.fullParams,fullChartParams:A.fullChartParams,graphicReverseScale:A.graphicReverseScale})));B({graphicSelection:N,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:$}).pipe(I(x),Y(async A=>A)).subscribe(A=>{A.graphicSelection.on("mouseover",(L,M)=>{L.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:A.highlightTarget,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L,data:A.computedData})}).on("mousemove",(L,M)=>{L.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:A.highlightTarget,data:A.computedData,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L})}).on("mouseout",(L,M)=>{L.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:A.highlightTarget,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L,data:A.computedData})}).on("click",(L,M)=>{L.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:A.highlightTarget,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L,data:A.computedData})})});const R=l.pipe(I(x),O(A=>A.onlyShowHighlighted),rt());return B({graphicSelection:N,highlight:g.pipe(O(A=>A.map(L=>L.id))),onlyShowHighlighted:R,fullChartParams:c}).pipe(I(x),Y(async A=>A)).subscribe(A=>{dk({selection:A.graphicSelection,ids:A.highlight,onlyShowHighlighted:A.onlyShowHighlighted,fullChartParams:A.fullChartParams})}),()=>{x.next(void 0)}},v2="Dots",mk=se(v2,Jh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=b2(v2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,event$:n.event$});return()=>{i.next(void 0),o()}}),yk={listRectWidth:14,listRectHeight:14,listRectRadius:0};function x2(t,e){const n=t<e.colors[e.colorScheme].series.length?t:t%e.colors[e.colorScheme].series.length;return e.colors[e.colorScheme].series[n]}const Cu=(t,{rootSelection:e,seriesLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=at(t,"root-position"),u=at(t,"legend-card"),l=at(t,"legend-list"),c=at(t,"legend-item"),f=new et,h=B({seriesLabels:n,fullChartParams:o}).pipe(I(f),Y(async _=>_),O(_=>{const T=new Map;let $=0;return _.seriesLabels.forEach((N,R)=>{if(!T.has(N)){const A=x2($,_.fullChartParams);T.set(N,A),$++}}),T})),p=n.pipe(I(f),O(_=>{const T=new Set;let $=[];return _.forEach(N=>{T.has(N)?$.push(!1):$.push(!0),T.add(N)}),$})),d=r.pipe(I(f),O(_=>_.position==="bottom"||_.position==="top"?"row":"column")),g=B({fullParams:r,layout:i}).pipe(I(f),Y(async _=>_),O(_=>{const T=_.fullParams.padding*2+_.fullParams.gap*2;return _.fullParams.position==="bottom"||_.fullParams.position==="top"?_.layout.rootWidth-T:_.layout.rootHeight-T})),b=B({layout:i,fullParams:r}).pipe(I(f),Y(async _=>_),O(_=>{let T=0,$=0;return _.fullParams.position==="bottom"?($=_.layout.rootHeight,_.fullParams.justify==="start"?T=0:_.fullParams.justify==="center"?T=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(T=_.layout.rootWidth)):_.fullParams.position==="right"?(T=_.layout.rootWidth,_.fullParams.justify==="start"?$=0:_.fullParams.justify==="center"?$=_.layout.rootHeight/2:_.fullParams.justify==="end"&&($=_.layout.rootHeight)):_.fullParams.position==="top"?($=0,_.fullParams.justify==="start"?T=0:_.fullParams.justify==="center"?T=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(T=_.layout.rootWidth)):_.fullParams.position==="left"&&(T=0,_.fullParams.justify==="start"?$=0:_.fullParams.justify==="center"?$=_.layout.rootHeight/2:_.fullParams.justify==="end"&&($=_.layout.rootHeight)),{x:T,y:$}})).pipe(I(f),O(_=>e.selectAll(`g.${s}`).data([_]).join(T=>T.append("g").classed(s,!0).attr("transform",$=>`translate(${$.x}, ${$.y})`),T=>T.transition().attr("transform",$=>`translate(${$.x}, ${$.y})`),T=>T.remove()))),x=r.pipe(I(f),O(_=>_.seriesList[0]?_.seriesList[0]:yk)),v=B({visibleList:p,fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:d,lineMaxSize:g,defaultListStyle:x,SeriesLabelColorMap:h,textSizePx:a}).pipe(I(f),Y(async _=>_),O(_=>_.seriesLabels.reduce((T,$,N)=>{if(!_.visibleList[N])return T;const R=n2($,_.textSizePx),A=_.textSizePx*1.5+R,L=_.SeriesLabelColorMap.get($),M=T[0]&&T[0][0]?T[T.length-1][T[T.length-1].length-1]:null,{translateX:z,translateY:U,lineIndex:C,itemIndex:k}=((G,j,Q)=>{let F=0,q=0,V=0,K=0;if(G.lineDirection==="column"){let W=Q?Q.translateY+G.textSizePx+G.fullParams.gap:0;if(W+G.textSizePx>G.lineMaxSize){V=Q.lineIndex+1,K=0,q=0;const nt=j[j.length-1].reduce((ut,H)=>H.itemWidth>ut?H.itemWidth:ut,0);F=Q.translateX+nt+G.fullParams.gap}else V=Q?Q.lineIndex:0,K=Q?Q.itemIndex+1:0,q=W,F=Q?Q.translateX:0}else{let W=Q?Q.translateX+Q.itemWidth+G.fullParams.gap:0;W+A>G.lineMaxSize?(V=Q.lineIndex+1,K=0,F=0):(V=Q?Q.lineIndex:0,K=Q?Q.itemIndex+1:0,F=W),q=(G.textSizePx+G.fullParams.gap)*V}return{translateX:F,translateY:q,lineIndex:V,itemIndex:K}})(_,T,M);T[C]||(T[C]=[]);const E=_.fullParams.seriesList[k]?_.fullParams.seriesList[k]:_.defaultListStyle;return T[C].push({id:$,seriesLabel:$,seriesIndex:N,lineIndex:C,itemIndex:k,text:$,itemWidth:A,translateX:z,translateY:U,color:L,listRectWidth:E.listRectWidth,listRectHeight:E.listRectHeight,listRectRadius:E.listRectRadius}),T},[])),Pt(1)),y=B({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:v,textSizePx:a}).pipe(I(f),Y(async _=>_),O(_=>{const{width:T,height:$}=((N,R)=>{let A=0,L=0;if(!R.length||!R[0].length)return{width:A,height:L};const M=R[0][R[0].length-1];return N.lineDirection==="column"?(A=R.reduce((z,U)=>{const C=U.reduce((k,E)=>E.itemWidth>k?E.itemWidth:k,0);return z+C},0),A+=N.fullParams.gap*(R.length-1),L=M.translateY+N.textSizePx):(A=M.translateX+M.itemWidth,L=N.textSizePx*R.length+N.fullParams.gap*(R.length-1)),{width:A,height:L}})(_,_.lengendItems);return{direction:_.lineDirection,width:T,height:$,translateX:_.fullParams.gap,translateY:_.fullParams.gap}}),Pt(1)),w=B({fullParams:r,lengendList:y}).pipe(I(f),Y(async _=>_),O(_=>{const T=_.lengendList.width+_.fullParams.gap*2,$=_.lengendList.height+_.fullParams.gap*2;let N=0,R=0;return _.fullParams.position==="left"?_.fullParams.justify==="start"?(N=_.fullParams.padding,R=_.fullParams.padding):_.fullParams.justify==="center"?(N=_.fullParams.padding,R=-$/2):_.fullParams.justify==="end"&&(N=_.fullParams.padding,R=-$-_.fullParams.padding):_.fullParams.position==="right"?_.fullParams.justify==="start"?(N=-T-_.fullParams.padding,R=_.fullParams.padding):_.fullParams.justify==="center"?(N=-T-_.fullParams.padding,R=-$/2):_.fullParams.justify==="end"&&(N=-T-_.fullParams.padding,R=-$-_.fullParams.padding):_.fullParams.position==="top"?_.fullParams.justify==="start"?(N=_.fullParams.padding,R=_.fullParams.padding):_.fullParams.justify==="center"?(N=-T/2,R=_.fullParams.padding):_.fullParams.justify==="end"&&(N=-T-_.fullParams.padding,R=_.fullParams.padding):_.fullParams.justify==="start"?(N=_.fullParams.padding,R=-$-_.fullParams.padding):_.fullParams.justify==="center"?(N=-T/2,R=-$-_.fullParams.padding):_.fullParams.justify==="end"&&(N=-T-_.fullParams.padding,R=-$-_.fullParams.padding),{width:T,height:$,translateX:N,translateY:R}})),D=B({rootPositionSelection:b,fullParams:r,fullChartParams:o,legendCard:w}).pipe(I(f),Y(async _=>_),O(_=>_.rootPositionSelection.selectAll("g").data([_.legendCard]).join(T=>T.append("g").classed(u,!0).attr("transform",$=>`translate(${$.translateX}, ${$.translateY})`),T=>T.transition().attr("transform",$=>`translate(${$.translateX}, ${$.translateY})`),T=>T.remove()).each((T,$,N)=>{X(N[$]).selectAll("rect").data([T]).join("rect").attr("width",R=>R.width).attr("height",R=>R.height).attr("fill",Ct(_.fullParams.backgroundFill,_.fullChartParams)).attr("stroke",Ct(_.fullParams.backgroundStroke,_.fullChartParams))}))),P=B({lengendCardSelection:D,fullParams:r,lengendList:y}).pipe(I(f),Y(async _=>_),O(_=>_.lengendCardSelection.selectAll("g").data([_.lengendList]).join(T=>T.append("g").classed(l,!0).attr("transform",$=>`translate(${$.translateX}, ${$.translateY})`),T=>T.transition().attr("transform",$=>`translate(${$.translateX}, ${$.translateY})`),T=>T.remove())));return B({lengendListSelection:P,fullParams:r,fullChartParams:o,lengendItems:v,textSizePx:a}).pipe(I(f),Y(async _=>_),O(_=>{const T=_.lengendItems[0]?_.lengendItems.flat():[];return _.lengendListSelection.selectAll(`g.${c}`).data(T).join($=>$.append("g").classed(c,!0).attr("cursor","default"),$=>$,$=>$.remove()).attr("transform",($,N)=>`translate(${$.translateX}, ${$.translateY})`).each(($,N,R)=>{const A=_.textSizePx/2,L=-$.listRectWidth/2,M=-$.listRectHeight/2;X(R[N]).selectAll("rect").data([$]).join("rect").attr("x",A).attr("y",A).attr("width",z=>z.listRectWidth).attr("height",z=>z.listRectHeight).attr("transform",z=>`translate(${L}, ${M})`).attr("fill",z=>z.color).attr("rx",z=>z.listRectRadius),X(R[N]).selectAll("text").data([$]).join(z=>z.append("text").attr("dominant-baseline","hanging"),z=>z,z=>z.remove()).attr("x",_.textSizePx*1.5).attr("font-size",_.fullChartParams.styles.textSize).attr("fill",z=>_.fullParams.textColorType==="series"?x2(z.seriesIndex,_.fullChartParams):Ct(_.fullParams.textColorType,_.fullChartParams)).text(z=>z.text)})})).subscribe(),()=>{f.next(void 0)}},_2="GridLegend",bk=se(_2,ap)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new et,o=n.SeriesDataMap$.pipe(I(i),O(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),O(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Cu(_2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),Eh=6;function vk({selection:t,xAxisClassName:e,groupingLabelClassName:n,params:r,tickTextAlign:i,axisLabelAlign:o,gridAxesSize:a,fullDataFormatter:s,chartParams:u,groupScale:l,groupScaleDomain:c,groupLabels:f,textTransform:h}){const p=t.selectAll(`g.${e}`).data([r]).join("g").classed(e,!0);t.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).each((b,x,v)=>{X(v[x]).selectAll("text").data([b]).join(y=>y.append("text").style("font-weight","bold"),y=>y,y=>y.remove()).attr("text-anchor",o.textAnchor).attr("dominant-baseline",o.dominantBaseline).attr("font-size",u.styles.textSize).style("fill",Ct(r.labelColorType,u)).style("transform",h).text(y=>s.grid.groupAxis.label)}).attr("transform",b=>`translate(${a.width+b.tickPadding+r.labelOffset[0]}, ${-b.tickPadding-Eh-r.labelOffset[1]})`);const d=Math.floor(c[1])-Math.ceil(c[0])+1,g=Cg(l).scale(l).ticks(r.ticks==="all"||r.ticks>d?d:r.ticks).tickSize(r.tickFullLine==!0?-a.height:Eh).tickSizeOuter(0).tickFormat(b=>{const x=f[b]??"";return Th(x,r.tickFormat)}).tickPadding(r.tickPadding),m=p.transition().duration(100).call(g);return m.selectAll("line").style("fill","none").style("stroke",r.tickLineVisible==!0?Ct(r.tickColorType,u):"none").style("stroke-dasharray",r.tickFullLineDasharray).attr("pointer-events","none"),m.selectAll("path").style("fill","none").style("stroke",r.axisLineVisible==!0?Ct(r.axisLineColorType,u):"none").style("shape-rendering","crispEdges"),p.selectAll("text").attr("font-size",u.styles.textSize).style("color",Ct(r.tickTextColorType,u)).attr("text-anchor",i.textAnchor).attr("dominant-baseline",i.dominantBaseline).attr("transform-origin",`0 -${r.tickPadding+Eh}`).style("transform",h),p}const w2=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c})=>{const f=new et,h=at(t,"container"),p=at(t,"xAxisG"),d=at(t,"xAxis"),g=at(t,"groupingLabel"),m=B({computedData:n.pipe(rt((S,_)=>S.length===_.length)),isSeriesSeprate:c}).pipe(I(f),Y(async S=>S),O(S=>S.isSeriesSeprate?S.computedData:[S.computedData[0]]),O((S,_)=>e.selectAll(`g.${h}`).data(S,T=>T[0]?T[0].seriesIndex:_).join("g").classed(h,!0))),b=m.pipe(I(f),O((S,_)=>S.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));B({containerSelection:m,gridContainerPosition:l}).pipe(I(f),Y(async S=>S)).subscribe(S=>{S.containerSelection.attr("transform",(_,T)=>{const $=S.gridContainerPosition[T]??S.gridContainerPosition[0],N=$.translate,R=$.scale;return`translate(${N[0]}, ${N[1]}) scale(${R[0]}, ${R[1]})`})}),B({axisSelection:b,gridAxesTransform:a}).pipe(I(f),Y(async S=>S)).subscribe(S=>{S.axisSelection.style("transform",S.gridAxesTransform.value)});const x=B({fullParams:r,fullDataFormatter:i,gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),Y(async S=>S),O(S=>{const _=`translate(${S.gridAxesReverseTransform.translate[0]}px, ${S.gridAxesReverseTransform.translate[1]}px)`,T=`rotate(${S.gridAxesReverseTransform.rotate}deg) rotateX(${S.gridAxesReverseTransform.rotateX}deg) rotateY(${S.gridAxesReverseTransform.rotateY}deg)`,$=`scale(${1/S.gridContainerPosition[0].scale[0]}, ${1/S.gridContainerPosition[0].scale[1]})`,R=`rotate(${S.fullDataFormatter.grid.groupAxis.position==="left"&&S.fullDataFormatter.grid.valueAxis.position==="top"||S.fullDataFormatter.grid.groupAxis.position==="right"&&S.fullDataFormatter.grid.valueAxis.position==="bottom"?S.fullParams.tickTextRotate+180:S.fullParams.tickTextRotate}deg)`;return`${_} ${T} ${$} ${R}`}),rt()),v=B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),Y(async S=>S),O(S=>{const T=S.computedData[0]?S.computedData[0].length-1:0,$=S.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-S.fullDataFormatter.grid.groupAxis.scalePadding:S.fullDataFormatter.grid.groupAxis.scaleDomain[0]-S.fullDataFormatter.grid.groupAxis.scalePadding,N=S.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?T+S.fullDataFormatter.grid.groupAxis.scalePadding:S.fullDataFormatter.grid.groupAxis.scaleDomain[1]+S.fullDataFormatter.grid.groupAxis.scalePadding;return[$,N]}),Pt(1)),y=B({groupScaleDomain:v,gridAxesSize:u}).pipe(I(f),Y(async S=>S),O(S=>eu().domain(S.groupScaleDomain).range([0,S.gridAxesSize.width]))),w=n.pipe(O(S=>(S[0]??[]).map(_=>_.groupLabel))),D=B({fullDataFormatter:i,fullParams:r}).pipe(I(f),Y(async S=>S),O(S=>{let _="middle",T="hanging";return S.fullDataFormatter.grid.groupAxis.position==="bottom"?(_=S.fullParams.tickTextRotate?"end":"middle",T="hanging"):S.fullDataFormatter.grid.groupAxis.position==="top"?(_=S.fullParams.tickTextRotate?"end":"middle",T="auto"):S.fullDataFormatter.grid.groupAxis.position==="left"?(_="end",T="middle"):S.fullDataFormatter.grid.groupAxis.position==="right"&&(_="start",T="middle"),{textAnchor:_,dominantBaseline:T}})),P=i.pipe(I(f),O(S=>{let _="start",T="hanging";return S.grid.groupAxis.position==="bottom"?T="hanging":S.grid.groupAxis.position==="top"?T="auto":S.grid.groupAxis.position==="left"?_="end":S.grid.groupAxis.position==="right"&&(_="start"),S.grid.valueAxis.position==="left"?_="start":S.grid.valueAxis.position==="right"?_="end":S.grid.valueAxis.position==="bottom"?T="auto":S.grid.valueAxis.position==="top"&&(T="hanging"),{textAnchor:_,dominantBaseline:T}}));return B({axisSelection:b,params:r,tickTextAlign:D,axisLabelAlign:P,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:y,groupScaleDomain:v,groupLabels:w,textTransform:x}).pipe(I(f),Y(async S=>S)).subscribe(S=>{vk({selection:S.axisSelection,xAxisClassName:d,groupingLabelClassName:g,params:S.params,tickTextAlign:S.tickTextAlign,axisLabelAlign:S.axisLabelAlign,gridAxesSize:S.gridAxesSize,fullDataFormatter:S.fullDataFormatter,chartParams:S.chartParams,groupScale:S.groupScale,groupScaleDomain:S.groupScaleDomain,groupLabels:S.groupLabels,textTransform:S.textTransform})}),()=>{f.next(void 0)}},$2="GroupAxis",xk=se($2,rp)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=w2($2,{selection:t,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),S2=6;function _k({selection:t,yAxisClassName:e,textClassName:n,fullParams:r,tickTextAlign:i,axisLabelAlign:o,gridAxesSize:a,fullDataFormatter:s,fullChartParams:u,valueScale:l,textTransform:c,minAndMax:f}){const h=t.selectAll(`g.${e}`).data([r]).join("g").classed(e,!0);t.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).each((b,x,v)=>{X(v[x]).selectAll("text").data([b]).join(y=>y.append("text").style("font-weight","bold"),y=>y,y=>y.remove()).attr("text-anchor",o.textAnchor).attr("dominant-baseline",o.dominantBaseline).attr("font-size",u.styles.textSize).style("fill",Ct(r.labelColorType,u)).style("transform",c).text(y=>s.grid.valueAxis.label)}).attr("transform",b=>`translate(${-b.tickPadding+r.labelOffset[0]}, ${a.height+b.tickPadding+r.labelOffset[1]})`);const p=f[1]-f[0],d=Eg(l).scale(l).ticks(p>r.ticks?r.ticks:f[0]===0&&f[1]===0?1:Math.ceil(p)).tickFormat(b=>Th(b,r.tickFormat)).tickSize(r.tickFullLine==!0?-a.width:S2).tickPadding(r.tickPadding),g=h.transition().duration(100).call(d);return g.selectAll("line").style("fill","none").style("stroke",r.tickLineVisible==!0?Ct(r.tickColorType,u):"none").style("stroke-dasharray",r.tickFullLineDasharray).attr("pointer-events","none"),g.selectAll("path").style("fill","none").style("stroke",r.axisLineVisible==!0?Ct(r.axisLineColorType,u):"none").style("shape-rendering","crispEdges"),h.selectAll("text").attr("font-size",u.styles.textSize).style("color",Ct(r.tickTextColorType,u)).attr("text-anchor",i.textAnchor).attr("dominant-baseline",i.dominantBaseline).attr("transform-origin",`-${r.tickPadding+S2} 0`).style("transform",c),h}const ai=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c})=>{const f=new et,h=at(t,"container"),p=at(t,"yAxisG"),d=at(t,"yAxis"),g=at(t,"text"),m=B({computedData:n.pipe(rt((P,S)=>P.length===S.length)),isSeriesSeprate:c}).pipe(I(f),Y(async P=>P),O(P=>P.isSeriesSeprate?P.computedData:[P.computedData[0]]),O((P,S)=>e.selectAll(`g.${h}`).data(P,_=>_[0]?_[0].seriesIndex:S).join("g").classed(h,!0))),b=m.pipe(I(f),O((P,S)=>P.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));B({containerSelection:m,gridContainerPosition:l}).pipe(I(f),Y(async P=>P)).subscribe(P=>{P.containerSelection.attr("transform",(S,_)=>{const T=P.gridContainerPosition[_]??P.gridContainerPosition[0],$=T.translate,N=T.scale;return`translate(${$[0]}, ${$[1]}) scale(${N[0]}, ${N[1]})`})}),B({axisSelection:b,gridAxesTransform:a}).pipe(I(f),Y(async P=>P)).subscribe(P=>{P.axisSelection.style("transform",P.gridAxesTransform.value)});const x=B({fullParams:r,fullDataFormatter:i,gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),Y(async P=>P),O(P=>{const S=`translate(${P.gridAxesReverseTransform.translate[0]}px, ${P.gridAxesReverseTransform.translate[1]}px)`,_=`rotate(${P.gridAxesReverseTransform.rotate}deg) rotateX(${P.gridAxesReverseTransform.rotateX}deg) rotateY(${P.gridAxesReverseTransform.rotateY}deg)`,T=`scale(${1/P.gridContainerPosition[0].scale[0]}, ${1/P.gridContainerPosition[0].scale[1]})`,N=`rotate(${P.fullDataFormatter.grid.groupAxis.position==="left"&&P.fullDataFormatter.grid.valueAxis.position==="top"||P.fullDataFormatter.grid.groupAxis.position==="right"&&P.fullDataFormatter.grid.valueAxis.position==="bottom"?P.fullParams.tickTextRotate+180:P.fullParams.tickTextRotate}deg)`;return`${S} ${_} ${T} ${N}`}),rt()),v=new pt(P=>{B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),Y(async S=>S)).subscribe(S=>{const T=S.computedData[0]?S.computedData[0].length-1:0,$=S.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-S.fullDataFormatter.grid.groupAxis.scalePadding:S.fullDataFormatter.grid.groupAxis.scaleDomain[0]-S.fullDataFormatter.grid.groupAxis.scalePadding,N=S.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?T+S.fullDataFormatter.grid.groupAxis.scalePadding:S.fullDataFormatter.grid.groupAxis.scaleDomain[1]+S.fullDataFormatter.grid.groupAxis.scalePadding,R=S.computedData.map((L,M)=>L.filter((z,U)=>U>=$&&U<=N)),A=LR(R.flat());P.next(A)})}),y=new pt(P=>{B({fullDataFormatter:i,gridAxesSize:u,minAndMax:v}).pipe(I(f),Y(async S=>S)).subscribe(S=>{const _=tg({maxValue:S.minAndMax[1],minValue:S.minAndMax[0],axisWidth:S.gridAxesSize.height,scaleDomain:S.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:S.fullDataFormatter.grid.valueAxis.scaleRange});P.next(_)})}),w=i.pipe(I(f),O(P=>{let S="start",_="hanging";return P.grid.valueAxis.position==="left"?(S="end",_="middle"):P.grid.valueAxis.position==="right"?(S="start",_="middle"):P.grid.valueAxis.position==="bottom"?(S="middle",_="hanging"):P.grid.valueAxis.position==="top"&&(S="middle",_="auto"),{textAnchor:S,dominantBaseline:_}})),D=i.pipe(I(f),O(P=>{let S="start",_="hanging";return P.grid.groupAxis.position==="bottom"?_="auto":P.grid.groupAxis.position==="top"?_="hanging":P.grid.groupAxis.position==="left"?S="start":P.grid.groupAxis.position==="right"&&(S="end"),P.grid.valueAxis.position==="left"?S="end":P.grid.valueAxis.position==="right"?S="start":P.grid.valueAxis.position==="bottom"?_="hanging":P.grid.valueAxis.position==="top"&&(_="auto"),{textAnchor:S,dominantBaseline:_}}));return B({axisSelection:b,fullParams:r,tickTextAlign:w,axisLabelAlign:D,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:y,textTransform:x,minAndMax:v}).pipe(I(f),Y(async P=>P)).subscribe(P=>{_k({selection:P.axisSelection,yAxisClassName:d,textClassName:g,fullParams:P.fullParams,tickTextAlign:P.tickTextAlign,axisLabelAlign:P.axisLabelAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,valueScale:P.valueScale,textTransform:P.textTransform,minAndMax:P.minAndMax})}),()=>{f.next(void 0)}},A2="ValueAxis",wk=se(A2,Fu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=ai(A2,{selection:t,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),M2="ValueStackAxis",$k=se(M2,ip)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=ai(M2,{selection:t,computedData$:n.computedStackedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),D2="ScalingArea",Sk=at(D2,"rect"),Ak=se(D2,op)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new et,a=e.insert("rect","g").classed(Sk,!0).attr("opacity",0);let s={k:1,x:0,y:0};r.layout$.pipe(I(o)).subscribe(l=>{a.attr("width",l.width).attr("height",l.height).attr("x",l.left).attr("y",l.top)});const u=r.computedData$.pipe(O(l=>l[0]?l[0].length-1:0),rt());return B({initGroupAxis:r.fullDataFormatter$.pipe(O(l=>l.grid.groupAxis),$_()),fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:u,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(I(o),Y(async l=>l)).subscribe(l=>{const f=l.groupMaxIndex,h=l.initGroupAxis.scaleDomain[0]==="auto"?0-l.initGroupAxis.scalePadding:l.initGroupAxis.scaleDomain[0]-l.initGroupAxis.scalePadding,p=l.initGroupAxis.scaleDomain[1]==="auto"?f+l.initGroupAxis.scalePadding:l.initGroupAxis.scaleDomain[1]+l.initGroupAxis.scalePadding,g=tg({maxValue:l.groupMaxIndex,minValue:0,axisWidth:l.axisSize.width,scaleDomain:[h,p],scaleRange:[0,1]}).copy(),m=t2().on("zoom",function(x){const v=x.transform,y=P=>{const S=Math.round(P);return Math.min(f,Math.max(0,S))},w=l.fullDataFormatter.grid.groupAxis.position==="bottom"||l.fullDataFormatter.grid.groupAxis.position==="top"?v.rescaleX(g).domain().map(y):v.rescaleY(g).domain().map(y);w[0]<=0&&w[1]>=f?v.k<s.k&&(v.k=s.k,v.x=s.x,v.y=s.y):w[1]-w[0]<=1&&v.k>s.k&&(v.k=s.k,v.x=s.x,v.y=s.y),s.k=v.k,s.x=v.x,s.y=v.y;const D={...l.fullDataFormatter,grid:{...l.fullDataFormatter.grid,groupAxis:{...l.fullDataFormatter.grid.groupAxis,scaleDomain:w}}};i.dataFormatter$.next(D)});e.call(m)}),()=>{o.next(void 0),a.remove()}});function P2(t,e){let n=new pt(()=>{});return t.each(function(){const r=Zu(this,e);n=Ku(n,r)}),n}const Eu="GroupAux",Rh=at(Eu,"label-box");function Mk({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function Dk({selection:t,pluginName:e,lineData:n,fullParams:r,fullChartParams:i}){const o=at(e,"auxline"),a=t.selectAll(`line.${o}`).data(n),s=a.enter().append("line").classed(o,!0).style("stroke",l=>Ct(r.lineColorType,i)).style("stroke-width",1).style("stroke-dasharray",r.lineDashArray??"none").style("pointer-events","none"),u=a.merge(s);return a.exit().remove(),s.attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),a.transition().duration(50).attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),u}function Pk(t){t.selectAll("line").data([]).exit().remove()}function Tk({groupLabel:t,axisX:e,fullParams:n}){return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:Th(t,n.labelTextFormat)}]:[]}function Lk({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,labelTransform:o,textSizePx:a}){const s=a+4,u=t.selectAll(`g.${Rh}`).data(e),l=u.enter().append("g").classed(Rh,!0).style("cursor","pointer"),c=l.merge(u);return l.attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.transition().duration(50).attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.exit().remove(),c.each((f,h,p)=>{const d=n2(f.text,a)+12;let g=-d/2,m=-2;r.grid.groupAxis.position==="bottom"?(g=-d/2,m=2):r.grid.groupAxis.position==="left"?(g=-d+2,m=-s/2):r.grid.groupAxis.position==="right"?(g=-2,m=-s/2):r.grid.groupAxis.position==="top"&&(g=-d/2,m=-s+2);const b=X(p[h]).selectAll("rect").data([f]),x=b.enter().append("rect").attr("height",`${s}px`).attr("fill",w=>Ct(n.labelColorType,i)).attr("x",g).attr("y",m).attr("rx",5).attr("ry",5).style("cursor","pointer");b.merge(x).attr("width",w=>`${d}px`).style("transform",o),b.exit().remove();const v=X(p[h]).selectAll("text").data([f]),y=v.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");v.merge(y).text(w=>w.text).style("transform",o).attr("fill",w=>Ct(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",g+6).attr("y",m),v.exit().remove()}),c}function Ck(t){t.selectAll(`g.${Rh}`).data([]).exit().remove()}const Ek=se(Eu,tp)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new et;let a=!1;const s=e.insert("rect","g").classed(at(Eu,"rect"),!0).attr("opacity",0),{seriesSelection$:u,axesSelection$:l,defsSelection$:c,graphicGSelection$:f}=ar({selection:t,pluginName:Eu,clipPathID:"test",seriesLabels$:i.seriesLabels$,gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(I(o)).subscribe(y=>{s.attr("width",y.rootWidth).attr("height",y.rootHeight)});const h=new pt(y=>{B({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(I(o),Y(async w=>w)).subscribe(w=>{const P=w.computedData[0]?w.computedData[0].length-1:0,S=w.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[0]-w.fullDataFormatter.grid.groupAxis.scalePadding,_=w.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?P+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding,T=w.computedData[0]?w.computedData[0].length:0;let $=w.fullDataFormatter.grid.seriesDirection==="row"?(w.computedData[0]??[]).map(L=>L.groupLabel):w.computedData.map(L=>L[0].groupLabel);const N=new Array(T).fill(0).map((L,M)=>$[M]!=null?$[M]:String(M)).filter((L,M)=>M>=S&&M<=_),R=w.fullDataFormatter.grid.groupAxis.scalePadding,A=p3({axisLabels:N,axisWidth:w.gridAxesSize.width,padding:R});y.next(A)})}),p=Lh({fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$}),d=i.fullChartParams$.pipe(I(o),O(y=>y.highlightTarget),rt()),g=P2(e,"mousemove").pipe(I(o)),m=B({fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),Y(async y=>y),O(y=>{const w=`translate(${y.gridAxesReverseTransform.translate[0]}px, ${y.gridAxesReverseTransform.translate[1]}px)`,D=`rotate(${y.gridAxesReverseTransform.rotate}deg) rotateX(${y.gridAxesReverseTransform.rotateX}deg) rotateY(${y.gridAxesReverseTransform.rotateY}deg)`,P=`scale(${1/y.gridContainerPosition[0].scale[0]}, ${1/y.gridContainerPosition[0].scale[1]})`,_=`rotate(${y.fullDataFormatter.grid.groupAxis.position==="left"&&y.fullDataFormatter.grid.valueAxis.position==="top"||y.fullDataFormatter.grid.groupAxis.position==="right"&&y.fullDataFormatter.grid.valueAxis.position==="bottom"?180:0}deg)`;return`${w} ${D} ${P} ${_}`}),rt()),b=i.gridContainerPosition$.pipe(I(o),O(y=>y.reduce((D,P)=>P.columnIndex>D?P.columnIndex:D,0)+1),rt()),x=i.gridContainerPosition$.pipe(I(o),O(y=>y.reduce((D,P)=>P.rowIndex>D?P.rowIndex:D,0)+1),rt());B({axesSelection:l,columnAmount:b,rowAmount:x,layout:i.layout$,rootMousemove:g,gridGroupPositionFn:p,computedData:i.computedData$,groupScale:h,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:d,labelTransform:m,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).subscribe(y=>{const w={offsetX:y.rootMousemove.offsetX*y.columnAmount%y.layout.rootWidth,offsetY:y.rootMousemove.offsetY*y.rowAmount%y.layout.rootHeight},{groupIndex:D,groupLabel:P}=y.gridGroupPositionFn(w),S=y.groupScale(P)??0,_=Mk({groupLabel:P,axisX:S,axisHeight:y.gridAxesSize.height,fullParams:y.fullParams});Dk({selection:y.axesSelection,pluginName:n,lineData:_,fullParams:y.fullParams,fullChartParams:y.fullChartParams});const T=Tk({groupLabel:P,axisX:S,fullParams:y.fullParams});Lk({selection:y.axesSelection,labelData:T,fullParams:y.fullParams,fullDataFormatter:y.fullDataFormatter,fullChartParams:y.fullChartParams,labelTransform:y.labelTransform,textSizePx:y.textSizePx}).on("mouseover",(N,R)=>{N.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:y.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:y.GroupDataMap.get(P)??[],groupIndex:D,groupLabel:P,event:N,data:y.computedData})}).on("mousemove",(N,R)=>{N.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:y.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:y.GroupDataMap.get(P)??[],groupIndex:D,groupLabel:P,event:N,data:y.computedData})}).on("mouseout",(N,R)=>{N.stopPropagation(),a=!1,r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:y.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:y.GroupDataMap.get(P)??[],groupIndex:D,groupLabel:P,event:N,data:y.computedData})}).on("click",(N,R)=>{N.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:y.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:y.GroupDataMap.get(P)??[],groupIndex:D,groupLabel:P,event:N,data:y.computedData})})});const v=P2(s,"mouseout").pipe(I(o));return B({rootRectMouseout:v,axesSelection:l}).pipe(I(o),Y(async y=>y)).subscribe(y=>{setTimeout(()=>{a!=!0&&(Pk(y.axesSelection),Ck(y.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),T2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,gridList:[{listRectWidth:14,listRectHeight:14,listRectRadius:0}],textColorType:"primary"},L2={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]},Ru={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]},Rk={...Ru},C2={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},E2={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},R2={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},k2={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},I2={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},N2={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},kh={firstAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},secondAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},gridIndexes:[0,1]},F2={...kh},G2="MultiGridLegend",kk=pe(G2,T2)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new et,o=n.multiGridEachDetail$.pipe(I(i),O(l=>l.map((f,h)=>f.SeriesDataMap$.pipe(O(p=>Array.from(p.keys()))))),Y(l=>B(l)),O(l=>l.flat())),a=B({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(I(i),Y(async l=>l),O(l=>l.computedData.map((c,f)=>{const h=bl(l.fullParams.gridList[f]??{},{listRectWidth:l.fullParams.listRectWidth,listRectHeight:l.fullParams.listRectHeight,listRectRadius:l.fullParams.listRectRadius});return c.map(p=>h)}).flat())),s=B({fullParams:n.fullParams$,seriesList:a}).pipe(I(i),Y(async l=>l),O(l=>({...l.fullParams,seriesList:l.seriesList}))),u=Cu(G2,{rootSelection:e,seriesLabels$:o,fullParams$:s,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),u()}}),Ce=t=>{const e=t.fullParams$.pipe(O(n=>n.gridIndexes),rt(),Pt(1));return B({multiGridEachDetail:t.multiGridEachDetail$,gridIndexes:e}).pipe(O(n=>n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},Ih="MultiBars",z2=at(Ih,"grid"),Ik=pe(Ih,C2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${z2}`).data(s).join("g").attr("class",z2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=Ch(Ih,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Nh="MultiBarStack",O2=at(Nh,"grid"),Nk=pe(Nh,E2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${O2}`).data(s).join("g").attr("class",O2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=h2(Nh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Fh="MultiBarsTriangle",U2=at(Fh,"grid"),Fk=pe(Fh,R2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${U2}`).data(s).join("g").attr("class",U2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=m2(Fh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,fullDataFormatter$:u.dataFormatter$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Gh="MultiLines",B2=at(Gh,"grid"),Gk=pe(Gh,k2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${B2}`).data(s).join("g").attr("class",B2).each((u,l,c)=>{const f=X(c[l]);o[l]=r2(Gh,{selection:f,computedData$:u.computedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedData$:u.visibleComputedData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullDataFormatter$:u.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),zh="MultiLineAreas",Y2=at(zh,"grid"),zk=pe(zh,I2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Y2}`).data(s).join("g").attr("class",Y2).each((u,l,c)=>{const f=X(c[l]);o[l]=o2(zh,{selection:f,computedData$:u.computedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedData$:u.visibleComputedData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullDataFormatter$:u.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Oh="MultiDots",H2=at(Oh,"grid"),Ok=pe(Oh,N2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${H2}`).data(s).join("g").attr("class",H2).each((u,l,c)=>{const f=X(c[l]);o[l]=b2(Oh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Uh="MultiGroupAxis",W2=at(Uh,"grid"),Uk=pe(Uh,L2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${W2}`).data(s).join("g").attr("class",W2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=w2(Uh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Bh="MultiValueAxis",V2=at(Bh,"grid"),Bk=pe(Bh,Ru)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${V2}`).data(s).join("g").attr("class",V2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=ai(Bh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Yh="MultiValueStackAxis",j2=at(Yh,"grid"),Yk=pe(Yh,Ru)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${j2}`).data(s).join("g").attr("class",j2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=ai(Yh,{selection:f,computedData$:u.computedStackedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}});function Hk(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function q2(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:Hk(n);return new Array(n).fill(null).map((a,s)=>{const u=s%o,l=Math.floor(s/o),c=(t.width-r*(o-1))/o,f=(t.height-r*(i-1))/i,h=u*c+u*r,p=l*f+l*r,d=[h,p],g=[c/t.width,f/t.height];return{slotIndex:s,rowIndex:l,columnIndex:u,translate:d,scale:g}})}const X2=({fullDataFormatter$:t,layout$:e})=>{const n=new et;function r({xAxis:i,yAxis:o,width:a,height:s}){if(!i||!o)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let u=0,l=0,c=0,f=0,h=0;return i.position==="bottom"?o.position==="left"?(f=180,l=s):o.position==="right"?(f=180,h=180,u=a,l=s):(f=180,l=s):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,u=a):(f=180,l=s)):i.position==="left"?o.position==="bottom"?(c=-90,l=s):o.position==="top"?(c=-90,h=180):(f=180,l=s):i.position==="right"&&(o.position==="bottom"?(c=-90,f=180,l=s,u=a):o.position==="top"?(c=-90,f=180,h=180,u=a):(f=180,l=s)),{translate:[u,l],scale:[1,1],rotate:c,rotateX:f,rotateY:h,value:`translate(${u}px, ${l}px) rotate(${c}deg) rotateX(${f}deg) rotateY(${h}deg)`}}return new pt(i=>(B({fullDataFormatter:t,layout:e}).pipe(I(n),Y(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.grid.groupAxis,yAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},Z2=({gridAxesTransform$:t})=>t.pipe(O(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${o}deg) rotateY(${a}deg)`}})),K2=({computedData$:t,fullDataFormatter$:e,layout$:n})=>B({computedData:t,fullDataFormatter:e,layout:n}).pipe(Y(async i=>i),O(i=>{if(i.fullDataFormatter.grid.separateSeries)return q2(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=q2(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Hh="OverlappingValueAxes",Q2=at(Hh,"grid"),Wk=pe(Hh,kh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[],a=r.fullParams$.pipe(I(i),O(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),O(c=>c.gridIndexes[1])),u=B({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),Y(async c=>c),O(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));let f="";return c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="left"?f="right":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="bottom"?f="top":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="top"?f="bottom":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="right"&&(f="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:f}},container:{...c.fullDataFormatter.container}}}));return Bo(r).pipe(I(i),O(c=>({...c,fullParams$:c.fullParams$.pipe(O(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),Y(c=>Ce(c)),O(c=>c.map((f,h)=>{if(h===0)return f;const p=X2({fullDataFormatter$:u,layout$:r.layout$}),d=Z2({gridAxesTransform$:p}),g=K2({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${Q2}`).data(c).join("g").attr("class",Q2).each((f,h,p)=>{if(h>1)return;const d=X(p[h]);o[h]=ai(Hh,{selection:d,computedData$:f.computedData$,fullParams$:r.fullParams$.pipe(O(g=>h===0?g.firstAxis:g.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),Wh="OverlappingValueStackAxes",J2=at(Wh,"grid"),Vk=pe(Wh,F2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[],a=r.fullParams$.pipe(I(i),O(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),O(c=>c.gridIndexes[1])),u=B({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),Y(async c=>c),O(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));let f="";return c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="left"?f="right":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="bottom"?f="top":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="top"?f="bottom":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="right"&&(f="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:f}},container:{...c.fullDataFormatter.container}}}));return Bo(r).pipe(I(i),O(c=>({...c,fullParams$:c.fullParams$.pipe(O(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),Y(c=>Ce(c)),O(c=>c.map((f,h)=>{if(h===0)return f;const p=X2({fullDataFormatter$:u,layout$:r.layout$}),d=Z2({gridAxesTransform$:p}),g=K2({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${J2}`).data(c).join("g").attr("class",J2).each((f,h,p)=>{if(h>1)return;const d=X(p[h]);o[h]=ai(Wh,{selection:d,computedData$:h===0?f.computedStackedData$:f.computedData$,fullParams$:r.fullParams$.pipe(O(g=>h===0?g.firstAxis:g.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),tx={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},ex={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,textRenderFn:t=>{if(t.highlightTarget==="datum"&&t.datum)return[`${t.datum.label}: ${t.datum.value}`];if(t.highlightTarget==="series"){const e=t.seriesLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="group"){const e=t.groupLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="category"){const e=t.categoryLabel,n=t.category.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}return[]},svgRenderFn:null},jk=eg("Container",tx)(({selection:t})=>function(){}),Vh="Tooltip",nx=at(Vh,"g"),qk=at(Vh,"box");function Xk(t,e){const n=e.textSizePx*1.5;return t.filter(r=>r!="").map((r,i)=>{const o=i*n;return`<text font-size="${e.textSize}" fill="${e.textColor}" x="0" y="${o}" style="dominant-baseline:text-before-edge">${r}</text>`}).join()}function Zk({rootSelection:t,pluginName:e,rootWidth:n,rootHeight:r,svgString:i,tooltipStyle:o,event:a}){t.interrupt("fadeout");const s=5,u=i?[i]:[],l=i?[o]:[],f=t.selectAll(`g.${nx}`).data(u).join(y=>y.append("g").classed(nx,!0).attr("pointer-events","none"),y=>y,y=>y.style("opacity",0).remove()).attr("transform",()=>`translate(${a.offsetX}, ${a.offsetY})`).selectAll(`g.${qk}`).data(l).join(y=>y.append("g").classed(at(e,"box"),!0)),h=f.selectAll("rect").data(l).join(y=>y.append("rect").attr("rx",s).attr("ry",s)).attr("fill",y=>y.backgroundColor).attr("stroke",y=>y.strokeColor).attr("opacity",y=>y.backgroundOpacity),p=f.selectAll("g").data(u).join(y=>y.append("g").classed(at(e,"content"),!0).attr("transform",()=>`translate(${o.padding}, ${o.padding})`));u.length&&PR(p,u[0]);const d=p!=null&&p.node()?e2(p):{width:0,height:0};h.attr("width",d.width+o.padding*2).attr("height",d.height+o.padding*2);const g=f!=null&&f.node()?e2(f):{width:0,height:0},m=n-g.width,b=r-g.height,x=a.offsetX+o.offset[0]>m?m-a.offsetX:o.offset[0],v=a.offsetY+o.offset[1]>b?b-a.offsetY:o.offset[1];f.attr("transform",y=>`translate(${x}, ${v})`),f.attr("transform",y=>`translate(${x}, ${v})`)}const Kk=eg(Vh,ex)(({selection:t,rootSelection:e,name:n,chartType:r,observer:i,subject:o})=>{const a=new et,s=o.event$.pipe(I(a),li(g=>g.eventName==="mouseover"||g.eventName==="mousemove")),u=o.event$.pipe(I(a),li(g=>g.eventName==="mouseout")),l=h3(i.fullChartParams$),c=B({fullChartParams:i.fullChartParams$,fullParams:i.fullParams$,textSizePx:l}).pipe(I(a),Y(async g=>g),O(g=>({backgroundColor:Ct(g.fullParams.backgroundColorType,g.fullChartParams),backgroundOpacity:g.fullParams.backgroundOpacity,strokeColor:Ct(g.fullParams.strokeColorType,g.fullChartParams),offset:g.fullParams.offset,padding:g.fullParams.padding,textSize:g.fullChartParams.styles.textSize,textSizePx:g.textSizePx,textColor:Ct(g.fullParams.textColorType,g.fullChartParams)}))),f=B({fullParams:i.fullParams$,tooltipStyle:c}).pipe(I(a),Y(async g=>g),O(g=>g.fullParams.svgRenderFn?g.fullParams.svgRenderFn:m=>{const b=g.fullParams.textRenderFn(m);return Xk(b,g.tooltipStyle)})),h=B({event:s,contentRenderFn:f}).pipe(I(a),Y(async g=>g),O(g=>g.contentRenderFn(g.event))),p=u.pipe(I(a),O(g=>"")),d=Ku(s,u).pipe(I(a),O(g=>g.event));return B({svgString:Ku(h,p),event:d,layout:i.layout$,tooltipStyle:c}).pipe(I(a),Y(async g=>g)).subscribe(g=>{Zk({rootSelection:e,pluginName:n,rootWidth:g.layout.rootWidth,rootHeight:g.layout.rootHeight,svgString:g.svgString,tooltipStyle:g.tooltipStyle,event:g.event})}),function(){a.next(void 0)}}),rx={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleText:{fillRate:.6,lineHeight:12,lineLengthMin:4},arcScaleType:"area"},ix={outerRadius:.95,innerRadius:0,outerRadiusWhileHighlight:1,startAngle:0,endAngle:Math.PI*2,padAngle:.02,cornerRadius:0},ox={eventFn:(t,e,n)=>e==="mouseover"||e==="mousemove"?[String(t.datum.value)]:[String(Math.round(t.data.reduce((r,i)=>r+i.reduce((o,a)=>o+(a.value??0),0),0)*n))],textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"middle","pointer-events":"none","dominant-baseline":"middle","font-size":64,fill:"#000"}]},ax={outerRadius:.95,outerRadiusWhileHighlight:1,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.3,labelColorType:"primary",labelFn:t=>String(t.label)},sx={outerRadius:.95,cornerRadius:0,arcScaleType:"area",mouseoverAngleIncrease:.05},ux={outerRadius:.95,labelCentroid:2.5,labelFn:t=>String(t.label),labelColorType:"primary",arcScaleType:"area"},lx={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"};function Qk(t,{text:e,radius:n,lineHeight:r,isBreakAll:i=!1,limit:o=0}){if(t==null||e==null){console.error("selection or text is not defined");return}n==null&&(n=t.node().getBBox().width/2);function a(p){let d;return i?d=p.split(""):d=p.split(/\s+/g),d[d.length-1]||d.pop(),d[0]||d.shift(),d}function s(p,d){return p&&d&&p.length>d&&(p=p.substring(0,d)+"..."),p}function u(p){var g;const d=document.createElement("canvas").getContext("2d");return((g=d==null?void 0:d.measureText(p))==null?void 0:g.width)??0}function l(p){const d=u(p.trim());return Math.sqrt(d*r)}function c(p,d){let g={width:0,text:""},m=1/0;const b=[];let x=" ";i&&(x="");for(let v=0,y=p.length;v<y;++v){const w=(g.text?g.text+x:"")+p[v],D=u(w);(m+D)/2<d?(g.width=m=D,g.text=w):(m=u(p[v]),g={width:m,text:p[v]},b.push(g))}return b}function f(p){let d=0;for(let g=0,m=p.length;g<m;++g){const b=(Math.abs(g-m/2+.5)+.5)*r,x=p[g].width/2;d=Math.max(d,Math.sqrt(x**2+b**2))}return d}function h(p,d){o>0&&(d=s(d,o));const g=a(d),m=l(d),b=c(g,m),x=f(b);let v=p.select("text");v.size()||(v=p.append("text")),v.attr("transform",`translate(0,0) scale(${n/x})`);const y=v.selectAll("tspan").data(b),w=y.enter().append("tspan").attr("x",0).merge(y).attr("y",(D,P)=>(P-b.length/2+.8)*r).text(D=>D.text);return y.exit().remove(),y.merge(w)}return h(t,e)}let Sn;function Jk(t,e){return Lm().velocityDecay(e.force.velocityDecay).force("collision",Dm().radius(n=>n.r+e.force.collisionSpacing)).force("charge",Cm().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function tI({visibleComputedLayoutData:t,LastBubbleDataMap:e,graphicWidth:n,graphicHeight:r,SeriesContainerPositionMap:i,scaleType:o}){const a=Math.min(n,r)/2,s=t.flat(),u=s.reduce((h,p)=>h+p.value,0),l=Kr().domain([0,u]).range([0,a]).exponent(o==="area"?.5:1),c=o==="area"?1:(()=>{const h=a*a*Math.PI;return Math.sqrt(h/Mg(s,p=>Math.PI*Math.pow(l(p.value),2)))})(),f=.9;return s.map(h=>{const p=h,d=e.get(p.id);if(d)p.x=d.x,p.y=d.y;else{const m=i.get(p.seriesLabel);p.x=Math.random()*m.width,p.y=Math.random()*m.height}const g=l(p.value??0)*c*f;return p.r=g,p._originR=g,p})}function eI({selection:t,bubblesData:e,fullParams:n,sumSeries:r}){const i=t.selectAll("g").data(e,a=>a.id).join(a=>{const s=a.append("g").attr("cursor","pointer").attr("font-size",12).style("fill","#ffffff").attr("text-anchor","middle");return s.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",u=>u.color),s.append("text").style("opacity",.8).attr("pointer-events","none"),s},a=>a,a=>a.remove()).attr("transform",a=>`translate(${a.x},${a.y})`),o=r?"seriesLabel":"label";return i.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),i.each((a,s,u)=>{const l=X(u[s]);let c=!0;a[o].length<=n.bubbleText.lineLengthMin&&(c=!1),l.call(Qk,{text:a[o],radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:c})}),i}function nI(){return Hg().on("start",(t,e)=>{t.active||Sn.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||Sn.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function rI({fullParams:t,SeriesContainerPositionMap:e}){Sn.force("x",Em().strength(t.force.strength).x(n=>e.get(n.seriesLabel).centerX)).force("y",Rm().strength(t.force.strength).y(n=>e.get(n.seriesLabel).centerY)),Sn.alpha(1).restart()}function iI({bubblesSelection:t,highlightIds:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1);return}t.each((r,i,o)=>{const a=X(o[i]);e.includes(r.id)?a.style("opacity",1).transition("highlight").ease(ji).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const oI=Cn("Bubbles",rx)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et;let o=new Map;const a=n.fullDataFormatter$.pipe(O(f=>f.sumSeries),rt()),s=n.fullParams$.pipe(I(i),O(f=>f.arcScaleType),rt()),u=B({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedLayoutData:n.visibleComputedLayoutData$,scaleType:s}).pipe(I(i),Y(async f=>f),O(f=>tI({visibleComputedLayoutData:f.visibleComputedLayoutData,LastBubbleDataMap:o,graphicWidth:f.layout.width,graphicHeight:f.layout.height,SeriesContainerPositionMap:f.SeriesContainerPositionMap,scaleType:f.scaleType})),Pt(1));u.subscribe(f=>{o=new Map(f.map(h=>[h.id,h]))});const l=n.fullChartParams$.pipe(I(i),O(f=>f.highlightTarget),rt()),c=B({bubblesData:u,fullParams:n.fullParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:a}).pipe(I(i),Y(async f=>f),O(f=>{Sn&&Sn.stop();const h=eI({selection:t,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return Sn=Jk(h,f.fullParams),Sn.nodes(f.bubblesData),rI({fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),h}));return B({bubblesSelection:c,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:l}).pipe(I(i),Y(async f=>f)).subscribe(f=>{f.bubblesSelection.on("mouseover",(h,p)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mousemove",(h,p)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mouseout",(h,p)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("click",(h,p)=>{r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).call(nI())}),B({bubblesSelection:c,bubblesData:u,highlight:n.seriesHighlight$.pipe(O(f=>f.map(h=>h.id))),fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,sumSeries:a,SeriesContainerPositionMap:n.SeriesContainerPositionMap$}).pipe(I(i),Y(async f=>f)).subscribe(f=>{iI({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function cx({data:t,startAngle:e,endAngle:n}){return pv().startAngle(e).endAngle(n).value(o=>o.value).sort((o,a)=>o.seq-a.seq)(t).map((o,a)=>{let s=o;return s.id=o.data.id,s})}function aI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r}){const i=at(e,"series");return B({seriesLabels:r,separateSeries:n}).pipe(Y(async o=>o),O((o,a)=>{const s=o.separateSeries?o.seriesLabels:[o.seriesLabels.join("")];return t.selectAll(`g.${i}`).data(s,u=>u).join(u=>u.append("g").classed(i,!0),u=>u,u=>u.remove())}),Pt(1))}const Io=({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=aI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r});return B({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(Y(async a=>a),rt((a,s)=>a.seriesContainerPosition.length===s.seriesContainerPosition.length)).subscribe(a=>{a.seriesCenterSelection.attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),B({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(Y(async a=>a)).subscribe(a=>{a.seriesCenterSelection.transition().attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),{seriesCenterSelection$:o}},jh="Pie";function sI({enter:t,exit:e,data:n,lastTweenData:r,fullParams:i}){return!t.size()&&!e.size()?o=>{const a=n.map((s,u)=>{const l=r[u]??{startAngle:0,endAngle:0,value:0};return{...s,startAngle:s.startAngle*o+l.startAngle*(1-o),endAngle:s.endAngle*o+l.endAngle*(1-o),value:s.value*o+l.value*(1-o)}});return qh(a,i.startAngle,i.endAngle,1)}:o=>qh(n,i.startAngle,i.endAngle,o)}function qh(t,e,n,r){return t.map((i,o)=>{const a=e+(i.startAngle-e)*r,s=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:s}})}function fx({selection:t,data:e,arc:n,pathClassName:r}){return t.selectAll("path").data(e,o=>o.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(o,a)=>o.data.color).attr("d",(o,a)=>n(o))}function uI({pathSelection:t,ids:e,fullChartParams:n,arc:r,arcHighlight:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}t.each((o,a,s)=>{const u=X(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(ji).duration(500).attr("d",l=>i(l)):u.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>r(l))})}function lI(t,e){const n=new et,r=at(t,"path");let i=[],o=[];const a=e.seriesContainerPosition$.pipe(I(n),O(h=>h.width<h.height?h.width:h.height),rt()),s=new pt(h=>{B({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),Y(async p=>p)).subscribe(p=>{const d=cx({data:p.containerVisibleComputedLayoutData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});h.next(d)})}),u=new pt(h=>{B({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),Y(async p=>p)).subscribe(p=>{const d=Tu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),l=new pt(h=>{B({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),Y(async p=>p)).subscribe(p=>{const d=Tu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),c=e.fullChartParams$.pipe(I(n),O(h=>h.highlightTarget),rt()),f=new pt(h=>{B({pieData:s,arc:u,computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:c}).pipe(I(n),Y(async p=>p)).subscribe(p=>{e.containerSelection.interrupt("graphicMove");const d=e.containerSelection.selectAll("path").data(p.pieData,x=>x.id),g=d.enter(),m=d.exit(),b=sI({enter:g,exit:m,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});e.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(x,v)=>y=>{o=b(y),fx({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r})}).on("end",(x,v)=>{o=qh(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const y=fx({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r});h.next(y),i=Object.assign([],p.pieData),e.event$.next({type:"series",pluginName:t,eventName:"transitionEnd",event:void 0,highlightTarget:p.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:p.computedData})})})}).pipe(Pt(1));return B({pathSelection:f,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:c}).pipe(I(n),Y(async h=>h)).subscribe(h=>{h.pathSelection.on("mouseover",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})})}),B({pathSelection:f,highlight:e.seriesHighlight$.pipe(O(h=>h.map(p=>p.id))),fullChartParams:e.fullChartParams$,arc:u,arcHighlight:l}).pipe(I(n),Y(async h=>h)).subscribe(h=>{uI({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const cI=Cn(jh,ix)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,{seriesCenterSelection$:o}=Io({selection:t,pluginName:jh,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=X(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),O(d=>d[l]??d[0])),p=r.seriesContainerPosition$.pipe(I(i),O(d=>d[l]??d[0]));a[l]=lI(jh,{containerSelection:f,computedData$:r.computedData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),ku="PieEventTexts",hx=at(ku,"text");function Xh(t,e){const n=t.selectAll(`text.${hx}`).data(e),r=n.enter().append("text").classed(hx,!0),i=n.merge(r);return i.each((o,a,s)=>{const u=X(s[a]).text(o.text);Object.keys(o.attr).forEach(l=>{u.attr(l,o.attr[l])}),Object.keys(o.style).forEach(l=>{u.style(l,o.style[l])})}),n.exit().remove(),i}function Zh({eventData:t,eventName:e,t:n,eventFn:r,textAttrs:i,textStyles:o}){return r(t,e,n).map((s,u)=>({text:s,attr:i[u],style:o[u]}))}function fI(t,e){const n=new et;let r;const i=e.fullChartParams$.pipe(I(n),O(o=>o.highlightTarget),rt());return B({computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:i}).pipe(I(n),Y(async o=>o)).subscribe(o=>{e.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>u=>{const l=Zh({eventData:{type:"series",pluginName:t,eventName:"transitionMove",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:u,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});Xh(e.containerSelection,l)}).on("end",(a,s)=>{const u=Zh({eventData:{type:"series",pluginName:t,eventName:"transitionEnd",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});Xh(e.containerSelection,u),r&&r.unsubscribe(),r=e.event$.subscribe(l=>{const c=Zh({eventData:l,eventName:l.eventName,t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});Xh(e.containerSelection,c)})})}),()=>{n.next(void 0)}}const hI=Cn(ku,ox)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,{seriesCenterSelection$:o}=Io({selection:t,pluginName:ku,separateSeries$:n.separateSeries$,seriesLabels$:n.seriesLabels$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=X(c[l]),h=n.computedLayoutData$.pipe(I(i),O(d=>d[l]??d[0])),p=n.seriesContainerPosition$.pipe(I(i),O(d=>d[l]??d[0]));a[l]=fI(ku,{containerSelection:f,computedData$:n.computedData$,containerComputedLayoutData$:h,SeriesDataMap$:n.SeriesDataMap$,fullParams$:n.fullParams$,fullChartParams$:n.fullChartParams$,seriesHighlight$:n.seriesHighlight$,seriesContainerPosition$:p,event$:r.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),Iu="PieLabels",pI=at(Iu,"text");function dI(t,e,n,r){return t.map((i,o)=>{const[a,s]=e.centroid(i),[u,l]=n.centroid(i);return{pieDatum:i,arcIndex:o,arcLabel:i.data.label,x:a*r,y:s*r,mouseoverX:u*r,mouseoverY:l*r}}).filter(i=>i.pieDatum.data.visible)}function gI(t,e,n,r){let i=t.selectAll("text").data(e,u=>u.pieDatum.id),o=i.enter().append("text").classed(pI,!0),a=i.exit();o.append("text");const s=i.merge(o);return s.attr("font-weight","bold").attr("text-anchor","middle").style("dominant-baseline","middle").style("cursor",u=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").text(u=>n.labelFn(u.pieDatum.data)).attr("font-size",r.styles.textSize).attr("fill",(u,l)=>Lu({datum:u.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).transition().attr("transform",u=>"translate("+u.x+","+u.y+")"),a.remove(),s}function mI({labelSelection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition().duration(200).attr("transform",r=>"translate("+r.x+","+r.y+")").style("opacity",1);return}t.each((r,i,o)=>{const a=X(o[i]);e.includes(r.pieDatum.id)?a.style("opacity",1).transition().duration(200).attr("transform",s=>"translate("+s.mouseoverX+","+s.mouseoverY+")"):a.style("opacity",n.styles.unhighlightedOpacity).transition().duration(200).attr("transform",s=>"translate("+s.x+","+s.y+")")})}function yI(t,e){const n=new et;let r=new et,i=[];const o=e.seriesContainerPosition$.pipe(I(n),O(a=>a.width<a.height?a.width:a.height),rt());return B({shorterSideWith:o,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),Y(async a=>a)).subscribe(a=>{const s=Tu({axisWidth:a.shorterSideWith,innerRadius:0,outerRadius:a.fullParams.outerRadius,padAngle:0,cornerRadius:0}),u=Tu({axisWidth:a.shorterSideWith,innerRadius:0,outerRadius:a.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),l=cx({data:a.containerVisibleComputedLayoutData,startAngle:a.fullParams.startAngle,endAngle:a.fullParams.endAngle});i=dI(l,s,u,a.fullParams.labelCentroid);const c=gI(e.containerSelection,i,a.fullParams,a.fullChartParams);r.next(c)}),B({labelSelection:r,highlight:e.seriesHighlight$.pipe(O(a=>a.map(s=>s.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),Y(async a=>a)).subscribe(a=>{mI({labelSelection:a.labelSelection,ids:a.highlight,fullChartParams:a.fullChartParams})}),()=>{n.next(void 0)}}const bI=Cn(Iu,ax)(({selection:t,observer:e,subject:n})=>{const r=new et,{seriesCenterSelection$:i}=Io({selection:t,pluginName:Iu,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=X(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),O(p=>p[u]??p[0])),h=e.seriesContainerPosition$.pipe(I(r),O(p=>p[u]??p[0]));o[u]=yI(Iu,{containerSelection:c,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),Kh="Rose",vI=Math.PI*2,px=0;function xI({cornerRadius:t,outerRadius:e,axisWidth:n,maxValue:r,arcScaleType:i}){const o=n/2*e,a=i==="area"?.5:1,s=Kr().domain([0,r]).range([0,o]).exponent(a);return u=>{const l=s(u.prevValue),c=s(u.value),f=qe(l,c);return h=>{const p=f(h);return mu().innerRadius(0).outerRadius(p).padAngle(px).padRadius(p).cornerRadius(t)(u)}}}function _I({pathSelection:t,ids:e,fullParams:n,fullChartParams:r,tweenArc:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>i(o)(1));return}t.each((o,a,s)=>{const u=X(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(ji).duration(500).attr("d",l=>i({...l,startAngle:l.startAngle-n.mouseoverAngleIncrease,endAngle:l.endAngle+n.mouseoverAngleIncrease})(1)):u.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>i(l)(1))})}function wI(t,e){const n=new et,r=at(t,"path");let i=[];const o=e.seriesContainerPosition$.pipe(I(n),O(p=>p.width<p.height?p.width:p.height),rt()),a=B({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),Y(async p=>p),O(p=>{const d=vI/p.containerVisibleComputedLayoutData.length;return p.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:d*m,endAngle:d*(m+1),padAngle:px,prevValue:i[m]&&i[m].id===g.id?i[m].value:0}))})),s=e.fullChartParams$.pipe(I(n),O(p=>p.highlightTarget),rt()),u=e.visibleComputedLayoutData$.pipe(O(p=>Math.max(...p.flat().map(d=>d.value))),rt()),l=B({fullParams:e.fullParams$,axisWidth:o,maxValue:u}).pipe(I(n),Y(async p=>p),O(p=>xI({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType}))),c=e.fullChartParams$.pipe(I(n),O(p=>p.transitionDuration),rt()),f=new kx(!1),h=new pt(p=>{B({pieData:a,tweenArc:l,transitionDuration:c}).pipe(I(n),Y(async d=>d)).subscribe(d=>{const g=d.pieData.map((b,x)=>(b.prevValue=i[x]&&i[x].id===b.id?i[x].value:0,b));f.next(!0);const m=e.containerSelection.selectAll("path").data(g,b=>b.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(b,x)=>b.data.color);m.interrupt("graphicMove"),m.transition("graphicMove").duration(d.transitionDuration).attrTween("d",d.tweenArc).on("end",()=>{p.next(m),f.next(!1)}),i=Object.assign([],g)})}).pipe(Pt(1));return B({pathSelection:h,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:s}).pipe(I(n),Y(async p=>p)).subscribe(p=>{p.pathSelection.on("mouseover",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mousemove",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mouseout",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("click",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})})}),B({pathSelection:h,highlight:e.seriesHighlight$.pipe(O(p=>p.map(d=>d.id))),fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,tweenArc:l,isTransitionMoving:f}).pipe(I(n),Y(async p=>p),li(p=>!p.isTransitionMoving)).subscribe(p=>{_I({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const $I=Cn(Kh,sx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,{seriesCenterSelection$:o}=Io({selection:t,pluginName:Kh,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=X(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),O(d=>JSON.parse(JSON.stringify(d[l]??d[0])))),p=r.seriesContainerPosition$.pipe(I(i),O(d=>JSON.parse(JSON.stringify(d[l]??d[0]))));a[l]=wI(Kh,{containerSelection:f,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),Nu="RoseLabels",SI=at(Nu,"text");function AI({pieData:t,centroid:e,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o}){const a=i/2*o,s=n==="area"?.5:1,u=Kr().domain([0,r]).range([0,a]).exponent(s);return t.map((l,c)=>{const f=u(l.value),h=mu().innerRadius(0).outerRadius(f).padAngle(0).padRadius(f).cornerRadius(0),[p,d]=h.centroid(l),[g,m]=[p,d];return{pieDatum:l,arcIndex:c,arcLabel:l.data.label,x:p*e,y:d*e,mouseoverX:g*e,mouseoverY:m*e}}).filter(l=>l.pieDatum.data.visible)}function MI(t,e,n,r){let i=t.selectAll("text").data(e,u=>u.pieDatum.id),o=i.enter().append("text").classed(SI,!0),a=i.exit();o.append("text");const s=i.merge(o);return s.attr("font-weight","bold").attr("text-anchor","middle").style("dominant-baseline","middle").style("cursor",u=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").text(u=>n.labelFn(u.pieDatum.data)).attr("font-size",r.styles.textSize).attr("fill",(u,l)=>Lu({datum:u.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).transition().attr("transform",u=>"translate("+u.x+","+u.y+")"),a.remove(),s}function DI({labelSelection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition().duration(200).attr("transform",r=>"translate("+r.x+","+r.y+")").style("opacity",1);return}t.each((r,i,o)=>{const a=X(o[i]);e.includes(r.pieDatum.data.id)?a.style("opacity",1).transition().duration(200).attr("transform",s=>"translate("+s.mouseoverX+","+s.mouseoverY+")"):a.style("opacity",n.styles.unhighlightedOpacity).transition().duration(200).attr("transform",s=>"translate("+s.x+","+s.y+")")})}function PI(t,e){const n=new et;let r=new et,i=[];const o=e.seriesContainerPosition$.pipe(I(n),O(s=>s.width<s.height?s.width:s.height),rt()),a=e.visibleComputedLayoutData$.pipe(O(s=>Math.max(...s.flat().map(u=>u.value))),rt());return B({shorterSideWith:o,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,maxValue:a,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),Y(async s=>s)).subscribe(s=>{const u=Math.PI*2/s.containerVisibleComputedLayoutData.length,l=s.containerVisibleComputedLayoutData.map((f,h)=>({id:f.id,data:f,index:h,value:f.value,startAngle:u*h,endAngle:u*(h+1),padAngle:0}));i=AI({pieData:l,centroid:s.fullParams.labelCentroid,arcScaleType:s.fullParams.arcScaleType,maxValue:s.maxValue,axisWidth:s.shorterSideWith,outerRadius:s.fullParams.outerRadius});const c=MI(e.containerSelection,i,s.fullParams,s.fullChartParams);r.next(c)}),B({labelSelection:r,highlight:e.seriesHighlight$.pipe(O(s=>s.map(u=>u.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),Y(async s=>s)).subscribe(s=>{DI({labelSelection:s.labelSelection,ids:s.highlight,fullChartParams:s.fullChartParams})}),()=>{n.next(void 0)}}const TI=Cn(Nu,ux)(({selection:t,observer:e,subject:n})=>{const r=new et,{seriesCenterSelection$:i}=Io({selection:t,pluginName:Nu,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=X(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),O(p=>JSON.parse(JSON.stringify(p[u]??p[0])))),h=e.seriesContainerPosition$.pipe(I(r),O(p=>JSON.parse(JSON.stringify(p[u]??p[0]))));o[u]=PI(Nu,{containerSelection:c,visibleComputedLayoutData$:e.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),dx="SeriesLegend",LI=Cn(dx,lx)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new et,o=n.SeriesDataMap$.pipe(I(i),O(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),O(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Cu(dx,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),gx={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(t,e)=>e.value-t.value},mx={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},yx="TreeLegend",CI=ng(yx,mx)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new et,o=n.CategoryDataMap$.pipe(I(i),O(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),O(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Cu(yx,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),sr="TreeMap",bx=at(sr,"tree"),vx=at(sr,"tile");function EI({selection:t,treeData:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=t.selectAll(`g.${bx}`).data(e,u=>u.data.id).join("g").attr("class",bx);return s.attr("transform",u=>!u.x0||!u.y0?null:`translate(${u.x0},${u.y0})`).each((u,l,c)=>{const f=X(c[l]);f.selectAll(`rect.${vx}`).data([u],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",vx).attr("cursor","pointer").attr("width",h=>h.x1-h.x0).attr("height",h=>h.y1-h.y0).attr("fill",h=>h.data.color).attr("data-name",h=>h.data.label).attr("data-category",h=>h.data.categoryLabel).attr("data-value",h=>h.data.value),f.selectAll("g").data([u]).join("g").each((h,p,d)=>{X(d[p]).selectAll("text").data([h]).join("text").text(m=>m.data.label).attr("dominant-baseline","hanging").attr("x",o).attr("y",o).attr("font-size",r.styles.textSize).each(function(m){const b=X(this),x=m.data.label.split(/\s+/).reverse();let v,y=[];const w=b.attr("x");let D=b.attr("y"),P=0,S=b.text(null).append("tspan").attr("cursor","pointer").attr("fill",Ct(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",w).attr("y",D);for(;v=x.pop();)y.push(v),S.text(y.join(" ")),S.node().getComputedTextLength()>m.x1-m.x0-o&&(y.pop(),S.text(y.join(" ")),y=[v],P+=a,S=b.append("tspan").attr("cursor","pointer").attr("fill",Ct(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",w).attr("y",D).attr("dy",P+"px").text(v))})})}),s}function RI({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.data.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const kI=ng(sr,gx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=B({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(I(i),Y(async u=>u),O(u=>{const l=$y().size([u.layout.width,u.layout.height]).paddingInner(u.fullParams.paddingInner).paddingOuter(u.fullParams.paddingOuter).round(!0).tile(Wf.ratio(u.fullParams.squarifyRatio)),c=js(u.visibleComputedData).sum(h=>h.value).sort(u.fullParams.sort);return l(c),c.leaves()})),a=B({selection:Bo(t),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(I(i),Y(async u=>u),O(u=>EI({selection:t,treeData:u.treeData,fullParams:u.fullParams,fullChartParams:u.fullChartParams,textSizePx:u.textSizePx}))),s=r.fullChartParams$.pipe(I(i),O(u=>u.highlightTarget),rt());return B({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(I(i),Y(async u=>u)).subscribe(u=>{u.cellSelection.on("mouseover",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:sr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mousemove",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mousemove",pluginName:sr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mouseout",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseout",pluginName:sr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("click",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"click",pluginName:sr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})})}),B({cellSelection:a,highlight:r.treeHighlight$.pipe(O(u=>u.map(l=>l.id))),fullChartParams:r.fullChartParams$}).pipe(I(i),Y(async u=>u)).subscribe(u=>{RI({selection:u.cellSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{i.next(void 0)}});Z.BarStack=ik,Z.Bars=ZR,Z.BarsPN=KR,Z.BarsTriangle=hk,Z.Bubbles=oI,Z.CONTAINER_PLUGIN_PARAMS=tx,Z.Container=jk,Z.DEFAULT_BARS_DIVERGING_PARAMS=xx,Z.DEFAULT_BARS_PARAMS=Fo,Z.DEFAULT_BARS_TRIANGLE_PARAMS=np,Z.DEFAULT_BAR_STACK_PARAMS=ep,Z.DEFAULT_BUBBLES_PARAMS=rx,Z.DEFAULT_DOTS_PARAMS=Jh,Z.DEFAULT_GRID_LEGEND_PARAMS=ap,Z.DEFAULT_GROUP_AREA_PARAMS=tp,Z.DEFAULT_GROUP_AXIS_PARAMS=rp,Z.DEFAULT_LINES_PARAMS=ur,Z.DEFAULT_LINE_AREAS_PARAMS=Qh,Z.DEFAULT_MULTI_BARS_PARAMS=C2,Z.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=R2,Z.DEFAULT_MULTI_BAR_STACK_PARAMS=E2,Z.DEFAULT_MULTI_DOTS_PARAMS=N2,Z.DEFAULT_MULTI_GRID_LEGEND_PARAMS=T2,Z.DEFAULT_MULTI_GROUP_AXIS_PARAMS=L2,Z.DEFAULT_MULTI_LINES_PARAMS=k2,Z.DEFAULT_MULTI_LINE_AREAS_PARAMS=I2,Z.DEFAULT_MULTI_VALUE_AXIS_PARAMS=Ru,Z.DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS=Rk,Z.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=kh,Z.DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS=F2,Z.DEFAULT_PIE_EVENT_TEXTS_PARAMS=ox,Z.DEFAULT_PIE_LABELS_PARAMS=ax,Z.DEFAULT_PIE_PARAMS=ix,Z.DEFAULT_ROSE_LABELS_PARAMS=ux,Z.DEFAULT_ROSE_PARAMS=sx,Z.DEFAULT_SCALING_AREA_PARAMS=op,Z.DEFAULT_SERIES_LEGEND_PARAMS=lx,Z.DEFAULT_TREE_LEGEND_PARAMS=mx,Z.DEFAULT_TREE_MAP_PARAMS=gx,Z.DEFAULT_VALUE_AXIS_PARAMS=Fu,Z.DEFAULT_VALUE_STACK_AXIS_PARAMS=ip,Z.Dots=mk,Z.GridLegend=bk,Z.GroupAux=Ek,Z.GroupAxis=xk,Z.LineAreas=YR,Z.Lines=NR,Z.MultiBarStack=Nk,Z.MultiBars=Ik,Z.MultiBarsTriangle=Fk,Z.MultiDots=Ok,Z.MultiGridLegend=kk,Z.MultiGroupAxis=Uk,Z.MultiLineAreas=zk,Z.MultiLines=Gk,Z.MultiValueAxis=Bk,Z.MultiValueStackAxis=Yk,Z.OverlappingValueAxes=Wk,Z.OverlappingValueStackAxes=Vk,Z.Pie=cI,Z.PieEventTexts=hI,Z.PieLabels=bI,Z.Rose=$I,Z.RoseLabels=TI,Z.ScalingArea=Ak,Z.SeriesLegend=LI,Z.TOOLTIP_PARAMS=ex,Z.Tooltip=Kk,Z.TreeLegend=CI,Z.TreeMap=kI,Z.ValueAxis=wk,Z.ValueStackAxis=$k,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
|
15
|
+
`})}function ck({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function fk({selection:t,ids:e,fullChartParams:n}){t.interrupt("highlight");const r=()=>{t.transition("highlight").duration(200).style("opacity",1)};if(!e.length){r();return}t.each((i,o,a)=>{e.includes(i.id)?X(a[o]).style("opacity",1):X(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const m2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,fullDataFormatter$:a,seriesLabels$:s,SeriesDataMap$:u,GroupDataMap$:l,fullParams$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,isSeriesSeprate$:b,event$:x})=>{const v=new et,y=$n(t,"clipPath-box"),w=at(t,"pathG"),D=at(t,"path"),{seriesSelection$:P,axesSelection$:S,defsSelection$:_,graphicGSelection$:T}=ar({selection:e,pluginName:t,clipPathID:y,seriesLabels$:s,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(I(v),O(E=>-E.translate[1]/E.scale[1]));const $=o.pipe(O(E=>E.map(G=>G[0]?G[0].axisY-G[0].axisYFromZero:0)),rt()),N=B({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:b}).pipe(I(v),Y(async E=>E),O(E=>E.params.barWidth?E.params.barWidth:E.isSeriesSeprate?g2({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):g2({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:E.visibleComputedData.length,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}))),R=i.pipe(I(v),O(E=>{const G=new Set;return E.forEach(j=>{j.forEach(Q=>{G.add(Q.groupLabel)})}),Array.from(G)})),A=new pt(E=>{B({seriesLabels:s,barWidth:N,params:c}).pipe(I(v),Y(async G=>G)).subscribe(G=>{const j=ok(G.barWidth,G.seriesLabels,G.params);E.next(j)})}),L=f.pipe(I(v),O(E=>E.transitionDuration),rt()),M=new pt(E=>{B({groupLabels:R,transitionDuration:L}).pipe(Y(async G=>G)).subscribe(G=>{const j=ak(G.groupLabels.length,G.transitionDuration);E.next(j)})}).pipe(I(v),rt()),z=new pt(E=>{B({groupLabels:R,transitionDuration:L}).pipe(Y(async G=>G)).subscribe(G=>{const j=sk(G.groupLabels.length,G.transitionDuration);E.next(j)})}).pipe(I(v),rt());B({defsSelection:_,gridAxesSize:d}).pipe(I(v),Y(async E=>E)).subscribe(E=>{const G=[{id:y,width:E.gridAxesSize.width,height:E.gridAxesSize.height}];ck({defsSelection:E.defsSelection,clipPathData:G})});const U=f.pipe(I(v),O(E=>E.highlightTarget),rt()),C=s.pipe(I(v),O(E=>E.map((G,j)=>$n(t,`lineargradient-${G}`)))),k=B({graphicGSelection:T,defsSelection:_,computedData:n,visibleComputedLayoutData:o,linearGradientIds:C,zeroYArr:$,groupLabels:R,barScale:A,params:c,chartParams:f,barWidth:N,delayGroup:M,transitionItem:z,isSeriesSeprate:b}).pipe(I(v),Y(async E=>E),O(E=>(lk({defsSelection:E.defsSelection,computedData:E.computedData,linearGradientIds:E.linearGradientIds,params:E.params}),uk({graphicGSelection:E.graphicGSelection,pathGClassName:w,pathClassName:D,visibleComputedLayoutData:E.visibleComputedLayoutData,linearGradientIds:E.linearGradientIds,zeroYArr:E.zeroYArr,groupLabels:E.groupLabels,barScale:E.barScale,params:E.params,chartParams:E.chartParams,barWidth:E.barWidth,delayGroup:E.delayGroup,transitionItem:E.transitionItem,isSeriesSeprate:E.isSeriesSeprate}))));return B({barSelection:k,computedData:n,highlightTarget:U,SeriesDataMap:u,GroupDataMap:l}).subscribe(E=>{E.barSelection.on("mouseover",(G,j)=>{G.stopPropagation(),x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:G,data:E.computedData})}).on("mousemove",(G,j)=>{G.stopPropagation(),x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:G,data:E.computedData})}).on("mouseout",(G,j)=>{G.stopPropagation(),x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:G,data:E.computedData})}).on("click",(G,j)=>{G.stopPropagation(),x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:G,data:E.computedData})})}),B({barSelection:k,highlight:g.pipe(O(E=>E.map(G=>G.id))),fullChartParams:f}).pipe(I(v),Y(async E=>E)).subscribe(E=>{fk({selection:E.barSelection,ids:E.highlight,fullChartParams:E.fullChartParams})}),()=>{v.next(void 0)}},y2="BarsTriangle",hk=se(y2,np)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=m2(y2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,fullDataFormatter$:r.fullDataFormatter$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}});function pk({graphicGSelection:t,circleGClassName:e,circleClassName:n,visibleComputedLayoutData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let u=0;return t.each((c,f,h)=>{X(h[f]).selectAll("g").data(r[f],p=>p.id).join(p=>(u=s(p),p.append("g").classed(e,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,g)=>{X(g[d]).selectAll("circle").data([p]).join(m=>m.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((b,x)=>d*u).attr("opacity",1),m=>m.transition().duration(50).attr("opacity",1),m=>m.remove()).attr("r",i.radius).attr("fill",(m,b)=>Lu({datum:m,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(m,b)=>Lu({datum:m,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),t.selectAll(`circle.${n}`)}function dk({selection:t,ids:e,onlyShowHighlighted:n,fullChartParams:r}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",n===!0?0:1);return}t.each((i,o,a)=>{e.includes(i.id)?X(a[o]).style("opacity",1).transition("highlight").duration(200):X(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function gk({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const b2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,event$:b})=>{const x=new et,v=$n(t,"clipPath-box"),y=at(t,"circleG"),w=at(t,"circle"),{seriesSelection$:D,axesSelection$:P,defsSelection$:S,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),T=B({computedData:n,gridGraphicReverseScale:p}).pipe(I(x),Y(async A=>A),O(A=>A.computedData.map((L,M)=>A.gridGraphicReverseScale[M])));B({defsSelection:S,gridAxesSize:d}).pipe(I(x),Y(async A=>A)).subscribe(A=>{const L=[{id:v,width:A.gridAxesSize.width,height:A.gridAxesSize.height}];gk({defsSelection:A.defsSelection,clipPathData:L})});const $=c.pipe(I(x),O(A=>A.highlightTarget),rt()),N=B({graphicGSelection:_,visibleComputedLayoutData:o,graphicReverseScale:T,fullChartParams:c,fullParams:l}).pipe(I(x),Y(async A=>A),O(A=>pk({graphicGSelection:A.graphicGSelection,circleGClassName:y,circleClassName:w,visibleComputedLayoutData:A.visibleComputedLayoutData,fullParams:A.fullParams,fullChartParams:A.fullChartParams,graphicReverseScale:A.graphicReverseScale})));B({graphicSelection:N,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:$}).pipe(I(x),Y(async A=>A)).subscribe(A=>{A.graphicSelection.on("mouseover",(L,M)=>{L.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:A.highlightTarget,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L,data:A.computedData})}).on("mousemove",(L,M)=>{L.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:A.highlightTarget,data:A.computedData,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L})}).on("mouseout",(L,M)=>{L.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:A.highlightTarget,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L,data:A.computedData})}).on("click",(L,M)=>{L.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:A.highlightTarget,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L,data:A.computedData})})});const R=l.pipe(I(x),O(A=>A.onlyShowHighlighted),rt());return B({graphicSelection:N,highlight:g.pipe(O(A=>A.map(L=>L.id))),onlyShowHighlighted:R,fullChartParams:c}).pipe(I(x),Y(async A=>A)).subscribe(A=>{dk({selection:A.graphicSelection,ids:A.highlight,onlyShowHighlighted:A.onlyShowHighlighted,fullChartParams:A.fullChartParams})}),()=>{x.next(void 0)}},v2="Dots",mk=se(v2,Jh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=b2(v2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,event$:n.event$});return()=>{i.next(void 0),o()}}),yk={listRectWidth:14,listRectHeight:14,listRectRadius:0};function x2(t,e){const n=t<e.colors[e.colorScheme].series.length?t:t%e.colors[e.colorScheme].series.length;return e.colors[e.colorScheme].series[n]}const Cu=(t,{rootSelection:e,seriesLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=at(t,"root-position"),u=at(t,"legend-card"),l=at(t,"legend-list"),c=at(t,"legend-item"),f=new et,h=B({seriesLabels:n,fullChartParams:o}).pipe(I(f),Y(async _=>_),O(_=>{const T=new Map;let $=0;return _.seriesLabels.forEach((N,R)=>{if(!T.has(N)){const A=x2($,_.fullChartParams);T.set(N,A),$++}}),T})),p=n.pipe(I(f),O(_=>{const T=new Set;let $=[];return _.forEach(N=>{T.has(N)?$.push(!1):$.push(!0),T.add(N)}),$})),d=r.pipe(I(f),O(_=>_.position==="bottom"||_.position==="top"?"row":"column")),g=B({fullParams:r,layout:i}).pipe(I(f),Y(async _=>_),O(_=>{const T=_.fullParams.padding*2+_.fullParams.gap*2;return _.fullParams.position==="bottom"||_.fullParams.position==="top"?_.layout.rootWidth-T:_.layout.rootHeight-T})),b=B({layout:i,fullParams:r}).pipe(I(f),Y(async _=>_),O(_=>{let T=0,$=0;return _.fullParams.position==="bottom"?($=_.layout.rootHeight,_.fullParams.justify==="start"?T=0:_.fullParams.justify==="center"?T=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(T=_.layout.rootWidth)):_.fullParams.position==="right"?(T=_.layout.rootWidth,_.fullParams.justify==="start"?$=0:_.fullParams.justify==="center"?$=_.layout.rootHeight/2:_.fullParams.justify==="end"&&($=_.layout.rootHeight)):_.fullParams.position==="top"?($=0,_.fullParams.justify==="start"?T=0:_.fullParams.justify==="center"?T=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(T=_.layout.rootWidth)):_.fullParams.position==="left"&&(T=0,_.fullParams.justify==="start"?$=0:_.fullParams.justify==="center"?$=_.layout.rootHeight/2:_.fullParams.justify==="end"&&($=_.layout.rootHeight)),{x:T,y:$}})).pipe(I(f),O(_=>e.selectAll(`g.${s}`).data([_]).join(T=>T.append("g").classed(s,!0).attr("transform",$=>`translate(${$.x}, ${$.y})`),T=>T.transition().attr("transform",$=>`translate(${$.x}, ${$.y})`),T=>T.remove()))),x=r.pipe(I(f),O(_=>_.seriesList[0]?_.seriesList[0]:yk)),v=B({visibleList:p,fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:d,lineMaxSize:g,defaultListStyle:x,SeriesLabelColorMap:h,textSizePx:a}).pipe(I(f),Y(async _=>_),O(_=>_.seriesLabels.reduce((T,$,N)=>{if(!_.visibleList[N])return T;const R=n2($,_.textSizePx),A=_.textSizePx*1.5+R,L=_.SeriesLabelColorMap.get($),M=T[0]&&T[0][0]?T[T.length-1][T[T.length-1].length-1]:null,{translateX:z,translateY:U,lineIndex:C,itemIndex:k}=((G,j,Q)=>{let F=0,q=0,V=0,K=0;if(G.lineDirection==="column"){let W=Q?Q.translateY+G.textSizePx+G.fullParams.gap:0;if(W+G.textSizePx>G.lineMaxSize){V=Q.lineIndex+1,K=0,q=0;const nt=j[j.length-1].reduce((ut,H)=>H.itemWidth>ut?H.itemWidth:ut,0);F=Q.translateX+nt+G.fullParams.gap}else V=Q?Q.lineIndex:0,K=Q?Q.itemIndex+1:0,q=W,F=Q?Q.translateX:0}else{let W=Q?Q.translateX+Q.itemWidth+G.fullParams.gap:0;W+A>G.lineMaxSize?(V=Q.lineIndex+1,K=0,F=0):(V=Q?Q.lineIndex:0,K=Q?Q.itemIndex+1:0,F=W),q=(G.textSizePx+G.fullParams.gap)*V}return{translateX:F,translateY:q,lineIndex:V,itemIndex:K}})(_,T,M);T[C]||(T[C]=[]);const E=_.fullParams.seriesList[k]?_.fullParams.seriesList[k]:_.defaultListStyle;return T[C].push({id:$,seriesLabel:$,seriesIndex:N,lineIndex:C,itemIndex:k,text:$,itemWidth:A,translateX:z,translateY:U,color:L,listRectWidth:E.listRectWidth,listRectHeight:E.listRectHeight,listRectRadius:E.listRectRadius}),T},[])),Pt(1)),y=B({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:v,textSizePx:a}).pipe(I(f),Y(async _=>_),O(_=>{const{width:T,height:$}=((N,R)=>{let A=0,L=0;if(!R.length||!R[0].length)return{width:A,height:L};const M=R[0][R[0].length-1];return N.lineDirection==="column"?(A=R.reduce((z,U)=>{const C=U.reduce((k,E)=>E.itemWidth>k?E.itemWidth:k,0);return z+C},0),A+=N.fullParams.gap*(R.length-1),L=M.translateY+N.textSizePx):(A=M.translateX+M.itemWidth,L=N.textSizePx*R.length+N.fullParams.gap*(R.length-1)),{width:A,height:L}})(_,_.lengendItems);return{direction:_.lineDirection,width:T,height:$,translateX:_.fullParams.gap,translateY:_.fullParams.gap}}),Pt(1)),w=B({fullParams:r,lengendList:y}).pipe(I(f),Y(async _=>_),O(_=>{const T=_.lengendList.width+_.fullParams.gap*2,$=_.lengendList.height+_.fullParams.gap*2;let N=0,R=0;return _.fullParams.position==="left"?_.fullParams.justify==="start"?(N=_.fullParams.padding,R=_.fullParams.padding):_.fullParams.justify==="center"?(N=_.fullParams.padding,R=-$/2):_.fullParams.justify==="end"&&(N=_.fullParams.padding,R=-$-_.fullParams.padding):_.fullParams.position==="right"?_.fullParams.justify==="start"?(N=-T-_.fullParams.padding,R=_.fullParams.padding):_.fullParams.justify==="center"?(N=-T-_.fullParams.padding,R=-$/2):_.fullParams.justify==="end"&&(N=-T-_.fullParams.padding,R=-$-_.fullParams.padding):_.fullParams.position==="top"?_.fullParams.justify==="start"?(N=_.fullParams.padding,R=_.fullParams.padding):_.fullParams.justify==="center"?(N=-T/2,R=_.fullParams.padding):_.fullParams.justify==="end"&&(N=-T-_.fullParams.padding,R=_.fullParams.padding):_.fullParams.justify==="start"?(N=_.fullParams.padding,R=-$-_.fullParams.padding):_.fullParams.justify==="center"?(N=-T/2,R=-$-_.fullParams.padding):_.fullParams.justify==="end"&&(N=-T-_.fullParams.padding,R=-$-_.fullParams.padding),{width:T,height:$,translateX:N,translateY:R}})),D=B({rootPositionSelection:b,fullParams:r,fullChartParams:o,legendCard:w}).pipe(I(f),Y(async _=>_),O(_=>_.rootPositionSelection.selectAll("g").data([_.legendCard]).join(T=>T.append("g").classed(u,!0).attr("transform",$=>`translate(${$.translateX}, ${$.translateY})`),T=>T.transition().attr("transform",$=>`translate(${$.translateX}, ${$.translateY})`),T=>T.remove()).each((T,$,N)=>{X(N[$]).selectAll("rect").data([T]).join("rect").attr("width",R=>R.width).attr("height",R=>R.height).attr("fill",Ct(_.fullParams.backgroundFill,_.fullChartParams)).attr("stroke",Ct(_.fullParams.backgroundStroke,_.fullChartParams))}))),P=B({lengendCardSelection:D,fullParams:r,lengendList:y}).pipe(I(f),Y(async _=>_),O(_=>_.lengendCardSelection.selectAll("g").data([_.lengendList]).join(T=>T.append("g").classed(l,!0).attr("transform",$=>`translate(${$.translateX}, ${$.translateY})`),T=>T.transition().attr("transform",$=>`translate(${$.translateX}, ${$.translateY})`),T=>T.remove())));return B({lengendListSelection:P,fullParams:r,fullChartParams:o,lengendItems:v,textSizePx:a}).pipe(I(f),Y(async _=>_),O(_=>{const T=_.lengendItems[0]?_.lengendItems.flat():[];return _.lengendListSelection.selectAll(`g.${c}`).data(T).join($=>$.append("g").classed(c,!0).attr("cursor","default"),$=>$,$=>$.remove()).attr("transform",($,N)=>`translate(${$.translateX}, ${$.translateY})`).each(($,N,R)=>{const A=_.textSizePx/2,L=-$.listRectWidth/2,M=-$.listRectHeight/2;X(R[N]).selectAll("rect").data([$]).join("rect").attr("x",A).attr("y",A).attr("width",z=>z.listRectWidth).attr("height",z=>z.listRectHeight).attr("transform",z=>`translate(${L}, ${M})`).attr("fill",z=>z.color).attr("rx",z=>z.listRectRadius),X(R[N]).selectAll("text").data([$]).join(z=>z.append("text").attr("dominant-baseline","hanging"),z=>z,z=>z.remove()).attr("x",_.textSizePx*1.5).attr("font-size",_.fullChartParams.styles.textSize).attr("fill",z=>_.fullParams.textColorType==="series"?x2(z.seriesIndex,_.fullChartParams):Ct(_.fullParams.textColorType,_.fullChartParams)).text(z=>z.text)})})).subscribe(),()=>{f.next(void 0)}},_2="GridLegend",bk=se(_2,ap)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new et,o=n.SeriesDataMap$.pipe(I(i),O(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),O(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Cu(_2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),Eh=6;function vk({selection:t,xAxisClassName:e,groupingLabelClassName:n,params:r,tickTextAlign:i,axisLabelAlign:o,gridAxesSize:a,fullDataFormatter:s,chartParams:u,groupScale:l,groupScaleDomain:c,groupLabels:f,textTransform:h}){const p=t.selectAll(`g.${e}`).data([r]).join("g").classed(e,!0);t.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).each((b,x,v)=>{X(v[x]).selectAll("text").data([b]).join(y=>y.append("text").style("font-weight","bold"),y=>y,y=>y.remove()).attr("text-anchor",o.textAnchor).attr("dominant-baseline",o.dominantBaseline).attr("font-size",u.styles.textSize).style("fill",Ct(r.labelColorType,u)).style("transform",h).text(y=>s.grid.groupAxis.label)}).attr("transform",b=>`translate(${a.width+b.tickPadding+r.labelOffset[0]}, ${-b.tickPadding-Eh-r.labelOffset[1]})`);const d=Math.floor(c[1])-Math.ceil(c[0])+1,g=Cg(l).scale(l).ticks(r.ticks==="all"||r.ticks>d?d:r.ticks).tickSize(r.tickFullLine==!0?-a.height:Eh).tickSizeOuter(0).tickFormat(b=>{const x=f[b]??"";return Th(x,r.tickFormat)}).tickPadding(r.tickPadding),m=p.transition().duration(100).call(g);return m.selectAll("line").style("fill","none").style("stroke",r.tickLineVisible==!0?Ct(r.tickColorType,u):"none").style("stroke-dasharray",r.tickFullLineDasharray).attr("pointer-events","none"),m.selectAll("path").style("fill","none").style("stroke",r.axisLineVisible==!0?Ct(r.axisLineColorType,u):"none").style("shape-rendering","crispEdges"),p.selectAll("text").attr("font-size",u.styles.textSize).style("color",Ct(r.tickTextColorType,u)).attr("text-anchor",i.textAnchor).attr("dominant-baseline",i.dominantBaseline).attr("transform-origin",`0 -${r.tickPadding+Eh}`).style("transform",h),p}const w2=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c})=>{const f=new et,h=at(t,"container"),p=at(t,"xAxisG"),d=at(t,"xAxis"),g=at(t,"groupingLabel"),m=B({computedData:n.pipe(rt((S,_)=>S.length===_.length)),isSeriesSeprate:c}).pipe(I(f),Y(async S=>S),O(S=>S.isSeriesSeprate?S.computedData:[S.computedData[0]]),O((S,_)=>e.selectAll(`g.${h}`).data(S,T=>T[0]?T[0].seriesIndex:_).join("g").classed(h,!0))),b=m.pipe(I(f),O((S,_)=>S.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));B({containerSelection:m,gridContainerPosition:l}).pipe(I(f),Y(async S=>S)).subscribe(S=>{S.containerSelection.attr("transform",(_,T)=>{const $=S.gridContainerPosition[T]??S.gridContainerPosition[0],N=$.translate,R=$.scale;return`translate(${N[0]}, ${N[1]}) scale(${R[0]}, ${R[1]})`})}),B({axisSelection:b,gridAxesTransform:a}).pipe(I(f),Y(async S=>S)).subscribe(S=>{S.axisSelection.style("transform",S.gridAxesTransform.value)});const x=B({fullParams:r,fullDataFormatter:i,gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),Y(async S=>S),O(S=>{const _=`translate(${S.gridAxesReverseTransform.translate[0]}px, ${S.gridAxesReverseTransform.translate[1]}px)`,T=`rotate(${S.gridAxesReverseTransform.rotate}deg) rotateX(${S.gridAxesReverseTransform.rotateX}deg) rotateY(${S.gridAxesReverseTransform.rotateY}deg)`,$=`scale(${1/S.gridContainerPosition[0].scale[0]}, ${1/S.gridContainerPosition[0].scale[1]})`,R=`rotate(${S.fullDataFormatter.grid.groupAxis.position==="left"&&S.fullDataFormatter.grid.valueAxis.position==="top"||S.fullDataFormatter.grid.groupAxis.position==="right"&&S.fullDataFormatter.grid.valueAxis.position==="bottom"?S.fullParams.tickTextRotate+180:S.fullParams.tickTextRotate}deg)`;return`${_} ${T} ${$} ${R}`}),rt()),v=B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),Y(async S=>S),O(S=>{const T=S.computedData[0]?S.computedData[0].length-1:0,$=S.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-S.fullDataFormatter.grid.groupAxis.scalePadding:S.fullDataFormatter.grid.groupAxis.scaleDomain[0]-S.fullDataFormatter.grid.groupAxis.scalePadding,N=S.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?T+S.fullDataFormatter.grid.groupAxis.scalePadding:S.fullDataFormatter.grid.groupAxis.scaleDomain[1]+S.fullDataFormatter.grid.groupAxis.scalePadding;return[$,N]}),Pt(1)),y=B({groupScaleDomain:v,gridAxesSize:u}).pipe(I(f),Y(async S=>S),O(S=>eu().domain(S.groupScaleDomain).range([0,S.gridAxesSize.width]))),w=n.pipe(O(S=>(S[0]??[]).map(_=>_.groupLabel))),D=B({fullDataFormatter:i,fullParams:r}).pipe(I(f),Y(async S=>S),O(S=>{let _="middle",T="hanging";return S.fullDataFormatter.grid.groupAxis.position==="bottom"?(_=S.fullParams.tickTextRotate?"end":"middle",T="hanging"):S.fullDataFormatter.grid.groupAxis.position==="top"?(_=S.fullParams.tickTextRotate?"end":"middle",T="auto"):S.fullDataFormatter.grid.groupAxis.position==="left"?(_="end",T="middle"):S.fullDataFormatter.grid.groupAxis.position==="right"&&(_="start",T="middle"),{textAnchor:_,dominantBaseline:T}})),P=i.pipe(I(f),O(S=>{let _="start",T="hanging";return S.grid.groupAxis.position==="bottom"?T="hanging":S.grid.groupAxis.position==="top"?T="auto":S.grid.groupAxis.position==="left"?_="end":S.grid.groupAxis.position==="right"&&(_="start"),S.grid.valueAxis.position==="left"?_="start":S.grid.valueAxis.position==="right"?_="end":S.grid.valueAxis.position==="bottom"?T="auto":S.grid.valueAxis.position==="top"&&(T="hanging"),{textAnchor:_,dominantBaseline:T}}));return B({axisSelection:b,params:r,tickTextAlign:D,axisLabelAlign:P,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:y,groupScaleDomain:v,groupLabels:w,textTransform:x}).pipe(I(f),Y(async S=>S)).subscribe(S=>{vk({selection:S.axisSelection,xAxisClassName:d,groupingLabelClassName:g,params:S.params,tickTextAlign:S.tickTextAlign,axisLabelAlign:S.axisLabelAlign,gridAxesSize:S.gridAxesSize,fullDataFormatter:S.fullDataFormatter,chartParams:S.chartParams,groupScale:S.groupScale,groupScaleDomain:S.groupScaleDomain,groupLabels:S.groupLabels,textTransform:S.textTransform})}),()=>{f.next(void 0)}},$2="GroupAxis",xk=se($2,rp)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=w2($2,{selection:t,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),S2=6;function _k({selection:t,yAxisClassName:e,textClassName:n,fullParams:r,tickTextAlign:i,axisLabelAlign:o,gridAxesSize:a,fullDataFormatter:s,fullChartParams:u,valueScale:l,textTransform:c,minAndMax:f}){const h=t.selectAll(`g.${e}`).data([r]).join("g").classed(e,!0);t.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).each((b,x,v)=>{X(v[x]).selectAll("text").data([b]).join(y=>y.append("text").style("font-weight","bold"),y=>y,y=>y.remove()).attr("text-anchor",o.textAnchor).attr("dominant-baseline",o.dominantBaseline).attr("font-size",u.styles.textSize).style("fill",Ct(r.labelColorType,u)).style("transform",c).text(y=>s.grid.valueAxis.label)}).attr("transform",b=>`translate(${-b.tickPadding+r.labelOffset[0]}, ${a.height+b.tickPadding+r.labelOffset[1]})`);const p=f[1]-f[0],d=Eg(l).scale(l).ticks(p>r.ticks?r.ticks:f[0]===0&&f[1]===0?1:Math.ceil(p)).tickFormat(b=>Th(b,r.tickFormat)).tickSize(r.tickFullLine==!0?-a.width:S2).tickPadding(r.tickPadding),g=h.transition().duration(100).call(d);return g.selectAll("line").style("fill","none").style("stroke",r.tickLineVisible==!0?Ct(r.tickColorType,u):"none").style("stroke-dasharray",r.tickFullLineDasharray).attr("pointer-events","none"),g.selectAll("path").style("fill","none").style("stroke",r.axisLineVisible==!0?Ct(r.axisLineColorType,u):"none").style("shape-rendering","crispEdges"),h.selectAll("text").attr("font-size",u.styles.textSize).style("color",Ct(r.tickTextColorType,u)).attr("text-anchor",i.textAnchor).attr("dominant-baseline",i.dominantBaseline).attr("transform-origin",`-${r.tickPadding+S2} 0`).style("transform",c),h}const ai=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c})=>{const f=new et,h=at(t,"container"),p=at(t,"yAxisG"),d=at(t,"yAxis"),g=at(t,"text"),m=B({computedData:n.pipe(rt((P,S)=>P.length===S.length)),isSeriesSeprate:c}).pipe(I(f),Y(async P=>P),O(P=>P.isSeriesSeprate?P.computedData:[P.computedData[0]]),O((P,S)=>e.selectAll(`g.${h}`).data(P,_=>_[0]?_[0].seriesIndex:S).join("g").classed(h,!0))),b=m.pipe(I(f),O((P,S)=>P.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));B({containerSelection:m,gridContainerPosition:l}).pipe(I(f),Y(async P=>P)).subscribe(P=>{P.containerSelection.attr("transform",(S,_)=>{const T=P.gridContainerPosition[_]??P.gridContainerPosition[0],$=T.translate,N=T.scale;return`translate(${$[0]}, ${$[1]}) scale(${N[0]}, ${N[1]})`})}),B({axisSelection:b,gridAxesTransform:a}).pipe(I(f),Y(async P=>P)).subscribe(P=>{P.axisSelection.style("transform",P.gridAxesTransform.value)});const x=B({fullParams:r,fullDataFormatter:i,gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),Y(async P=>P),O(P=>{const S=`translate(${P.gridAxesReverseTransform.translate[0]}px, ${P.gridAxesReverseTransform.translate[1]}px)`,_=`rotate(${P.gridAxesReverseTransform.rotate}deg) rotateX(${P.gridAxesReverseTransform.rotateX}deg) rotateY(${P.gridAxesReverseTransform.rotateY}deg)`,T=`scale(${1/P.gridContainerPosition[0].scale[0]}, ${1/P.gridContainerPosition[0].scale[1]})`,N=`rotate(${P.fullDataFormatter.grid.groupAxis.position==="left"&&P.fullDataFormatter.grid.valueAxis.position==="top"||P.fullDataFormatter.grid.groupAxis.position==="right"&&P.fullDataFormatter.grid.valueAxis.position==="bottom"?P.fullParams.tickTextRotate+180:P.fullParams.tickTextRotate}deg)`;return`${S} ${_} ${T} ${N}`}),rt()),v=new pt(P=>{B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),Y(async S=>S)).subscribe(S=>{const T=S.computedData[0]?S.computedData[0].length-1:0,$=S.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-S.fullDataFormatter.grid.groupAxis.scalePadding:S.fullDataFormatter.grid.groupAxis.scaleDomain[0]-S.fullDataFormatter.grid.groupAxis.scalePadding,N=S.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?T+S.fullDataFormatter.grid.groupAxis.scalePadding:S.fullDataFormatter.grid.groupAxis.scaleDomain[1]+S.fullDataFormatter.grid.groupAxis.scalePadding,R=S.computedData.map((L,M)=>L.filter((z,U)=>U>=$&&U<=N)),A=LR(R.flat());P.next(A)})}),y=new pt(P=>{B({fullDataFormatter:i,gridAxesSize:u,minAndMax:v}).pipe(I(f),Y(async S=>S)).subscribe(S=>{const _=tg({maxValue:S.minAndMax[1],minValue:S.minAndMax[0],axisWidth:S.gridAxesSize.height,scaleDomain:S.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:S.fullDataFormatter.grid.valueAxis.scaleRange});P.next(_)})}),w=i.pipe(I(f),O(P=>{let S="start",_="hanging";return P.grid.valueAxis.position==="left"?(S="end",_="middle"):P.grid.valueAxis.position==="right"?(S="start",_="middle"):P.grid.valueAxis.position==="bottom"?(S="middle",_="hanging"):P.grid.valueAxis.position==="top"&&(S="middle",_="auto"),{textAnchor:S,dominantBaseline:_}})),D=i.pipe(I(f),O(P=>{let S="start",_="hanging";return P.grid.groupAxis.position==="bottom"?_="auto":P.grid.groupAxis.position==="top"?_="hanging":P.grid.groupAxis.position==="left"?S="start":P.grid.groupAxis.position==="right"&&(S="end"),P.grid.valueAxis.position==="left"?S="end":P.grid.valueAxis.position==="right"?S="start":P.grid.valueAxis.position==="bottom"?_="hanging":P.grid.valueAxis.position==="top"&&(_="auto"),{textAnchor:S,dominantBaseline:_}}));return B({axisSelection:b,fullParams:r,tickTextAlign:w,axisLabelAlign:D,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:y,textTransform:x,minAndMax:v}).pipe(I(f),Y(async P=>P)).subscribe(P=>{_k({selection:P.axisSelection,yAxisClassName:d,textClassName:g,fullParams:P.fullParams,tickTextAlign:P.tickTextAlign,axisLabelAlign:P.axisLabelAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,valueScale:P.valueScale,textTransform:P.textTransform,minAndMax:P.minAndMax})}),()=>{f.next(void 0)}},A2="ValueAxis",wk=se(A2,Fu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=ai(A2,{selection:t,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),M2="ValueStackAxis",$k=se(M2,ip)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=ai(M2,{selection:t,computedData$:n.computedStackedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),D2="ScalingArea",Sk=at(D2,"rect"),Ak=se(D2,op)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new et,a=e.insert("rect","g").classed(Sk,!0).attr("opacity",0);let s={k:1,x:0,y:0};r.layout$.pipe(I(o)).subscribe(l=>{a.attr("width",l.width).attr("height",l.height).attr("x",l.left).attr("y",l.top)});const u=r.computedData$.pipe(O(l=>l[0]?l[0].length-1:0),rt());return B({initGroupAxis:r.fullDataFormatter$.pipe(O(l=>l.grid.groupAxis),$_()),fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:u,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(I(o),Y(async l=>l)).subscribe(l=>{const f=l.groupMaxIndex,h=l.initGroupAxis.scaleDomain[0]==="auto"?0-l.initGroupAxis.scalePadding:l.initGroupAxis.scaleDomain[0]-l.initGroupAxis.scalePadding,p=l.initGroupAxis.scaleDomain[1]==="auto"?f+l.initGroupAxis.scalePadding:l.initGroupAxis.scaleDomain[1]+l.initGroupAxis.scalePadding,g=tg({maxValue:l.groupMaxIndex,minValue:0,axisWidth:l.axisSize.width,scaleDomain:[h,p],scaleRange:[0,1]}).copy(),m=t2().on("zoom",function(x){const v=x.transform,y=P=>{const S=Math.round(P);return Math.min(f,Math.max(0,S))},w=l.fullDataFormatter.grid.groupAxis.position==="bottom"||l.fullDataFormatter.grid.groupAxis.position==="top"?v.rescaleX(g).domain().map(y):v.rescaleY(g).domain().map(y);w[0]<=0&&w[1]>=f?v.k<s.k&&(v.k=s.k,v.x=s.x,v.y=s.y):w[1]-w[0]<=1&&v.k>s.k&&(v.k=s.k,v.x=s.x,v.y=s.y),s.k=v.k,s.x=v.x,s.y=v.y;const D={...l.fullDataFormatter,grid:{...l.fullDataFormatter.grid,groupAxis:{...l.fullDataFormatter.grid.groupAxis,scaleDomain:w}}};i.dataFormatter$.next(D)});e.call(m)}),()=>{o.next(void 0),a.remove()}});function P2(t,e){let n=new pt(()=>{});return t.each(function(){const r=Zu(this,e);n=Ku(n,r)}),n}const Eu="GroupAux",Rh=at(Eu,"label-box");function Mk({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function Dk({selection:t,pluginName:e,lineData:n,fullParams:r,fullChartParams:i}){const o=at(e,"auxline"),a=t.selectAll(`line.${o}`).data(n),s=a.enter().append("line").classed(o,!0).style("stroke",l=>Ct(r.lineColorType,i)).style("stroke-width",1).style("stroke-dasharray",r.lineDashArray??"none").style("pointer-events","none"),u=a.merge(s);return a.exit().remove(),s.attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),a.transition().duration(50).attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),u}function Pk(t){t.selectAll("line").data([]).exit().remove()}function Tk({groupLabel:t,axisX:e,fullParams:n}){return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:Th(t,n.labelTextFormat)}]:[]}function Lk({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,labelTransform:o,textSizePx:a}){const s=a+4,u=t.selectAll(`g.${Rh}`).data(e),l=u.enter().append("g").classed(Rh,!0).style("cursor","pointer"),c=l.merge(u);return l.attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.transition().duration(50).attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.exit().remove(),c.each((f,h,p)=>{const d=n2(f.text,a)+12;let g=-d/2,m=-2;r.grid.groupAxis.position==="bottom"?(g=-d/2,m=2):r.grid.groupAxis.position==="left"?(g=-d+2,m=-s/2):r.grid.groupAxis.position==="right"?(g=-2,m=-s/2):r.grid.groupAxis.position==="top"&&(g=-d/2,m=-s+2);const b=X(p[h]).selectAll("rect").data([f]),x=b.enter().append("rect").attr("height",`${s}px`).attr("fill",w=>Ct(n.labelColorType,i)).attr("x",g).attr("y",m).attr("rx",5).attr("ry",5).style("cursor","pointer");b.merge(x).attr("width",w=>`${d}px`).style("transform",o),b.exit().remove();const v=X(p[h]).selectAll("text").data([f]),y=v.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");v.merge(y).text(w=>w.text).style("transform",o).attr("fill",w=>Ct(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",g+6).attr("y",m),v.exit().remove()}),c}function Ck(t){t.selectAll(`g.${Rh}`).data([]).exit().remove()}const Ek=se(Eu,tp)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new et;let a=!1;const s=e.insert("rect","g").classed(at(Eu,"rect"),!0).attr("opacity",0),{seriesSelection$:u,axesSelection$:l,defsSelection$:c,graphicGSelection$:f}=ar({selection:t,pluginName:Eu,clipPathID:"test",seriesLabels$:i.seriesLabels$,gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(I(o)).subscribe(y=>{s.attr("width",y.rootWidth).attr("height",y.rootHeight)});const h=new pt(y=>{B({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(I(o),Y(async w=>w)).subscribe(w=>{const P=w.computedData[0]?w.computedData[0].length-1:0,S=w.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[0]-w.fullDataFormatter.grid.groupAxis.scalePadding,_=w.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?P+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding,T=w.computedData[0]?w.computedData[0].length:0;let $=w.fullDataFormatter.grid.seriesDirection==="row"?(w.computedData[0]??[]).map(L=>L.groupLabel):w.computedData.map(L=>L[0].groupLabel);const N=new Array(T).fill(0).map((L,M)=>$[M]!=null?$[M]:String(M)).filter((L,M)=>M>=S&&M<=_),R=w.fullDataFormatter.grid.groupAxis.scalePadding,A=p3({axisLabels:N,axisWidth:w.gridAxesSize.width,padding:R});y.next(A)})}),p=Lh({fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$}),d=i.fullChartParams$.pipe(I(o),O(y=>y.highlightTarget),rt()),g=P2(e,"mousemove").pipe(I(o)),m=B({fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),Y(async y=>y),O(y=>{const w=`translate(${y.gridAxesReverseTransform.translate[0]}px, ${y.gridAxesReverseTransform.translate[1]}px)`,D=`rotate(${y.gridAxesReverseTransform.rotate}deg) rotateX(${y.gridAxesReverseTransform.rotateX}deg) rotateY(${y.gridAxesReverseTransform.rotateY}deg)`,P=`scale(${1/y.gridContainerPosition[0].scale[0]}, ${1/y.gridContainerPosition[0].scale[1]})`,_=`rotate(${y.fullDataFormatter.grid.groupAxis.position==="left"&&y.fullDataFormatter.grid.valueAxis.position==="top"||y.fullDataFormatter.grid.groupAxis.position==="right"&&y.fullDataFormatter.grid.valueAxis.position==="bottom"?180:0}deg)`;return`${w} ${D} ${P} ${_}`}),rt()),b=i.gridContainerPosition$.pipe(I(o),O(y=>y.reduce((D,P)=>P.columnIndex>D?P.columnIndex:D,0)+1),rt()),x=i.gridContainerPosition$.pipe(I(o),O(y=>y.reduce((D,P)=>P.rowIndex>D?P.rowIndex:D,0)+1),rt());B({axesSelection:l,columnAmount:b,rowAmount:x,layout:i.layout$,rootMousemove:g,gridGroupPositionFn:p,computedData:i.computedData$,groupScale:h,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:d,labelTransform:m,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).subscribe(y=>{const w={offsetX:y.rootMousemove.offsetX*y.columnAmount%y.layout.rootWidth,offsetY:y.rootMousemove.offsetY*y.rowAmount%y.layout.rootHeight},{groupIndex:D,groupLabel:P}=y.gridGroupPositionFn(w),S=y.groupScale(P)??0,_=Mk({groupLabel:P,axisX:S,axisHeight:y.gridAxesSize.height,fullParams:y.fullParams});Dk({selection:y.axesSelection,pluginName:n,lineData:_,fullParams:y.fullParams,fullChartParams:y.fullChartParams});const T=Tk({groupLabel:P,axisX:S,fullParams:y.fullParams});Lk({selection:y.axesSelection,labelData:T,fullParams:y.fullParams,fullDataFormatter:y.fullDataFormatter,fullChartParams:y.fullChartParams,labelTransform:y.labelTransform,textSizePx:y.textSizePx}).on("mouseover",(N,R)=>{N.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:y.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:y.GroupDataMap.get(P)??[],groupIndex:D,groupLabel:P,event:N,data:y.computedData})}).on("mousemove",(N,R)=>{N.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:y.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:y.GroupDataMap.get(P)??[],groupIndex:D,groupLabel:P,event:N,data:y.computedData})}).on("mouseout",(N,R)=>{N.stopPropagation(),a=!1,r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:y.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:y.GroupDataMap.get(P)??[],groupIndex:D,groupLabel:P,event:N,data:y.computedData})}).on("click",(N,R)=>{N.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:y.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:y.GroupDataMap.get(P)??[],groupIndex:D,groupLabel:P,event:N,data:y.computedData})})});const v=P2(s,"mouseout").pipe(I(o));return B({rootRectMouseout:v,axesSelection:l}).pipe(I(o),Y(async y=>y)).subscribe(y=>{setTimeout(()=>{a!=!0&&(Pk(y.axesSelection),Ck(y.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),T2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,gridList:[{listRectWidth:14,listRectHeight:14,listRectRadius:0}],textColorType:"primary"},L2={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]},Ru={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]},Rk={...Ru},C2={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},E2={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},R2={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},k2={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},I2={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},N2={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},kh={firstAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},secondAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},gridIndexes:[0,1]},F2={...kh},G2="MultiGridLegend",kk=pe(G2,T2)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new et,o=n.multiGridEachDetail$.pipe(I(i),O(l=>l.map((f,h)=>f.SeriesDataMap$.pipe(O(p=>Array.from(p.keys()))))),Y(l=>B(l)),O(l=>l.flat())),a=B({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(I(i),Y(async l=>l),O(l=>l.computedData.map((c,f)=>{const h=bl(l.fullParams.gridList[f]??{},{listRectWidth:l.fullParams.listRectWidth,listRectHeight:l.fullParams.listRectHeight,listRectRadius:l.fullParams.listRectRadius});return c.map(p=>h)}).flat())),s=B({fullParams:n.fullParams$,seriesList:a}).pipe(I(i),Y(async l=>l),O(l=>({...l.fullParams,seriesList:l.seriesList}))),u=Cu(G2,{rootSelection:e,seriesLabels$:o,fullParams$:s,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),u()}}),Ce=t=>{const e=t.fullParams$.pipe(O(n=>n.gridIndexes),rt(),Pt(1));return B({multiGridEachDetail:t.multiGridEachDetail$,gridIndexes:e}).pipe(O(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},Ih="MultiBars",z2=at(Ih,"grid"),Ik=pe(Ih,C2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${z2}`).data(s).join("g").attr("class",z2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=Ch(Ih,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Nh="MultiBarStack",O2=at(Nh,"grid"),Nk=pe(Nh,E2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${O2}`).data(s).join("g").attr("class",O2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=h2(Nh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Fh="MultiBarsTriangle",U2=at(Fh,"grid"),Fk=pe(Fh,R2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${U2}`).data(s).join("g").attr("class",U2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=m2(Fh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,fullDataFormatter$:u.dataFormatter$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Gh="MultiLines",B2=at(Gh,"grid"),Gk=pe(Gh,k2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${B2}`).data(s).join("g").attr("class",B2).each((u,l,c)=>{const f=X(c[l]);o[l]=r2(Gh,{selection:f,computedData$:u.computedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedData$:u.visibleComputedData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullDataFormatter$:u.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),zh="MultiLineAreas",Y2=at(zh,"grid"),zk=pe(zh,I2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Y2}`).data(s).join("g").attr("class",Y2).each((u,l,c)=>{const f=X(c[l]);o[l]=o2(zh,{selection:f,computedData$:u.computedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedData$:u.visibleComputedData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullDataFormatter$:u.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Oh="MultiDots",H2=at(Oh,"grid"),Ok=pe(Oh,N2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${H2}`).data(s).join("g").attr("class",H2).each((u,l,c)=>{const f=X(c[l]);o[l]=b2(Oh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Uh="MultiGroupAxis",W2=at(Uh,"grid"),Uk=pe(Uh,L2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${W2}`).data(s).join("g").attr("class",W2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=w2(Uh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Bh="MultiValueAxis",V2=at(Bh,"grid"),Bk=pe(Bh,Ru)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${V2}`).data(s).join("g").attr("class",V2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=ai(Bh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Yh="MultiValueStackAxis",j2=at(Yh,"grid"),Yk=pe(Yh,Ru)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${j2}`).data(s).join("g").attr("class",j2).each((u,l,c)=>{const f=X(c[l]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=ai(Yh,{selection:f,computedData$:u.computedStackedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}});function Hk(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function q2(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:Hk(n);return new Array(n).fill(null).map((a,s)=>{const u=s%o,l=Math.floor(s/o),c=(t.width-r*(o-1))/o,f=(t.height-r*(i-1))/i,h=u*c+u*r,p=l*f+l*r,d=[h,p],g=[c/t.width,f/t.height];return{slotIndex:s,rowIndex:l,columnIndex:u,translate:d,scale:g}})}const X2=({fullDataFormatter$:t,layout$:e})=>{const n=new et;function r({xAxis:i,yAxis:o,width:a,height:s}){if(!i||!o)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let u=0,l=0,c=0,f=0,h=0;return i.position==="bottom"?o.position==="left"?(f=180,l=s):o.position==="right"?(f=180,h=180,u=a,l=s):(f=180,l=s):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,u=a):(f=180,l=s)):i.position==="left"?o.position==="bottom"?(c=-90,l=s):o.position==="top"?(c=-90,h=180):(f=180,l=s):i.position==="right"&&(o.position==="bottom"?(c=-90,f=180,l=s,u=a):o.position==="top"?(c=-90,f=180,h=180,u=a):(f=180,l=s)),{translate:[u,l],scale:[1,1],rotate:c,rotateX:f,rotateY:h,value:`translate(${u}px, ${l}px) rotate(${c}deg) rotateX(${f}deg) rotateY(${h}deg)`}}return new pt(i=>(B({fullDataFormatter:t,layout:e}).pipe(I(n),Y(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.grid.groupAxis,yAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},Z2=({gridAxesTransform$:t})=>t.pipe(O(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${o}deg) rotateY(${a}deg)`}})),K2=({computedData$:t,fullDataFormatter$:e,layout$:n})=>B({computedData:t,fullDataFormatter:e,layout:n}).pipe(Y(async i=>i),O(i=>{if(i.fullDataFormatter.grid.separateSeries)return q2(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=q2(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Hh="OverlappingValueAxes",Q2=at(Hh,"grid"),Wk=pe(Hh,kh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[],a=r.fullParams$.pipe(I(i),O(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),O(c=>c.gridIndexes[1])),u=B({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),Y(async c=>c),O(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));let f="";return c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="left"?f="right":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="bottom"?f="top":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="top"?f="bottom":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="right"&&(f="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:f}},container:{...c.fullDataFormatter.container}}}));return Bo(r).pipe(I(i),O(c=>({...c,fullParams$:c.fullParams$.pipe(O(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),Y(c=>Ce(c)),O(c=>c.map((f,h)=>{if(h===0)return f;const p=X2({fullDataFormatter$:u,layout$:r.layout$}),d=Z2({gridAxesTransform$:p}),g=K2({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${Q2}`).data(c).join("g").attr("class",Q2).each((f,h,p)=>{if(h>1)return;const d=X(p[h]);o[h]=ai(Hh,{selection:d,computedData$:f.computedData$,fullParams$:r.fullParams$.pipe(O(g=>h===0?g.firstAxis:g.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),Wh="OverlappingValueStackAxes",J2=at(Wh,"grid"),Vk=pe(Wh,F2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=[],a=r.fullParams$.pipe(I(i),O(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),O(c=>c.gridIndexes[1])),u=B({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),Y(async c=>c),O(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));let f="";return c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="left"?f="right":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="bottom"?f="top":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="top"?f="bottom":c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position==="right"&&(f="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:f}},container:{...c.fullDataFormatter.container}}}));return Bo(r).pipe(I(i),O(c=>({...c,fullParams$:c.fullParams$.pipe(O(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),Y(c=>Ce(c)),O(c=>c.map((f,h)=>{if(h===0)return f;const p=X2({fullDataFormatter$:u,layout$:r.layout$}),d=Z2({gridAxesTransform$:p}),g=K2({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${J2}`).data(c).join("g").attr("class",J2).each((f,h,p)=>{if(h>1)return;const d=X(p[h]);o[h]=ai(Wh,{selection:d,computedData$:h===0?f.computedStackedData$:f.computedData$,fullParams$:r.fullParams$.pipe(O(g=>h===0?g.firstAxis:g.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),tx={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},ex={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,textRenderFn:t=>{if(t.highlightTarget==="datum"&&t.datum)return[`${t.datum.label}: ${t.datum.value}`];if(t.highlightTarget==="series"){const e=t.seriesLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="group"){const e=t.groupLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="category"){const e=t.categoryLabel,n=t.category.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}return[]},svgRenderFn:null},jk=eg("Container",tx)(({selection:t})=>function(){}),Vh="Tooltip",nx=at(Vh,"g"),qk=at(Vh,"box");function Xk(t,e){const n=e.textSizePx*1.5;return t.filter(r=>r!="").map((r,i)=>{const o=i*n;return`<text font-size="${e.textSize}" fill="${e.textColor}" x="0" y="${o}" style="dominant-baseline:text-before-edge">${r}</text>`}).join()}function Zk({rootSelection:t,pluginName:e,rootWidth:n,rootHeight:r,svgString:i,tooltipStyle:o,event:a}){t.interrupt("fadeout");const s=5,u=i?[i]:[],l=i?[o]:[],f=t.selectAll(`g.${nx}`).data(u).join(y=>y.append("g").classed(nx,!0).attr("pointer-events","none"),y=>y,y=>y.style("opacity",0).remove()).attr("transform",()=>`translate(${a.offsetX}, ${a.offsetY})`).selectAll(`g.${qk}`).data(l).join(y=>y.append("g").classed(at(e,"box"),!0)),h=f.selectAll("rect").data(l).join(y=>y.append("rect").attr("rx",s).attr("ry",s)).attr("fill",y=>y.backgroundColor).attr("stroke",y=>y.strokeColor).attr("opacity",y=>y.backgroundOpacity),p=f.selectAll("g").data(u).join(y=>y.append("g").classed(at(e,"content"),!0).attr("transform",()=>`translate(${o.padding}, ${o.padding})`));u.length&&PR(p,u[0]);const d=p!=null&&p.node()?e2(p):{width:0,height:0};h.attr("width",d.width+o.padding*2).attr("height",d.height+o.padding*2);const g=f!=null&&f.node()?e2(f):{width:0,height:0},m=n-g.width,b=r-g.height,x=a.offsetX+o.offset[0]>m?m-a.offsetX:o.offset[0],v=a.offsetY+o.offset[1]>b?b-a.offsetY:o.offset[1];f.attr("transform",y=>`translate(${x}, ${v})`),f.attr("transform",y=>`translate(${x}, ${v})`)}const Kk=eg(Vh,ex)(({selection:t,rootSelection:e,name:n,chartType:r,observer:i,subject:o})=>{const a=new et,s=o.event$.pipe(I(a),li(g=>g.eventName==="mouseover"||g.eventName==="mousemove")),u=o.event$.pipe(I(a),li(g=>g.eventName==="mouseout")),l=h3(i.fullChartParams$),c=B({fullChartParams:i.fullChartParams$,fullParams:i.fullParams$,textSizePx:l}).pipe(I(a),Y(async g=>g),O(g=>({backgroundColor:Ct(g.fullParams.backgroundColorType,g.fullChartParams),backgroundOpacity:g.fullParams.backgroundOpacity,strokeColor:Ct(g.fullParams.strokeColorType,g.fullChartParams),offset:g.fullParams.offset,padding:g.fullParams.padding,textSize:g.fullChartParams.styles.textSize,textSizePx:g.textSizePx,textColor:Ct(g.fullParams.textColorType,g.fullChartParams)}))),f=B({fullParams:i.fullParams$,tooltipStyle:c}).pipe(I(a),Y(async g=>g),O(g=>g.fullParams.svgRenderFn?g.fullParams.svgRenderFn:m=>{const b=g.fullParams.textRenderFn(m);return Xk(b,g.tooltipStyle)})),h=B({event:s,contentRenderFn:f}).pipe(I(a),Y(async g=>g),O(g=>g.contentRenderFn(g.event))),p=u.pipe(I(a),O(g=>"")),d=Ku(s,u).pipe(I(a),O(g=>g.event));return B({svgString:Ku(h,p),event:d,layout:i.layout$,tooltipStyle:c}).pipe(I(a),Y(async g=>g)).subscribe(g=>{Zk({rootSelection:e,pluginName:n,rootWidth:g.layout.rootWidth,rootHeight:g.layout.rootHeight,svgString:g.svgString,tooltipStyle:g.tooltipStyle,event:g.event})}),function(){a.next(void 0)}}),rx={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleText:{fillRate:.6,lineHeight:12,lineLengthMin:4},arcScaleType:"area"},ix={outerRadius:.95,innerRadius:0,outerRadiusWhileHighlight:1,startAngle:0,endAngle:Math.PI*2,padAngle:.02,cornerRadius:0},ox={eventFn:(t,e,n)=>e==="mouseover"||e==="mousemove"?[String(t.datum.value)]:[String(Math.round(t.data.reduce((r,i)=>r+i.reduce((o,a)=>o+(a.value??0),0),0)*n))],textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"middle","pointer-events":"none","dominant-baseline":"middle","font-size":64,fill:"#000"}]},ax={outerRadius:.95,outerRadiusWhileHighlight:1,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.3,labelColorType:"primary",labelFn:t=>String(t.label)},sx={outerRadius:.95,cornerRadius:0,arcScaleType:"area",mouseoverAngleIncrease:.05},ux={outerRadius:.95,labelCentroid:2.5,labelFn:t=>String(t.label),labelColorType:"primary",arcScaleType:"area"},lx={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"};function Qk(t,{text:e,radius:n,lineHeight:r,isBreakAll:i=!1,limit:o=0}){if(t==null||e==null){console.error("selection or text is not defined");return}n==null&&(n=t.node().getBBox().width/2);function a(p){let d;return i?d=p.split(""):d=p.split(/\s+/g),d[d.length-1]||d.pop(),d[0]||d.shift(),d}function s(p,d){return p&&d&&p.length>d&&(p=p.substring(0,d)+"..."),p}function u(p){var g;const d=document.createElement("canvas").getContext("2d");return((g=d==null?void 0:d.measureText(p))==null?void 0:g.width)??0}function l(p){const d=u(p.trim());return Math.sqrt(d*r)}function c(p,d){let g={width:0,text:""},m=1/0;const b=[];let x=" ";i&&(x="");for(let v=0,y=p.length;v<y;++v){const w=(g.text?g.text+x:"")+p[v],D=u(w);(m+D)/2<d?(g.width=m=D,g.text=w):(m=u(p[v]),g={width:m,text:p[v]},b.push(g))}return b}function f(p){let d=0;for(let g=0,m=p.length;g<m;++g){const b=(Math.abs(g-m/2+.5)+.5)*r,x=p[g].width/2;d=Math.max(d,Math.sqrt(x**2+b**2))}return d}function h(p,d){o>0&&(d=s(d,o));const g=a(d),m=l(d),b=c(g,m),x=f(b);let v=p.select("text");v.size()||(v=p.append("text")),v.attr("transform",`translate(0,0) scale(${n/x})`);const y=v.selectAll("tspan").data(b),w=y.enter().append("tspan").attr("x",0).merge(y).attr("y",(D,P)=>(P-b.length/2+.8)*r).text(D=>D.text);return y.exit().remove(),y.merge(w)}return h(t,e)}let Sn;function Jk(t,e){return Lm().velocityDecay(e.force.velocityDecay).force("collision",Dm().radius(n=>n.r+e.force.collisionSpacing)).force("charge",Cm().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function tI({visibleComputedLayoutData:t,LastBubbleDataMap:e,graphicWidth:n,graphicHeight:r,SeriesContainerPositionMap:i,scaleType:o}){const a=Math.min(n,r)/2,s=t.flat(),u=s.reduce((h,p)=>h+p.value,0),l=Kr().domain([0,u]).range([0,a]).exponent(o==="area"?.5:1),c=o==="area"?1:(()=>{const h=a*a*Math.PI;return Math.sqrt(h/Mg(s,p=>Math.PI*Math.pow(l(p.value),2)))})(),f=.9;return s.map(h=>{const p=h,d=e.get(p.id);if(d)p.x=d.x,p.y=d.y;else{const m=i.get(p.seriesLabel);p.x=Math.random()*m.width,p.y=Math.random()*m.height}const g=l(p.value??0)*c*f;return p.r=g,p._originR=g,p})}function eI({selection:t,bubblesData:e,fullParams:n,sumSeries:r}){const i=t.selectAll("g").data(e,a=>a.id).join(a=>{const s=a.append("g").attr("cursor","pointer").attr("font-size",12).style("fill","#ffffff").attr("text-anchor","middle");return s.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",u=>u.color),s.append("text").style("opacity",.8).attr("pointer-events","none"),s},a=>a,a=>a.remove()).attr("transform",a=>`translate(${a.x},${a.y})`),o=r?"seriesLabel":"label";return i.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),i.each((a,s,u)=>{const l=X(u[s]);let c=!0;a[o].length<=n.bubbleText.lineLengthMin&&(c=!1),l.call(Qk,{text:a[o],radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:c})}),i}function nI(){return Hg().on("start",(t,e)=>{t.active||Sn.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||Sn.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function rI({fullParams:t,SeriesContainerPositionMap:e}){Sn.force("x",Em().strength(t.force.strength).x(n=>e.get(n.seriesLabel).centerX)).force("y",Rm().strength(t.force.strength).y(n=>e.get(n.seriesLabel).centerY)),Sn.alpha(1).restart()}function iI({bubblesSelection:t,highlightIds:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1);return}t.each((r,i,o)=>{const a=X(o[i]);e.includes(r.id)?a.style("opacity",1).transition("highlight").ease(ji).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const oI=Cn("Bubbles",rx)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et;let o=new Map;const a=n.fullDataFormatter$.pipe(O(f=>f.sumSeries),rt()),s=n.fullParams$.pipe(I(i),O(f=>f.arcScaleType),rt()),u=B({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedLayoutData:n.visibleComputedLayoutData$,scaleType:s}).pipe(I(i),Y(async f=>f),O(f=>tI({visibleComputedLayoutData:f.visibleComputedLayoutData,LastBubbleDataMap:o,graphicWidth:f.layout.width,graphicHeight:f.layout.height,SeriesContainerPositionMap:f.SeriesContainerPositionMap,scaleType:f.scaleType})),Pt(1));u.subscribe(f=>{o=new Map(f.map(h=>[h.id,h]))});const l=n.fullChartParams$.pipe(I(i),O(f=>f.highlightTarget),rt()),c=B({bubblesData:u,fullParams:n.fullParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:a}).pipe(I(i),Y(async f=>f),O(f=>{Sn&&Sn.stop();const h=eI({selection:t,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return Sn=Jk(h,f.fullParams),Sn.nodes(f.bubblesData),rI({fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),h}));return B({bubblesSelection:c,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:l}).pipe(I(i),Y(async f=>f)).subscribe(f=>{f.bubblesSelection.on("mouseover",(h,p)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mousemove",(h,p)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mouseout",(h,p)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("click",(h,p)=>{r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).call(nI())}),B({bubblesSelection:c,bubblesData:u,highlight:n.seriesHighlight$.pipe(O(f=>f.map(h=>h.id))),fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,sumSeries:a,SeriesContainerPositionMap:n.SeriesContainerPositionMap$}).pipe(I(i),Y(async f=>f)).subscribe(f=>{iI({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function cx({data:t,startAngle:e,endAngle:n}){return pv().startAngle(e).endAngle(n).value(o=>o.value).sort((o,a)=>o.seq-a.seq)(t).map((o,a)=>{let s=o;return s.id=o.data.id,s})}function aI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r}){const i=at(e,"series");return B({seriesLabels:r,separateSeries:n}).pipe(Y(async o=>o),O((o,a)=>{const s=o.separateSeries?o.seriesLabels:[o.seriesLabels.join("")];return t.selectAll(`g.${i}`).data(s,u=>u).join(u=>u.append("g").classed(i,!0),u=>u,u=>u.remove())}),Pt(1))}const Io=({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=aI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r});return B({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(Y(async a=>a),rt((a,s)=>a.seriesContainerPosition.length===s.seriesContainerPosition.length)).subscribe(a=>{a.seriesCenterSelection.attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),B({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(Y(async a=>a)).subscribe(a=>{a.seriesCenterSelection.transition().attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),{seriesCenterSelection$:o}},jh="Pie";function sI({enter:t,exit:e,data:n,lastTweenData:r,fullParams:i}){return!t.size()&&!e.size()?o=>{const a=n.map((s,u)=>{const l=r[u]??{startAngle:0,endAngle:0,value:0};return{...s,startAngle:s.startAngle*o+l.startAngle*(1-o),endAngle:s.endAngle*o+l.endAngle*(1-o),value:s.value*o+l.value*(1-o)}});return qh(a,i.startAngle,i.endAngle,1)}:o=>qh(n,i.startAngle,i.endAngle,o)}function qh(t,e,n,r){return t.map((i,o)=>{const a=e+(i.startAngle-e)*r,s=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:s}})}function fx({selection:t,data:e,arc:n,pathClassName:r}){return t.selectAll("path").data(e,o=>o.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(o,a)=>o.data.color).attr("d",(o,a)=>n(o))}function uI({pathSelection:t,ids:e,fullChartParams:n,arc:r,arcHighlight:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}t.each((o,a,s)=>{const u=X(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(ji).duration(500).attr("d",l=>i(l)):u.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>r(l))})}function lI(t,e){const n=new et,r=at(t,"path");let i=[],o=[];const a=e.seriesContainerPosition$.pipe(I(n),O(h=>h.width<h.height?h.width:h.height),rt()),s=new pt(h=>{B({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),Y(async p=>p)).subscribe(p=>{const d=cx({data:p.containerVisibleComputedLayoutData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});h.next(d)})}),u=new pt(h=>{B({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),Y(async p=>p)).subscribe(p=>{const d=Tu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),l=new pt(h=>{B({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),Y(async p=>p)).subscribe(p=>{const d=Tu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),c=e.fullChartParams$.pipe(I(n),O(h=>h.highlightTarget),rt()),f=new pt(h=>{B({pieData:s,arc:u,computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:c}).pipe(I(n),Y(async p=>p)).subscribe(p=>{e.containerSelection.interrupt("graphicMove");const d=e.containerSelection.selectAll("path").data(p.pieData,x=>x.id),g=d.enter(),m=d.exit(),b=sI({enter:g,exit:m,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});e.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(x,v)=>y=>{o=b(y),fx({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r})}).on("end",(x,v)=>{o=qh(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const y=fx({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r});h.next(y),i=Object.assign([],p.pieData),e.event$.next({type:"series",pluginName:t,eventName:"transitionEnd",event:void 0,highlightTarget:p.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:p.computedData})})})}).pipe(Pt(1));return B({pathSelection:f,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:c}).pipe(I(n),Y(async h=>h)).subscribe(h=>{h.pathSelection.on("mouseover",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})})}),B({pathSelection:f,highlight:e.seriesHighlight$.pipe(O(h=>h.map(p=>p.id))),fullChartParams:e.fullChartParams$,arc:u,arcHighlight:l}).pipe(I(n),Y(async h=>h)).subscribe(h=>{uI({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const cI=Cn(jh,ix)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,{seriesCenterSelection$:o}=Io({selection:t,pluginName:jh,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=X(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),O(d=>d[l]??d[0])),p=r.seriesContainerPosition$.pipe(I(i),O(d=>d[l]??d[0]));a[l]=lI(jh,{containerSelection:f,computedData$:r.computedData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),ku="PieEventTexts",hx=at(ku,"text");function Xh(t,e){const n=t.selectAll(`text.${hx}`).data(e),r=n.enter().append("text").classed(hx,!0),i=n.merge(r);return i.each((o,a,s)=>{const u=X(s[a]).text(o.text);Object.keys(o.attr).forEach(l=>{u.attr(l,o.attr[l])}),Object.keys(o.style).forEach(l=>{u.style(l,o.style[l])})}),n.exit().remove(),i}function Zh({eventData:t,eventName:e,t:n,eventFn:r,textAttrs:i,textStyles:o}){return r(t,e,n).map((s,u)=>({text:s,attr:i[u],style:o[u]}))}function fI(t,e){const n=new et;let r;const i=e.fullChartParams$.pipe(I(n),O(o=>o.highlightTarget),rt());return B({computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:i}).pipe(I(n),Y(async o=>o)).subscribe(o=>{e.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>u=>{const l=Zh({eventData:{type:"series",pluginName:t,eventName:"transitionMove",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:u,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});Xh(e.containerSelection,l)}).on("end",(a,s)=>{const u=Zh({eventData:{type:"series",pluginName:t,eventName:"transitionEnd",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});Xh(e.containerSelection,u),r&&r.unsubscribe(),r=e.event$.subscribe(l=>{const c=Zh({eventData:l,eventName:l.eventName,t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});Xh(e.containerSelection,c)})})}),()=>{n.next(void 0)}}const hI=Cn(ku,ox)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,{seriesCenterSelection$:o}=Io({selection:t,pluginName:ku,separateSeries$:n.separateSeries$,seriesLabels$:n.seriesLabels$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=X(c[l]),h=n.computedLayoutData$.pipe(I(i),O(d=>d[l]??d[0])),p=n.seriesContainerPosition$.pipe(I(i),O(d=>d[l]??d[0]));a[l]=fI(ku,{containerSelection:f,computedData$:n.computedData$,containerComputedLayoutData$:h,SeriesDataMap$:n.SeriesDataMap$,fullParams$:n.fullParams$,fullChartParams$:n.fullChartParams$,seriesHighlight$:n.seriesHighlight$,seriesContainerPosition$:p,event$:r.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),Iu="PieLabels",pI=at(Iu,"text");function dI(t,e,n,r){return t.map((i,o)=>{const[a,s]=e.centroid(i),[u,l]=n.centroid(i);return{pieDatum:i,arcIndex:o,arcLabel:i.data.label,x:a*r,y:s*r,mouseoverX:u*r,mouseoverY:l*r}}).filter(i=>i.pieDatum.data.visible)}function gI(t,e,n,r){let i=t.selectAll("text").data(e,u=>u.pieDatum.id),o=i.enter().append("text").classed(pI,!0),a=i.exit();o.append("text");const s=i.merge(o);return s.attr("font-weight","bold").attr("text-anchor","middle").style("dominant-baseline","middle").style("cursor",u=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").text(u=>n.labelFn(u.pieDatum.data)).attr("font-size",r.styles.textSize).attr("fill",(u,l)=>Lu({datum:u.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).transition().attr("transform",u=>"translate("+u.x+","+u.y+")"),a.remove(),s}function mI({labelSelection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition().duration(200).attr("transform",r=>"translate("+r.x+","+r.y+")").style("opacity",1);return}t.each((r,i,o)=>{const a=X(o[i]);e.includes(r.pieDatum.id)?a.style("opacity",1).transition().duration(200).attr("transform",s=>"translate("+s.mouseoverX+","+s.mouseoverY+")"):a.style("opacity",n.styles.unhighlightedOpacity).transition().duration(200).attr("transform",s=>"translate("+s.x+","+s.y+")")})}function yI(t,e){const n=new et;let r=new et,i=[];const o=e.seriesContainerPosition$.pipe(I(n),O(a=>a.width<a.height?a.width:a.height),rt());return B({shorterSideWith:o,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),Y(async a=>a)).subscribe(a=>{const s=Tu({axisWidth:a.shorterSideWith,innerRadius:0,outerRadius:a.fullParams.outerRadius,padAngle:0,cornerRadius:0}),u=Tu({axisWidth:a.shorterSideWith,innerRadius:0,outerRadius:a.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),l=cx({data:a.containerVisibleComputedLayoutData,startAngle:a.fullParams.startAngle,endAngle:a.fullParams.endAngle});i=dI(l,s,u,a.fullParams.labelCentroid);const c=gI(e.containerSelection,i,a.fullParams,a.fullChartParams);r.next(c)}),B({labelSelection:r,highlight:e.seriesHighlight$.pipe(O(a=>a.map(s=>s.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),Y(async a=>a)).subscribe(a=>{mI({labelSelection:a.labelSelection,ids:a.highlight,fullChartParams:a.fullChartParams})}),()=>{n.next(void 0)}}const bI=Cn(Iu,ax)(({selection:t,observer:e,subject:n})=>{const r=new et,{seriesCenterSelection$:i}=Io({selection:t,pluginName:Iu,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=X(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),O(p=>p[u]??p[0])),h=e.seriesContainerPosition$.pipe(I(r),O(p=>p[u]??p[0]));o[u]=yI(Iu,{containerSelection:c,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),Kh="Rose",vI=Math.PI*2,px=0;function xI({cornerRadius:t,outerRadius:e,axisWidth:n,maxValue:r,arcScaleType:i}){const o=n/2*e,a=i==="area"?.5:1,s=Kr().domain([0,r]).range([0,o]).exponent(a);return u=>{const l=s(u.prevValue),c=s(u.value),f=qe(l,c);return h=>{const p=f(h);return mu().innerRadius(0).outerRadius(p).padAngle(px).padRadius(p).cornerRadius(t)(u)}}}function _I({pathSelection:t,ids:e,fullParams:n,fullChartParams:r,tweenArc:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>i(o)(1));return}t.each((o,a,s)=>{const u=X(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(ji).duration(500).attr("d",l=>i({...l,startAngle:l.startAngle-n.mouseoverAngleIncrease,endAngle:l.endAngle+n.mouseoverAngleIncrease})(1)):u.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>i(l)(1))})}function wI(t,e){const n=new et,r=at(t,"path");let i=[];const o=e.seriesContainerPosition$.pipe(I(n),O(p=>p.width<p.height?p.width:p.height),rt()),a=B({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),Y(async p=>p),O(p=>{const d=vI/p.containerVisibleComputedLayoutData.length;return p.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:d*m,endAngle:d*(m+1),padAngle:px,prevValue:i[m]&&i[m].id===g.id?i[m].value:0}))})),s=e.fullChartParams$.pipe(I(n),O(p=>p.highlightTarget),rt()),u=e.visibleComputedLayoutData$.pipe(O(p=>Math.max(...p.flat().map(d=>d.value))),rt()),l=B({fullParams:e.fullParams$,axisWidth:o,maxValue:u}).pipe(I(n),Y(async p=>p),O(p=>xI({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType}))),c=e.fullChartParams$.pipe(I(n),O(p=>p.transitionDuration),rt()),f=new kx(!1),h=new pt(p=>{B({pieData:a,tweenArc:l,transitionDuration:c}).pipe(I(n),Y(async d=>d)).subscribe(d=>{const g=d.pieData.map((b,x)=>(b.prevValue=i[x]&&i[x].id===b.id?i[x].value:0,b));f.next(!0);const m=e.containerSelection.selectAll("path").data(g,b=>b.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(b,x)=>b.data.color);m.interrupt("graphicMove"),m.transition("graphicMove").duration(d.transitionDuration).attrTween("d",d.tweenArc).on("end",()=>{p.next(m),f.next(!1)}),i=Object.assign([],g)})}).pipe(Pt(1));return B({pathSelection:h,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:s}).pipe(I(n),Y(async p=>p)).subscribe(p=>{p.pathSelection.on("mouseover",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mousemove",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mouseout",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("click",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})})}),B({pathSelection:h,highlight:e.seriesHighlight$.pipe(O(p=>p.map(d=>d.id))),fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,tweenArc:l,isTransitionMoving:f}).pipe(I(n),Y(async p=>p),li(p=>!p.isTransitionMoving)).subscribe(p=>{_I({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const $I=Cn(Kh,sx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,{seriesCenterSelection$:o}=Io({selection:t,pluginName:Kh,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=X(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),O(d=>JSON.parse(JSON.stringify(d[l]??d[0])))),p=r.seriesContainerPosition$.pipe(I(i),O(d=>JSON.parse(JSON.stringify(d[l]??d[0]))));a[l]=wI(Kh,{containerSelection:f,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),Nu="RoseLabels",SI=at(Nu,"text");function AI({pieData:t,centroid:e,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o}){const a=i/2*o,s=n==="area"?.5:1,u=Kr().domain([0,r]).range([0,a]).exponent(s);return t.map((l,c)=>{const f=u(l.value),h=mu().innerRadius(0).outerRadius(f).padAngle(0).padRadius(f).cornerRadius(0),[p,d]=h.centroid(l),[g,m]=[p,d];return{pieDatum:l,arcIndex:c,arcLabel:l.data.label,x:p*e,y:d*e,mouseoverX:g*e,mouseoverY:m*e}}).filter(l=>l.pieDatum.data.visible)}function MI(t,e,n,r){let i=t.selectAll("text").data(e,u=>u.pieDatum.id),o=i.enter().append("text").classed(SI,!0),a=i.exit();o.append("text");const s=i.merge(o);return s.attr("font-weight","bold").attr("text-anchor","middle").style("dominant-baseline","middle").style("cursor",u=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").text(u=>n.labelFn(u.pieDatum.data)).attr("font-size",r.styles.textSize).attr("fill",(u,l)=>Lu({datum:u.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).transition().attr("transform",u=>"translate("+u.x+","+u.y+")"),a.remove(),s}function DI({labelSelection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition().duration(200).attr("transform",r=>"translate("+r.x+","+r.y+")").style("opacity",1);return}t.each((r,i,o)=>{const a=X(o[i]);e.includes(r.pieDatum.data.id)?a.style("opacity",1).transition().duration(200).attr("transform",s=>"translate("+s.mouseoverX+","+s.mouseoverY+")"):a.style("opacity",n.styles.unhighlightedOpacity).transition().duration(200).attr("transform",s=>"translate("+s.x+","+s.y+")")})}function PI(t,e){const n=new et;let r=new et,i=[];const o=e.seriesContainerPosition$.pipe(I(n),O(s=>s.width<s.height?s.width:s.height),rt()),a=e.visibleComputedLayoutData$.pipe(O(s=>Math.max(...s.flat().map(u=>u.value))),rt());return B({shorterSideWith:o,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,maxValue:a,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),Y(async s=>s)).subscribe(s=>{const u=Math.PI*2/s.containerVisibleComputedLayoutData.length,l=s.containerVisibleComputedLayoutData.map((f,h)=>({id:f.id,data:f,index:h,value:f.value,startAngle:u*h,endAngle:u*(h+1),padAngle:0}));i=AI({pieData:l,centroid:s.fullParams.labelCentroid,arcScaleType:s.fullParams.arcScaleType,maxValue:s.maxValue,axisWidth:s.shorterSideWith,outerRadius:s.fullParams.outerRadius});const c=MI(e.containerSelection,i,s.fullParams,s.fullChartParams);r.next(c)}),B({labelSelection:r,highlight:e.seriesHighlight$.pipe(O(s=>s.map(u=>u.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),Y(async s=>s)).subscribe(s=>{DI({labelSelection:s.labelSelection,ids:s.highlight,fullChartParams:s.fullChartParams})}),()=>{n.next(void 0)}}const TI=Cn(Nu,ux)(({selection:t,observer:e,subject:n})=>{const r=new et,{seriesCenterSelection$:i}=Io({selection:t,pluginName:Nu,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=X(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),O(p=>JSON.parse(JSON.stringify(p[u]??p[0])))),h=e.seriesContainerPosition$.pipe(I(r),O(p=>JSON.parse(JSON.stringify(p[u]??p[0]))));o[u]=PI(Nu,{containerSelection:c,visibleComputedLayoutData$:e.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),dx="SeriesLegend",LI=Cn(dx,lx)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new et,o=n.SeriesDataMap$.pipe(I(i),O(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),O(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Cu(dx,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),gx={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(t,e)=>e.value-t.value},mx={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},yx="TreeLegend",CI=ng(yx,mx)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new et,o=n.CategoryDataMap$.pipe(I(i),O(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),O(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Cu(yx,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),sr="TreeMap",bx=at(sr,"tree"),vx=at(sr,"tile");function EI({selection:t,treeData:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=t.selectAll(`g.${bx}`).data(e,u=>u.data.id).join("g").attr("class",bx);return s.attr("transform",u=>!u.x0||!u.y0?null:`translate(${u.x0},${u.y0})`).each((u,l,c)=>{const f=X(c[l]);f.selectAll(`rect.${vx}`).data([u],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",vx).attr("cursor","pointer").attr("width",h=>h.x1-h.x0).attr("height",h=>h.y1-h.y0).attr("fill",h=>h.data.color).attr("data-name",h=>h.data.label).attr("data-category",h=>h.data.categoryLabel).attr("data-value",h=>h.data.value),f.selectAll("g").data([u]).join("g").each((h,p,d)=>{X(d[p]).selectAll("text").data([h]).join("text").text(m=>m.data.label).attr("dominant-baseline","hanging").attr("x",o).attr("y",o).attr("font-size",r.styles.textSize).each(function(m){const b=X(this),x=m.data.label.split(/\s+/).reverse();let v,y=[];const w=b.attr("x");let D=b.attr("y"),P=0,S=b.text(null).append("tspan").attr("cursor","pointer").attr("fill",Ct(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",w).attr("y",D);for(;v=x.pop();)y.push(v),S.text(y.join(" ")),S.node().getComputedTextLength()>m.x1-m.x0-o&&(y.pop(),S.text(y.join(" ")),y=[v],P+=a,S=b.append("tspan").attr("cursor","pointer").attr("fill",Ct(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",w).attr("y",D).attr("dy",P+"px").text(v))})})}),s}function RI({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.data.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const kI=ng(sr,gx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=B({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(I(i),Y(async u=>u),O(u=>{const l=$y().size([u.layout.width,u.layout.height]).paddingInner(u.fullParams.paddingInner).paddingOuter(u.fullParams.paddingOuter).round(!0).tile(Wf.ratio(u.fullParams.squarifyRatio)),c=js(u.visibleComputedData).sum(h=>h.value).sort(u.fullParams.sort);return l(c),c.leaves()})),a=B({selection:Bo(t),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(I(i),Y(async u=>u),O(u=>EI({selection:t,treeData:u.treeData,fullParams:u.fullParams,fullChartParams:u.fullChartParams,textSizePx:u.textSizePx}))),s=r.fullChartParams$.pipe(I(i),O(u=>u.highlightTarget),rt());return B({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(I(i),Y(async u=>u)).subscribe(u=>{u.cellSelection.on("mouseover",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:sr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mousemove",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mousemove",pluginName:sr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mouseout",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseout",pluginName:sr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("click",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"click",pluginName:sr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})})}),B({cellSelection:a,highlight:r.treeHighlight$.pipe(O(u=>u.map(l=>l.id))),fullChartParams:r.fullChartParams$}).pipe(I(i),Y(async u=>u)).subscribe(u=>{RI({selection:u.cellSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{i.next(void 0)}});Z.BarStack=ik,Z.Bars=ZR,Z.BarsPN=KR,Z.BarsTriangle=hk,Z.Bubbles=oI,Z.CONTAINER_PLUGIN_PARAMS=tx,Z.Container=jk,Z.DEFAULT_BARS_DIVERGING_PARAMS=xx,Z.DEFAULT_BARS_PARAMS=Fo,Z.DEFAULT_BARS_TRIANGLE_PARAMS=np,Z.DEFAULT_BAR_STACK_PARAMS=ep,Z.DEFAULT_BUBBLES_PARAMS=rx,Z.DEFAULT_DOTS_PARAMS=Jh,Z.DEFAULT_GRID_LEGEND_PARAMS=ap,Z.DEFAULT_GROUP_AREA_PARAMS=tp,Z.DEFAULT_GROUP_AXIS_PARAMS=rp,Z.DEFAULT_LINES_PARAMS=ur,Z.DEFAULT_LINE_AREAS_PARAMS=Qh,Z.DEFAULT_MULTI_BARS_PARAMS=C2,Z.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=R2,Z.DEFAULT_MULTI_BAR_STACK_PARAMS=E2,Z.DEFAULT_MULTI_DOTS_PARAMS=N2,Z.DEFAULT_MULTI_GRID_LEGEND_PARAMS=T2,Z.DEFAULT_MULTI_GROUP_AXIS_PARAMS=L2,Z.DEFAULT_MULTI_LINES_PARAMS=k2,Z.DEFAULT_MULTI_LINE_AREAS_PARAMS=I2,Z.DEFAULT_MULTI_VALUE_AXIS_PARAMS=Ru,Z.DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS=Rk,Z.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=kh,Z.DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS=F2,Z.DEFAULT_PIE_EVENT_TEXTS_PARAMS=ox,Z.DEFAULT_PIE_LABELS_PARAMS=ax,Z.DEFAULT_PIE_PARAMS=ix,Z.DEFAULT_ROSE_LABELS_PARAMS=ux,Z.DEFAULT_ROSE_PARAMS=sx,Z.DEFAULT_SCALING_AREA_PARAMS=op,Z.DEFAULT_SERIES_LEGEND_PARAMS=lx,Z.DEFAULT_TREE_LEGEND_PARAMS=mx,Z.DEFAULT_TREE_MAP_PARAMS=gx,Z.DEFAULT_VALUE_AXIS_PARAMS=Fu,Z.DEFAULT_VALUE_STACK_AXIS_PARAMS=ip,Z.Dots=mk,Z.GridLegend=bk,Z.GroupAux=Ek,Z.GroupAxis=xk,Z.LineAreas=YR,Z.Lines=NR,Z.MultiBarStack=Nk,Z.MultiBars=Ik,Z.MultiBarsTriangle=Fk,Z.MultiDots=Ok,Z.MultiGridLegend=kk,Z.MultiGroupAxis=Uk,Z.MultiLineAreas=zk,Z.MultiLines=Gk,Z.MultiValueAxis=Bk,Z.MultiValueStackAxis=Yk,Z.OverlappingValueAxes=Wk,Z.OverlappingValueStackAxes=Vk,Z.Pie=cI,Z.PieEventTexts=hI,Z.PieLabels=bI,Z.Rose=$I,Z.RoseLabels=TI,Z.ScalingArea=Ak,Z.SeriesLegend=LI,Z.TOOLTIP_PARAMS=ex,Z.Tooltip=Kk,Z.TreeLegend=CI,Z.TreeMap=kI,Z.ValueAxis=wk,Z.ValueStackAxis=$k,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
|
@@ -2,7 +2,7 @@ import { Observable } from 'rxjs';
|
|
2
2
|
import { ContextObserverMultiGrid, ContextObserverMultiGridDetail } from '@orbcharts/core';
|
3
3
|
|
4
4
|
interface MultiGridPluginParams {
|
5
|
-
gridIndexes: number[];
|
5
|
+
gridIndexes: number[] | 'all';
|
6
6
|
}
|
7
7
|
export declare const multiGridPluginDetailObservables: (observer: ContextObserverMultiGrid<MultiGridPluginParams>) => Observable<ContextObserverMultiGridDetail[]>;
|
8
8
|
export {};
|
@@ -26,31 +26,31 @@ export interface MultiGridLegendParams {
|
|
26
26
|
textColorType: ColorType;
|
27
27
|
}
|
28
28
|
export interface MultiGroupAxisParams extends BaseGroupAxisParams {
|
29
|
-
gridIndexes: number[];
|
29
|
+
gridIndexes: number[] | 'all';
|
30
30
|
}
|
31
31
|
export interface MultiValueAxisParams extends BaseValueAxisParams {
|
32
|
-
gridIndexes: number[];
|
32
|
+
gridIndexes: number[] | 'all';
|
33
33
|
}
|
34
34
|
export interface MultiValueStackAxisParams extends BaseValueAxisParams {
|
35
|
-
gridIndexes: number[];
|
35
|
+
gridIndexes: number[] | 'all';
|
36
36
|
}
|
37
37
|
export interface MultiBarsParams extends BaseBarsParams {
|
38
|
-
gridIndexes: number[];
|
38
|
+
gridIndexes: number[] | 'all';
|
39
39
|
}
|
40
40
|
export interface MultiBarStackParams extends BaseBarStackParams {
|
41
|
-
gridIndexes: number[];
|
41
|
+
gridIndexes: number[] | 'all';
|
42
42
|
}
|
43
43
|
export interface MultiBarsTriangleParams extends BaseBarsTriangleParams {
|
44
|
-
gridIndexes: number[];
|
44
|
+
gridIndexes: number[] | 'all';
|
45
45
|
}
|
46
46
|
export interface MultiLinesParams extends BaseLinesParams {
|
47
|
-
gridIndexes: number[];
|
47
|
+
gridIndexes: number[] | 'all';
|
48
48
|
}
|
49
49
|
export interface MultiLineAreasParams extends BaseLineAreasParams {
|
50
|
-
gridIndexes: number[];
|
50
|
+
gridIndexes: number[] | 'all';
|
51
51
|
}
|
52
52
|
export interface MultiDotsParams extends BaseDotsParams {
|
53
|
-
gridIndexes: number[];
|
53
|
+
gridIndexes: number[] | 'all';
|
54
54
|
}
|
55
55
|
export interface OverlappingValueAxesParams {
|
56
56
|
firstAxis: BaseValueAxisParams;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orbcharts/plugins-basic",
|
3
|
-
"version": "3.0.0-alpha.
|
3
|
+
"version": "3.0.0-alpha.54",
|
4
4
|
"description": "plugins for OrbCharts",
|
5
5
|
"author": "Blue Planet Inc.",
|
6
6
|
"license": "Apache-2.0",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
"vite-plugin-dts": "^3.7.3"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@orbcharts/core": "^3.0.0-alpha.
|
38
|
+
"@orbcharts/core": "^3.0.0-alpha.50",
|
39
39
|
"d3": "^7.8.5",
|
40
40
|
"rxjs": "^7.8.1"
|
41
41
|
}
|
@@ -19,7 +19,7 @@ import type {
|
|
19
19
|
|
20
20
|
// 可設定多個gridIndex的params
|
21
21
|
interface MultiGridPluginParams {
|
22
|
-
gridIndexes: number[]
|
22
|
+
gridIndexes: number[] | 'all'
|
23
23
|
}
|
24
24
|
|
25
25
|
// 對應grid資料的plugin所需Observable(必須有gridIndexes)
|
@@ -35,6 +35,11 @@ export const multiGridPluginDetailObservables = (observer: ContextObserverMultiG
|
|
35
35
|
gridIndexes: gridIndexes$,
|
36
36
|
}).pipe(
|
37
37
|
map(data => {
|
38
|
+
// 對應所有grid
|
39
|
+
if (data.gridIndexes === 'all') {
|
40
|
+
return data.multiGridEachDetail
|
41
|
+
}
|
42
|
+
// 自訂對應grid
|
38
43
|
return data.gridIndexes.map(gridIndex => {
|
39
44
|
return data.multiGridEachDetail[gridIndex] ?? data.multiGridEachDetail[0]
|
40
45
|
})
|
package/src/multiGrid/types.ts
CHANGED
@@ -29,39 +29,39 @@ export interface MultiGridLegendParams {
|
|
29
29
|
}
|
30
30
|
|
31
31
|
export interface MultiGroupAxisParams extends BaseGroupAxisParams {
|
32
|
-
gridIndexes: number[]
|
32
|
+
gridIndexes: number[] | 'all'
|
33
33
|
}
|
34
34
|
|
35
35
|
export interface MultiValueAxisParams extends BaseValueAxisParams {
|
36
|
-
gridIndexes: number[]
|
36
|
+
gridIndexes: number[] | 'all'
|
37
37
|
}
|
38
38
|
|
39
39
|
export interface MultiValueStackAxisParams extends BaseValueAxisParams {
|
40
|
-
gridIndexes: number[]
|
40
|
+
gridIndexes: number[] | 'all'
|
41
41
|
}
|
42
42
|
|
43
43
|
export interface MultiBarsParams extends BaseBarsParams {
|
44
|
-
gridIndexes: number[]
|
44
|
+
gridIndexes: number[] | 'all'
|
45
45
|
}
|
46
46
|
|
47
47
|
export interface MultiBarStackParams extends BaseBarStackParams {
|
48
|
-
gridIndexes: number[]
|
48
|
+
gridIndexes: number[] | 'all'
|
49
49
|
}
|
50
50
|
|
51
51
|
export interface MultiBarsTriangleParams extends BaseBarsTriangleParams {
|
52
|
-
gridIndexes: number[]
|
52
|
+
gridIndexes: number[] | 'all'
|
53
53
|
}
|
54
54
|
|
55
55
|
export interface MultiLinesParams extends BaseLinesParams {
|
56
|
-
gridIndexes: number[]
|
56
|
+
gridIndexes: number[] | 'all'
|
57
57
|
}
|
58
58
|
|
59
59
|
export interface MultiLineAreasParams extends BaseLineAreasParams {
|
60
|
-
gridIndexes: number[]
|
60
|
+
gridIndexes: number[] | 'all'
|
61
61
|
}
|
62
62
|
|
63
63
|
export interface MultiDotsParams extends BaseDotsParams {
|
64
|
-
gridIndexes: number[]
|
64
|
+
gridIndexes: number[] | 'all'
|
65
65
|
}
|
66
66
|
|
67
67
|
export interface OverlappingValueAxesParams {
|