@orbcharts/plugins-basic 3.0.0-alpha.65 → 3.0.0-alpha.66

Sign up to get free protection for your applications and to get access to all the features.
@@ -20325,7 +20325,7 @@ const Ix = ({ fullDataFormatter$: t, layout$: e }) => {
20325
20325
  I(i),
20326
20326
  U(async (c) => c),
20327
20327
  z((c) => {
20328
- console.log("data", c), c.fullDataFormatter.gridList[c.secondGridIndex] || (c.fullDataFormatter.gridList[c.secondGridIndex] = Object.assign({}, c.fullDataFormatter.gridList[c.firstGridIndex]));
20328
+ c.fullDataFormatter.gridList[c.secondGridIndex] || (c.fullDataFormatter.gridList[c.secondGridIndex] = Object.assign({}, c.fullDataFormatter.gridList[c.firstGridIndex]));
20329
20329
  const f = c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;
20330
20330
  let h = f;
20331
20331
  return f === "left" ? h = "right" : f === "bottom" ? h = "top" : f === "top" ? h = "bottom" : f === "right" && (h = "left"), {
@@ -13,7 +13,7 @@
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
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)=>{j(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)?j(a[o]).style("opacity",1):j(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const mx=(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=Sn(t,"clipPath-box"),S=it(t,"pathG"),$=it(t,"path"),{seriesSelection$:R,axesSelection$:P,defsSelection$:_,graphicGSelection$:w}=sr({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 A=o.pipe(F(T=>T.map(G=>G[0]?G[0].axisY-G[0].axisYFromZero:0)),tt()),N=B({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?gx({axisWidth:T.gridAxesSize.width,groupAmount:T.computedData[0]?T.computedData[0].length:0,barAmountOfGroup:1,barPadding:T.params.barPadding,barGroupPadding:T.params.barGroupPadding}):gx({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 G=new Set;return T.forEach(q=>{q.forEach(Q=>{G.add(Q.groupLabel)})}),Array.from(G)})),M=new dt(T=>{B({seriesLabels:s,barWidth:N,params:c}).pipe(I(x),W(async G=>G)).subscribe(G=>{const q=XR(G.barWidth,G.seriesLabels,G.params);T.next(q)})}),L=f.pipe(I(x),F(T=>T.transitionDuration),tt()),D=new dt(T=>{B({groupLabels:C,transitionDuration:L}).pipe(W(async G=>G)).subscribe(G=>{const q=qR(G.groupLabels.length,G.transitionDuration);T.next(q)})}).pipe(I(x),tt()),O=new dt(T=>{B({groupLabels:C,transitionDuration:L}).pipe(W(async G=>G)).subscribe(G=>{const q=jR(G.groupLabels.length,G.transitionDuration);T.next(q)})}).pipe(I(x),tt());B({defsSelection:_,gridAxesSize:d}).pipe(I(x),W(async T=>T)).subscribe(T=>{const G=[{id:v,width:T.gridAxesSize.width,height:T.gridAxesSize.height}];KR({defsSelection:T.defsSelection,clipPathData:G})});const z=f.pipe(I(x),F(T=>T.highlightTarget),tt()),k=s.pipe(I(x),F(T=>T.map((G,q)=>Sn(t,`lineargradient-${G}`)))),E=B({graphicGSelection:w,defsSelection:_,computedData:n,visibleComputedLayoutData:o,linearGradientIds:k,zeroYArr:A,groupLabels:C,barScale:M,params:c,chartParams:f,barWidth:N,delayGroup:D,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}),VR({graphicGSelection:T.graphicGSelection,pathGClassName:S,pathClassName:$,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 B({barSelection:E,computedData:n,highlightTarget:z,SeriesDataMap:u,GroupDataMap:l}).subscribe(T=>{T.barSelection.on("mouseover",(G,q)=>{G.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:T.highlightTarget,datum:q,gridIndex:q.gridIndex,series:T.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:T.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:G,data:T.computedData})}).on("mousemove",(G,q)=>{G.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:T.highlightTarget,datum:q,gridIndex:q.gridIndex,series:T.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:T.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:G,data:T.computedData})}).on("mouseout",(G,q)=>{G.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:T.highlightTarget,datum:q,gridIndex:q.gridIndex,series:T.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:T.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:G,data:T.computedData})}).on("click",(G,q)=>{G.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:T.highlightTarget,datum:q,gridIndex:q.gridIndex,series:T.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:T.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:G,data:T.computedData})})}),B({barSelection:E,highlight:g.pipe(F(T=>T.map(G=>G.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)}},yx="BarsTriangle",JR=se(yx,sp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=mx(yx,{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)=>{j(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)=>{j(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)=>$n({datum:m,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(m,y)=>$n({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)?j(a[o]).style("opacity",1).transition("highlight").duration(200):j(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)=>{j(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 bx=(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=Sn(t,"clipPath-box"),v=it(t,"circleG"),S=it(t,"circle"),{seriesSelection$:$,axesSelection$:R,defsSelection$:P,graphicGSelection$:_}=sr({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),w=B({computedData:n,gridGraphicReverseScale:p}).pipe(I(b),W(async M=>M),F(M=>M.computedData.map((L,D)=>M.gridGraphicReverseScale[D])));B({defsSelection:P,gridAxesSize:d}).pipe(I(b),W(async M=>M)).subscribe(M=>{const L=[{id:x,width:M.gridAxesSize.width,height:M.gridAxesSize.height}];nk({defsSelection:M.defsSelection,clipPathData:L})});const A=c.pipe(I(b),F(M=>M.highlightTarget),tt()),N=B({graphicGSelection:_,visibleComputedLayoutData:o,graphicReverseScale:w,fullChartParams:c,fullParams:l}).pipe(I(b),W(async M=>M),F(M=>tk({graphicGSelection:M.graphicGSelection,circleGClassName:v,circleClassName:S,visibleComputedLayoutData:M.visibleComputedLayoutData,fullParams:M.fullParams,fullChartParams:M.fullChartParams,graphicReverseScale:M.graphicReverseScale})));B({graphicSelection:N,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:A}).pipe(I(b),W(async M=>M)).subscribe(M=>{M.graphicSelection.on("mouseover",(L,D)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:M.highlightTarget,datum:D,gridIndex:D.gridIndex,series:M.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:M.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:L,data:M.computedData})}).on("mousemove",(L,D)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:M.highlightTarget,data:M.computedData,datum:D,gridIndex:D.gridIndex,series:M.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:M.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:L})}).on("mouseout",(L,D)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:M.highlightTarget,datum:D,gridIndex:D.gridIndex,series:M.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:M.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:L,data:M.computedData})}).on("click",(L,D)=>{L.stopPropagation(),y.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:M.highlightTarget,datum:D,gridIndex:D.gridIndex,series:M.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:M.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:L,data:M.computedData})})});const C=l.pipe(I(b),F(M=>M.onlyShowHighlighted),tt());return B({graphicSelection:N,highlight:g.pipe(F(M=>M.map(L=>L.id))),onlyShowHighlighted:C,fullChartParams:c}).pipe(I(b),W(async M=>M)).subscribe(M=>{ek({selection:M.graphicSelection,ids:M.highlight,onlyShowHighlighted:M.onlyShowHighlighted,fullChartParams:M.fullChartParams})}),()=>{b.next(void 0)}},vx="Dots",rk=se(vx,op)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=bx(vx,{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 xx(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 Eu=(t,{rootSelection:e,seriesLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=it(t,"root-position"),u=it(t,"legend-card"),l=it(t,"legend-list"),c=it(t,"legend-item"),f=new nt,h=B({seriesLabels:n,fullChartParams:o}).pipe(I(f),W(async _=>_),F(_=>{const w=new Map;let A=0;return _.seriesLabels.forEach((N,C)=>{if(!w.has(N)){const M=xx(A,_.fullChartParams);w.set(N,M),A++}}),w})),p=n.pipe(I(f),F(_=>{const w=new Set;let A=[];return _.forEach(N=>{w.has(N)?A.push(!1):A.push(!0),w.add(N)}),A})),d=r.pipe(I(f),F(_=>_.position==="bottom"||_.position==="top"?"row":"column")),g=B({fullParams:r,layout:i}).pipe(I(f),W(async _=>_),F(_=>{const w=_.fullParams.padding*2+_.fullParams.gap*2;return _.fullParams.position==="bottom"||_.fullParams.position==="top"?_.layout.rootWidth-w:_.layout.rootHeight-w})),y=B({layout:i,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>{let w=0,A=0;return _.fullParams.position==="bottom"?(A=_.layout.rootHeight,_.fullParams.justify==="start"?w=0:_.fullParams.justify==="center"?w=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(w=_.layout.rootWidth)):_.fullParams.position==="right"?(w=_.layout.rootWidth,_.fullParams.justify==="start"?A=0:_.fullParams.justify==="center"?A=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(A=_.layout.rootHeight)):_.fullParams.position==="top"?(A=0,_.fullParams.justify==="start"?w=0:_.fullParams.justify==="center"?w=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(w=_.layout.rootWidth)):_.fullParams.position==="left"&&(w=0,_.fullParams.justify==="start"?A=0:_.fullParams.justify==="center"?A=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(A=_.layout.rootHeight)),{x:w,y:A}})).pipe(I(f),F(_=>e.selectAll(`g.${s}`).data([_]).join(w=>w.append("g").classed(s,!0).attr("transform",A=>`translate(${A.x}, ${A.y})`),w=>w.transition().attr("transform",A=>`translate(${A.x}, ${A.y})`),w=>w.remove()))),b=r.pipe(I(f),F(_=>_.seriesList[0]?_.seriesList[0]:ik)),x=B({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((w,A,N)=>{if(!_.visibleList[N])return w;const C=ex(A,_.textSizePx),M=_.textSizePx*1.5+C,L=_.SeriesLabelColorMap.get(A),D=w[0]&&w[0][0]?w[w.length-1][w[w.length-1].length-1]:null,{translateX:O,translateY:z,lineIndex:k,itemIndex:E}=((G,q,Q)=>{let Y=0,Z=0,U=0,V=0;if(G.lineDirection==="column"){let X=Q?Q.translateY+G.textSizePx+G.fullParams.gap:0;if(X+G.textSizePx>G.lineMaxSize){U=Q.lineIndex+1,V=0,Z=0;const rt=q[q.length-1].reduce((ut,H)=>H.itemWidth>ut?H.itemWidth:ut,0);Y=Q.translateX+rt+G.fullParams.gap}else U=Q?Q.lineIndex:0,V=Q?Q.itemIndex+1:0,Z=X,Y=Q?Q.translateX:0}else{let X=Q?Q.translateX+Q.itemWidth+G.fullParams.gap:0;X+M>G.lineMaxSize?(U=Q.lineIndex+1,V=0,Y=0):(U=Q?Q.lineIndex:0,V=Q?Q.itemIndex+1:0,Y=X),Z=(G.textSizePx+G.fullParams.gap)*U}return{translateX:Y,translateY:Z,lineIndex:U,itemIndex:V}})(_,w,D);w[k]||(w[k]=[]);const T=_.fullParams.seriesList[E]?_.fullParams.seriesList[E]:_.defaultListStyle;return w[k].push({id:A,seriesLabel:A,seriesIndex:N,lineIndex:k,itemIndex:E,text:A,itemWidth:M,translateX:O,translateY:z,color:L,listRectWidth:T.listRectWidth,listRectHeight:T.listRectHeight,listRectRadius:T.listRectRadius}),w},[])),St(1)),v=B({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const{width:w,height:A}=((N,C)=>{let M=0,L=0;if(!C.length||!C[0].length)return{width:M,height:L};const D=C[0][C[0].length-1];return N.lineDirection==="column"?(M=C.reduce((O,z)=>{const k=z.reduce((E,T)=>T.itemWidth>E?T.itemWidth:E,0);return O+k},0),M+=N.fullParams.gap*(C.length-1),L=D.translateY+N.textSizePx):(M=D.translateX+D.itemWidth,L=N.textSizePx*C.length+N.fullParams.gap*(C.length-1)),{width:M,height:L}})(_,_.lengendItems);return{direction:_.lineDirection,width:w,height:A,translateX:_.fullParams.gap,translateY:_.fullParams.gap}}),St(1)),S=B({fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>{const w=_.lengendList.width+_.fullParams.gap*2,A=_.lengendList.height+_.fullParams.gap*2;let N=0,C=0;return _.fullParams.position==="left"?_.fullParams.justify==="start"?(N=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(N=_.fullParams.padding,C=-A/2):_.fullParams.justify==="end"&&(N=_.fullParams.padding,C=-A-_.fullParams.padding):_.fullParams.position==="right"?_.fullParams.justify==="start"?(N=-w-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(N=-w-_.fullParams.padding,C=-A/2):_.fullParams.justify==="end"&&(N=-w-_.fullParams.padding,C=-A-_.fullParams.padding):_.fullParams.position==="top"?_.fullParams.justify==="start"?(N=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(N=-w/2,C=_.fullParams.padding):_.fullParams.justify==="end"&&(N=-w-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="start"?(N=_.fullParams.padding,C=-A-_.fullParams.padding):_.fullParams.justify==="center"?(N=-w/2,C=-A-_.fullParams.padding):_.fullParams.justify==="end"&&(N=-w-_.fullParams.padding,C=-A-_.fullParams.padding),{width:w,height:A,translateX:N,translateY:C}})),$=B({rootPositionSelection:y,fullParams:r,fullChartParams:o,legendCard:S}).pipe(I(f),W(async _=>_),F(_=>_.rootPositionSelection.selectAll("g").data([_.legendCard]).join(w=>w.append("g").classed(u,!0).attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),w=>w.transition().attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),w=>w.remove()).each((w,A,N)=>{j(N[A]).selectAll("rect").data([w]).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=B({lengendCardSelection:$,fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>_.lengendCardSelection.selectAll("g").data([_.lengendList]).join(w=>w.append("g").classed(l,!0).attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),w=>w.transition().attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),w=>w.remove())));return B({lengendListSelection:R,fullParams:r,fullChartParams:o,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const w=_.lengendItems[0]?_.lengendItems.flat():[];return _.lengendListSelection.selectAll(`g.${c}`).data(w).join(A=>A.append("g").classed(c,!0).attr("cursor","default"),A=>A,A=>A.remove()).attr("transform",(A,N)=>`translate(${A.translateX}, ${A.translateY})`).each((A,N,C)=>{const M=_.textSizePx/2,L=-A.listRectWidth/2,D=-A.listRectHeight/2;j(C[N]).selectAll("rect").data([A]).join("rect").attr("x",M).attr("y",M).attr("width",O=>O.listRectWidth).attr("height",O=>O.listRectHeight).attr("transform",O=>`translate(${L}, ${D})`).attr("fill",O=>O.color).attr("rx",O=>O.listRectRadius),j(C[N]).selectAll("text").data([A]).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"?xx(O.seriesIndex,_.fullChartParams):Ct(_.fullParams.textColorType,_.fullChartParams)).text(O=>O.text)})})).subscribe(),()=>{e.select(`g.${s}`).remove(),f.next(void 0)}},_x="GridLegend",ok=se(_x,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=Eu(_x,{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)=>{j(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,textSizePx:f}){const h=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),p=Math.floor(u[1])-Math.ceil(u[0])+1;let d=0,g=0;o.grid.groupAxis.position==="left"?(d=0,g=-n.tickPadding):o.grid.groupAxis.position==="right"?(d=0,g=n.tickPadding):o.grid.groupAxis.position==="bottom"?(d=n.tickPadding,g=0):o.grid.groupAxis.position==="top"&&(d=-n.tickPadding,g=-0);const m=Lg(s).scale(s).ticks(n.ticks==="all"||n.ticks>p?p:n.ticks).tickSize(n.tickFullLine==!0?i.height:-ak).tickSizeOuter(0).tickFormat(x=>{const v=l[x]??"";return Lh(v,n.tickFormat)}).tickPadding(d),y=h.transition().duration(100).call(m).on("end",(x,v)=>{y.selectAll(".tick text").each((S,$,R)=>{const _=(l[$]??"").split(`
16
- `),w=j(R[$]).text(null),A=Number(w.attr("x"));let N=Number(w.attr("y"));o.grid.groupAxis.position==="top"&&(N-=(_.length-1)*f),w.selectAll("tspan").data(_).join("tspan").attr("x",A).attr("y",(C,M)=>N+M*f).text(C=>C)})});return y.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?Ct(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),y.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?Ct(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),h.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",g).style("transform",c).attr("dy",0),h}const wx=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c,textSizePx$:f})=>{const h=new nt,p=it(t,"container"),d=it(t,"xAxisG"),g=it(t,"xAxis"),m=it(t,"groupingLabel"),y=B({computedData:n.pipe(tt((w,A)=>w.length===A.length)),isSeriesSeprate:c}).pipe(I(h),W(async w=>w),F(w=>w.isSeriesSeprate?w.computedData:[w.computedData[0]]),F((w,A)=>e.selectAll(`g.${p}`).data(w,N=>N[0]?N[0].seriesIndex:A).join("g").classed(p,!0))),b=y.pipe(I(h),F((w,A)=>w.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));B({containerSelection:y,gridContainerPosition:l}).pipe(I(h),W(async w=>w)).subscribe(w=>{w.containerSelection.attr("transform",(A,N)=>{const C=w.gridContainerPosition[N]??w.gridContainerPosition[0],M=C.translate,L=C.scale;return`translate(${M[0]}, ${M[1]}) scale(${L[0]}, ${L[1]})`})}),B({axisSelection:b,gridAxesTransform:a}).pipe(I(h),W(async w=>w)).subscribe(w=>{w.axisSelection.style("transform",w.gridAxesTransform.value)});const x=B({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(h),W(async w=>w),F(w=>{const A=`rotateX(${w.gridAxesReverseTransform.rotateX}deg) rotateY(${w.gridAxesReverseTransform.rotateY}deg)`,N=`rotate(${w.gridAxesReverseTransform.rotate}deg)`,C=`scale(${1/w.gridContainerPosition[0].scale[0]}, ${1/w.gridContainerPosition[0].scale[1]})`;return`${A} ${N} ${C}`}),tt()),v=B({textReverseTransform:x,fullParams:r}).pipe(I(h),W(async w=>w),F(w=>`${w.textReverseTransform} rotate(${w.fullParams.tickTextRotate}deg)`)),S=B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(h),W(async w=>w),F(w=>{const N=w.computedData[0]?w.computedData[0].length-1:0,C=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"?N+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding;return[C,M]}),St(1)),$=B({groupScaleDomain:S,gridAxesSize:u}).pipe(I(h),W(async w=>w),F(w=>Po().domain(w.groupScaleDomain).range([0,w.gridAxesSize.width]))),R=n.pipe(F(w=>(w[0]??[]).map(A=>A.groupLabel))),P=B({fullDataFormatter:i,fullParams:r}).pipe(I(h),W(async w=>w),F(w=>{let A="middle",N="hanging";return w.fullDataFormatter.grid.groupAxis.position==="bottom"?(A=w.fullParams.tickTextRotate?"end":"middle",N="hanging"):w.fullDataFormatter.grid.groupAxis.position==="top"?(A=w.fullParams.tickTextRotate?"start":"middle",N="auto"):w.fullDataFormatter.grid.groupAxis.position==="left"?(A="end",N="middle"):w.fullDataFormatter.grid.groupAxis.position==="right"&&(A="start",N="middle"),{textAnchor:A,dominantBaseline:N}})),_=i.pipe(I(h),F(w=>{let A="start",N="hanging";return w.grid.groupAxis.position==="bottom"?N="hanging":w.grid.groupAxis.position==="top"?N="auto":w.grid.groupAxis.position==="left"?A="end":w.grid.groupAxis.position==="right"&&(A="start"),w.grid.valueAxis.position==="left"?A="start":w.grid.valueAxis.position==="right"?A="end":w.grid.valueAxis.position==="bottom"?N="auto":w.grid.valueAxis.position==="top"&&(N="hanging"),{textAnchor:A,dominantBaseline:N}}));return B({axisSelection:b,fullParams:r,tickTextAlign:P,axisLabelAlign:_,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:$,groupScaleDomain:S,groupLabels:R,textReverseTransform:x,textReverseTransformWithRotate:v,textSizePx:f}).pipe(I(h),W(async w=>w)).subscribe(w=>{uk({selection:w.axisSelection,xAxisClassName:g,fullParams:w.fullParams,tickTextAlign:w.tickTextAlign,gridAxesSize:w.gridAxesSize,fullDataFormatter:w.fullDataFormatter,chartParams:w.chartParams,groupScale:w.groupScale,groupScaleDomain:w.groupScaleDomain,groupLabels:w.groupLabels,textReverseTransformWithRotate:w.textReverseTransformWithRotate,textSizePx:w.textSizePx}),sk({selection:w.axisSelection,groupingLabelClassName:m,fullParams:w.fullParams,axisLabelAlign:w.axisLabelAlign,gridAxesSize:w.gridAxesSize,fullDataFormatter:w.fullDataFormatter,chartParams:w.chartParams,textReverseTransform:w.textReverseTransform})}),()=>{h.next(void 0)}},$x="GroupAxis",lk=se($x,Fu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=wx($x,{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$,textSizePx$:n.textSizePx$});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)=>{j(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=Cg(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 si=(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=it(t,"container"),p=it(t,"yAxisG"),d=it(t,"yAxis"),g=it(t,"text"),m=B({computedData:n.pipe(tt((P,_)=>P.length===_.length)),isSeriesSeprate:c}).pipe(I(f),W(async P=>P),F(P=>P.isSeriesSeprate?P.computedData:[P.computedData[0]]),F((P,_)=>e.selectAll(`g.${h}`).data(P,w=>w[0]?w[0].seriesIndex:_).join("g").classed(h,!0))),y=m.pipe(I(f),F((P,_)=>P.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));B({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async P=>P)).subscribe(P=>{P.containerSelection.attr("transform",(_,w)=>{const A=P.gridContainerPosition[w]??P.gridContainerPosition[0],N=A.translate,C=A.scale;return`translate(${N[0]}, ${N[1]}) scale(${C[0]}, ${C[1]})`})}),B({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async P=>P)).subscribe(P=>{P.axisSelection.style("transform",P.gridAxesTransform.value)});const b=B({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async P=>P),F(P=>{const _=`rotateX(${P.gridAxesReverseTransform.rotateX}deg) rotateY(${P.gridAxesReverseTransform.rotateY}deg)`,w=`rotate(${P.gridAxesReverseTransform.rotate}deg)`,A=`scale(${1/P.gridContainerPosition[0].scale[0]}, ${1/P.gridContainerPosition[0].scale[1]})`;return`${_} ${w} ${A}`}),tt()),x=B({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async P=>P),F(P=>`${P.textReverseTransform} rotate(${P.fullParams.tickTextRotate}deg)`)),v=new dt(P=>{B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async _=>_)).subscribe(_=>{const A=_.computedData[0]?_.computedData[0].length-1:0,N=_.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"?A+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding,M=_.computedData.map((D,O)=>D.filter((z,k)=>k>=N&&k<=C)),L=mR(M.flat());L[0]===L[1]&&(L[0]=L[1]-1),P.next(L)})}),S=new dt(P=>{B({fullDataFormatter:i,gridAxesSize:u,minAndMax:v}).pipe(I(f),W(async _=>_)).subscribe(_=>{const w=Jd({maxValue:_.minAndMax[1],minValue:_.minAndMax[0],axisWidth:_.gridAxesSize.height,scaleDomain:_.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:_.fullDataFormatter.grid.valueAxis.scaleRange});P.next(w)})}),$=B({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async P=>P),F(P=>{let _="start",w="hanging";return P.fullDataFormatter.grid.valueAxis.position==="left"?(_="end",w="middle"):P.fullDataFormatter.grid.valueAxis.position==="right"?(_="start",w="middle"):P.fullDataFormatter.grid.valueAxis.position==="bottom"?(_=P.fullParams.tickTextRotate?"end":"middle",w="hanging"):P.fullDataFormatter.grid.valueAxis.position==="top"&&(_=P.fullParams.tickTextRotate?"start":"middle",w="auto"),{textAnchor:_,dominantBaseline:w}})),R=i.pipe(I(f),F(P=>{let _="start",w="hanging";return P.grid.groupAxis.position==="bottom"?w="auto":P.grid.groupAxis.position==="top"?w="hanging":P.grid.groupAxis.position==="left"?_="start":P.grid.groupAxis.position==="right"&&(_="end"),P.grid.valueAxis.position==="left"?_="end":P.grid.valueAxis.position==="right"?_="start":P.grid.valueAxis.position==="bottom"?w="hanging":P.grid.valueAxis.position==="top"&&(w="auto"),{textAnchor:_,dominantBaseline:w}}));return B({axisSelection:y,fullParams:r,tickTextAlign:$,axisLabelAlign:R,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:S,textReverseTransform:b,textReverseTransformWithRotate:x,minAndMax:v}).pipe(I(f),W(async P=>P)).subscribe(P=>{hk({selection:P.axisSelection,yAxisClassName:d,fullParams:P.fullParams,tickTextAlign:P.tickTextAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,valueScale:P.valueScale,textReverseTransformWithRotate:P.textReverseTransformWithRotate,minAndMax:P.minAndMax}),fk({selection:P.axisSelection,textClassName:g,fullParams:P.fullParams,axisLabelAlign:P.axisLabelAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,textReverseTransform:P.textReverseTransform})}),()=>{f.next(void 0)}},Sx="ValueAxis",pk=se(Sx,Gu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=si(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()}}),Ax="ValueStackAxis",dk=se(Ax,up)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=si(Ax,{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()}}),Mx="ScalingArea",gk=it(Mx,"rect"),mk=se(Mx,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 B({initGroupAxis:r.fullDataFormatter$.pipe(F(l=>l.grid.groupAxis),g_()),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=Jv().on("zoom",function(b){const x=b.transform,v=R=>{const P=Math.round(R);return Math.min(f,Math.max(0,P))},S=l.fullDataFormatter.grid.groupAxis.position==="bottom"||l.fullDataFormatter.grid.groupAxis.position==="top"?x.rescaleX(g).domain().map(v):x.rescaleY(g).domain().map(v);S[0]<=0&&S[1]>=f?x.k<s.k&&(x.k=s.k,x.x=s.x,x.y=s.y):S[1]-S[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 $={...l.fullDataFormatter,grid:{...l.fullDataFormatter.grid,groupAxis:{...l.fullDataFormatter.grid.groupAxis,scaleDomain:S}}};i.dataFormatter$.next($)});e.call(m)}),()=>{o.next(void 0),a.remove()}}),Ru="GroupAux",Rh=it(Ru,"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=it(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=ex(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=j(p[h]).selectAll("rect").data([f]),b=y.enter().append("rect").attr("height",`${s}px`).attr("fill",S=>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",S=>`${d}px`).style("transform",o),y.exit().remove();const x=j(p[h]).selectAll("text").data([f]),v=x.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");x.merge(v).text(S=>S.text).style("transform",o).attr("fill",S=>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(Ru,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(it(Ru,"rect"),!0).attr("opacity",0),{seriesSelection$:u,axesSelection$:l,defsSelection$:c,graphicGSelection$:f}=sr({selection:t,pluginName:Ru,clipPathID:"test",seriesLabels$:i.seriesLabels$,gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(I(o)).subscribe($=>{s.attr("width",$.rootWidth).attr("height",$.rootHeight)});const h=B({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(I(o),W(async $=>$),F($=>{const P=$.computedData[0]?$.computedData[0].length-1:0,_=$.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-$.fullDataFormatter.grid.groupAxis.scalePadding:$.fullDataFormatter.grid.groupAxis.scaleDomain[0]-$.fullDataFormatter.grid.groupAxis.scalePadding,w=$.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?P+$.fullDataFormatter.grid.groupAxis.scalePadding:$.fullDataFormatter.grid.groupAxis.scaleDomain[1]+$.fullDataFormatter.grid.groupAxis.scalePadding;return[_,w]}),St(1)),p=B({groupScaleDomain:h,gridAxesSize:i.gridAxesSize$}).pipe(I(o),W(async $=>$),F($=>Po().domain($.groupScaleDomain).range([0,$.gridAxesSize.width]))),d=i.fullChartParams$.pipe(I(o),F($=>$.highlightTarget),tt()),g=Ch(e,"mousemove").pipe(I(o)),m=B({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),W(async $=>$),F($=>{const R=`rotateX(${$.gridAxesReverseTransform.rotateX}deg) rotateY(${$.gridAxesReverseTransform.rotateY}deg)`,P=`rotate(${$.gridAxesReverseTransform.rotate}deg)`,_=`scale(${1/$.gridContainerPosition[0].scale[0]}, ${1/$.gridContainerPosition[0].scale[1]})`;return`${R} ${P} ${_}`}),tt()),y=B({textReverseTransform:m,fullParams:i.fullParams$}).pipe(I(o),W(async $=>$),F($=>`${$.textReverseTransform} rotate(${$.fullParams.labelRotate}deg)`)),b=i.gridContainerPosition$.pipe(I(o),F($=>$.reduce((P,_)=>_.columnIndex>P?_.columnIndex:P,0)+1),tt()),x=i.gridContainerPosition$.pipe(I(o),F($=>$.reduce((P,_)=>_.rowIndex>P?_.rowIndex:P,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));B({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($=>{const{groupIndex:R,groupLabel:P}=$.gridGroupPosition,_=$.groupScale(R)??0,w=yk({groupLabel:P,axisX:_,axisHeight:$.gridAxesSize.height,fullParams:$.fullParams});bk({selection:$.axesSelection,pluginName:n,lineData:w,fullParams:$.fullParams,fullChartParams:$.fullChartParams});const A=xk({groupLabel:P,axisX:_,fullParams:$.fullParams});_k({selection:$.axesSelection,labelData:A,fullParams:$.fullParams,fullDataFormatter:$.fullDataFormatter,fullChartParams:$.fullChartParams,textReverseTransformWithRotate:$.textReverseTransformWithRotate,textSizePx:$.textSizePx}).on("mouseover",(C,M)=>{C.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(P)??[],groupIndex:R,groupLabel:P,event:C,data:$.computedData})}).on("mousemove",(C,M)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(P)??[],groupIndex:R,groupLabel:P,event:C,data:$.computedData})}).on("click",(C,M)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(P)??[],groupIndex:R,groupLabel:P,event:C,data:$.computedData})})});const S=Ch(s,"mouseout").pipe(I(o));return B({rootRectMouseout:S,axesSelection:l}).pipe(I(o),W(async $=>$)).subscribe($=>{setTimeout(()=>{a!=!0&&(vk($.axesSelection),wk($.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 ku={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={...ku},Dx={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},Tx={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},Lx={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},Cx={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Ex={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},Rx={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]},kx={...Ih},Ix="MultiGridLegend",Ak=pe(Ix,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=>B(l)),F(l=>l.flat())),a=B({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=B({fullParams:n.fullParams$,seriesList:a}).pipe(I(i),W(async l=>l),F(l=>({...l.fullParams,seriesList:l.seriesList}))),u=Eu(Ix,{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 B({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",Nx=it(Nh,"grid"),Mk=pe(Nh,Dx)(({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.${Nx}`).data(s).join("g").attr("class",Nx).each((u,l,c)=>{const f=j(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",Fx=it(Fh,"grid"),Pk=pe(Fh,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=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=hx(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",Gx=it(Gh,"grid"),Dk=pe(Gh,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=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=mx(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",zx=it(zh,"grid"),Tk=pe(zh,Cx)(({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.${zx}`).data(l).join("g").attr("class",zx).each((c,f,h)=>{const p=j(h[f]);a[f]=rx(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",Ox=it(Oh,"grid"),Lk=pe(Oh,Ex)(({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.${Ox}`).data(u).join("g").attr("class",Ox).each((l,c,f)=>{const h=j(f[c]);o[c]=ox(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())}}),Yh="MultiDots",Yx=it(Yh,"grid"),Ck=pe(Yh,Rx)(({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=j(c[l]);o[l]=bx(Yh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Uh="MultiGroupAxis",Ux=it(Uh,"grid"),Ek=pe(Uh,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.${Ux}`).data(s).join("g").attr("class",Ux).each((u,l,c)=>{const f=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=wx(Uh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,textSizePx$:r.textSizePx$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Bh="MultiValueAxis",Bx=it(Bh,"grid"),Rk=pe(Bh,ku)(({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=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=si(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())}}),Wh="MultiValueStackAxis",Wx=it(Wh,"grid"),kk=pe(Wh,ku)(({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=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=si(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 Hx(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 Xx=({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=>(B({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)`}})),jx=({computedData$:t,fullDataFormatter$:e,layout$:n})=>B({computedData:t,fullDataFormatter:e,layout:n}).pipe(W(async i=>i),F(i=>{if(i.fullDataFormatter.grid.separateSeries)return Hx(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=Hx(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Hh="OverlappingValueAxes",Vx=it(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=B({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 Xo(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=Xx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=jx({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.${Vx}`).data(c).join("g").attr("class",Vx).each((f,h,p)=>{if(h>1)return;const d=j(p[h]);o[h]=si(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())}}),Xh="OverlappingValueStackAxes",Zx=it(Xh,"grid"),Fk=pe(Xh,kx)(({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=B({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 Xo(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=Xx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=jx({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=j(p[h]);o[h]=si(Xh,{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())}}),Gk={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},qh={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};qh.textRenderFn.toString=()=>`(eventData) => {
16
+ `),w=j(R[$]).text(null),A=Number(w.attr("x"));let N=Number(w.attr("y"));o.grid.groupAxis.position==="top"&&(N-=(_.length-1)*f),w.selectAll("tspan").data(_).join("tspan").attr("x",A).attr("y",(C,M)=>N+M*f).text(C=>C)})});return y.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?Ct(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),y.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?Ct(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),h.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",g).style("transform",c).attr("dy",0),h}const wx=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c,textSizePx$:f})=>{const h=new nt,p=it(t,"container"),d=it(t,"xAxisG"),g=it(t,"xAxis"),m=it(t,"groupingLabel"),y=B({computedData:n.pipe(tt((w,A)=>w.length===A.length)),isSeriesSeprate:c}).pipe(I(h),W(async w=>w),F(w=>w.isSeriesSeprate?w.computedData:[w.computedData[0]]),F((w,A)=>e.selectAll(`g.${p}`).data(w,N=>N[0]?N[0].seriesIndex:A).join("g").classed(p,!0))),b=y.pipe(I(h),F((w,A)=>w.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));B({containerSelection:y,gridContainerPosition:l}).pipe(I(h),W(async w=>w)).subscribe(w=>{w.containerSelection.attr("transform",(A,N)=>{const C=w.gridContainerPosition[N]??w.gridContainerPosition[0],M=C.translate,L=C.scale;return`translate(${M[0]}, ${M[1]}) scale(${L[0]}, ${L[1]})`})}),B({axisSelection:b,gridAxesTransform:a}).pipe(I(h),W(async w=>w)).subscribe(w=>{w.axisSelection.style("transform",w.gridAxesTransform.value)});const x=B({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(h),W(async w=>w),F(w=>{const A=`rotateX(${w.gridAxesReverseTransform.rotateX}deg) rotateY(${w.gridAxesReverseTransform.rotateY}deg)`,N=`rotate(${w.gridAxesReverseTransform.rotate}deg)`,C=`scale(${1/w.gridContainerPosition[0].scale[0]}, ${1/w.gridContainerPosition[0].scale[1]})`;return`${A} ${N} ${C}`}),tt()),v=B({textReverseTransform:x,fullParams:r}).pipe(I(h),W(async w=>w),F(w=>`${w.textReverseTransform} rotate(${w.fullParams.tickTextRotate}deg)`)),S=B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(h),W(async w=>w),F(w=>{const N=w.computedData[0]?w.computedData[0].length-1:0,C=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"?N+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding;return[C,M]}),St(1)),$=B({groupScaleDomain:S,gridAxesSize:u}).pipe(I(h),W(async w=>w),F(w=>Po().domain(w.groupScaleDomain).range([0,w.gridAxesSize.width]))),R=n.pipe(F(w=>(w[0]??[]).map(A=>A.groupLabel))),P=B({fullDataFormatter:i,fullParams:r}).pipe(I(h),W(async w=>w),F(w=>{let A="middle",N="hanging";return w.fullDataFormatter.grid.groupAxis.position==="bottom"?(A=w.fullParams.tickTextRotate?"end":"middle",N="hanging"):w.fullDataFormatter.grid.groupAxis.position==="top"?(A=w.fullParams.tickTextRotate?"start":"middle",N="auto"):w.fullDataFormatter.grid.groupAxis.position==="left"?(A="end",N="middle"):w.fullDataFormatter.grid.groupAxis.position==="right"&&(A="start",N="middle"),{textAnchor:A,dominantBaseline:N}})),_=i.pipe(I(h),F(w=>{let A="start",N="hanging";return w.grid.groupAxis.position==="bottom"?N="hanging":w.grid.groupAxis.position==="top"?N="auto":w.grid.groupAxis.position==="left"?A="end":w.grid.groupAxis.position==="right"&&(A="start"),w.grid.valueAxis.position==="left"?A="start":w.grid.valueAxis.position==="right"?A="end":w.grid.valueAxis.position==="bottom"?N="auto":w.grid.valueAxis.position==="top"&&(N="hanging"),{textAnchor:A,dominantBaseline:N}}));return B({axisSelection:b,fullParams:r,tickTextAlign:P,axisLabelAlign:_,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:$,groupScaleDomain:S,groupLabels:R,textReverseTransform:x,textReverseTransformWithRotate:v,textSizePx:f}).pipe(I(h),W(async w=>w)).subscribe(w=>{uk({selection:w.axisSelection,xAxisClassName:g,fullParams:w.fullParams,tickTextAlign:w.tickTextAlign,gridAxesSize:w.gridAxesSize,fullDataFormatter:w.fullDataFormatter,chartParams:w.chartParams,groupScale:w.groupScale,groupScaleDomain:w.groupScaleDomain,groupLabels:w.groupLabels,textReverseTransformWithRotate:w.textReverseTransformWithRotate,textSizePx:w.textSizePx}),sk({selection:w.axisSelection,groupingLabelClassName:m,fullParams:w.fullParams,axisLabelAlign:w.axisLabelAlign,gridAxesSize:w.gridAxesSize,fullDataFormatter:w.fullDataFormatter,chartParams:w.chartParams,textReverseTransform:w.textReverseTransform})}),()=>{h.next(void 0)}},$x="GroupAxis",lk=se($x,Fu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=wx($x,{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$,textSizePx$:n.textSizePx$});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)=>{j(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=Cg(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 si=(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=it(t,"container"),p=it(t,"yAxisG"),d=it(t,"yAxis"),g=it(t,"text"),m=B({computedData:n.pipe(tt((P,_)=>P.length===_.length)),isSeriesSeprate:c}).pipe(I(f),W(async P=>P),F(P=>P.isSeriesSeprate?P.computedData:[P.computedData[0]]),F((P,_)=>e.selectAll(`g.${h}`).data(P,w=>w[0]?w[0].seriesIndex:_).join("g").classed(h,!0))),y=m.pipe(I(f),F((P,_)=>P.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));B({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async P=>P)).subscribe(P=>{P.containerSelection.attr("transform",(_,w)=>{const A=P.gridContainerPosition[w]??P.gridContainerPosition[0],N=A.translate,C=A.scale;return`translate(${N[0]}, ${N[1]}) scale(${C[0]}, ${C[1]})`})}),B({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async P=>P)).subscribe(P=>{P.axisSelection.style("transform",P.gridAxesTransform.value)});const b=B({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async P=>P),F(P=>{const _=`rotateX(${P.gridAxesReverseTransform.rotateX}deg) rotateY(${P.gridAxesReverseTransform.rotateY}deg)`,w=`rotate(${P.gridAxesReverseTransform.rotate}deg)`,A=`scale(${1/P.gridContainerPosition[0].scale[0]}, ${1/P.gridContainerPosition[0].scale[1]})`;return`${_} ${w} ${A}`}),tt()),x=B({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async P=>P),F(P=>`${P.textReverseTransform} rotate(${P.fullParams.tickTextRotate}deg)`)),v=new dt(P=>{B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async _=>_)).subscribe(_=>{const A=_.computedData[0]?_.computedData[0].length-1:0,N=_.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"?A+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding,M=_.computedData.map((D,O)=>D.filter((z,k)=>k>=N&&k<=C)),L=mR(M.flat());L[0]===L[1]&&(L[0]=L[1]-1),P.next(L)})}),S=new dt(P=>{B({fullDataFormatter:i,gridAxesSize:u,minAndMax:v}).pipe(I(f),W(async _=>_)).subscribe(_=>{const w=Jd({maxValue:_.minAndMax[1],minValue:_.minAndMax[0],axisWidth:_.gridAxesSize.height,scaleDomain:_.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:_.fullDataFormatter.grid.valueAxis.scaleRange});P.next(w)})}),$=B({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async P=>P),F(P=>{let _="start",w="hanging";return P.fullDataFormatter.grid.valueAxis.position==="left"?(_="end",w="middle"):P.fullDataFormatter.grid.valueAxis.position==="right"?(_="start",w="middle"):P.fullDataFormatter.grid.valueAxis.position==="bottom"?(_=P.fullParams.tickTextRotate?"end":"middle",w="hanging"):P.fullDataFormatter.grid.valueAxis.position==="top"&&(_=P.fullParams.tickTextRotate?"start":"middle",w="auto"),{textAnchor:_,dominantBaseline:w}})),R=i.pipe(I(f),F(P=>{let _="start",w="hanging";return P.grid.groupAxis.position==="bottom"?w="auto":P.grid.groupAxis.position==="top"?w="hanging":P.grid.groupAxis.position==="left"?_="start":P.grid.groupAxis.position==="right"&&(_="end"),P.grid.valueAxis.position==="left"?_="end":P.grid.valueAxis.position==="right"?_="start":P.grid.valueAxis.position==="bottom"?w="hanging":P.grid.valueAxis.position==="top"&&(w="auto"),{textAnchor:_,dominantBaseline:w}}));return B({axisSelection:y,fullParams:r,tickTextAlign:$,axisLabelAlign:R,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:S,textReverseTransform:b,textReverseTransformWithRotate:x,minAndMax:v}).pipe(I(f),W(async P=>P)).subscribe(P=>{hk({selection:P.axisSelection,yAxisClassName:d,fullParams:P.fullParams,tickTextAlign:P.tickTextAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,valueScale:P.valueScale,textReverseTransformWithRotate:P.textReverseTransformWithRotate,minAndMax:P.minAndMax}),fk({selection:P.axisSelection,textClassName:g,fullParams:P.fullParams,axisLabelAlign:P.axisLabelAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,textReverseTransform:P.textReverseTransform})}),()=>{f.next(void 0)}},Sx="ValueAxis",pk=se(Sx,Gu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=si(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()}}),Ax="ValueStackAxis",dk=se(Ax,up)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=si(Ax,{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()}}),Mx="ScalingArea",gk=it(Mx,"rect"),mk=se(Mx,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 B({initGroupAxis:r.fullDataFormatter$.pipe(F(l=>l.grid.groupAxis),g_()),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=Jv().on("zoom",function(b){const x=b.transform,v=R=>{const P=Math.round(R);return Math.min(f,Math.max(0,P))},S=l.fullDataFormatter.grid.groupAxis.position==="bottom"||l.fullDataFormatter.grid.groupAxis.position==="top"?x.rescaleX(g).domain().map(v):x.rescaleY(g).domain().map(v);S[0]<=0&&S[1]>=f?x.k<s.k&&(x.k=s.k,x.x=s.x,x.y=s.y):S[1]-S[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 $={...l.fullDataFormatter,grid:{...l.fullDataFormatter.grid,groupAxis:{...l.fullDataFormatter.grid.groupAxis,scaleDomain:S}}};i.dataFormatter$.next($)});e.call(m)}),()=>{o.next(void 0),a.remove()}}),Ru="GroupAux",Rh=it(Ru,"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=it(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=ex(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=j(p[h]).selectAll("rect").data([f]),b=y.enter().append("rect").attr("height",`${s}px`).attr("fill",S=>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",S=>`${d}px`).style("transform",o),y.exit().remove();const x=j(p[h]).selectAll("text").data([f]),v=x.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");x.merge(v).text(S=>S.text).style("transform",o).attr("fill",S=>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(Ru,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(it(Ru,"rect"),!0).attr("opacity",0),{seriesSelection$:u,axesSelection$:l,defsSelection$:c,graphicGSelection$:f}=sr({selection:t,pluginName:Ru,clipPathID:"test",seriesLabels$:i.seriesLabels$,gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(I(o)).subscribe($=>{s.attr("width",$.rootWidth).attr("height",$.rootHeight)});const h=B({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(I(o),W(async $=>$),F($=>{const P=$.computedData[0]?$.computedData[0].length-1:0,_=$.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-$.fullDataFormatter.grid.groupAxis.scalePadding:$.fullDataFormatter.grid.groupAxis.scaleDomain[0]-$.fullDataFormatter.grid.groupAxis.scalePadding,w=$.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?P+$.fullDataFormatter.grid.groupAxis.scalePadding:$.fullDataFormatter.grid.groupAxis.scaleDomain[1]+$.fullDataFormatter.grid.groupAxis.scalePadding;return[_,w]}),St(1)),p=B({groupScaleDomain:h,gridAxesSize:i.gridAxesSize$}).pipe(I(o),W(async $=>$),F($=>Po().domain($.groupScaleDomain).range([0,$.gridAxesSize.width]))),d=i.fullChartParams$.pipe(I(o),F($=>$.highlightTarget),tt()),g=Ch(e,"mousemove").pipe(I(o)),m=B({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),W(async $=>$),F($=>{const R=`rotateX(${$.gridAxesReverseTransform.rotateX}deg) rotateY(${$.gridAxesReverseTransform.rotateY}deg)`,P=`rotate(${$.gridAxesReverseTransform.rotate}deg)`,_=`scale(${1/$.gridContainerPosition[0].scale[0]}, ${1/$.gridContainerPosition[0].scale[1]})`;return`${R} ${P} ${_}`}),tt()),y=B({textReverseTransform:m,fullParams:i.fullParams$}).pipe(I(o),W(async $=>$),F($=>`${$.textReverseTransform} rotate(${$.fullParams.labelRotate}deg)`)),b=i.gridContainerPosition$.pipe(I(o),F($=>$.reduce((P,_)=>_.columnIndex>P?_.columnIndex:P,0)+1),tt()),x=i.gridContainerPosition$.pipe(I(o),F($=>$.reduce((P,_)=>_.rowIndex>P?_.rowIndex:P,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));B({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($=>{const{groupIndex:R,groupLabel:P}=$.gridGroupPosition,_=$.groupScale(R)??0,w=yk({groupLabel:P,axisX:_,axisHeight:$.gridAxesSize.height,fullParams:$.fullParams});bk({selection:$.axesSelection,pluginName:n,lineData:w,fullParams:$.fullParams,fullChartParams:$.fullChartParams});const A=xk({groupLabel:P,axisX:_,fullParams:$.fullParams});_k({selection:$.axesSelection,labelData:A,fullParams:$.fullParams,fullDataFormatter:$.fullDataFormatter,fullChartParams:$.fullChartParams,textReverseTransformWithRotate:$.textReverseTransformWithRotate,textSizePx:$.textSizePx}).on("mouseover",(C,M)=>{C.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(P)??[],groupIndex:R,groupLabel:P,event:C,data:$.computedData})}).on("mousemove",(C,M)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(P)??[],groupIndex:R,groupLabel:P,event:C,data:$.computedData})}).on("click",(C,M)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(P)??[],groupIndex:R,groupLabel:P,event:C,data:$.computedData})})});const S=Ch(s,"mouseout").pipe(I(o));return B({rootRectMouseout:S,axesSelection:l}).pipe(I(o),W(async $=>$)).subscribe($=>{setTimeout(()=>{a!=!0&&(vk($.axesSelection),wk($.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 ku={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={...ku},Dx={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},Tx={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},Lx={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},Cx={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Ex={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},Rx={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]},kx={...Ih},Ix="MultiGridLegend",Ak=pe(Ix,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=>B(l)),F(l=>l.flat())),a=B({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=B({fullParams:n.fullParams$,seriesList:a}).pipe(I(i),W(async l=>l),F(l=>({...l.fullParams,seriesList:l.seriesList}))),u=Eu(Ix,{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 B({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",Nx=it(Nh,"grid"),Mk=pe(Nh,Dx)(({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.${Nx}`).data(s).join("g").attr("class",Nx).each((u,l,c)=>{const f=j(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",Fx=it(Fh,"grid"),Pk=pe(Fh,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=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=hx(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",Gx=it(Gh,"grid"),Dk=pe(Gh,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=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=mx(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",zx=it(zh,"grid"),Tk=pe(zh,Cx)(({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.${zx}`).data(l).join("g").attr("class",zx).each((c,f,h)=>{const p=j(h[f]);a[f]=rx(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",Ox=it(Oh,"grid"),Lk=pe(Oh,Ex)(({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.${Ox}`).data(u).join("g").attr("class",Ox).each((l,c,f)=>{const h=j(f[c]);o[c]=ox(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())}}),Yh="MultiDots",Yx=it(Yh,"grid"),Ck=pe(Yh,Rx)(({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=j(c[l]);o[l]=bx(Yh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Uh="MultiGroupAxis",Ux=it(Uh,"grid"),Ek=pe(Uh,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.${Ux}`).data(s).join("g").attr("class",Ux).each((u,l,c)=>{const f=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=wx(Uh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,textSizePx$:r.textSizePx$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Bh="MultiValueAxis",Bx=it(Bh,"grid"),Rk=pe(Bh,ku)(({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=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=si(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())}}),Wh="MultiValueStackAxis",Wx=it(Wh,"grid"),kk=pe(Wh,ku)(({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=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=si(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 Hx(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 Xx=({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=>(B({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)`}})),jx=({computedData$:t,fullDataFormatter$:e,layout$:n})=>B({computedData:t,fullDataFormatter:e,layout:n}).pipe(W(async i=>i),F(i=>{if(i.fullDataFormatter.grid.separateSeries)return Hx(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=Hx(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Hh="OverlappingValueAxes",Vx=it(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=B({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 Xo(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=Xx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=jx({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.${Vx}`).data(c).join("g").attr("class",Vx).each((f,h,p)=>{if(h>1)return;const d=j(p[h]);o[h]=si(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())}}),Xh="OverlappingValueStackAxes",Zx=it(Xh,"grid"),Fk=pe(Xh,kx)(({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=B({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 Xo(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=Xx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=jx({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=j(p[h]);o[h]=si(Xh,{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())}}),Gk={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},qh={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};qh.textRenderFn.toString=()=>`(eventData) => {
17
17
  if (eventData.highlightTarget === 'datum' && eventData.datum) {
18
18
  return [\`\${eventData.datum.label}: \${eventData.datum.value}\`]
19
19
  } 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.65",
3
+ "version": "3.0.0-alpha.66",
4
4
  "description": "plugins for OrbCharts",
5
5
  "author": "Blue Planet Inc.",
6
6
  "license": "Apache-2.0",
@@ -47,7 +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
+ // console.log('data', data)
51
51
  if (!data.fullDataFormatter.gridList[data.secondGridIndex]) {
52
52
  data.fullDataFormatter.gridList[data.secondGridIndex] = Object.assign({}, data.fullDataFormatter.gridList[data.firstGridIndex])
53
53
  }