@orbcharts/plugins-basic 3.0.0-alpha.55 → 3.0.0-alpha.56
Sign up to get free protection for your applications and to get access to all the features.
@@ -20264,15 +20264,16 @@ const Bx = ({ fullDataFormatter$: t, layout$: e }) => {
|
|
20264
20264
|
U(async (c) => c),
|
20265
20265
|
O((c) => {
|
20266
20266
|
c.fullDataFormatter.gridList[c.secondGridIndex] || (c.fullDataFormatter.gridList[c.secondGridIndex] = Object.assign({}, c.fullDataFormatter.gridList[c.firstGridIndex]));
|
20267
|
-
|
20268
|
-
|
20267
|
+
const f = c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;
|
20268
|
+
let h = f;
|
20269
|
+
return f === "left" ? h = "right" : f === "bottom" ? h = "top" : f === "top" ? h = "bottom" : f === "right" && (h = "left"), {
|
20269
20270
|
type: "grid",
|
20270
20271
|
visibleFilter: c.fullDataFormatter.visibleFilter,
|
20271
20272
|
grid: {
|
20272
20273
|
...c.fullDataFormatter.gridList[c.secondGridIndex],
|
20273
20274
|
valueAxis: {
|
20274
20275
|
...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,
|
20275
|
-
position:
|
20276
|
+
position: h
|
20276
20277
|
}
|
20277
20278
|
},
|
20278
20279
|
container: {
|
@@ -20351,15 +20352,16 @@ const Bx = ({ fullDataFormatter$: t, layout$: e }) => {
|
|
20351
20352
|
U(async (c) => c),
|
20352
20353
|
O((c) => {
|
20353
20354
|
c.fullDataFormatter.gridList[c.secondGridIndex] || (c.fullDataFormatter.gridList[c.secondGridIndex] = Object.assign({}, c.fullDataFormatter.gridList[c.firstGridIndex]));
|
20354
|
-
|
20355
|
-
|
20355
|
+
const f = c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;
|
20356
|
+
let h = f;
|
20357
|
+
return f === "left" ? h = "right" : f === "bottom" ? h = "top" : f === "top" ? h = "bottom" : f === "right" && (h = "left"), {
|
20356
20358
|
type: "grid",
|
20357
20359
|
visibleFilter: c.fullDataFormatter.visibleFilter,
|
20358
20360
|
grid: {
|
20359
20361
|
...c.fullDataFormatter.gridList[c.secondGridIndex],
|
20360
20362
|
valueAxis: {
|
20361
20363
|
...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,
|
20362
|
-
position:
|
20364
|
+
position: h
|
20363
20365
|
}
|
20364
20366
|
},
|
20365
20367
|
container: {
|
@@ -12,7 +12,7 @@
|
|
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 f2=(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=Eh({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)}},h2="LineAreas",YR=se(h2,ap)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=f2(h2,{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()}}),p2=.3;function d2({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 Jf().domain(e).range([-i/2+r,i/2-r])}function WR(t,e){return t<=1?0:e/(t-1)*p2}function VR(t,e){return t<=1?e:e*(1-p2)}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 Rh=(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?d2({axisWidth:k.gridAxesSize.width,groupAmount:k.computedData[0]?k.computedData[0].length:0,barAmountOfGroup:1,barPadding:k.params.barPadding,barGroupPadding:k.params.barGroupPadding}):d2({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)}},g2="Bars",ZR=se(g2,Fo)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=Rh(g2,{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()}}),m2="BarsPN",KR=se(m2,Fo)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=Rh(m2,{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()}}),y2=.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)*y2}function tk(t,e){return t<=1?e:e*(1-y2)}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 b2=(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)}},v2="BarStack",ik=se(v2,up)(({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$,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()}}),x2=.3;function _2({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 Jf().domain(e).range([-i/2+r,i/2-r])}function ak(t,e){return t<=1?0:e/(t-1)*x2}function sk(t,e){return t<=1?e:e*(1-x2)}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 w2=(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?_2({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):_2({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)}},$2="BarsTriangle",hk=se($2,lp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=w2($2,{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 S2=(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)}},A2="Dots",mk=se(A2,sp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=S2(A2,{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 M2(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=M2($,_.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=u2($,_.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"?M2(z.seriesIndex,_.fullChartParams):Ct(_.fullParams.textColorType,_.fullChartParams)).text(z=>z.text)})})).subscribe(),()=>{f.next(void 0)}},D2="GridLegend",bk=se(D2,hp)(({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(D2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),kh=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-kh-r.labelOffset[1]})`);const d=Math.floor(c[1])-Math.ceil(c[0])+1,g=Fg(l).scale(l).ticks(r.ticks==="all"||r.ticks>d?d:r.ticks).tickSize(r.tickFullLine==!0?-a.height:kh).tickSizeOuter(0).tickFormat(b=>{const x=f[b]??"";return Ch(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+kh}`).style("transform",h),p}const P2=(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)}},T2="GroupAxis",xk=se(T2,Gu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=P2(T2,{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()}}),L2=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=Gg(l).scale(l).ticks(p>r.ticks?r.ticks:f[0]===0&&f[1]===0?1:Math.ceil(p)).tickFormat(b=>Ch(b,r.tickFormat)).tickSize(r.tickFullLine==!0?-a.width:L2).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+L2} 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 _=ag({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)}},C2="ValueAxis",wk=se(C2,zu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=ai(C2,{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()}}),E2="ValueStackAxis",$k=se(E2,cp)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=ai(E2,{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()}}),R2="ScalingArea",Sk=at(R2,"rect"),Ak=se(R2,fp)(({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=ag({maxValue:l.groupMaxIndex,minValue:0,axisWidth:l.axisSize.width,scaleDomain:[h,p],scaleRange:[0,1]}).copy(),m=a2().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 k2(t,e){let n=new pt(()=>{});return t.each(function(){const r=Qu(this,e);n=Ju(n,r)}),n}const Eu="GroupAux",Ih=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:Ch(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.${Ih}`).data(e),l=u.enter().append("g").classed(Ih,!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=u2(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.${Ih}`).data([]).exit().remove()}const Ek=se(Eu,Fu)(({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=Eh({fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$}),d=i.fullChartParams$.pipe(I(o),O(y=>y.highlightTarget),rt()),g=k2(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=k2(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()}}),I2={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"},Nh={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]};Nh.tickFormat.toString=()=>"text => text";const 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},N2={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},F2={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},G2={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},z2={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},O2={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},U2={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Fh={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]},B2={...Fh},Y2="MultiGridLegend",kk=pe(Y2,I2)(({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=xl(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(Y2,{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])))},Gh="MultiBars",H2=at(Gh,"grid"),Ik=pe(Gh,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]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=Rh(Gh,{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())}}),zh="MultiBarStack",W2=at(zh,"grid"),Nk=pe(zh,F2)(({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]=b2(zh,{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())}}),Oh="MultiBarsTriangle",V2=at(Oh,"grid"),Fk=pe(Oh,G2)(({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]=w2(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$,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())}}),Uh="MultiLines",j2=at(Uh,"grid"),Gk=pe(Uh,z2)(({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]);o[l]=l2(Uh,{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())}}),Bh="MultiLineAreas",q2=at(Bh,"grid"),zk=pe(Bh,O2)(({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.${q2}`).data(s).join("g").attr("class",q2).each((u,l,c)=>{const f=X(c[l]);o[l]=f2(Bh,{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())}}),Yh="MultiDots",X2=at(Yh,"grid"),Ok=pe(Yh,U2)(({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.${X2}`).data(s).join("g").attr("class",X2).each((u,l,c)=>{const f=X(c[l]);o[l]=S2(Yh,{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())}}),Hh="MultiGroupAxis",Z2=at(Hh,"grid"),Uk=pe(Hh,Nh)(({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]=P2(Hh,{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())}}),Wh="MultiValueAxis",K2=at(Wh,"grid"),Bk=pe(Wh,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.${K2}`).data(s).join("g").attr("class",K2).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(Wh,{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())}}),Vh="MultiValueStackAxis",Q2=at(Vh,"grid"),Yk=pe(Vh,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.${Q2}`).data(s).join("g").attr("class",Q2).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(Vh,{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 J2(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 tx=({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):(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)}))},ex=({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)`}})),nx=({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 J2(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=J2(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),jh="OverlappingValueAxes",rx=at(jh,"grid"),Wk=pe(jh,Fh)(({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=tx({fullDataFormatter$:u,layout$:r.layout$}),d=ex({gridAxesTransform$:p}),g=nx({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.${rx}`).data(c).join("g").attr("class",rx).each((f,h,p)=>{if(h>1)return;const d=X(p[h]);o[h]=ai(jh,{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())}}),qh="OverlappingValueStackAxes",ix=at(qh,"grid"),Vk=pe(qh,B2)(({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=tx({fullDataFormatter$:u,layout$:r.layout$}),d=ex({gridAxesTransform$:p}),g=nx({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.${ix}`).data(c).join("g").attr("class",ix).each((f,h,p)=>{if(h>1)return;const d=X(p[h]);o[h]=ai(qh,{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())}}),ox={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},Xh={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};Xh.textRenderFn.toString=()=>`(eventData) => {
|
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 w2=(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?_2({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):_2({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)}},$2="BarsTriangle",hk=se($2,lp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=w2($2,{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 S2=(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)}},A2="Dots",mk=se(A2,sp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new et,o=S2(A2,{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 M2(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=M2($,_.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=u2($,_.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"?M2(z.seriesIndex,_.fullChartParams):Ct(_.fullParams.textColorType,_.fullChartParams)).text(z=>z.text)})})).subscribe(),()=>{f.next(void 0)}},D2="GridLegend",bk=se(D2,hp)(({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(D2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),kh=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-kh-r.labelOffset[1]})`);const d=Math.floor(c[1])-Math.ceil(c[0])+1,g=Fg(l).scale(l).ticks(r.ticks==="all"||r.ticks>d?d:r.ticks).tickSize(r.tickFullLine==!0?-a.height:kh).tickSizeOuter(0).tickFormat(b=>{const x=f[b]??"";return Ch(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+kh}`).style("transform",h),p}const P2=(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)}},T2="GroupAxis",xk=se(T2,Gu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=P2(T2,{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()}}),L2=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=Gg(l).scale(l).ticks(p>r.ticks?r.ticks:f[0]===0&&f[1]===0?1:Math.ceil(p)).tickFormat(b=>Ch(b,r.tickFormat)).tickSize(r.tickFullLine==!0?-a.width:L2).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+L2} 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 _=ag({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)}},C2="ValueAxis",wk=se(C2,zu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=ai(C2,{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()}}),E2="ValueStackAxis",$k=se(E2,cp)(({selection:t,name:e,observer:n,subject:r})=>{const i=new et,o=ai(E2,{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()}}),R2="ScalingArea",Sk=at(R2,"rect"),Ak=se(R2,fp)(({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=ag({maxValue:l.groupMaxIndex,minValue:0,axisWidth:l.axisSize.width,scaleDomain:[h,p],scaleRange:[0,1]}).copy(),m=a2().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 k2(t,e){let n=new pt(()=>{});return t.each(function(){const r=Qu(this,e);n=Ju(n,r)}),n}const Eu="GroupAux",Ih=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:Ch(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.${Ih}`).data(e),l=u.enter().append("g").classed(Ih,!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=u2(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.${Ih}`).data([]).exit().remove()}const Ek=se(Eu,Fu)(({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=Eh({fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$}),d=i.fullChartParams$.pipe(I(o),O(y=>y.highlightTarget),rt()),g=k2(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=k2(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()}}),I2={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"},Nh={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]};Nh.tickFormat.toString=()=>"text => text";const 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},N2={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},F2={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},G2={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},z2={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},O2={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},U2={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Fh={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]},B2={...Fh},Y2="MultiGridLegend",kk=pe(Y2,I2)(({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=xl(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(Y2,{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])))},Gh="MultiBars",H2=at(Gh,"grid"),Ik=pe(Gh,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]),h=u.dataFormatter$.pipe(I(i),O(p=>p.grid.separateSeries),rt(),Pt(1));o[l]=Rh(Gh,{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())}}),zh="MultiBarStack",W2=at(zh,"grid"),Nk=pe(zh,F2)(({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]=b2(zh,{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())}}),Oh="MultiBarsTriangle",V2=at(Oh,"grid"),Fk=pe(Oh,G2)(({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]=w2(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$,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())}}),Uh="MultiLines",j2=at(Uh,"grid"),Gk=pe(Uh,z2)(({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]);o[l]=l2(Uh,{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())}}),Bh="MultiLineAreas",q2=at(Bh,"grid"),zk=pe(Bh,O2)(({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.${q2}`).data(s).join("g").attr("class",q2).each((u,l,c)=>{const f=X(c[l]);o[l]=f2(Bh,{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())}}),Yh="MultiDots",X2=at(Yh,"grid"),Ok=pe(Yh,U2)(({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.${X2}`).data(s).join("g").attr("class",X2).each((u,l,c)=>{const f=X(c[l]);o[l]=S2(Yh,{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())}}),Hh="MultiGroupAxis",Z2=at(Hh,"grid"),Uk=pe(Hh,Nh)(({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]=P2(Hh,{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())}}),Wh="MultiValueAxis",K2=at(Wh,"grid"),Bk=pe(Wh,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.${K2}`).data(s).join("g").attr("class",K2).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(Wh,{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())}}),Vh="MultiValueStackAxis",Q2=at(Vh,"grid"),Yk=pe(Vh,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.${Q2}`).data(s).join("g").attr("class",Q2).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(Vh,{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 J2(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 tx=({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):(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)}))},ex=({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)`}})),nx=({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 J2(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=J2(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),jh="OverlappingValueAxes",rx=at(jh,"grid"),Wk=pe(jh,Fh)(({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]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h}},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=tx({fullDataFormatter$:u,layout$:r.layout$}),d=ex({gridAxesTransform$:p}),g=nx({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.${rx}`).data(c).join("g").attr("class",rx).each((f,h,p)=>{if(h>1)return;const d=X(p[h]);o[h]=ai(jh,{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())}}),qh="OverlappingValueStackAxes",ix=at(qh,"grid"),Vk=pe(qh,B2)(({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]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h}},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=tx({fullDataFormatter$:u,layout$:r.layout$}),d=ex({gridAxesTransform$:p}),g=nx({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.${ix}`).data(c).join("g").attr("class",ix).each((f,h,p)=>{if(h>1)return;const d=X(p[h]);o[h]=ai(qh,{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())}}),ox={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},Xh={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};Xh.textRenderFn.toString=()=>`(eventData) => {
|
16
16
|
if (eventData.highlightTarget === 'datum' && eventData.datum) {
|
17
17
|
return [\`\${eventData.datum.label}: \${eventData.datum.value}\`]
|
18
18
|
} else if (eventData.highlightTarget === 'series') {
|
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.56",
|
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.52",
|
39
39
|
"d3": "^7.8.5",
|
40
40
|
"rxjs": "^7.8.1"
|
41
41
|
}
|
@@ -50,15 +50,16 @@ export const OverlappingValueAxes = defineMultiGridPlugin(pluginName, DEFAULT_OV
|
|
50
50
|
if (!data.fullDataFormatter.gridList[data.secondGridIndex]) {
|
51
51
|
data.fullDataFormatter.gridList[data.secondGridIndex] = Object.assign({}, data.fullDataFormatter.gridList[data.firstGridIndex])
|
52
52
|
}
|
53
|
+
const position = data.fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position
|
53
54
|
// 反轉第二個valueAxis的位置
|
54
|
-
let reversePosition =
|
55
|
-
if (
|
55
|
+
let reversePosition = position
|
56
|
+
if (position === 'left') {
|
56
57
|
reversePosition = 'right'
|
57
|
-
} else if (
|
58
|
+
} else if (position === 'bottom') {
|
58
59
|
reversePosition = 'top'
|
59
|
-
} else if (
|
60
|
+
} else if (position === 'top') {
|
60
61
|
reversePosition = 'bottom'
|
61
|
-
} else if (
|
62
|
+
} else if (position === 'right') {
|
62
63
|
reversePosition = 'left'
|
63
64
|
}
|
64
65
|
return <DataFormatterGrid>{
|
@@ -51,15 +51,16 @@ export const OverlappingValueStackAxes = defineMultiGridPlugin(pluginName, DEFAU
|
|
51
51
|
if (!data.fullDataFormatter.gridList[data.secondGridIndex]) {
|
52
52
|
data.fullDataFormatter.gridList[data.secondGridIndex] = Object.assign({}, data.fullDataFormatter.gridList[data.firstGridIndex])
|
53
53
|
}
|
54
|
+
const position = data.fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position
|
54
55
|
// 反轉第二個valueAxis的位置
|
55
|
-
let reversePosition =
|
56
|
-
if (
|
56
|
+
let reversePosition = position
|
57
|
+
if (position === 'left') {
|
57
58
|
reversePosition = 'right'
|
58
|
-
} else if (
|
59
|
+
} else if (position === 'bottom') {
|
59
60
|
reversePosition = 'top'
|
60
|
-
} else if (
|
61
|
+
} else if (position === 'top') {
|
61
62
|
reversePosition = 'bottom'
|
62
|
-
} else if (
|
63
|
+
} else if (position === 'right') {
|
63
64
|
reversePosition = 'left'
|
64
65
|
}
|
65
66
|
return <DataFormatterGrid>{
|