@orbcharts/plugins-basic 3.0.0-alpha.63 → 3.0.0-alpha.64

Sign up to get free protection for your applications and to get access to all the features.
@@ -19002,7 +19002,7 @@ const Lu = (t, {
19002
19002
  });
19003
19003
  })
19004
19004
  ).subscribe(), () => {
19005
- f.next(void 0);
19005
+ e.select(`g.${s}`).remove(), f.next(void 0);
19006
19006
  };
19007
19007
  }, Zg = "GridLegend", ZR = le(Zg, Kx)(({ selection: t, rootSelection: e, observer: n, subject: r }) => {
19008
19008
  const i = new nt(), o = n.SeriesDataMap$.pipe(
@@ -20313,7 +20313,7 @@ const Rx = ({ fullDataFormatter$: t, layout$: e }) => {
20313
20313
  I(i),
20314
20314
  W(async (c) => c),
20315
20315
  F((c) => {
20316
- c.fullDataFormatter.gridList[c.secondGridIndex] || (c.fullDataFormatter.gridList[c.secondGridIndex] = Object.assign({}, c.fullDataFormatter.gridList[c.firstGridIndex]));
20316
+ console.log("data", c), c.fullDataFormatter.gridList[c.secondGridIndex] || (c.fullDataFormatter.gridList[c.secondGridIndex] = Object.assign({}, c.fullDataFormatter.gridList[c.firstGridIndex]));
20317
20317
  const f = c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;
20318
20318
  let h = f;
20319
20319
  return f === "left" ? h = "right" : f === "bottom" ? h = "top" : f === "top" ? h = "bottom" : f === "right" && (h = "left"), {
@@ -20356,6 +20356,7 @@ const Rx = ({ fullDataFormatter$: t, layout$: e }) => {
20356
20356
  });
20357
20357
  return {
20358
20358
  ...f,
20359
+ dataFormatter$: u,
20359
20360
  gridAxesTransform$: p,
20360
20361
  gridAxesReverseTransform$: d,
20361
20362
  gridContainerPosition$: g
@@ -20444,6 +20445,7 @@ const Rx = ({ fullDataFormatter$: t, layout$: e }) => {
20444
20445
  });
20445
20446
  return {
20446
20447
  ...f,
20448
+ dataFormatter$: u,
20447
20449
  gridAxesTransform$: p,
20448
20450
  gridAxesReverseTransform$: d,
20449
20451
  gridContainerPosition$: g
@@ -12,7 +12,7 @@
12
12
  `})}function TR({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)=>{Z(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(Io(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 ax=(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$:y,event$:b})=>{const x=new nt,v=$n(t,"clipPath-box"),$=at(t,"path"),{seriesSelection$:w,axesSelection$:R,defsSelection$:D,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),M=p.pipe(I(x),F(k=>-k.translate[1]/k.scale[1])),S=new dt(k=>{const E=Y({fullParams:l,valueAxisStart:M}).pipe(I(x)).subscribe(T=>{const N=SR(T.fullParams.lineCurve,T.valueAxisStart);k.next(N)});return()=>{E.unsubscribe()}}),G=f.pipe(F(k=>k.transitionDuration),tt()),C=f.pipe(F(k=>k.transitionEase),tt());Y({defsSelection:D,seriesLabels:a,axisSize:d,transitionDuration:G,transitionEase:C}).pipe(I(x),W(async k=>k)).subscribe(k=>{const T=[{id:v,width:k.axisSize.width,height:k.axisSize.height}].concat(k.seriesLabels.map(N=>({id:`orbcharts__clipPath_${N}`,width:k.axisSize.width,height:k.axisSize.height})));TR({defsSelection:k.defsSelection,clipPathData:T,transitionDuration:k.transitionDuration,transitionEase:k.transitionEase})});const A=n.pipe(F(k=>{const E=new Map;return k.flat().forEach(T=>E.set(T.id,T)),E})),L=rx({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:m,layout$:y}),P=f.pipe(I(x),F(k=>k.highlightTarget),tt()),O=a.pipe(I(x),F(k=>k.map((E,T)=>$n(t,`lineargradient-${E}`)))),z=Y({graphicGSelection:_,defsSelection:D,visibleComputedLayoutData:o,linearGradientIds:O,areaPath:S,params:l}).pipe(I(x),W(async k=>k),F(k=>{let E=[];return k.graphicGSelection.each((T,N,j)=>{const Q=AR(k.visibleComputedLayoutData[N]??[]);E[N]=MR({selection:Z(j[N]),pathClassName:$,areaPath:k.areaPath,segmentData:Q,linearGradientIds:k.linearGradientIds,params:k.params}),PR({defsSelection:k.defsSelection,computedData:k.visibleComputedLayoutData,linearGradientIds:k.linearGradientIds,params:k.params})}),E}));return Y({pathSelectionArr:z,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:P,gridGroupPositionFn:L}).pipe(I(x),W(async k=>k)).subscribe(k=>{k.pathSelectionArr.forEach(E=>{E.on("mouseover",(T,N)=>{const j=N[0]?N[0].seriesLabel:"",{groupIndex:Q,groupLabel:U}=k.gridGroupPositionFn(T),q=k.GroupDataMap.get(U).find(V=>V.seriesLabel===j)??N[0];b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:k.highlightTarget,datum:q,gridIndex:q.gridIndex,series:k.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:k.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:T,data:k.computedData})}).on("mousemove",(T,N)=>{const j=N[0]?N[0].seriesLabel:"",{groupIndex:Q,groupLabel:U}=k.gridGroupPositionFn(T),q=k.GroupDataMap.get(U).find(V=>V.seriesLabel===j)??N[0];b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:k.highlightTarget,datum:q,gridIndex:q.gridIndex,series:k.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:k.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:T,data:k.computedData})}).on("mouseout",(T,N)=>{const j=N[0]?N[0].seriesLabel:"",{groupIndex:Q,groupLabel:U}=k.gridGroupPositionFn(T),q=k.GroupDataMap.get(U).find(V=>V.seriesLabel===j)??N[0];b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:k.highlightTarget,datum:q,gridIndex:q.gridIndex,series:k.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:k.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:T,data:k.computedData})}).on("click",(T,N)=>{const j=N[0]?N[0].seriesLabel:"",{groupIndex:Q,groupLabel:U}=k.gridGroupPositionFn(T),q=k.GroupDataMap.get(U).find(V=>V.seriesLabel===j)??N[0];b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:k.highlightTarget,datum:q,gridIndex:q.gridIndex,series:k.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:k.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:T,data:k.computedData})})})}),f.pipe(I(x),li(k=>k.highlightTarget==="series"),W(k=>Y({graphicGSelection:_,gridHighlight:g,DataMap:A,fullChartParams:f}).pipe(I(x),W(async E=>E)))).subscribe(k=>{const E=k.gridHighlight[0]?k.gridHighlight[0].seriesLabel:null;DR({selection:k.graphicGSelection,seriesLabel:E,fullChartParams:k.fullChartParams})}),()=>{x.next(void 0)}},sx="LineAreas",LR=se(sx,ip)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=ax(sx,{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$,allContainerPosition$:n.gridContainerPosition$,layout$:n.layout$,event$:r.event$});return()=>{i.next(void 0),o()}}),ux=.3;function lx({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 CR(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Qf().domain(e).range([-i/2+r,i/2-r])}function ER(t,e){return t<=1?0:e/(t-1)*ux}function RR(t,e){return t<=1?e:e*(1-ux)}function kR({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,y)=>{Z(y[m]).selectAll(`rect.${e}`).data(n[m]??[],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)-p}, 0)`).attr("fill",b=>b.color).attr("y",b=>b.axisY<r[m]?b.axisY:r[m]).attr("x",b=>h?0:o(b.seriesLabel)).attr("width",u).attr("rx",l[m][0]??1).attr("ry",l[m][1]??1).transition().duration(f).ease(Io(s.transitionEase)).delay((b,x)=>b.groupIndex*c).attr("height",b=>Math.abs(b.axisYFromZero))}),t.selectAll(`rect.${e}`)}function IR({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)=>{Z(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 NR({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)?Z(o[i]).style("opacity",1):Z(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const Eh=(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$:y,event$:b})=>{const x=new nt,v=$n(t,"clipPath-box"),$=at(t,"rect"),{seriesSelection$:w,axesSelection$:R,defsSelection$:D,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),M=o.pipe(I(x),F(E=>E.map(T=>T[0]?T[0].axisY-T[0].axisYFromZero:0)),tt()),S=Y({computedData:n,visibleComputedData:i,params:l,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(x),W(async E=>E),F(E=>E.params.barWidth?E.params.barWidth:E.isSeriesSeprate?lx({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):lx({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})),tt()),G=Y({computedData:n,barWidth:S,params:l,gridGraphicReverseScale:p}).pipe(I(x),W(async E=>E),F(E=>{const T=E.barWidth/2,N=E.params.barRadius===!0?T:E.params.barRadius===!1?0:typeof E.params.barRadius=="number"?E.params.barRadius:0;return E.computedData.map((j,Q)=>{const U=E.gridGraphicReverseScale[Q]??E.gridGraphicReverseScale[0];let X=N*U[0],B=N*U[1];if(X>T){const q=T/X;X=X*q,B=B*q}return[X,B]})})),C=i.pipe(I(x),F(E=>{const T=new Set;return E.forEach(N=>{N.forEach(j=>{T.add(j.groupLabel)})}),Array.from(T)})),A=Y({seriesLabels:a,barWidth:S,params:l}).pipe(I(x),W(async E=>E),F(E=>CR(E.barWidth,E.seriesLabels,E.params))),L=c.pipe(I(x),F(E=>E.transitionDuration),tt()),P=new dt(E=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async T=>T)).subscribe(T=>{const N=ER(T.groupLabels.length,T.transitionDuration);E.next(N)})}).pipe(I(x),tt()),O=new dt(E=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async T=>T)).subscribe(T=>{const N=RR(T.groupLabels.length,T.transitionDuration);E.next(N)})}).pipe(I(x),tt());Y({defsSelection:D,gridAxesSize:d}).pipe(I(x),W(async E=>E)).subscribe(E=>{const T=[{id:v,width:E.gridAxesSize.width,height:E.gridAxesSize.height}];IR({defsSelection:E.defsSelection,clipPathData:T})});const z=c.pipe(I(x),F(E=>E.highlightTarget),tt()),k=Y({graphicGSelection:_,visibleComputedLayoutData:o,zeroYArr:M,groupLabels:C,barScale:A,params:l,chartParams:c,highlightTarget:z,barWidth:S,transformedBarRadius:G,delayGroup:P,transitionItem:O,isSeriesSeprate:y}).pipe(I(x),W(async E=>E),F(E=>kR({graphicGSelection:E.graphicGSelection,rectClassName:$,visibleComputedLayoutData:E.visibleComputedLayoutData,zeroYArr:E.zeroYArr,groupLabels:E.groupLabels,barScale:E.barScale,params:E.params,chartParams:E.chartParams,barWidth:E.barWidth,transformedBarRadius:E.transformedBarRadius,delayGroup:E.delayGroup,transitionItem:E.transitionItem,isSeriesSeprate:E.isSeriesSeprate})));return Y({barSelection:k,computedData:n,highlightTarget:z,SeriesDataMap:s,GroupDataMap:u}).pipe(I(x),W(async E=>E)).subscribe(E=>{E.barSelection.on("mouseover",(T,N)=>{T.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:E.highlightTarget,datum:N,gridIndex:N.gridIndex,series:E.SeriesDataMap.get(N.seriesLabel),seriesIndex:N.seriesIndex,seriesLabel:N.seriesLabel,groups:E.GroupDataMap.get(N.groupLabel),groupIndex:N.groupIndex,groupLabel:N.groupLabel,event:T,data:E.computedData})}).on("mousemove",(T,N)=>{T.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:E.highlightTarget,datum:N,gridIndex:N.gridIndex,series:E.SeriesDataMap.get(N.seriesLabel),seriesIndex:N.seriesIndex,seriesLabel:N.seriesLabel,groups:E.GroupDataMap.get(N.groupLabel),groupIndex:N.groupIndex,groupLabel:N.groupLabel,event:T,data:E.computedData})}).on("mouseout",(T,N)=>{T.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:E.highlightTarget,datum:N,gridIndex:N.gridIndex,series:E.SeriesDataMap.get(N.seriesLabel),seriesIndex:N.seriesIndex,seriesLabel:N.seriesLabel,groups:E.GroupDataMap.get(N.groupLabel),groupIndex:N.groupIndex,groupLabel:N.groupLabel,event:T,data:E.computedData})}).on("click",(T,N)=>{T.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:E.highlightTarget,datum:N,gridIndex:N.gridIndex,series:E.SeriesDataMap.get(N.seriesLabel),seriesIndex:N.seriesIndex,seriesLabel:N.seriesLabel,groups:E.GroupDataMap.get(N.groupLabel),groupIndex:N.groupIndex,groupLabel:N.groupLabel,event:T,data:E.computedData})})}),Y({barSelection:k,highlight:g.pipe(F(E=>E.map(T=>T.id))),fullChartParams:c}).pipe(I(x),W(async E=>E)).subscribe(E=>{NR({selection:E.barSelection,ids:E.highlight,fullChartParams:E.fullChartParams})}),()=>{x.next(void 0)}},cx="Bars",FR=se(cx,Go)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Eh(cx,{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()}}),fx="BarsPN",GR=se(fx,Go)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Eh(fx,{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$:Yo(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),hx=.3;function zR({axisWidth:t,groupAmount:e,barGroupPadding:n=0}){const i=t/(e-1)-n;return i>1?i:1}function OR(t,e){return t<=1?0:e/(t-1)*hx}function UR(t,e){return t<=1?e:e*(1-hx)}function BR({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)=>{Z(m[g]).selectAll(`rect.${e}`).data(n[g]??[],y=>y.id).join(y=>y.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",b=>0),y=>y,y=>y.remove()).attr("transform",(y,b)=>`translate(${(y?y.axisX:0)-h}, 0)`).attr("fill",y=>y.color).attr("y",y=>r).attr("x",y=>0).attr("width",s).attr("rx",u[g][0]??1).attr("ry",u[g][1]??1).transition().duration(c).ease(Io(a.transitionEase)).delay((y,b)=>y.groupIndex*l).attr("y",y=>y._barStartY).attr("height",y=>Math.abs(y._barHeight))}),t.selectAll(`rect.${e}`)}function YR({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)=>{Z(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 WR({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)?Z(o[i]).style("opacity",1):Z(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const px=(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$:y,isSeriesSeprate$:b,event$:x})=>{const v=new nt,$=$n(t,"clipPath-box"),w=at(t,"rect"),{seriesSelection$:R,axesSelection$:D,defsSelection$:_,graphicGSelection$:M}=ar({selection:e,pluginName:t,clipPathID:$,seriesLabels$:a,gridContainerPosition$:y,gridAxesTransform$:h,gridGraphicTransform$:p}),S=o.pipe(I(v),F(U=>U[0]&&U[0][0]?U[0][0].axisY-U[0][0].axisYFromZero:0),tt()),G=Y({computedData:n,params:l,axisSize:g,isSeriesSeprate:b}).pipe(I(v),W(async U=>U),F(U=>U.params.barWidth?U.params.barWidth:zR({axisWidth:U.axisSize.width,groupAmount:U.computedData[0]?U.computedData[0].length:0,barGroupPadding:U.params.barGroupPadding})),tt()),C=Y({computedData:n,barWidth:G,params:l,gridGraphicReverseScale:d}).pipe(I(v),W(async U=>U),F(U=>{const X=U.barWidth/2,B=U.params.barRadius===!0?X:U.params.barRadius===!1?0:typeof U.params.barRadius=="number"?U.params.barRadius:0;return U.computedData.map((q,V)=>{const rt=U.gridGraphicReverseScale[V]??U.gridGraphicReverseScale[0],ut=B*rt[0],H=B*rt[1];return[ut,H]})})),A=i.pipe(I(v),F(U=>{const X=new Set;return U.forEach(B=>{B.forEach(q=>{X.add(q.groupLabel)})}),Array.from(X)}),St(1)),L=f.pipe(I(v),F(U=>U.transitionDuration),tt()),P=new dt(U=>{Y({groupLabels:A,transitionDuration:L}).pipe(W(async X=>X)).subscribe(X=>{const B=OR(X.groupLabels.length,X.transitionDuration);U.next(B)})}).pipe(I(v),tt()),O=new dt(U=>{Y({groupLabels:A,transitionDuration:L}).pipe(W(async X=>X)).subscribe(X=>{const B=UR(X.groupLabels.length,X.transitionDuration);U.next(B)})}).pipe(I(v),tt()),z=Y({computedData:n,dataFormatter:c}).pipe(I(v),W(async U=>U),F(U=>{const B=U.computedData[0]?U.computedData[0].length-1:0,q=U.dataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0:U.dataFormatter.grid.groupAxis.scaleDomain[0],V=U.dataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?B:U.dataFormatter.grid.groupAxis.scaleDomain[1];return[q,V]})),k=Y({visibleComputedLayoutData:o,groupScaleDomain:z}).pipe(I(v),W(async U=>U),F(U=>{const X=U.groupScaleDomain[0],B=U.groupScaleDomain[1],V=U.visibleComputedLayoutData.map(mt=>mt.filter((ht,Yt)=>ht.groupIndex>=X&&ht.groupIndex<=B)).flat();if(V.length<=1)return 1;const rt=V.reduce((mt,ht)=>ht.value>mt.value?ht:mt,V[0]),ut=rt.groupIndex,H=V.filter(mt=>mt.groupIndex===ut).reduce((mt,ht)=>mt+ht.value,0);return rt.value/H})),E=Y({computedLayoutData:r,yRatio:k,zeroY:S}).pipe(I(v),F(U=>{let X=U.computedLayoutData[0]?U.computedLayoutData[0].map(()=>U.zeroY):[];return U.computedLayoutData.map((B,q)=>B.map((V,rt)=>{const ut=X[rt];let H=0;return V.visible&&(H=V.axisYFromZero*U.yRatio,X[rt]=X[rt]+H),{...V,_barStartY:ut,_barHeight:H}}))})),T=Y({computedLayoutData:r,zeroY:S}).pipe(I(v),F(U=>U.computedLayoutData.map((X,B)=>X.map((q,V)=>({...q,_barStartY:U.zeroY,_barHeight:q.axisYFromZero}))))),N=b.pipe(W(U=>c_(()=>U,T,E)));Y({defsSelection:_,gridAxesSize:g}).pipe(I(v),W(async U=>U)).subscribe(U=>{const X=[{id:$,width:U.gridAxesSize.width,height:U.gridAxesSize.height}];YR({defsSelection:U.defsSelection,clipPathData:X})});const j=f.pipe(I(v),F(U=>U.highlightTarget),tt()),Q=Y({graphicGSelection:M,graphicData:N,zeroY:S,groupLabels:A,params:l,chartParams:f,highlightTarget:j,barWidth:G,transformedBarRadius:C,delayGroup:P,transitionItem:O,isSeriesSeprate:b}).pipe(I(v),W(async U=>U),F(U=>BR({graphicGSelection:U.graphicGSelection,rectClassName:w,barData:U.graphicData,zeroY:U.zeroY,groupLabels:U.groupLabels,params:U.params,chartParams:U.chartParams,barWidth:U.barWidth,transformedBarRadius:U.transformedBarRadius,delayGroup:U.delayGroup,transitionItem:U.transitionItem,isSeriesSeprate:U.isSeriesSeprate})));return Y({barSelection:Q,computedData:n,highlightTarget:j,SeriesDataMap:s,GroupDataMap:u}).subscribe(U=>{U.barSelection.on("mouseover",(X,B)=>{X.stopPropagation(),x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:U.highlightTarget,datum:B,gridIndex:B.gridIndex,series:U.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:U.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:X,data:U.computedData})}).on("mousemove",(X,B)=>{X.stopPropagation(),x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:U.highlightTarget,datum:B,gridIndex:B.gridIndex,series:U.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:U.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:X,data:U.computedData})}).on("mouseout",(X,B)=>{X.stopPropagation(),x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:U.highlightTarget,datum:B,gridIndex:B.gridIndex,series:U.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:U.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:X,data:U.computedData})}).on("click",(X,B)=>{X.stopPropagation(),x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:U.highlightTarget,datum:B,gridIndex:B.gridIndex,series:U.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:U.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:X,data:U.computedData})})}),Y({barSelection:Q,highlight:m.pipe(F(U=>U.map(X=>X.id))),fullChartParams:f}).pipe(I(v),W(async U=>U)).subscribe(U=>{WR({selection:U.barSelection,ids:U.highlight,fullChartParams:U.fullChartParams})}),()=>{v.next(void 0)}},dx="BarStack",HR=se(dx,ap)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=px(dx,{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()}}),gx=.3;function mx({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 VR(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Qf().domain(e).range([-i/2+r,i/2-r])}function jR(t,e){return t<=1?0:e/(t-1)*gx}function qR(t,e){return t<=1?e:e*(1-gx)}function XR({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,y,b)=>{Z(b[y]).selectAll(`g.${e}`).data(r[y]??[]).join(v=>{const $=v.append("g").classed(e,!0).attr("cursor","pointer");return $.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",w=>{const R=-d,D=o[y],_=o[y];return`M${R},${D} L${R+c/2},${_} ${R+c},${D}`}),$},v=>v,v=>v.remove()).attr("transform",v=>`translate(${p?0:s(v.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",v=>Math.abs(v.axisYFromZero)).attr("y",v=>v.axisY<o[y]?v.axisY:o[y]).attr("x",v=>p?0:s(v.seriesLabel)).style("fill",v=>`url(#${i[v.seriesIndex]})`).attr("stroke",v=>v.color).attr("transform",v=>`translate(${v?v.axisX:0}, 0)`).transition().duration(h).ease(Io(l.transitionEase)).delay((v,$)=>v.groupIndex*f).attr("d",v=>{const $=-d,w=o[y],R=v.axisY;return`M${$},${w} L${$+c/2},${R} ${$+c},${w}`})}),t.selectAll(`path.${n}`)}function ZR({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 KR({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)=>{Z(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 QR({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)?Z(a[o]).style("opacity",1):Z(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const yx=(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$:y,event$:b})=>{const x=new nt,v=$n(t,"clipPath-box"),$=at(t,"pathG"),w=at(t,"path"),{seriesSelection$:R,axesSelection$:D,defsSelection$:_,graphicGSelection$:M}=ar({selection:e,pluginName:t,clipPathID:v,seriesLabels$:s,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(I(x),F(T=>-T.translate[1]/T.scale[1]));const S=o.pipe(F(T=>T.map(N=>N[0]?N[0].axisY-N[0].axisYFromZero:0)),tt()),G=Y({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(x),W(async T=>T),F(T=>T.params.barWidth?T.params.barWidth:T.isSeriesSeprate?mx({axisWidth:T.gridAxesSize.width,groupAmount:T.computedData[0]?T.computedData[0].length:0,barAmountOfGroup:1,barPadding:T.params.barPadding,barGroupPadding:T.params.barGroupPadding}):mx({axisWidth:T.gridAxesSize.width,groupAmount:T.computedData[0]?T.computedData[0].length:0,barAmountOfGroup:T.visibleComputedData.length,barPadding:T.params.barPadding,barGroupPadding:T.params.barGroupPadding}))),C=i.pipe(I(x),F(T=>{const N=new Set;return T.forEach(j=>{j.forEach(Q=>{N.add(Q.groupLabel)})}),Array.from(N)})),A=new dt(T=>{Y({seriesLabels:s,barWidth:G,params:c}).pipe(I(x),W(async N=>N)).subscribe(N=>{const j=VR(N.barWidth,N.seriesLabels,N.params);T.next(j)})}),L=f.pipe(I(x),F(T=>T.transitionDuration),tt()),P=new dt(T=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async N=>N)).subscribe(N=>{const j=jR(N.groupLabels.length,N.transitionDuration);T.next(j)})}).pipe(I(x),tt()),O=new dt(T=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async N=>N)).subscribe(N=>{const j=qR(N.groupLabels.length,N.transitionDuration);T.next(j)})}).pipe(I(x),tt());Y({defsSelection:_,gridAxesSize:d}).pipe(I(x),W(async T=>T)).subscribe(T=>{const N=[{id:v,width:T.gridAxesSize.width,height:T.gridAxesSize.height}];KR({defsSelection:T.defsSelection,clipPathData:N})});const z=f.pipe(I(x),F(T=>T.highlightTarget),tt()),k=s.pipe(I(x),F(T=>T.map((N,j)=>$n(t,`lineargradient-${N}`)))),E=Y({graphicGSelection:M,defsSelection:_,computedData:n,visibleComputedLayoutData:o,linearGradientIds:k,zeroYArr:S,groupLabels:C,barScale:A,params:c,chartParams:f,barWidth:G,delayGroup:P,transitionItem:O,isSeriesSeprate:y}).pipe(I(x),W(async T=>T),F(T=>(ZR({defsSelection:T.defsSelection,computedData:T.computedData,linearGradientIds:T.linearGradientIds,params:T.params}),XR({graphicGSelection:T.graphicGSelection,pathGClassName:$,pathClassName:w,visibleComputedLayoutData:T.visibleComputedLayoutData,linearGradientIds:T.linearGradientIds,zeroYArr:T.zeroYArr,groupLabels:T.groupLabels,barScale:T.barScale,params:T.params,chartParams:T.chartParams,barWidth:T.barWidth,delayGroup:T.delayGroup,transitionItem:T.transitionItem,isSeriesSeprate:T.isSeriesSeprate}))));return Y({barSelection:E,computedData:n,highlightTarget:z,SeriesDataMap:u,GroupDataMap:l}).subscribe(T=>{T.barSelection.on("mouseover",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})}).on("mousemove",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})}).on("mouseout",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})}).on("click",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})})}),Y({barSelection:E,highlight:g.pipe(F(T=>T.map(N=>N.id))),fullChartParams:f}).pipe(I(x),W(async T=>T)).subscribe(T=>{QR({selection:T.barSelection,ids:T.highlight,fullChartParams:T.fullChartParams})}),()=>{x.next(void 0)}},bx="BarsTriangle",JR=se(bx,sp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=yx(bx,{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 tk({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)=>{Z(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)=>{Z(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((y,b)=>d*u).attr("opacity",1),m=>m.transition().duration(50).attr("opacity",1),m=>m.remove()).attr("r",i.radius).attr("fill",(m,y)=>Tu({datum:m,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(m,y)=>Tu({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 ek({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)?Z(a[o]).style("opacity",1).transition("highlight").duration(200):Z(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}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)=>{Z(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 vx=(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$:y})=>{const b=new nt,x=$n(t,"clipPath-box"),v=at(t,"circleG"),$=at(t,"circle"),{seriesSelection$:w,axesSelection$:R,defsSelection$:D,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),M=Y({computedData:n,gridGraphicReverseScale:p}).pipe(I(b),W(async A=>A),F(A=>A.computedData.map((L,P)=>A.gridGraphicReverseScale[P])));Y({defsSelection:D,gridAxesSize:d}).pipe(I(b),W(async A=>A)).subscribe(A=>{const L=[{id:x,width:A.gridAxesSize.width,height:A.gridAxesSize.height}];nk({defsSelection:A.defsSelection,clipPathData:L})});const S=c.pipe(I(b),F(A=>A.highlightTarget),tt()),G=Y({graphicGSelection:_,visibleComputedLayoutData:o,graphicReverseScale:M,fullChartParams:c,fullParams:l}).pipe(I(b),W(async A=>A),F(A=>tk({graphicGSelection:A.graphicGSelection,circleGClassName:v,circleClassName:$,visibleComputedLayoutData:A.visibleComputedLayoutData,fullParams:A.fullParams,fullChartParams:A.fullChartParams,graphicReverseScale:A.graphicReverseScale})));Y({graphicSelection:G,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:S}).pipe(I(b),W(async A=>A)).subscribe(A=>{A.graphicSelection.on("mouseover",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:A.highlightTarget,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L,data:A.computedData})}).on("mousemove",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:A.highlightTarget,data:A.computedData,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L})}).on("mouseout",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:A.highlightTarget,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L,data:A.computedData})}).on("click",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:A.highlightTarget,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L,data:A.computedData})})});const C=l.pipe(I(b),F(A=>A.onlyShowHighlighted),tt());return Y({graphicSelection:G,highlight:g.pipe(F(A=>A.map(L=>L.id))),onlyShowHighlighted:C,fullChartParams:c}).pipe(I(b),W(async A=>A)).subscribe(A=>{ek({selection:A.graphicSelection,ids:A.highlight,onlyShowHighlighted:A.onlyShowHighlighted,fullChartParams:A.fullChartParams})}),()=>{b.next(void 0)}},xx="Dots",rk=se(xx,op)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=vx(xx,{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()}}),ik={listRectWidth:14,listRectHeight:14,listRectRadius:0};function _x(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 Lu=(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 nt,h=Y({seriesLabels:n,fullChartParams:o}).pipe(I(f),W(async _=>_),F(_=>{const M=new Map;let S=0;return _.seriesLabels.forEach((G,C)=>{if(!M.has(G)){const A=_x(S,_.fullChartParams);M.set(G,A),S++}}),M})),p=n.pipe(I(f),F(_=>{const M=new Set;let S=[];return _.forEach(G=>{M.has(G)?S.push(!1):S.push(!0),M.add(G)}),S})),d=r.pipe(I(f),F(_=>_.position==="bottom"||_.position==="top"?"row":"column")),g=Y({fullParams:r,layout:i}).pipe(I(f),W(async _=>_),F(_=>{const M=_.fullParams.padding*2+_.fullParams.gap*2;return _.fullParams.position==="bottom"||_.fullParams.position==="top"?_.layout.rootWidth-M:_.layout.rootHeight-M})),y=Y({layout:i,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>{let M=0,S=0;return _.fullParams.position==="bottom"?(S=_.layout.rootHeight,_.fullParams.justify==="start"?M=0:_.fullParams.justify==="center"?M=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(M=_.layout.rootWidth)):_.fullParams.position==="right"?(M=_.layout.rootWidth,_.fullParams.justify==="start"?S=0:_.fullParams.justify==="center"?S=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(S=_.layout.rootHeight)):_.fullParams.position==="top"?(S=0,_.fullParams.justify==="start"?M=0:_.fullParams.justify==="center"?M=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(M=_.layout.rootWidth)):_.fullParams.position==="left"&&(M=0,_.fullParams.justify==="start"?S=0:_.fullParams.justify==="center"?S=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(S=_.layout.rootHeight)),{x:M,y:S}})).pipe(I(f),F(_=>e.selectAll(`g.${s}`).data([_]).join(M=>M.append("g").classed(s,!0).attr("transform",S=>`translate(${S.x}, ${S.y})`),M=>M.transition().attr("transform",S=>`translate(${S.x}, ${S.y})`),M=>M.remove()))),b=r.pipe(I(f),F(_=>_.seriesList[0]?_.seriesList[0]:ik)),x=Y({visibleList:p,fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:d,lineMaxSize:g,defaultListStyle:b,SeriesLabelColorMap:h,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>_.seriesLabels.reduce((M,S,G)=>{if(!_.visibleList[G])return M;const C=nx(S,_.textSizePx),A=_.textSizePx*1.5+C,L=_.SeriesLabelColorMap.get(S),P=M[0]&&M[0][0]?M[M.length-1][M[M.length-1].length-1]:null,{translateX:O,translateY:z,lineIndex:k,itemIndex:E}=((N,j,Q)=>{let U=0,X=0,B=0,q=0;if(N.lineDirection==="column"){let V=Q?Q.translateY+N.textSizePx+N.fullParams.gap:0;if(V+N.textSizePx>N.lineMaxSize){B=Q.lineIndex+1,q=0,X=0;const rt=j[j.length-1].reduce((ut,H)=>H.itemWidth>ut?H.itemWidth:ut,0);U=Q.translateX+rt+N.fullParams.gap}else B=Q?Q.lineIndex:0,q=Q?Q.itemIndex+1:0,X=V,U=Q?Q.translateX:0}else{let V=Q?Q.translateX+Q.itemWidth+N.fullParams.gap:0;V+A>N.lineMaxSize?(B=Q.lineIndex+1,q=0,U=0):(B=Q?Q.lineIndex:0,q=Q?Q.itemIndex+1:0,U=V),X=(N.textSizePx+N.fullParams.gap)*B}return{translateX:U,translateY:X,lineIndex:B,itemIndex:q}})(_,M,P);M[k]||(M[k]=[]);const T=_.fullParams.seriesList[E]?_.fullParams.seriesList[E]:_.defaultListStyle;return M[k].push({id:S,seriesLabel:S,seriesIndex:G,lineIndex:k,itemIndex:E,text:S,itemWidth:A,translateX:O,translateY:z,color:L,listRectWidth:T.listRectWidth,listRectHeight:T.listRectHeight,listRectRadius:T.listRectRadius}),M},[])),St(1)),v=Y({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const{width:M,height:S}=((G,C)=>{let A=0,L=0;if(!C.length||!C[0].length)return{width:A,height:L};const P=C[0][C[0].length-1];return G.lineDirection==="column"?(A=C.reduce((O,z)=>{const k=z.reduce((E,T)=>T.itemWidth>E?T.itemWidth:E,0);return O+k},0),A+=G.fullParams.gap*(C.length-1),L=P.translateY+G.textSizePx):(A=P.translateX+P.itemWidth,L=G.textSizePx*C.length+G.fullParams.gap*(C.length-1)),{width:A,height:L}})(_,_.lengendItems);return{direction:_.lineDirection,width:M,height:S,translateX:_.fullParams.gap,translateY:_.fullParams.gap}}),St(1)),$=Y({fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>{const M=_.lengendList.width+_.fullParams.gap*2,S=_.lengendList.height+_.fullParams.gap*2;let G=0,C=0;return _.fullParams.position==="left"?_.fullParams.justify==="start"?(G=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(G=_.fullParams.padding,C=-S/2):_.fullParams.justify==="end"&&(G=_.fullParams.padding,C=-S-_.fullParams.padding):_.fullParams.position==="right"?_.fullParams.justify==="start"?(G=-M-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(G=-M-_.fullParams.padding,C=-S/2):_.fullParams.justify==="end"&&(G=-M-_.fullParams.padding,C=-S-_.fullParams.padding):_.fullParams.position==="top"?_.fullParams.justify==="start"?(G=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(G=-M/2,C=_.fullParams.padding):_.fullParams.justify==="end"&&(G=-M-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="start"?(G=_.fullParams.padding,C=-S-_.fullParams.padding):_.fullParams.justify==="center"?(G=-M/2,C=-S-_.fullParams.padding):_.fullParams.justify==="end"&&(G=-M-_.fullParams.padding,C=-S-_.fullParams.padding),{width:M,height:S,translateX:G,translateY:C}})),w=Y({rootPositionSelection:y,fullParams:r,fullChartParams:o,legendCard:$}).pipe(I(f),W(async _=>_),F(_=>_.rootPositionSelection.selectAll("g").data([_.legendCard]).join(M=>M.append("g").classed(u,!0).attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.transition().attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.remove()).each((M,S,G)=>{Z(G[S]).selectAll("rect").data([M]).join("rect").attr("width",C=>C.width).attr("height",C=>C.height).attr("fill",Ct(_.fullParams.backgroundFill,_.fullChartParams)).attr("stroke",Ct(_.fullParams.backgroundStroke,_.fullChartParams))}))),R=Y({lengendCardSelection:w,fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>_.lengendCardSelection.selectAll("g").data([_.lengendList]).join(M=>M.append("g").classed(l,!0).attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.transition().attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.remove())));return Y({lengendListSelection:R,fullParams:r,fullChartParams:o,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const M=_.lengendItems[0]?_.lengendItems.flat():[];return _.lengendListSelection.selectAll(`g.${c}`).data(M).join(S=>S.append("g").classed(c,!0).attr("cursor","default"),S=>S,S=>S.remove()).attr("transform",(S,G)=>`translate(${S.translateX}, ${S.translateY})`).each((S,G,C)=>{const A=_.textSizePx/2,L=-S.listRectWidth/2,P=-S.listRectHeight/2;Z(C[G]).selectAll("rect").data([S]).join("rect").attr("x",A).attr("y",A).attr("width",O=>O.listRectWidth).attr("height",O=>O.listRectHeight).attr("transform",O=>`translate(${L}, ${P})`).attr("fill",O=>O.color).attr("rx",O=>O.listRectRadius),Z(C[G]).selectAll("text").data([S]).join(O=>O.append("text").attr("dominant-baseline","hanging"),O=>O,O=>O.remove()).attr("x",_.textSizePx*1.5).attr("font-size",_.fullChartParams.styles.textSize).attr("fill",O=>_.fullParams.textColorType==="series"?_x(O.seriesIndex,_.fullChartParams):Ct(_.fullParams.textColorType,_.fullChartParams)).text(O=>O.text)})})).subscribe(),()=>{f.next(void 0)}},wx="GridLegend",ok=se(wx,cp)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.SeriesDataMap$.pipe(I(i),F(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),F(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Lu(wx,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),ak=6;function sk({selection:t,groupingLabelClassName:e,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,textReverseTransform:s}){const u=n.tickPadding+n.labelOffset[0],l=n.tickPadding+n.labelOffset[1];let c=0,f=0;o.grid.groupAxis.position==="bottom"?(f=l,o.grid.valueAxis.position==="left"?c=u:o.grid.valueAxis.position==="right"&&(c=-u)):o.grid.groupAxis.position==="top"?(f=-l,o.grid.valueAxis.position==="left"?c=u:o.grid.valueAxis.position==="right"&&(c=-u)):o.grid.groupAxis.position==="left"?(c=-u,o.grid.valueAxis.position==="bottom"?f=-l:o.grid.valueAxis.position==="top"&&(f=l)):o.grid.groupAxis.position==="right"&&(c=u,o.grid.valueAxis.position==="bottom"?f=-l:o.grid.valueAxis.position==="top"&&(f=l)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{Z(d[p]).selectAll("text").data([h]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",Ct(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(g=>o.grid.groupAxis.label)}).attr("transform",h=>`translate(${i.width}, 0)`)}function uk({selection:t,xAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:u,groupLabels:l,textReverseTransformWithRotate:c}){const f=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),h=Math.floor(u[1])-Math.ceil(u[0])+1;let p=0,d=0;o.grid.groupAxis.position==="left"?(p=0,d=-n.tickPadding):o.grid.groupAxis.position==="right"?(p=0,d=n.tickPadding):o.grid.groupAxis.position==="bottom"?(p=n.tickPadding,d=0):o.grid.groupAxis.position==="top"&&(p=-n.tickPadding,d=-0);const g=Cg(s).scale(s).ticks(n.ticks==="all"||n.ticks>h?h:n.ticks).tickSize(n.tickFullLine==!0?i.height:-ak).tickSizeOuter(0).tickFormat(b=>{const x=l[b]??"";return Lh(x,n.tickFormat)}).tickPadding(p),m=f.transition().duration(100).call(g);return m.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?Ct(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),m.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?Ct(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),f.selectAll("text").attr("font-size",a.styles.textSize).style("color",Ct(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("x",d).style("transform",c).attr("dy",0),f}const $x=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c})=>{const f=new nt,h=at(t,"container"),p=at(t,"xAxisG"),d=at(t,"xAxis"),g=at(t,"groupingLabel"),m=Y({computedData:n.pipe(tt((_,M)=>_.length===M.length)),isSeriesSeprate:c}).pipe(I(f),W(async _=>_),F(_=>_.isSeriesSeprate?_.computedData:[_.computedData[0]]),F((_,M)=>e.selectAll(`g.${h}`).data(_,S=>S[0]?S[0].seriesIndex:M).join("g").classed(h,!0))),y=m.pipe(I(f),F((_,M)=>_.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));Y({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async _=>_)).subscribe(_=>{_.containerSelection.attr("transform",(M,S)=>{const G=_.gridContainerPosition[S]??_.gridContainerPosition[0],C=G.translate,A=G.scale;return`translate(${C[0]}, ${C[1]}) scale(${A[0]}, ${A[1]})`})}),Y({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async _=>_)).subscribe(_=>{_.axisSelection.style("transform",_.gridAxesTransform.value)});const b=Y({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async _=>_),F(_=>{const M=`rotateX(${_.gridAxesReverseTransform.rotateX}deg) rotateY(${_.gridAxesReverseTransform.rotateY}deg)`,S=`rotate(${_.gridAxesReverseTransform.rotate}deg)`,G=`scale(${1/_.gridContainerPosition[0].scale[0]}, ${1/_.gridContainerPosition[0].scale[1]})`;return`${M} ${S} ${G}`}),tt()),x=Y({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>`${_.textReverseTransform} rotate(${_.fullParams.tickTextRotate}deg)`)),v=Y({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async _=>_),F(_=>{const S=_.computedData[0]?_.computedData[0].length-1:0,G=_.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[0]-_.fullDataFormatter.grid.groupAxis.scalePadding,C=_.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?S+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding;return[G,C]}),St(1)),$=Y({groupScaleDomain:v,gridAxesSize:u}).pipe(I(f),W(async _=>_),F(_=>So().domain(_.groupScaleDomain).range([0,_.gridAxesSize.width]))),w=n.pipe(F(_=>(_[0]??[]).map(M=>M.groupLabel))),R=Y({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>{let M="middle",S="hanging";return _.fullDataFormatter.grid.groupAxis.position==="bottom"?(M=_.fullParams.tickTextRotate?"end":"middle",S="hanging"):_.fullDataFormatter.grid.groupAxis.position==="top"?(M=_.fullParams.tickTextRotate?"start":"middle",S="auto"):_.fullDataFormatter.grid.groupAxis.position==="left"?(M="end",S="middle"):_.fullDataFormatter.grid.groupAxis.position==="right"&&(M="start",S="middle"),{textAnchor:M,dominantBaseline:S}})),D=i.pipe(I(f),F(_=>{let M="start",S="hanging";return _.grid.groupAxis.position==="bottom"?S="hanging":_.grid.groupAxis.position==="top"?S="auto":_.grid.groupAxis.position==="left"?M="end":_.grid.groupAxis.position==="right"&&(M="start"),_.grid.valueAxis.position==="left"?M="start":_.grid.valueAxis.position==="right"?M="end":_.grid.valueAxis.position==="bottom"?S="auto":_.grid.valueAxis.position==="top"&&(S="hanging"),{textAnchor:M,dominantBaseline:S}}));return Y({axisSelection:y,fullParams:r,tickTextAlign:R,axisLabelAlign:D,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:$,groupScaleDomain:v,groupLabels:w,textReverseTransform:b,textReverseTransformWithRotate:x}).pipe(I(f),W(async _=>_)).subscribe(_=>{uk({selection:_.axisSelection,xAxisClassName:d,fullParams:_.fullParams,tickTextAlign:_.tickTextAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,groupScale:_.groupScale,groupScaleDomain:_.groupScaleDomain,groupLabels:_.groupLabels,textReverseTransformWithRotate:_.textReverseTransformWithRotate}),sk({selection:_.axisSelection,groupingLabelClassName:g,fullParams:_.fullParams,axisLabelAlign:_.axisLabelAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,textReverseTransform:_.textReverseTransform})}),()=>{f.next(void 0)}},Sx="GroupAxis",lk=se(Sx,Fu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=$x(Sx,{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()}}),ck=6;function fk({selection:t,textClassName:e,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,textReverseTransform:s}){const u=n.tickPadding-n.labelOffset[0],l=n.tickPadding+n.labelOffset[1];let c=0,f=0;o.grid.groupAxis.position==="bottom"?(f=-l,o.grid.valueAxis.position==="left"?c=-u:o.grid.valueAxis.position==="right"&&(c=u)):o.grid.groupAxis.position==="top"?(f=l,o.grid.valueAxis.position==="left"?c=-u:o.grid.valueAxis.position==="right"&&(c=u)):o.grid.groupAxis.position==="left"?(c=u,o.grid.valueAxis.position==="bottom"?f=l:o.grid.valueAxis.position==="top"&&(f=-l)):o.grid.groupAxis.position==="right"&&(c=-u,o.grid.valueAxis.position==="bottom"?f=l:o.grid.valueAxis.position==="top"&&(f=-l)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{Z(d[p]).selectAll("text").data([h]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",Ct(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(g=>o.grid.valueAxis.label)}).attr("transform",h=>`translate(0, ${i.height})`)}function hk({selection:t,yAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:s,textReverseTransformWithRotate:u,minAndMax:l}){const c=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),f=l[1]-l[0];let h=0,p=0;o.grid.valueAxis.position==="left"?(h=n.tickPadding,p=0):o.grid.valueAxis.position==="right"?(h=-n.tickPadding,p=0):o.grid.valueAxis.position==="bottom"?(h=0,p=n.tickPadding):o.grid.valueAxis.position==="top"&&(h=0,p=-n.tickPadding);const d=Eg(s).scale(s).ticks(f>n.ticks?n.ticks:l[0]===0&&l[1]===0?1:Math.ceil(f)).tickFormat(y=>Lh(y,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:ck).tickPadding(h),g=c.transition().duration(100).call(d);g.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?Ct(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),g.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?Ct(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges");const m=c.selectAll("text").attr("font-size",a.styles.textSize).style("color",Ct(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("y",p);return m.style("transform",u),(o.grid.valueAxis.position==="bottom"||o.grid.valueAxis.position==="top")&&m.attr("dy",0),c}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 nt,h=at(t,"container"),p=at(t,"yAxisG"),d=at(t,"yAxis"),g=at(t,"text"),m=Y({computedData:n.pipe(tt((D,_)=>D.length===_.length)),isSeriesSeprate:c}).pipe(I(f),W(async D=>D),F(D=>D.isSeriesSeprate?D.computedData:[D.computedData[0]]),F((D,_)=>e.selectAll(`g.${h}`).data(D,M=>M[0]?M[0].seriesIndex:_).join("g").classed(h,!0))),y=m.pipe(I(f),F((D,_)=>D.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));Y({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async D=>D)).subscribe(D=>{D.containerSelection.attr("transform",(_,M)=>{const S=D.gridContainerPosition[M]??D.gridContainerPosition[0],G=S.translate,C=S.scale;return`translate(${G[0]}, ${G[1]}) scale(${C[0]}, ${C[1]})`})}),Y({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async D=>D)).subscribe(D=>{D.axisSelection.style("transform",D.gridAxesTransform.value)});const b=Y({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async D=>D),F(D=>{const _=`rotateX(${D.gridAxesReverseTransform.rotateX}deg) rotateY(${D.gridAxesReverseTransform.rotateY}deg)`,M=`rotate(${D.gridAxesReverseTransform.rotate}deg)`,S=`scale(${1/D.gridContainerPosition[0].scale[0]}, ${1/D.gridContainerPosition[0].scale[1]})`;return`${_} ${M} ${S}`}),tt()),x=Y({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async D=>D),F(D=>`${D.textReverseTransform} rotate(${D.fullParams.tickTextRotate}deg)`)),v=new dt(D=>{Y({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async _=>_)).subscribe(_=>{const S=_.computedData[0]?_.computedData[0].length-1:0,G=_.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[0]-_.fullDataFormatter.grid.groupAxis.scalePadding,C=_.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?S+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding,A=_.computedData.map((P,O)=>P.filter((z,k)=>k>=G&&k<=C)),L=mR(A.flat());L[0]===L[1]&&(L[0]=L[1]-1),D.next(L)})}),$=new dt(D=>{Y({fullDataFormatter:i,gridAxesSize:u,minAndMax:v}).pipe(I(f),W(async _=>_)).subscribe(_=>{const M=Jd({maxValue:_.minAndMax[1],minValue:_.minAndMax[0],axisWidth:_.gridAxesSize.height,scaleDomain:_.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:_.fullDataFormatter.grid.valueAxis.scaleRange});D.next(M)})}),w=Y({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async D=>D),F(D=>{let _="start",M="hanging";return D.fullDataFormatter.grid.valueAxis.position==="left"?(_="end",M="middle"):D.fullDataFormatter.grid.valueAxis.position==="right"?(_="start",M="middle"):D.fullDataFormatter.grid.valueAxis.position==="bottom"?(_=D.fullParams.tickTextRotate?"end":"middle",M="hanging"):D.fullDataFormatter.grid.valueAxis.position==="top"&&(_=D.fullParams.tickTextRotate?"start":"middle",M="auto"),{textAnchor:_,dominantBaseline:M}})),R=i.pipe(I(f),F(D=>{let _="start",M="hanging";return D.grid.groupAxis.position==="bottom"?M="auto":D.grid.groupAxis.position==="top"?M="hanging":D.grid.groupAxis.position==="left"?_="start":D.grid.groupAxis.position==="right"&&(_="end"),D.grid.valueAxis.position==="left"?_="end":D.grid.valueAxis.position==="right"?_="start":D.grid.valueAxis.position==="bottom"?M="hanging":D.grid.valueAxis.position==="top"&&(M="auto"),{textAnchor:_,dominantBaseline:M}}));return Y({axisSelection:y,fullParams:r,tickTextAlign:w,axisLabelAlign:R,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:$,textReverseTransform:b,textReverseTransformWithRotate:x,minAndMax:v}).pipe(I(f),W(async D=>D)).subscribe(D=>{hk({selection:D.axisSelection,yAxisClassName:d,fullParams:D.fullParams,tickTextAlign:D.tickTextAlign,gridAxesSize:D.gridAxesSize,fullDataFormatter:D.fullDataFormatter,fullChartParams:D.fullChartParams,valueScale:D.valueScale,textReverseTransformWithRotate:D.textReverseTransformWithRotate,minAndMax:D.minAndMax}),fk({selection:D.axisSelection,textClassName:g,fullParams:D.fullParams,axisLabelAlign:D.axisLabelAlign,gridAxesSize:D.gridAxesSize,fullDataFormatter:D.fullDataFormatter,fullChartParams:D.fullChartParams,textReverseTransform:D.textReverseTransform})}),()=>{f.next(void 0)}},Ax="ValueAxis",pk=se(Ax,Gu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=ai(Ax,{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()}}),Mx="ValueStackAxis",dk=se(Mx,up)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=ai(Mx,{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()}}),Dx="ScalingArea",gk=at(Dx,"rect"),mk=se(Dx,lp)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new nt,a=e.insert("rect","g").classed(gk,!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(F(l=>l[0]?l[0].length-1:0),tt());return Y({initGroupAxis:r.fullDataFormatter$.pipe(F(l=>l.grid.groupAxis),m_()),fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:u,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(I(o),W(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=Jd({maxValue:l.groupMaxIndex,minValue:0,axisWidth:l.axisSize.width,scaleDomain:[h,p],scaleRange:[0,1]}).copy(),m=tx().on("zoom",function(b){const x=b.transform,v=R=>{const D=Math.round(R);return Math.min(f,Math.max(0,D))},$=l.fullDataFormatter.grid.groupAxis.position==="bottom"||l.fullDataFormatter.grid.groupAxis.position==="top"?x.rescaleX(g).domain().map(v):x.rescaleY(g).domain().map(v);$[0]<=0&&$[1]>=f?x.k<s.k&&(x.k=s.k,x.x=s.x,x.y=s.y):$[1]-$[0]<=1&&x.k>s.k&&(x.k=s.k,x.x=s.x,x.y=s.y),s.k=x.k,s.x=x.x,s.y=x.y;const w={...l.fullDataFormatter,grid:{...l.fullDataFormatter.grid,groupAxis:{...l.fullDataFormatter.grid.groupAxis,scaleDomain:$}}};i.dataFormatter$.next(w)});e.call(m)}),()=>{o.next(void 0),a.remove()}}),Cu="GroupAux",Rh=at(Cu,"label-box");function yk({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function bk({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 vk(t){t.selectAll("line").data([]).exit().remove()}function xk({groupLabel:t,axisX:e,fullParams:n}){return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:Lh(t,n.labelTextFormat)}]:[]}function _k({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){const s=a+6,u=t.selectAll(`g.${Rh}`).data(e),l=u.enter().append("g").classed(Rh,!0).style("cursor","pointer"),c=l.merge(u);return l.attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.transition().duration(50).attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.exit().remove(),c.each((f,h,p)=>{const d=nx(f.text,a)+12;let g=-d/2,m=-2;r.grid.groupAxis.position==="bottom"?(g=n.labelRotate?-d+s:-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=n.labelRotate?-d+s:-d/2,m=-s+2);const y=Z(p[h]).selectAll("rect").data([f]),b=y.enter().append("rect").attr("height",`${s}px`).attr("fill",$=>Ct(n.labelColorType,i)).attr("x",g).attr("y",m-2).attr("rx",5).attr("ry",5).style("cursor","pointer");y.merge(b).attr("width",$=>`${d}px`).style("transform",o),y.exit().remove();const x=Z(p[h]).selectAll("text").data([f]),v=x.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");x.merge(v).text($=>$.text).style("transform",o).attr("fill",$=>Ct(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",g+6).attr("y",m),x.exit().remove()}),c}function wk(t){t.selectAll(`g.${Rh}`).data([]).exit().remove()}const $k=se(Cu,Nu)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new nt;let a=!1;const s=e.insert("rect","g").classed(at(Cu,"rect"),!0).attr("opacity",0),{seriesSelection$:u,axesSelection$:l,defsSelection$:c,graphicGSelection$:f}=ar({selection:t,pluginName:Cu,clipPathID:"test",seriesLabels$:i.seriesLabels$,gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(I(o)).subscribe(w=>{s.attr("width",w.rootWidth).attr("height",w.rootHeight)});const h=Y({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(I(o),W(async w=>w),F(w=>{const D=w.computedData[0]?w.computedData[0].length-1:0,_=w.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[0]-w.fullDataFormatter.grid.groupAxis.scalePadding,M=w.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?D+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding;return[_,M]}),St(1)),p=Y({groupScaleDomain:h,gridAxesSize:i.gridAxesSize$}).pipe(I(o),W(async w=>w),F(w=>So().domain(w.groupScaleDomain).range([0,w.gridAxesSize.width]))),d=i.fullChartParams$.pipe(I(o),F(w=>w.highlightTarget),tt()),g=Ch(e,"mousemove").pipe(I(o)),m=Y({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),W(async w=>w),F(w=>{const R=`rotateX(${w.gridAxesReverseTransform.rotateX}deg) rotateY(${w.gridAxesReverseTransform.rotateY}deg)`,D=`rotate(${w.gridAxesReverseTransform.rotate}deg)`,_=`scale(${1/w.gridContainerPosition[0].scale[0]}, ${1/w.gridContainerPosition[0].scale[1]})`;return`${R} ${D} ${_}`}),tt()),y=Y({textReverseTransform:m,fullParams:i.fullParams$}).pipe(I(o),W(async w=>w),F(w=>`${w.textReverseTransform} rotate(${w.fullParams.labelRotate}deg)`)),b=i.gridContainerPosition$.pipe(I(o),F(w=>w.reduce((D,_)=>_.columnIndex>D?_.columnIndex:D,0)+1),tt()),x=i.gridContainerPosition$.pipe(I(o),F(w=>w.reduce((D,_)=>_.rowIndex>D?_.rowIndex:D,0)+1),tt()),v=yR({rootSelection:e,fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$,gridContainerPosition$:i.gridContainerPosition$,layout$:i.layout$}).pipe(I(o));Y({axesSelection:l,columnAmount:b,rowAmount:x,layout:i.layout$,rootMousemove:g,gridGroupPosition:v,computedData:i.computedData$,groupScale:p,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:d,textReverseTransformWithRotate:y,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).subscribe(w=>{const{groupIndex:R,groupLabel:D}=w.gridGroupPosition,_=w.groupScale(R)??0,M=yk({groupLabel:D,axisX:_,axisHeight:w.gridAxesSize.height,fullParams:w.fullParams});bk({selection:w.axesSelection,pluginName:n,lineData:M,fullParams:w.fullParams,fullChartParams:w.fullChartParams});const S=xk({groupLabel:D,axisX:_,fullParams:w.fullParams});_k({selection:w.axesSelection,labelData:S,fullParams:w.fullParams,fullDataFormatter:w.fullDataFormatter,fullChartParams:w.fullChartParams,textReverseTransformWithRotate:w.textReverseTransformWithRotate,textSizePx:w.textSizePx}).on("mouseover",(C,A)=>{C.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:w.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:w.GroupDataMap.get(D)??[],groupIndex:R,groupLabel:D,event:C,data:w.computedData})}).on("mousemove",(C,A)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:w.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:w.GroupDataMap.get(D)??[],groupIndex:R,groupLabel:D,event:C,data:w.computedData})}).on("click",(C,A)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:w.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:w.GroupDataMap.get(D)??[],groupIndex:R,groupLabel:D,event:C,data:w.computedData})})});const $=Ch(s,"mouseout").pipe(I(o));return Y({rootRectMouseout:$,axesSelection:l}).pipe(I(o),W(async w=>w)).subscribe(w=>{setTimeout(()=>{a!=!0&&(vk(w.axesSelection),wk(w.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),Px={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"},kh={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]};kh.tickFormat.toString=()=>"text => text";const Eu={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]},Sk={...Eu},Tx={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},Lx={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},Cx={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},Ex={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Rx={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},kx={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Ih={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]},Ix={...Ih},Nx="MultiGridLegend",Ak=pe(Nx,Px)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.multiGridEachDetail$.pipe(I(i),F(l=>l.map((f,h)=>f.SeriesDataMap$.pipe(F(p=>Array.from(p.keys()))))),W(l=>Y(l)),F(l=>l.flat())),a=Y({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(I(i),W(async l=>l),F(l=>l.computedData.map((c,f)=>{const h=vl(l.fullParams.gridList[f]??{},{listRectWidth:l.fullParams.listRectWidth,listRectHeight:l.fullParams.listRectHeight,listRectRadius:l.fullParams.listRectRadius});return c.map(p=>h)}).flat())),s=Y({fullParams:n.fullParams$,seriesList:a}).pipe(I(i),W(async l=>l),F(l=>({...l.fullParams,seriesList:l.seriesList}))),u=Lu(Nx,{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(F(n=>n.gridIndexes),tt(),St(1));return Y({multiGridEachDetail:t.multiGridEachDetail$,gridIndexes:e}).pipe(F(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},Nh="MultiBars",Fx=at(Nh,"grid"),Mk=pe(Nh,Tx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Fx}`).data(s).join("g").attr("class",Fx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=Eh(Nh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Fh="MultiBarStack",Gx=at(Fh,"grid"),Dk=pe(Fh,Lx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Gx}`).data(s).join("g").attr("class",Gx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=px(Fh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,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())}}),Gh="MultiBarsTriangle",zx=at(Gh,"grid"),Pk=pe(Gh,Cx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${zx}`).data(s).join("g").attr("class",zx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=yx(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$,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())}}),zh="MultiLines",Ox=at(zh,"grid"),Tk=pe(zh,Ex)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new nt,a=[],s=i.multiGridContainerPosition$.pipe(I(o),F(l=>l.flat()));return Ce(i).pipe(I(o)).subscribe(l=>{a.forEach(c=>c()),t.selectAll(`g.${Ox}`).data(l).join("g").attr("class",Ox).each((c,f,h)=>{const p=Z(h[f]);a[f]=ix(zh,{selection:p,computedData$:c.computedData$,computedLayoutData$:c.computedLayoutData$,visibleComputedData$:c.visibleComputedData$,visibleComputedLayoutData$:c.visibleComputedLayoutData$,seriesLabels$:c.seriesLabels$,SeriesDataMap$:c.SeriesDataMap$,GroupDataMap$:c.GroupDataMap$,fullDataFormatter$:c.dataFormatter$,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,gridAxesTransform$:c.gridAxesTransform$,gridGraphicTransform$:c.gridGraphicTransform$,gridAxesSize$:c.gridAxesSize$,gridHighlight$:c.gridHighlight$,gridContainerPosition$:c.gridContainerPosition$,allContainerPosition$:s,layout$:i.layout$,event$:r.event$})})}),()=>{o.next(void 0),a.forEach(l=>l())}}),Oh="MultiLineAreas",Ux=at(Oh,"grid"),Lk=pe(Oh,Rx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.multiGridContainerPosition$.pipe(I(i),F(u=>u.flat()));return Ce(r).pipe(I(i)).subscribe(u=>{o.forEach(l=>l()),t.selectAll(`g.${Ux}`).data(u).join("g").attr("class",Ux).each((l,c,f)=>{const h=Z(f[c]);o[c]=ax(Oh,{selection:h,computedData$:l.computedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedData$:l.visibleComputedData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullDataFormatter$:l.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,allContainerPosition$:a,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(u=>u())}}),Uh="MultiDots",Bx=at(Uh,"grid"),Ck=pe(Uh,kx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Bx}`).data(s).join("g").attr("class",Bx).each((u,l,c)=>{const f=Z(c[l]);o[l]=vx(Uh,{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())}}),Bh="MultiGroupAxis",Yx=at(Bh,"grid"),Ek=pe(Bh,kh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Yx}`).data(s).join("g").attr("class",Yx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=$x(Bh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Yh="MultiValueAxis",Wx=at(Yh,"grid"),Rk=pe(Yh,Eu)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Wx}`).data(s).join("g").attr("class",Wx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=ai(Yh,{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="MultiValueStackAxis",Hx=at(Wh,"grid"),kk=pe(Wh,Eu)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Hx}`).data(s).join("g").attr("class",Hx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=ai(Wh,{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 Ik(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function Vx(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:Ik(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 jx=({fullDataFormatter$:t,layout$:e})=>{const n=new nt;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 dt(i=>(Y({fullDataFormatter:t,layout:e}).pipe(I(n),W(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)}))},qx=({gridAxesTransform$:t})=>t.pipe(F(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) rotateX(${o}deg) rotateY(${a}deg) rotate(${i}deg)`}})),Xx=({computedData$:t,fullDataFormatter$:e,layout$:n})=>Y({computedData:t,fullDataFormatter:e,layout:n}).pipe(W(async i=>i),F(i=>{if(i.fullDataFormatter.grid.separateSeries)return Vx(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=Vx(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Hh="OverlappingValueAxes",Zx=at(Hh,"grid"),Nk=pe(Hh,Ih)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[1])),u=Y({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),W(async c=>c),F(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 Yo(r).pipe(I(i),F(c=>({...c,fullParams$:c.fullParams$.pipe(F(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),W(c=>Ce(c)),F(c=>c.map((f,h)=>{if(h===0)return f;const p=jx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=Xx({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.${Zx}`).data(c).join("g").attr("class",Zx).each((f,h,p)=>{if(h>1)return;const d=Z(p[h]);o[h]=ai(Hh,{selection:d,computedData$:f.computedData$,fullParams$:r.fullParams$.pipe(F(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())}}),Vh="OverlappingValueStackAxes",Kx=at(Vh,"grid"),Fk=pe(Vh,Ix)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[1])),u=Y({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),W(async c=>c),F(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 Yo(r).pipe(I(i),F(c=>({...c,fullParams$:c.fullParams$.pipe(F(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),W(c=>Ce(c)),F(c=>c.map((f,h)=>{if(h===0)return f;const p=jx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=Xx({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.${Kx}`).data(c).join("g").attr("class",Kx).each((f,h,p)=>{if(h>1)return;const d=Z(p[h]);o[h]=ai(Vh,{selection:d,computedData$:h===0?f.computedStackedData$:f.computedData$,fullParams$:r.fullParams$.pipe(F(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())}}),Qx={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},jh={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};jh.textRenderFn.toString=()=>`(eventData) => {
15
+ `})}function KR({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)=>{Z(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 QR({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)?Z(a[o]).style("opacity",1):Z(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const yx=(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$:y,event$:b})=>{const x=new nt,v=$n(t,"clipPath-box"),$=at(t,"pathG"),w=at(t,"path"),{seriesSelection$:R,axesSelection$:D,defsSelection$:_,graphicGSelection$:M}=ar({selection:e,pluginName:t,clipPathID:v,seriesLabels$:s,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(I(x),F(T=>-T.translate[1]/T.scale[1]));const S=o.pipe(F(T=>T.map(N=>N[0]?N[0].axisY-N[0].axisYFromZero:0)),tt()),G=Y({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(x),W(async T=>T),F(T=>T.params.barWidth?T.params.barWidth:T.isSeriesSeprate?mx({axisWidth:T.gridAxesSize.width,groupAmount:T.computedData[0]?T.computedData[0].length:0,barAmountOfGroup:1,barPadding:T.params.barPadding,barGroupPadding:T.params.barGroupPadding}):mx({axisWidth:T.gridAxesSize.width,groupAmount:T.computedData[0]?T.computedData[0].length:0,barAmountOfGroup:T.visibleComputedData.length,barPadding:T.params.barPadding,barGroupPadding:T.params.barGroupPadding}))),C=i.pipe(I(x),F(T=>{const N=new Set;return T.forEach(j=>{j.forEach(Q=>{N.add(Q.groupLabel)})}),Array.from(N)})),A=new dt(T=>{Y({seriesLabels:s,barWidth:G,params:c}).pipe(I(x),W(async N=>N)).subscribe(N=>{const j=VR(N.barWidth,N.seriesLabels,N.params);T.next(j)})}),L=f.pipe(I(x),F(T=>T.transitionDuration),tt()),P=new dt(T=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async N=>N)).subscribe(N=>{const j=jR(N.groupLabels.length,N.transitionDuration);T.next(j)})}).pipe(I(x),tt()),O=new dt(T=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async N=>N)).subscribe(N=>{const j=qR(N.groupLabels.length,N.transitionDuration);T.next(j)})}).pipe(I(x),tt());Y({defsSelection:_,gridAxesSize:d}).pipe(I(x),W(async T=>T)).subscribe(T=>{const N=[{id:v,width:T.gridAxesSize.width,height:T.gridAxesSize.height}];KR({defsSelection:T.defsSelection,clipPathData:N})});const z=f.pipe(I(x),F(T=>T.highlightTarget),tt()),k=s.pipe(I(x),F(T=>T.map((N,j)=>$n(t,`lineargradient-${N}`)))),E=Y({graphicGSelection:M,defsSelection:_,computedData:n,visibleComputedLayoutData:o,linearGradientIds:k,zeroYArr:S,groupLabels:C,barScale:A,params:c,chartParams:f,barWidth:G,delayGroup:P,transitionItem:O,isSeriesSeprate:y}).pipe(I(x),W(async T=>T),F(T=>(ZR({defsSelection:T.defsSelection,computedData:T.computedData,linearGradientIds:T.linearGradientIds,params:T.params}),XR({graphicGSelection:T.graphicGSelection,pathGClassName:$,pathClassName:w,visibleComputedLayoutData:T.visibleComputedLayoutData,linearGradientIds:T.linearGradientIds,zeroYArr:T.zeroYArr,groupLabels:T.groupLabels,barScale:T.barScale,params:T.params,chartParams:T.chartParams,barWidth:T.barWidth,delayGroup:T.delayGroup,transitionItem:T.transitionItem,isSeriesSeprate:T.isSeriesSeprate}))));return Y({barSelection:E,computedData:n,highlightTarget:z,SeriesDataMap:u,GroupDataMap:l}).subscribe(T=>{T.barSelection.on("mouseover",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})}).on("mousemove",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})}).on("mouseout",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})}).on("click",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})})}),Y({barSelection:E,highlight:g.pipe(F(T=>T.map(N=>N.id))),fullChartParams:f}).pipe(I(x),W(async T=>T)).subscribe(T=>{QR({selection:T.barSelection,ids:T.highlight,fullChartParams:T.fullChartParams})}),()=>{x.next(void 0)}},bx="BarsTriangle",JR=se(bx,sp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=yx(bx,{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 tk({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)=>{Z(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)=>{Z(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((y,b)=>d*u).attr("opacity",1),m=>m.transition().duration(50).attr("opacity",1),m=>m.remove()).attr("r",i.radius).attr("fill",(m,y)=>Tu({datum:m,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(m,y)=>Tu({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 ek({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)?Z(a[o]).style("opacity",1).transition("highlight").duration(200):Z(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}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)=>{Z(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 vx=(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$:y})=>{const b=new nt,x=$n(t,"clipPath-box"),v=at(t,"circleG"),$=at(t,"circle"),{seriesSelection$:w,axesSelection$:R,defsSelection$:D,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),M=Y({computedData:n,gridGraphicReverseScale:p}).pipe(I(b),W(async A=>A),F(A=>A.computedData.map((L,P)=>A.gridGraphicReverseScale[P])));Y({defsSelection:D,gridAxesSize:d}).pipe(I(b),W(async A=>A)).subscribe(A=>{const L=[{id:x,width:A.gridAxesSize.width,height:A.gridAxesSize.height}];nk({defsSelection:A.defsSelection,clipPathData:L})});const S=c.pipe(I(b),F(A=>A.highlightTarget),tt()),G=Y({graphicGSelection:_,visibleComputedLayoutData:o,graphicReverseScale:M,fullChartParams:c,fullParams:l}).pipe(I(b),W(async A=>A),F(A=>tk({graphicGSelection:A.graphicGSelection,circleGClassName:v,circleClassName:$,visibleComputedLayoutData:A.visibleComputedLayoutData,fullParams:A.fullParams,fullChartParams:A.fullChartParams,graphicReverseScale:A.graphicReverseScale})));Y({graphicSelection:G,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:S}).pipe(I(b),W(async A=>A)).subscribe(A=>{A.graphicSelection.on("mouseover",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:A.highlightTarget,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L,data:A.computedData})}).on("mousemove",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:A.highlightTarget,data:A.computedData,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L})}).on("mouseout",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:A.highlightTarget,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L,data:A.computedData})}).on("click",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:A.highlightTarget,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L,data:A.computedData})})});const C=l.pipe(I(b),F(A=>A.onlyShowHighlighted),tt());return Y({graphicSelection:G,highlight:g.pipe(F(A=>A.map(L=>L.id))),onlyShowHighlighted:C,fullChartParams:c}).pipe(I(b),W(async A=>A)).subscribe(A=>{ek({selection:A.graphicSelection,ids:A.highlight,onlyShowHighlighted:A.onlyShowHighlighted,fullChartParams:A.fullChartParams})}),()=>{b.next(void 0)}},xx="Dots",rk=se(xx,op)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=vx(xx,{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()}}),ik={listRectWidth:14,listRectHeight:14,listRectRadius:0};function _x(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 Lu=(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 nt,h=Y({seriesLabels:n,fullChartParams:o}).pipe(I(f),W(async _=>_),F(_=>{const M=new Map;let S=0;return _.seriesLabels.forEach((G,C)=>{if(!M.has(G)){const A=_x(S,_.fullChartParams);M.set(G,A),S++}}),M})),p=n.pipe(I(f),F(_=>{const M=new Set;let S=[];return _.forEach(G=>{M.has(G)?S.push(!1):S.push(!0),M.add(G)}),S})),d=r.pipe(I(f),F(_=>_.position==="bottom"||_.position==="top"?"row":"column")),g=Y({fullParams:r,layout:i}).pipe(I(f),W(async _=>_),F(_=>{const M=_.fullParams.padding*2+_.fullParams.gap*2;return _.fullParams.position==="bottom"||_.fullParams.position==="top"?_.layout.rootWidth-M:_.layout.rootHeight-M})),y=Y({layout:i,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>{let M=0,S=0;return _.fullParams.position==="bottom"?(S=_.layout.rootHeight,_.fullParams.justify==="start"?M=0:_.fullParams.justify==="center"?M=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(M=_.layout.rootWidth)):_.fullParams.position==="right"?(M=_.layout.rootWidth,_.fullParams.justify==="start"?S=0:_.fullParams.justify==="center"?S=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(S=_.layout.rootHeight)):_.fullParams.position==="top"?(S=0,_.fullParams.justify==="start"?M=0:_.fullParams.justify==="center"?M=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(M=_.layout.rootWidth)):_.fullParams.position==="left"&&(M=0,_.fullParams.justify==="start"?S=0:_.fullParams.justify==="center"?S=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(S=_.layout.rootHeight)),{x:M,y:S}})).pipe(I(f),F(_=>e.selectAll(`g.${s}`).data([_]).join(M=>M.append("g").classed(s,!0).attr("transform",S=>`translate(${S.x}, ${S.y})`),M=>M.transition().attr("transform",S=>`translate(${S.x}, ${S.y})`),M=>M.remove()))),b=r.pipe(I(f),F(_=>_.seriesList[0]?_.seriesList[0]:ik)),x=Y({visibleList:p,fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:d,lineMaxSize:g,defaultListStyle:b,SeriesLabelColorMap:h,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>_.seriesLabels.reduce((M,S,G)=>{if(!_.visibleList[G])return M;const C=nx(S,_.textSizePx),A=_.textSizePx*1.5+C,L=_.SeriesLabelColorMap.get(S),P=M[0]&&M[0][0]?M[M.length-1][M[M.length-1].length-1]:null,{translateX:O,translateY:z,lineIndex:k,itemIndex:E}=((N,j,Q)=>{let U=0,X=0,B=0,q=0;if(N.lineDirection==="column"){let V=Q?Q.translateY+N.textSizePx+N.fullParams.gap:0;if(V+N.textSizePx>N.lineMaxSize){B=Q.lineIndex+1,q=0,X=0;const rt=j[j.length-1].reduce((ut,H)=>H.itemWidth>ut?H.itemWidth:ut,0);U=Q.translateX+rt+N.fullParams.gap}else B=Q?Q.lineIndex:0,q=Q?Q.itemIndex+1:0,X=V,U=Q?Q.translateX:0}else{let V=Q?Q.translateX+Q.itemWidth+N.fullParams.gap:0;V+A>N.lineMaxSize?(B=Q.lineIndex+1,q=0,U=0):(B=Q?Q.lineIndex:0,q=Q?Q.itemIndex+1:0,U=V),X=(N.textSizePx+N.fullParams.gap)*B}return{translateX:U,translateY:X,lineIndex:B,itemIndex:q}})(_,M,P);M[k]||(M[k]=[]);const T=_.fullParams.seriesList[E]?_.fullParams.seriesList[E]:_.defaultListStyle;return M[k].push({id:S,seriesLabel:S,seriesIndex:G,lineIndex:k,itemIndex:E,text:S,itemWidth:A,translateX:O,translateY:z,color:L,listRectWidth:T.listRectWidth,listRectHeight:T.listRectHeight,listRectRadius:T.listRectRadius}),M},[])),St(1)),v=Y({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const{width:M,height:S}=((G,C)=>{let A=0,L=0;if(!C.length||!C[0].length)return{width:A,height:L};const P=C[0][C[0].length-1];return G.lineDirection==="column"?(A=C.reduce((O,z)=>{const k=z.reduce((E,T)=>T.itemWidth>E?T.itemWidth:E,0);return O+k},0),A+=G.fullParams.gap*(C.length-1),L=P.translateY+G.textSizePx):(A=P.translateX+P.itemWidth,L=G.textSizePx*C.length+G.fullParams.gap*(C.length-1)),{width:A,height:L}})(_,_.lengendItems);return{direction:_.lineDirection,width:M,height:S,translateX:_.fullParams.gap,translateY:_.fullParams.gap}}),St(1)),$=Y({fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>{const M=_.lengendList.width+_.fullParams.gap*2,S=_.lengendList.height+_.fullParams.gap*2;let G=0,C=0;return _.fullParams.position==="left"?_.fullParams.justify==="start"?(G=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(G=_.fullParams.padding,C=-S/2):_.fullParams.justify==="end"&&(G=_.fullParams.padding,C=-S-_.fullParams.padding):_.fullParams.position==="right"?_.fullParams.justify==="start"?(G=-M-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(G=-M-_.fullParams.padding,C=-S/2):_.fullParams.justify==="end"&&(G=-M-_.fullParams.padding,C=-S-_.fullParams.padding):_.fullParams.position==="top"?_.fullParams.justify==="start"?(G=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(G=-M/2,C=_.fullParams.padding):_.fullParams.justify==="end"&&(G=-M-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="start"?(G=_.fullParams.padding,C=-S-_.fullParams.padding):_.fullParams.justify==="center"?(G=-M/2,C=-S-_.fullParams.padding):_.fullParams.justify==="end"&&(G=-M-_.fullParams.padding,C=-S-_.fullParams.padding),{width:M,height:S,translateX:G,translateY:C}})),w=Y({rootPositionSelection:y,fullParams:r,fullChartParams:o,legendCard:$}).pipe(I(f),W(async _=>_),F(_=>_.rootPositionSelection.selectAll("g").data([_.legendCard]).join(M=>M.append("g").classed(u,!0).attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.transition().attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.remove()).each((M,S,G)=>{Z(G[S]).selectAll("rect").data([M]).join("rect").attr("width",C=>C.width).attr("height",C=>C.height).attr("fill",Ct(_.fullParams.backgroundFill,_.fullChartParams)).attr("stroke",Ct(_.fullParams.backgroundStroke,_.fullChartParams))}))),R=Y({lengendCardSelection:w,fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>_.lengendCardSelection.selectAll("g").data([_.lengendList]).join(M=>M.append("g").classed(l,!0).attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.transition().attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.remove())));return Y({lengendListSelection:R,fullParams:r,fullChartParams:o,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const M=_.lengendItems[0]?_.lengendItems.flat():[];return _.lengendListSelection.selectAll(`g.${c}`).data(M).join(S=>S.append("g").classed(c,!0).attr("cursor","default"),S=>S,S=>S.remove()).attr("transform",(S,G)=>`translate(${S.translateX}, ${S.translateY})`).each((S,G,C)=>{const A=_.textSizePx/2,L=-S.listRectWidth/2,P=-S.listRectHeight/2;Z(C[G]).selectAll("rect").data([S]).join("rect").attr("x",A).attr("y",A).attr("width",O=>O.listRectWidth).attr("height",O=>O.listRectHeight).attr("transform",O=>`translate(${L}, ${P})`).attr("fill",O=>O.color).attr("rx",O=>O.listRectRadius),Z(C[G]).selectAll("text").data([S]).join(O=>O.append("text").attr("dominant-baseline","hanging"),O=>O,O=>O.remove()).attr("x",_.textSizePx*1.5).attr("font-size",_.fullChartParams.styles.textSize).attr("fill",O=>_.fullParams.textColorType==="series"?_x(O.seriesIndex,_.fullChartParams):Ct(_.fullParams.textColorType,_.fullChartParams)).text(O=>O.text)})})).subscribe(),()=>{e.select(`g.${s}`).remove(),f.next(void 0)}},wx="GridLegend",ok=se(wx,cp)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.SeriesDataMap$.pipe(I(i),F(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),F(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Lu(wx,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),ak=6;function sk({selection:t,groupingLabelClassName:e,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,textReverseTransform:s}){const u=n.tickPadding+n.labelOffset[0],l=n.tickPadding+n.labelOffset[1];let c=0,f=0;o.grid.groupAxis.position==="bottom"?(f=l,o.grid.valueAxis.position==="left"?c=u:o.grid.valueAxis.position==="right"&&(c=-u)):o.grid.groupAxis.position==="top"?(f=-l,o.grid.valueAxis.position==="left"?c=u:o.grid.valueAxis.position==="right"&&(c=-u)):o.grid.groupAxis.position==="left"?(c=-u,o.grid.valueAxis.position==="bottom"?f=-l:o.grid.valueAxis.position==="top"&&(f=l)):o.grid.groupAxis.position==="right"&&(c=u,o.grid.valueAxis.position==="bottom"?f=-l:o.grid.valueAxis.position==="top"&&(f=l)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{Z(d[p]).selectAll("text").data([h]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",Ct(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(g=>o.grid.groupAxis.label)}).attr("transform",h=>`translate(${i.width}, 0)`)}function uk({selection:t,xAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:u,groupLabels:l,textReverseTransformWithRotate:c}){const f=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),h=Math.floor(u[1])-Math.ceil(u[0])+1;let p=0,d=0;o.grid.groupAxis.position==="left"?(p=0,d=-n.tickPadding):o.grid.groupAxis.position==="right"?(p=0,d=n.tickPadding):o.grid.groupAxis.position==="bottom"?(p=n.tickPadding,d=0):o.grid.groupAxis.position==="top"&&(p=-n.tickPadding,d=-0);const g=Cg(s).scale(s).ticks(n.ticks==="all"||n.ticks>h?h:n.ticks).tickSize(n.tickFullLine==!0?i.height:-ak).tickSizeOuter(0).tickFormat(b=>{const x=l[b]??"";return Lh(x,n.tickFormat)}).tickPadding(p),m=f.transition().duration(100).call(g);return m.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?Ct(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),m.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?Ct(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),f.selectAll("text").attr("font-size",a.styles.textSize).style("color",Ct(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("x",d).style("transform",c).attr("dy",0),f}const $x=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c})=>{const f=new nt,h=at(t,"container"),p=at(t,"xAxisG"),d=at(t,"xAxis"),g=at(t,"groupingLabel"),m=Y({computedData:n.pipe(tt((_,M)=>_.length===M.length)),isSeriesSeprate:c}).pipe(I(f),W(async _=>_),F(_=>_.isSeriesSeprate?_.computedData:[_.computedData[0]]),F((_,M)=>e.selectAll(`g.${h}`).data(_,S=>S[0]?S[0].seriesIndex:M).join("g").classed(h,!0))),y=m.pipe(I(f),F((_,M)=>_.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));Y({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async _=>_)).subscribe(_=>{_.containerSelection.attr("transform",(M,S)=>{const G=_.gridContainerPosition[S]??_.gridContainerPosition[0],C=G.translate,A=G.scale;return`translate(${C[0]}, ${C[1]}) scale(${A[0]}, ${A[1]})`})}),Y({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async _=>_)).subscribe(_=>{_.axisSelection.style("transform",_.gridAxesTransform.value)});const b=Y({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async _=>_),F(_=>{const M=`rotateX(${_.gridAxesReverseTransform.rotateX}deg) rotateY(${_.gridAxesReverseTransform.rotateY}deg)`,S=`rotate(${_.gridAxesReverseTransform.rotate}deg)`,G=`scale(${1/_.gridContainerPosition[0].scale[0]}, ${1/_.gridContainerPosition[0].scale[1]})`;return`${M} ${S} ${G}`}),tt()),x=Y({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>`${_.textReverseTransform} rotate(${_.fullParams.tickTextRotate}deg)`)),v=Y({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async _=>_),F(_=>{const S=_.computedData[0]?_.computedData[0].length-1:0,G=_.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[0]-_.fullDataFormatter.grid.groupAxis.scalePadding,C=_.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?S+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding;return[G,C]}),St(1)),$=Y({groupScaleDomain:v,gridAxesSize:u}).pipe(I(f),W(async _=>_),F(_=>So().domain(_.groupScaleDomain).range([0,_.gridAxesSize.width]))),w=n.pipe(F(_=>(_[0]??[]).map(M=>M.groupLabel))),R=Y({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>{let M="middle",S="hanging";return _.fullDataFormatter.grid.groupAxis.position==="bottom"?(M=_.fullParams.tickTextRotate?"end":"middle",S="hanging"):_.fullDataFormatter.grid.groupAxis.position==="top"?(M=_.fullParams.tickTextRotate?"start":"middle",S="auto"):_.fullDataFormatter.grid.groupAxis.position==="left"?(M="end",S="middle"):_.fullDataFormatter.grid.groupAxis.position==="right"&&(M="start",S="middle"),{textAnchor:M,dominantBaseline:S}})),D=i.pipe(I(f),F(_=>{let M="start",S="hanging";return _.grid.groupAxis.position==="bottom"?S="hanging":_.grid.groupAxis.position==="top"?S="auto":_.grid.groupAxis.position==="left"?M="end":_.grid.groupAxis.position==="right"&&(M="start"),_.grid.valueAxis.position==="left"?M="start":_.grid.valueAxis.position==="right"?M="end":_.grid.valueAxis.position==="bottom"?S="auto":_.grid.valueAxis.position==="top"&&(S="hanging"),{textAnchor:M,dominantBaseline:S}}));return Y({axisSelection:y,fullParams:r,tickTextAlign:R,axisLabelAlign:D,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:$,groupScaleDomain:v,groupLabels:w,textReverseTransform:b,textReverseTransformWithRotate:x}).pipe(I(f),W(async _=>_)).subscribe(_=>{uk({selection:_.axisSelection,xAxisClassName:d,fullParams:_.fullParams,tickTextAlign:_.tickTextAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,groupScale:_.groupScale,groupScaleDomain:_.groupScaleDomain,groupLabels:_.groupLabels,textReverseTransformWithRotate:_.textReverseTransformWithRotate}),sk({selection:_.axisSelection,groupingLabelClassName:g,fullParams:_.fullParams,axisLabelAlign:_.axisLabelAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,textReverseTransform:_.textReverseTransform})}),()=>{f.next(void 0)}},Sx="GroupAxis",lk=se(Sx,Fu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=$x(Sx,{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()}}),ck=6;function fk({selection:t,textClassName:e,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,textReverseTransform:s}){const u=n.tickPadding-n.labelOffset[0],l=n.tickPadding+n.labelOffset[1];let c=0,f=0;o.grid.groupAxis.position==="bottom"?(f=-l,o.grid.valueAxis.position==="left"?c=-u:o.grid.valueAxis.position==="right"&&(c=u)):o.grid.groupAxis.position==="top"?(f=l,o.grid.valueAxis.position==="left"?c=-u:o.grid.valueAxis.position==="right"&&(c=u)):o.grid.groupAxis.position==="left"?(c=u,o.grid.valueAxis.position==="bottom"?f=l:o.grid.valueAxis.position==="top"&&(f=-l)):o.grid.groupAxis.position==="right"&&(c=-u,o.grid.valueAxis.position==="bottom"?f=l:o.grid.valueAxis.position==="top"&&(f=-l)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{Z(d[p]).selectAll("text").data([h]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",Ct(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(g=>o.grid.valueAxis.label)}).attr("transform",h=>`translate(0, ${i.height})`)}function hk({selection:t,yAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:s,textReverseTransformWithRotate:u,minAndMax:l}){const c=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),f=l[1]-l[0];let h=0,p=0;o.grid.valueAxis.position==="left"?(h=n.tickPadding,p=0):o.grid.valueAxis.position==="right"?(h=-n.tickPadding,p=0):o.grid.valueAxis.position==="bottom"?(h=0,p=n.tickPadding):o.grid.valueAxis.position==="top"&&(h=0,p=-n.tickPadding);const d=Eg(s).scale(s).ticks(f>n.ticks?n.ticks:l[0]===0&&l[1]===0?1:Math.ceil(f)).tickFormat(y=>Lh(y,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:ck).tickPadding(h),g=c.transition().duration(100).call(d);g.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?Ct(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),g.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?Ct(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges");const m=c.selectAll("text").attr("font-size",a.styles.textSize).style("color",Ct(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("y",p);return m.style("transform",u),(o.grid.valueAxis.position==="bottom"||o.grid.valueAxis.position==="top")&&m.attr("dy",0),c}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 nt,h=at(t,"container"),p=at(t,"yAxisG"),d=at(t,"yAxis"),g=at(t,"text"),m=Y({computedData:n.pipe(tt((D,_)=>D.length===_.length)),isSeriesSeprate:c}).pipe(I(f),W(async D=>D),F(D=>D.isSeriesSeprate?D.computedData:[D.computedData[0]]),F((D,_)=>e.selectAll(`g.${h}`).data(D,M=>M[0]?M[0].seriesIndex:_).join("g").classed(h,!0))),y=m.pipe(I(f),F((D,_)=>D.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));Y({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async D=>D)).subscribe(D=>{D.containerSelection.attr("transform",(_,M)=>{const S=D.gridContainerPosition[M]??D.gridContainerPosition[0],G=S.translate,C=S.scale;return`translate(${G[0]}, ${G[1]}) scale(${C[0]}, ${C[1]})`})}),Y({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async D=>D)).subscribe(D=>{D.axisSelection.style("transform",D.gridAxesTransform.value)});const b=Y({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async D=>D),F(D=>{const _=`rotateX(${D.gridAxesReverseTransform.rotateX}deg) rotateY(${D.gridAxesReverseTransform.rotateY}deg)`,M=`rotate(${D.gridAxesReverseTransform.rotate}deg)`,S=`scale(${1/D.gridContainerPosition[0].scale[0]}, ${1/D.gridContainerPosition[0].scale[1]})`;return`${_} ${M} ${S}`}),tt()),x=Y({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async D=>D),F(D=>`${D.textReverseTransform} rotate(${D.fullParams.tickTextRotate}deg)`)),v=new dt(D=>{Y({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async _=>_)).subscribe(_=>{const S=_.computedData[0]?_.computedData[0].length-1:0,G=_.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[0]-_.fullDataFormatter.grid.groupAxis.scalePadding,C=_.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?S+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding,A=_.computedData.map((P,O)=>P.filter((z,k)=>k>=G&&k<=C)),L=mR(A.flat());L[0]===L[1]&&(L[0]=L[1]-1),D.next(L)})}),$=new dt(D=>{Y({fullDataFormatter:i,gridAxesSize:u,minAndMax:v}).pipe(I(f),W(async _=>_)).subscribe(_=>{const M=Jd({maxValue:_.minAndMax[1],minValue:_.minAndMax[0],axisWidth:_.gridAxesSize.height,scaleDomain:_.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:_.fullDataFormatter.grid.valueAxis.scaleRange});D.next(M)})}),w=Y({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async D=>D),F(D=>{let _="start",M="hanging";return D.fullDataFormatter.grid.valueAxis.position==="left"?(_="end",M="middle"):D.fullDataFormatter.grid.valueAxis.position==="right"?(_="start",M="middle"):D.fullDataFormatter.grid.valueAxis.position==="bottom"?(_=D.fullParams.tickTextRotate?"end":"middle",M="hanging"):D.fullDataFormatter.grid.valueAxis.position==="top"&&(_=D.fullParams.tickTextRotate?"start":"middle",M="auto"),{textAnchor:_,dominantBaseline:M}})),R=i.pipe(I(f),F(D=>{let _="start",M="hanging";return D.grid.groupAxis.position==="bottom"?M="auto":D.grid.groupAxis.position==="top"?M="hanging":D.grid.groupAxis.position==="left"?_="start":D.grid.groupAxis.position==="right"&&(_="end"),D.grid.valueAxis.position==="left"?_="end":D.grid.valueAxis.position==="right"?_="start":D.grid.valueAxis.position==="bottom"?M="hanging":D.grid.valueAxis.position==="top"&&(M="auto"),{textAnchor:_,dominantBaseline:M}}));return Y({axisSelection:y,fullParams:r,tickTextAlign:w,axisLabelAlign:R,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:$,textReverseTransform:b,textReverseTransformWithRotate:x,minAndMax:v}).pipe(I(f),W(async D=>D)).subscribe(D=>{hk({selection:D.axisSelection,yAxisClassName:d,fullParams:D.fullParams,tickTextAlign:D.tickTextAlign,gridAxesSize:D.gridAxesSize,fullDataFormatter:D.fullDataFormatter,fullChartParams:D.fullChartParams,valueScale:D.valueScale,textReverseTransformWithRotate:D.textReverseTransformWithRotate,minAndMax:D.minAndMax}),fk({selection:D.axisSelection,textClassName:g,fullParams:D.fullParams,axisLabelAlign:D.axisLabelAlign,gridAxesSize:D.gridAxesSize,fullDataFormatter:D.fullDataFormatter,fullChartParams:D.fullChartParams,textReverseTransform:D.textReverseTransform})}),()=>{f.next(void 0)}},Ax="ValueAxis",pk=se(Ax,Gu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=ai(Ax,{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()}}),Mx="ValueStackAxis",dk=se(Mx,up)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=ai(Mx,{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()}}),Dx="ScalingArea",gk=at(Dx,"rect"),mk=se(Dx,lp)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new nt,a=e.insert("rect","g").classed(gk,!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(F(l=>l[0]?l[0].length-1:0),tt());return Y({initGroupAxis:r.fullDataFormatter$.pipe(F(l=>l.grid.groupAxis),m_()),fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:u,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(I(o),W(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=Jd({maxValue:l.groupMaxIndex,minValue:0,axisWidth:l.axisSize.width,scaleDomain:[h,p],scaleRange:[0,1]}).copy(),m=tx().on("zoom",function(b){const x=b.transform,v=R=>{const D=Math.round(R);return Math.min(f,Math.max(0,D))},$=l.fullDataFormatter.grid.groupAxis.position==="bottom"||l.fullDataFormatter.grid.groupAxis.position==="top"?x.rescaleX(g).domain().map(v):x.rescaleY(g).domain().map(v);$[0]<=0&&$[1]>=f?x.k<s.k&&(x.k=s.k,x.x=s.x,x.y=s.y):$[1]-$[0]<=1&&x.k>s.k&&(x.k=s.k,x.x=s.x,x.y=s.y),s.k=x.k,s.x=x.x,s.y=x.y;const w={...l.fullDataFormatter,grid:{...l.fullDataFormatter.grid,groupAxis:{...l.fullDataFormatter.grid.groupAxis,scaleDomain:$}}};i.dataFormatter$.next(w)});e.call(m)}),()=>{o.next(void 0),a.remove()}}),Cu="GroupAux",Rh=at(Cu,"label-box");function yk({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function bk({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 vk(t){t.selectAll("line").data([]).exit().remove()}function xk({groupLabel:t,axisX:e,fullParams:n}){return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:Lh(t,n.labelTextFormat)}]:[]}function _k({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){const s=a+6,u=t.selectAll(`g.${Rh}`).data(e),l=u.enter().append("g").classed(Rh,!0).style("cursor","pointer"),c=l.merge(u);return l.attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.transition().duration(50).attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.exit().remove(),c.each((f,h,p)=>{const d=nx(f.text,a)+12;let g=-d/2,m=-2;r.grid.groupAxis.position==="bottom"?(g=n.labelRotate?-d+s:-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=n.labelRotate?-d+s:-d/2,m=-s+2);const y=Z(p[h]).selectAll("rect").data([f]),b=y.enter().append("rect").attr("height",`${s}px`).attr("fill",$=>Ct(n.labelColorType,i)).attr("x",g).attr("y",m-2).attr("rx",5).attr("ry",5).style("cursor","pointer");y.merge(b).attr("width",$=>`${d}px`).style("transform",o),y.exit().remove();const x=Z(p[h]).selectAll("text").data([f]),v=x.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");x.merge(v).text($=>$.text).style("transform",o).attr("fill",$=>Ct(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",g+6).attr("y",m),x.exit().remove()}),c}function wk(t){t.selectAll(`g.${Rh}`).data([]).exit().remove()}const $k=se(Cu,Nu)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new nt;let a=!1;const s=e.insert("rect","g").classed(at(Cu,"rect"),!0).attr("opacity",0),{seriesSelection$:u,axesSelection$:l,defsSelection$:c,graphicGSelection$:f}=ar({selection:t,pluginName:Cu,clipPathID:"test",seriesLabels$:i.seriesLabels$,gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(I(o)).subscribe(w=>{s.attr("width",w.rootWidth).attr("height",w.rootHeight)});const h=Y({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(I(o),W(async w=>w),F(w=>{const D=w.computedData[0]?w.computedData[0].length-1:0,_=w.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[0]-w.fullDataFormatter.grid.groupAxis.scalePadding,M=w.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?D+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding;return[_,M]}),St(1)),p=Y({groupScaleDomain:h,gridAxesSize:i.gridAxesSize$}).pipe(I(o),W(async w=>w),F(w=>So().domain(w.groupScaleDomain).range([0,w.gridAxesSize.width]))),d=i.fullChartParams$.pipe(I(o),F(w=>w.highlightTarget),tt()),g=Ch(e,"mousemove").pipe(I(o)),m=Y({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),W(async w=>w),F(w=>{const R=`rotateX(${w.gridAxesReverseTransform.rotateX}deg) rotateY(${w.gridAxesReverseTransform.rotateY}deg)`,D=`rotate(${w.gridAxesReverseTransform.rotate}deg)`,_=`scale(${1/w.gridContainerPosition[0].scale[0]}, ${1/w.gridContainerPosition[0].scale[1]})`;return`${R} ${D} ${_}`}),tt()),y=Y({textReverseTransform:m,fullParams:i.fullParams$}).pipe(I(o),W(async w=>w),F(w=>`${w.textReverseTransform} rotate(${w.fullParams.labelRotate}deg)`)),b=i.gridContainerPosition$.pipe(I(o),F(w=>w.reduce((D,_)=>_.columnIndex>D?_.columnIndex:D,0)+1),tt()),x=i.gridContainerPosition$.pipe(I(o),F(w=>w.reduce((D,_)=>_.rowIndex>D?_.rowIndex:D,0)+1),tt()),v=yR({rootSelection:e,fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$,gridContainerPosition$:i.gridContainerPosition$,layout$:i.layout$}).pipe(I(o));Y({axesSelection:l,columnAmount:b,rowAmount:x,layout:i.layout$,rootMousemove:g,gridGroupPosition:v,computedData:i.computedData$,groupScale:p,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:d,textReverseTransformWithRotate:y,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).subscribe(w=>{const{groupIndex:R,groupLabel:D}=w.gridGroupPosition,_=w.groupScale(R)??0,M=yk({groupLabel:D,axisX:_,axisHeight:w.gridAxesSize.height,fullParams:w.fullParams});bk({selection:w.axesSelection,pluginName:n,lineData:M,fullParams:w.fullParams,fullChartParams:w.fullChartParams});const S=xk({groupLabel:D,axisX:_,fullParams:w.fullParams});_k({selection:w.axesSelection,labelData:S,fullParams:w.fullParams,fullDataFormatter:w.fullDataFormatter,fullChartParams:w.fullChartParams,textReverseTransformWithRotate:w.textReverseTransformWithRotate,textSizePx:w.textSizePx}).on("mouseover",(C,A)=>{C.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:w.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:w.GroupDataMap.get(D)??[],groupIndex:R,groupLabel:D,event:C,data:w.computedData})}).on("mousemove",(C,A)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:w.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:w.GroupDataMap.get(D)??[],groupIndex:R,groupLabel:D,event:C,data:w.computedData})}).on("click",(C,A)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:w.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:w.GroupDataMap.get(D)??[],groupIndex:R,groupLabel:D,event:C,data:w.computedData})})});const $=Ch(s,"mouseout").pipe(I(o));return Y({rootRectMouseout:$,axesSelection:l}).pipe(I(o),W(async w=>w)).subscribe(w=>{setTimeout(()=>{a!=!0&&(vk(w.axesSelection),wk(w.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),Px={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"},kh={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]};kh.tickFormat.toString=()=>"text => text";const Eu={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]},Sk={...Eu},Tx={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},Lx={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},Cx={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},Ex={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Rx={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},kx={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Ih={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]},Ix={...Ih},Nx="MultiGridLegend",Ak=pe(Nx,Px)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.multiGridEachDetail$.pipe(I(i),F(l=>l.map((f,h)=>f.SeriesDataMap$.pipe(F(p=>Array.from(p.keys()))))),W(l=>Y(l)),F(l=>l.flat())),a=Y({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(I(i),W(async l=>l),F(l=>l.computedData.map((c,f)=>{const h=vl(l.fullParams.gridList[f]??{},{listRectWidth:l.fullParams.listRectWidth,listRectHeight:l.fullParams.listRectHeight,listRectRadius:l.fullParams.listRectRadius});return c.map(p=>h)}).flat())),s=Y({fullParams:n.fullParams$,seriesList:a}).pipe(I(i),W(async l=>l),F(l=>({...l.fullParams,seriesList:l.seriesList}))),u=Lu(Nx,{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(F(n=>n.gridIndexes),tt(),St(1));return Y({multiGridEachDetail:t.multiGridEachDetail$,gridIndexes:e}).pipe(F(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},Nh="MultiBars",Fx=at(Nh,"grid"),Mk=pe(Nh,Tx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Fx}`).data(s).join("g").attr("class",Fx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=Eh(Nh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Fh="MultiBarStack",Gx=at(Fh,"grid"),Dk=pe(Fh,Lx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Gx}`).data(s).join("g").attr("class",Gx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=px(Fh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,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())}}),Gh="MultiBarsTriangle",zx=at(Gh,"grid"),Pk=pe(Gh,Cx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${zx}`).data(s).join("g").attr("class",zx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=yx(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$,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())}}),zh="MultiLines",Ox=at(zh,"grid"),Tk=pe(zh,Ex)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new nt,a=[],s=i.multiGridContainerPosition$.pipe(I(o),F(l=>l.flat()));return Ce(i).pipe(I(o)).subscribe(l=>{a.forEach(c=>c()),t.selectAll(`g.${Ox}`).data(l).join("g").attr("class",Ox).each((c,f,h)=>{const p=Z(h[f]);a[f]=ix(zh,{selection:p,computedData$:c.computedData$,computedLayoutData$:c.computedLayoutData$,visibleComputedData$:c.visibleComputedData$,visibleComputedLayoutData$:c.visibleComputedLayoutData$,seriesLabels$:c.seriesLabels$,SeriesDataMap$:c.SeriesDataMap$,GroupDataMap$:c.GroupDataMap$,fullDataFormatter$:c.dataFormatter$,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,gridAxesTransform$:c.gridAxesTransform$,gridGraphicTransform$:c.gridGraphicTransform$,gridAxesSize$:c.gridAxesSize$,gridHighlight$:c.gridHighlight$,gridContainerPosition$:c.gridContainerPosition$,allContainerPosition$:s,layout$:i.layout$,event$:r.event$})})}),()=>{o.next(void 0),a.forEach(l=>l())}}),Oh="MultiLineAreas",Ux=at(Oh,"grid"),Lk=pe(Oh,Rx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.multiGridContainerPosition$.pipe(I(i),F(u=>u.flat()));return Ce(r).pipe(I(i)).subscribe(u=>{o.forEach(l=>l()),t.selectAll(`g.${Ux}`).data(u).join("g").attr("class",Ux).each((l,c,f)=>{const h=Z(f[c]);o[c]=ax(Oh,{selection:h,computedData$:l.computedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedData$:l.visibleComputedData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullDataFormatter$:l.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,allContainerPosition$:a,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(u=>u())}}),Uh="MultiDots",Bx=at(Uh,"grid"),Ck=pe(Uh,kx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Bx}`).data(s).join("g").attr("class",Bx).each((u,l,c)=>{const f=Z(c[l]);o[l]=vx(Uh,{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())}}),Bh="MultiGroupAxis",Yx=at(Bh,"grid"),Ek=pe(Bh,kh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Yx}`).data(s).join("g").attr("class",Yx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=$x(Bh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Yh="MultiValueAxis",Wx=at(Yh,"grid"),Rk=pe(Yh,Eu)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Wx}`).data(s).join("g").attr("class",Wx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=ai(Yh,{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="MultiValueStackAxis",Hx=at(Wh,"grid"),kk=pe(Wh,Eu)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Hx}`).data(s).join("g").attr("class",Hx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=ai(Wh,{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 Ik(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function Vx(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:Ik(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 jx=({fullDataFormatter$:t,layout$:e})=>{const n=new nt;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 dt(i=>(Y({fullDataFormatter:t,layout:e}).pipe(I(n),W(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)}))},qx=({gridAxesTransform$:t})=>t.pipe(F(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) rotateX(${o}deg) rotateY(${a}deg) rotate(${i}deg)`}})),Xx=({computedData$:t,fullDataFormatter$:e,layout$:n})=>Y({computedData:t,fullDataFormatter:e,layout:n}).pipe(W(async i=>i),F(i=>{if(i.fullDataFormatter.grid.separateSeries)return Vx(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=Vx(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Hh="OverlappingValueAxes",Zx=at(Hh,"grid"),Nk=pe(Hh,Ih)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[1])),u=Y({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),W(async c=>c),F(c=>{console.log("data",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 Yo(r).pipe(I(i),F(c=>({...c,fullParams$:c.fullParams$.pipe(F(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),W(c=>Ce(c)),F(c=>c.map((f,h)=>{if(h===0)return f;const p=jx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=Xx({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,dataFormatter$:u,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${Zx}`).data(c).join("g").attr("class",Zx).each((f,h,p)=>{if(h>1)return;const d=Z(p[h]);o[h]=ai(Hh,{selection:d,computedData$:f.computedData$,fullParams$:r.fullParams$.pipe(F(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())}}),Vh="OverlappingValueStackAxes",Kx=at(Vh,"grid"),Fk=pe(Vh,Ix)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[1])),u=Y({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),W(async c=>c),F(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 Yo(r).pipe(I(i),F(c=>({...c,fullParams$:c.fullParams$.pipe(F(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),W(c=>Ce(c)),F(c=>c.map((f,h)=>{if(h===0)return f;const p=jx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=Xx({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,dataFormatter$:u,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${Kx}`).data(c).join("g").attr("class",Kx).each((f,h,p)=>{if(h>1)return;const d=Z(p[h]);o[h]=ai(Vh,{selection:d,computedData$:h===0?f.computedStackedData$:f.computedData$,fullParams$:r.fullParams$.pipe(F(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())}}),Qx={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},jh={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};jh.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.63",
3
+ "version": "3.0.0-alpha.64",
4
4
  "description": "plugins for OrbCharts",
5
5
  "author": "Blue Planet Inc.",
6
6
  "license": "Apache-2.0",
@@ -637,6 +637,7 @@ export const createBaseLegend: BasePluginFn<BaseLegendContext> = (pluginName: st
637
637
  itemSelection$.subscribe()
638
638
 
639
639
  return () => {
640
+ rootSelection.select(`g.${rootPositionClassName}`).remove()
640
641
  destroy$.next(undefined)
641
642
  }
642
643
  }
@@ -47,6 +47,7 @@ export const OverlappingValueAxes = defineMultiGridPlugin(pluginName, DEFAULT_OV
47
47
  takeUntil(destroy$),
48
48
  switchMap(async (d) => d),
49
49
  map(data => {
50
+ console.log('data', data)
50
51
  if (!data.fullDataFormatter.gridList[data.secondGridIndex]) {
51
52
  data.fullDataFormatter.gridList[data.secondGridIndex] = Object.assign({}, data.fullDataFormatter.gridList[data.firstGridIndex])
52
53
  }
@@ -62,6 +63,7 @@ export const OverlappingValueAxes = defineMultiGridPlugin(pluginName, DEFAULT_OV
62
63
  } else if (position === 'right') {
63
64
  reversePosition = 'left'
64
65
  }
66
+ // console.log('reversePosition', reversePosition)
65
67
  return <DataFormatterGrid>{
66
68
  type: 'grid',
67
69
  visibleFilter: data.fullDataFormatter.visibleFilter as any,
@@ -116,6 +118,7 @@ export const OverlappingValueAxes = defineMultiGridPlugin(pluginName, DEFAULT_OV
116
118
  })
117
119
  return {
118
120
  ...observables,
121
+ dataFormatter$: secondGridDataFormatter$,
119
122
  gridAxesTransform$,
120
123
  gridAxesReverseTransform$,
121
124
  gridContainerPosition$,
@@ -117,6 +117,7 @@ export const OverlappingValueStackAxes = defineMultiGridPlugin(pluginName, DEFAU
117
117
  })
118
118
  return {
119
119
  ...observables,
120
+ dataFormatter$: secondGridDataFormatter$,
120
121
  gridAxesTransform$,
121
122
  gridAxesReverseTransform$,
122
123
  gridContainerPosition$,