@oliasoft-open-source/charts-library 5.1.2 → 5.1.3-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/assets/{Color-YHDXOIA2-CXm47ReI.js → Color-YHDXOIA2-tKvMPNPn.js} +1 -1
  2. package/dist/assets/{DocsRenderer-CFRXHY34-DLpitdoa.js → DocsRenderer-CFRXHY34-BfcJmjM4.js} +3 -3
  3. package/dist/assets/{bar-chart.stories-B9kaES0x.js → bar-chart.stories-VGzn34XP.js} +1 -1
  4. package/dist/assets/{entry-preview-C2Hy9tFT.js → entry-preview-Bi68xEWA.js} +1 -1
  5. package/dist/assets/{get-draggableData-B9HmP7vM.js → get-draggableData-YBXdJsiL.js} +1 -1
  6. package/dist/assets/{iframe-B41g-Bdk.js → iframe-8p0_GgKU.js} +2 -2
  7. package/dist/assets/{legend-ow0wxTbS.js → legend-CqbLApjH.js} +88 -88
  8. package/dist/assets/{legend-context-UUIiOgUg.js → legend-context-BxOj5cqZ.js} +15 -15
  9. package/dist/assets/line-chart-CuHfFHXH.js +6 -0
  10. package/dist/assets/{line-chart.stories-_CoMKB-U.js → line-chart.stories-CszuqJbu.js} +16 -13
  11. package/dist/assets/{line-chart.test-case.stories-C7ZeDs4F.js → line-chart.test-case.stories-kKZe_JRW.js} +1 -1
  12. package/dist/assets/{pie-chart.stories-Du7YirB8.js → pie-chart.stories-2vnB-vlk.js} +1 -1
  13. package/dist/assets/{preview-coSInfHn.js → preview-BL8bTZrU.js} +2 -2
  14. package/dist/assets/{preview-BAP9gq49.js → preview-DGTxg2Vu.js} +1 -1
  15. package/dist/assets/{scatter-chart.stories-p8Rbfy00.js → scatter-chart.stories-mTVN52nb.js} +1 -1
  16. package/dist/common/common.interface.d.ts +1 -0
  17. package/dist/common/legend-component/state/legend-state-reducer.d.ts +2 -1
  18. package/dist/iframe.html +1 -1
  19. package/dist/index.js +57 -26
  20. package/dist/line-chart/hooks/use-chart-state.d.ts +1 -5
  21. package/dist/line-chart/utils/axis-scales/axis-scales.d.ts +1 -3
  22. package/dist/line-chart/utils/line-chart-utils.d.ts +2 -10
  23. package/dist/pie-chart/use-pie-chart-config.d.ts +3 -2
  24. package/dist/project.json +1 -1
  25. package/dist/src/components/common/common.interface.d.ts +1 -0
  26. package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +2 -1
  27. package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +1 -2
  28. package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +3 -2
  29. package/package.json +1 -1
  30. package/dist/assets/line-chart-3fkfieVt.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as a}from"./jsx-runtime-W3oueGCa.js";import{r as s}from"./index-YTOF1_EJ.js";import{D as ea,B as l}from"./legend-ow0wxTbS.js";import{L as c}from"./line-chart-3fkfieVt.js";import{D as la}from"./legend-context-UUIiOgUg.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";import"./index-CgYGpm1H.js";import"./get-draggableData-B9HmP7vM.js";const ta="chartOne-plan-view-chart-controls",na={datasets:[{label:"CH-4ST",lineTension:0,borderColor:"#a30125",pointBackgroundColor:"#a30125",pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:2,fill:!1,data:[{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:.3927,label:[]},{x:0,y:2.4838,label:[]},{x:0,y:7.1727,label:[]},{x:0,y:14.4238,label:[]},{x:0,y:24.1818,label:[]},{x:0,y:36.3728,label:[]},{x:0,y:50.9039,label:[]},{x:0,y:67.6648,label:[]},{x:0,y:86.528,label:[]},{x:0,y:107.3503,label:[]},{x:0,y:129.9733,label:[]},{x:0,y:154.2251,label:[]},{x:0,y:179.9215,label:[]},{x:0,y:206.867,label:[]},{x:0,y:234.8569,label:[]},{x:0,y:263.6785,label:[]},{x:0,y:293.1127,label:[]},{x:0,y:322.9358,label:[]},{x:0,y:344.2833,label:[]},{x:0,y:352.9221,label:[]},{x:0,y:382.9221,label:[]},{x:0,y:412.9221,label:[]},{x:0,y:442.9221,label:[]},{x:0,y:472.9221,label:[]},{x:0,y:502.9221,label:[]},{x:0,y:532.9221,label:[]},{x:0,y:562.9221,label:[]},{x:0,y:592.9221,label:[]},{x:0,y:622.9221,label:[]},{x:0,y:644.2821,label:[]}]},{label:"CH-4",lineTension:0,borderColor:"#0154a3",pointBackgroundColor:"#0154a3",pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:2,fill:!1,data:[{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]}]}]},oa={direction:"vertical",axes:{x:[{label:"E/W [m]",position:"top"}],y:[{label:"N/S [m]",position:"left"}]},additionalAxesOptions:{chartScaleType:"linear"},graph:{showDataLabels:!0,showMinorGridlines:!0,lineTension:0},chartStyling:{height:"100%"},annotations:{showAnnotations:!0,enableDragAnnotation:!0,annotationsData:[]}},sa={controlsPortalId:ta,data:na,options:oa},m=[{label:"Dataset 1",data:[{x:0,y:0},{x:5,y:25}]}],ra={data:{datasets:m},options:{title:"Chart title",chartStyling:{height:"100%"}}},ma={title:"LineChart / Test Cases",component:c,args:{chart:ra}},y=()=>a.jsx(c,{chart:{data:{datasets:[{label:"Duration %",lineTension:"0",pointHitRadius:10,borderColor:"#dc3912",pointBackgroundColor:"#dc3912",borderWidth:2,pointRadius:4,data:[{x:3,y:0},{x:3,y:100}],yAxisID:"y2"}]},options:{direction:"vertical",axes:{x:[{label:"Duration (TempSim long) [d]",position:"bottom"}],y:[{label:"Probability"},{label:"Percentage [%]"}]},annotations:{annotationsData:[{annotationAxis:"y2",color:"darkgrey",value:16},{displayDragCoordinates:!1,color:"#ff9900",label:"P16",dragAxis:"y",enableDrag:!0,resizable:!1,type:"box",xMax:3,xMin:3,yMax:17,yMin:15,yScaleID:"y2"},{annotationAxis:"y2",color:"darkgrey",value:66},{displayDragCoordinates:!1,color:"#109618",label:"P66",dragAxis:"y",enableDrag:!0,resizable:!1,type:"box",xMax:3,xMin:3,yMax:67,yMin:65,yScaleID:"y2"},{annotationAxis:"y2",color:"darkgrey",value:78},{displayDragCoordinates:!1,color:"#990099",label:"P78",dragAxis:"y",enableDrag:!0,resizable:!1,type:"box",xMax:3,xMin:3,yMax:79,yMin:77,yScaleID:"y2"},{annotationAxis:"y2",color:"darkgrey",value:90},{displayDragCoordinates:!1,color:"#0099c6",label:"P90",dragAxis:"y",enableDrag:!0,resizable:!1,type:"box",xMax:3,xMin:3,yMax:91,yMin:89,yScaleID:"y2"}],enableDragAnnotation:!0,showAnnotations:!0},additionalAxesOptions:{range:{x:{min:3}},chartScaleType:"linear",reverse:!1},graph:{showMinorGridlines:!0},chartStyling:{height:"100%"},chartOptions:{showPoints:!1,enableDragAnnotation:!0}}}}),b=()=>a.jsx(c,{chart:sa}),x=()=>{const[u,n]=s.useState(m),[L,d]=s.useState(0),[g,_]=s.useState(!1),[D,i]=s.useState(!0),[O,C]=s.useState(!1),[f,W]=s.useState(!0),[A,E]=s.useState("linear"),[S,p]=s.useState(!1),M=s.useMemo(()=>({title:"Stress Tester",axes:{x:[{label:"X Axis"}],y:[{label:"Y Axis"}]},chartOptions:{enableDragAnnotation:!0},annotations:{showAnnotations:!0,enableDragAnnotation:!0,annotationsData:[{enableDrag:!0,type:"box",xMin:3.5,xMax:4,yMin:5,yMax:10,color:"rgba(255, 0, 0, 0.3)",label:"DRAG ME!"},{type:"point",enableDrag:!0,xValue:1,yValue:10,radius:ea,color:"red",label:"Draggable Point",labelConfig:{font:`bold 8px ${la}`,color:"rgba(0,0,0,0.7)"}}]},chartStyling:{height:"100%",squareAspectRatio:f},additionalAxesOptions:{chartScaleType:A},legend:{display:!1}}),[u,f,A]),U=s.useMemo(()=>({data:{datasets:u},options:M}),[u,M]),V=()=>{p(!0),i(!0),setTimeout(()=>{i(!1),p(!1)},5e3)},F=()=>{n(m),d(e=>e+1),i(!0),p(!1)},$=()=>{C(!0);const e=[],o=50,r=40;for(let t=0;t<o;t++)setTimeout(()=>{e.push({label:`DS ${t+1}`,data:[{x:t,y:Math.random()*100},{x:t+1,y:Math.random()*100}],borderColor:`hsl(${t*(360/o)}, 100%, 50%)`}),n([...e]),t===15&&(console.warn("Forcing unmount mid-update"),i(!1)),t===25&&(console.warn("Remounting chart"),i(!0),d(h=>h+1)),t===o-1&&(console.log("Async injection complete"),C(!1))},t*r)},z=()=>{n([{label:"Broken Dataset",borderColor:"red"}])},X=()=>{n([])},Y=()=>{n([{label:"X/Y Points",data:[{x:0,y:0},{x:1,y:1}],borderColor:"green"},{label:"Y Only Array",data:[2,4,6],borderColor:"blue"}])},K=()=>{n([{label:"Bad Y Axis Ref",yAxisID:"y-missing",data:[{x:1,y:1},{x:2,y:2}],borderColor:"purple"}])},H=()=>{const e=Array.from({length:5e3},(o,r)=>({x:r,y:Math.sin(r/100)*100}));n([{label:"Big 5k Points",data:e,borderColor:"orange"}])},N=()=>{n([{label:"Corrupt Point Dataset",data:[{x:0,y:10},{x:1},{y:20},null,void 0,"bad-value",{x:5,y:50}],borderColor:"red"}])},G=()=>{n([{label:"Valid A",data:[{x:0,y:1},{x:1,y:2}],borderColor:"blue"},{label:"Corrupt",data:"not-an-array",borderColor:"red"},{label:"Valid B",data:[{x:0,y:3},{x:1,y:4}],borderColor:"green"}])},q=()=>{const e=[];for(let t=0;t<4;t++){const h=Array.from({length:3e3},(ia,aa)=>({x:aa,y:Math.random()*100}));e.push({label:`Stream DS ${t+1}`,data:h,borderColor:`hsl(${t*90}, 100%, 50%)`})}let o=0;const r=setInterval(()=>{n(e.slice(0,o+1)),o++,o===e.length&&clearInterval(r)},500)},J=()=>{E(e=>e==="linear"?"logarithmic":"linear")},Q=()=>{W(e=>!e)},Z=()=>{let e=0;const o=setInterval(()=>{d(r=>r+1),e++,e===100&&clearInterval(o)},30)};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:16},children:[a.jsx(l,{label:"Reset to Initial State",colored:!0,onClick:F}),a.jsx(l,{label:"Async Dataset + Unmount",onClick:$,disabled:O}),a.jsx(l,{label:"Set Invalid Dataset",onClick:z}),a.jsx(l,{label:"Set Empty Dataset",onClick:X}),a.jsx(l,{label:"Mixed Data Formats",onClick:Y}),a.jsx(l,{label:"Bad Axis Ref",onClick:K}),a.jsx(l,{label:"Toggle size",onClick:()=>_(!g)}),a.jsx(l,{label:"Toggle Axis Type",onClick:J}),a.jsx(l,{label:"Toggle Aspect Ratio",onClick:Q}),a.jsx(l,{label:"Spam Re-renders",onClick:Z}),a.jsx(l,{label:D?"Unmount Chart":"Remount Chart",onClick:()=>i(e=>!e)}),a.jsx(l,{label:"Manual Re-render",onClick:()=>d(e=>e+1)}),a.jsx(l,{label:"Empty Dataset",onClick:()=>n([])}),a.jsx(l,{label:"Add 5k Points Slowly",onClick:H}),a.jsx(l,{label:"Dataset With Invalid Point",onClick:N}),a.jsx(l,{label:"Malformed Dataset Combo",onClick:G}),a.jsx(l,{label:"Cycle Big Load (Async)",onClick:q}),a.jsx(l,{label:"Timed Unmount During Drag",onClick:V,disabled:S})]}),S&&a.jsx("span",{style:{color:"crimson",fontWeight:"bold"},children:"⏱ Unmounting in 5s – start dragging!"}),a.jsx("div",{style:{height:g?300:null,width:g?300:null,padding:"var(--padding)",overflow:"auto"},children:D?a.jsx(c,{chart:U},L):a.jsx("div",{style:{padding:40,textAlign:"center"},children:"Chart unmounted"})})]})};y.__docgenInfo={description:"",methods:[],displayName:"PartialRangeWithSimilarValues"};b.__docgenInfo={description:"",methods:[],displayName:"closeToValueInDifferentAxes"};x.__docgenInfo={description:"",methods:[],displayName:"StressTest"};var T,v,R;y.parameters={...y.parameters,docs:{...(T=y.parameters)==null?void 0:T.docs,source:{originalSource:`() => {
1
+ import{j as a}from"./jsx-runtime-W3oueGCa.js";import{r as s}from"./index-YTOF1_EJ.js";import{D as ea,B as l}from"./legend-CqbLApjH.js";import{L as c}from"./line-chart-CuHfFHXH.js";import{D as la}from"./legend-context-BxOj5cqZ.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";import"./index-CgYGpm1H.js";import"./get-draggableData-YBXdJsiL.js";const ta="chartOne-plan-view-chart-controls",na={datasets:[{label:"CH-4ST",lineTension:0,borderColor:"#a30125",pointBackgroundColor:"#a30125",pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:2,fill:!1,data:[{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:.3927,label:[]},{x:0,y:2.4838,label:[]},{x:0,y:7.1727,label:[]},{x:0,y:14.4238,label:[]},{x:0,y:24.1818,label:[]},{x:0,y:36.3728,label:[]},{x:0,y:50.9039,label:[]},{x:0,y:67.6648,label:[]},{x:0,y:86.528,label:[]},{x:0,y:107.3503,label:[]},{x:0,y:129.9733,label:[]},{x:0,y:154.2251,label:[]},{x:0,y:179.9215,label:[]},{x:0,y:206.867,label:[]},{x:0,y:234.8569,label:[]},{x:0,y:263.6785,label:[]},{x:0,y:293.1127,label:[]},{x:0,y:322.9358,label:[]},{x:0,y:344.2833,label:[]},{x:0,y:352.9221,label:[]},{x:0,y:382.9221,label:[]},{x:0,y:412.9221,label:[]},{x:0,y:442.9221,label:[]},{x:0,y:472.9221,label:[]},{x:0,y:502.9221,label:[]},{x:0,y:532.9221,label:[]},{x:0,y:562.9221,label:[]},{x:0,y:592.9221,label:[]},{x:0,y:622.9221,label:[]},{x:0,y:644.2821,label:[]}]},{label:"CH-4",lineTension:0,borderColor:"#0154a3",pointBackgroundColor:"#0154a3",pointRadius:0,pointHoverRadius:0,pointHitRadius:0,borderWidth:2,fill:!1,data:[{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]},{x:0,y:0,label:[]}]}]},oa={direction:"vertical",axes:{x:[{label:"E/W [m]",position:"top"}],y:[{label:"N/S [m]",position:"left"}]},additionalAxesOptions:{chartScaleType:"linear"},graph:{showDataLabels:!0,showMinorGridlines:!0,lineTension:0},chartStyling:{height:"100%"},annotations:{showAnnotations:!0,enableDragAnnotation:!0,annotationsData:[]}},sa={controlsPortalId:ta,data:na,options:oa},m=[{label:"Dataset 1",data:[{x:0,y:0},{x:5,y:25}]}],ra={data:{datasets:m},options:{title:"Chart title",chartStyling:{height:"100%"}}},ma={title:"LineChart / Test Cases",component:c,args:{chart:ra}},y=()=>a.jsx(c,{chart:{data:{datasets:[{label:"Duration %",lineTension:"0",pointHitRadius:10,borderColor:"#dc3912",pointBackgroundColor:"#dc3912",borderWidth:2,pointRadius:4,data:[{x:3,y:0},{x:3,y:100}],yAxisID:"y2"}]},options:{direction:"vertical",axes:{x:[{label:"Duration (TempSim long) [d]",position:"bottom"}],y:[{label:"Probability"},{label:"Percentage [%]"}]},annotations:{annotationsData:[{annotationAxis:"y2",color:"darkgrey",value:16},{displayDragCoordinates:!1,color:"#ff9900",label:"P16",dragAxis:"y",enableDrag:!0,resizable:!1,type:"box",xMax:3,xMin:3,yMax:17,yMin:15,yScaleID:"y2"},{annotationAxis:"y2",color:"darkgrey",value:66},{displayDragCoordinates:!1,color:"#109618",label:"P66",dragAxis:"y",enableDrag:!0,resizable:!1,type:"box",xMax:3,xMin:3,yMax:67,yMin:65,yScaleID:"y2"},{annotationAxis:"y2",color:"darkgrey",value:78},{displayDragCoordinates:!1,color:"#990099",label:"P78",dragAxis:"y",enableDrag:!0,resizable:!1,type:"box",xMax:3,xMin:3,yMax:79,yMin:77,yScaleID:"y2"},{annotationAxis:"y2",color:"darkgrey",value:90},{displayDragCoordinates:!1,color:"#0099c6",label:"P90",dragAxis:"y",enableDrag:!0,resizable:!1,type:"box",xMax:3,xMin:3,yMax:91,yMin:89,yScaleID:"y2"}],enableDragAnnotation:!0,showAnnotations:!0},additionalAxesOptions:{range:{x:{min:3}},chartScaleType:"linear",reverse:!1},graph:{showMinorGridlines:!0},chartStyling:{height:"100%"},chartOptions:{showPoints:!1,enableDragAnnotation:!0}}}}),b=()=>a.jsx(c,{chart:sa}),x=()=>{const[u,n]=s.useState(m),[L,d]=s.useState(0),[g,_]=s.useState(!1),[D,i]=s.useState(!0),[O,C]=s.useState(!1),[f,W]=s.useState(!0),[A,E]=s.useState("linear"),[S,p]=s.useState(!1),M=s.useMemo(()=>({title:"Stress Tester",axes:{x:[{label:"X Axis"}],y:[{label:"Y Axis"}]},chartOptions:{enableDragAnnotation:!0},annotations:{showAnnotations:!0,enableDragAnnotation:!0,annotationsData:[{enableDrag:!0,type:"box",xMin:3.5,xMax:4,yMin:5,yMax:10,color:"rgba(255, 0, 0, 0.3)",label:"DRAG ME!"},{type:"point",enableDrag:!0,xValue:1,yValue:10,radius:ea,color:"red",label:"Draggable Point",labelConfig:{font:`bold 8px ${la}`,color:"rgba(0,0,0,0.7)"}}]},chartStyling:{height:"100%",squareAspectRatio:f},additionalAxesOptions:{chartScaleType:A},legend:{display:!1}}),[u,f,A]),U=s.useMemo(()=>({data:{datasets:u},options:M}),[u,M]),V=()=>{p(!0),i(!0),setTimeout(()=>{i(!1),p(!1)},5e3)},F=()=>{n(m),d(e=>e+1),i(!0),p(!1)},$=()=>{C(!0);const e=[],o=50,r=40;for(let t=0;t<o;t++)setTimeout(()=>{e.push({label:`DS ${t+1}`,data:[{x:t,y:Math.random()*100},{x:t+1,y:Math.random()*100}],borderColor:`hsl(${t*(360/o)}, 100%, 50%)`}),n([...e]),t===15&&(console.warn("Forcing unmount mid-update"),i(!1)),t===25&&(console.warn("Remounting chart"),i(!0),d(h=>h+1)),t===o-1&&(console.log("Async injection complete"),C(!1))},t*r)},z=()=>{n([{label:"Broken Dataset",borderColor:"red"}])},X=()=>{n([])},Y=()=>{n([{label:"X/Y Points",data:[{x:0,y:0},{x:1,y:1}],borderColor:"green"},{label:"Y Only Array",data:[2,4,6],borderColor:"blue"}])},K=()=>{n([{label:"Bad Y Axis Ref",yAxisID:"y-missing",data:[{x:1,y:1},{x:2,y:2}],borderColor:"purple"}])},H=()=>{const e=Array.from({length:5e3},(o,r)=>({x:r,y:Math.sin(r/100)*100}));n([{label:"Big 5k Points",data:e,borderColor:"orange"}])},N=()=>{n([{label:"Corrupt Point Dataset",data:[{x:0,y:10},{x:1},{y:20},null,void 0,"bad-value",{x:5,y:50}],borderColor:"red"}])},G=()=>{n([{label:"Valid A",data:[{x:0,y:1},{x:1,y:2}],borderColor:"blue"},{label:"Corrupt",data:"not-an-array",borderColor:"red"},{label:"Valid B",data:[{x:0,y:3},{x:1,y:4}],borderColor:"green"}])},q=()=>{const e=[];for(let t=0;t<4;t++){const h=Array.from({length:3e3},(ia,aa)=>({x:aa,y:Math.random()*100}));e.push({label:`Stream DS ${t+1}`,data:h,borderColor:`hsl(${t*90}, 100%, 50%)`})}let o=0;const r=setInterval(()=>{n(e.slice(0,o+1)),o++,o===e.length&&clearInterval(r)},500)},J=()=>{E(e=>e==="linear"?"logarithmic":"linear")},Q=()=>{W(e=>!e)},Z=()=>{let e=0;const o=setInterval(()=>{d(r=>r+1),e++,e===100&&clearInterval(o)},30)};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:16},children:[a.jsx(l,{label:"Reset to Initial State",colored:!0,onClick:F}),a.jsx(l,{label:"Async Dataset + Unmount",onClick:$,disabled:O}),a.jsx(l,{label:"Set Invalid Dataset",onClick:z}),a.jsx(l,{label:"Set Empty Dataset",onClick:X}),a.jsx(l,{label:"Mixed Data Formats",onClick:Y}),a.jsx(l,{label:"Bad Axis Ref",onClick:K}),a.jsx(l,{label:"Toggle size",onClick:()=>_(!g)}),a.jsx(l,{label:"Toggle Axis Type",onClick:J}),a.jsx(l,{label:"Toggle Aspect Ratio",onClick:Q}),a.jsx(l,{label:"Spam Re-renders",onClick:Z}),a.jsx(l,{label:D?"Unmount Chart":"Remount Chart",onClick:()=>i(e=>!e)}),a.jsx(l,{label:"Manual Re-render",onClick:()=>d(e=>e+1)}),a.jsx(l,{label:"Empty Dataset",onClick:()=>n([])}),a.jsx(l,{label:"Add 5k Points Slowly",onClick:H}),a.jsx(l,{label:"Dataset With Invalid Point",onClick:N}),a.jsx(l,{label:"Malformed Dataset Combo",onClick:G}),a.jsx(l,{label:"Cycle Big Load (Async)",onClick:q}),a.jsx(l,{label:"Timed Unmount During Drag",onClick:V,disabled:S})]}),S&&a.jsx("span",{style:{color:"crimson",fontWeight:"bold"},children:"⏱ Unmounting in 5s – start dragging!"}),a.jsx("div",{style:{height:g?300:null,width:g?300:null,padding:"var(--padding)",overflow:"auto"},children:D?a.jsx(c,{chart:U},L):a.jsx("div",{style:{padding:40,textAlign:"center"},children:"Chart unmounted"})})]})};y.__docgenInfo={description:"",methods:[],displayName:"PartialRangeWithSimilarValues"};b.__docgenInfo={description:"",methods:[],displayName:"closeToValueInDifferentAxes"};x.__docgenInfo={description:"",methods:[],displayName:"StressTest"};var T,v,R;y.parameters={...y.parameters,docs:{...(T=y.parameters)==null?void 0:T.docs,source:{originalSource:`() => {
2
2
  return <LineChart chart={{
3
3
  data: {
4
4
  datasets: [{
@@ -1,4 +1,4 @@
1
- import{j as H}from"./jsx-runtime-W3oueGCa.js";import{r as Le}from"./index-YTOF1_EJ.js";import{A as Oe,P as He,C as w,g as je,T as Ie,L as B,a as Ae,d as ve,r as Ne,b as we,s as Me,c as $e,e as ye,f as We,h as Re,i as Ee,j as Ue,k as Be,l as Fe,p as Ve,m as Ge,n as Ze,o as qe,q as Xe,t as Ye}from"./legend-context-UUIiOgUg.js";import{D as ze,a as Je}from"./bar-chart-const-Cgj9sgUU.js";import"./index-CgYGpm1H.js";const Ke="_chart_1jdnu_1",Qe="_fixedHeight_1jdnu_13",ea="_stretchHeight_1jdnu_19",M={chart:Ke,fixedHeight:Qe,stretchHeight:ea},aa=e=>({width:e==null?void 0:e.width,height:e==null?void 0:e.height,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)||!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)||!1,performanceMode:(e==null?void 0:e.performanceMode)??!0}),ta=e=>({tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)||!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),sa=e=>({showDataLabels:(e==null?void 0:e.showDataLabels)||!1,stacked:(e==null?void 0:e.stacked)||!1,cutout:(e==null?void 0:e.cutout)||0}),ra=e=>({display:(e==null?void 0:e.display)??!0,useDataset:(e==null?void 0:e.useDataset)||!1,position:(e==null?void 0:e.position)||He.Bottom,align:(e==null?void 0:e.align)||Oe.Center}),na=e=>({enableZoom:(e==null?void 0:e.enableZoom)||!1,enablePan:(e==null?void 0:e.enablePan)||!1}),oa=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover}),la=e=>({labels:(e==null?void 0:e.labels)||[],datasets:(e==null?void 0:e.datasets)||[]}),Pe=e=>{const l=(e==null?void 0:e.chart)||{},s=(l==null?void 0:l.options)||{};return{testId:(l==null?void 0:l.testId)??null,data:la(l==null?void 0:l.data),options:{title:(s==null?void 0:s.title)||"",chartStyling:aa(s==null?void 0:s.chartStyling),tooltip:ta(s==null?void 0:s.tooltip),graph:sa(s==null?void 0:s.graph),legend:ra(s==null?void 0:s.legend),chartOptions:na(s==null?void 0:s.chartOptions),interactions:oa(s==null?void 0:s.interactions)}}},ia=e=>{const[l,s]=Le.useState(!1),{data:i,options:t}=e,j=(u=>{var n;const a=[...u];if(t.graph.stacked){const o={label:((n=a==null?void 0:a[0])==null?void 0:n.label)??"",backgroundColor:[],borderColor:"",borderWidth:Number(a[0].borderWidth)||1,data:[],borderDash:[]};return i.labels.map((c,d)=>{a.map((g,b)=>{o.data.push(g.data[d]);const{backgroundColor:x}=g,{borderColor:f}=g;o.backgroundColor.push((Array.isArray(x)?x[d%((f==null?void 0:f.length)||1)]:x)||w[d]+`${99-10*b}`),o.borderColor=f??""})}),[o]}return a.map((o,c)=>{const{borderWidth:d="1"}=o??{},g=parseFloat(String(d))||1,b=w[c],x=o.borderColor||b,f=o.backgroundColor||je(w);return{...o,borderWidth:g,borderColor:x,backgroundColor:f}})})(i.datasets),N=()=>t.title!==""?{display:!0,text:e.options.title}:{},I=(u,a,r)=>{var o;const{chart:n}=r??{};if(a&&n){const{index:c=0}=a;if(n.toggleDataVisibility(c),n.update(),(o=t.interactions)!=null&&o.onLegendClick){const d=n.isDatasetVisible(c);t.interactions.onLegendClick(a.text,!d)}}};return{generatedDatasets:j,getTitle:N,legendClick:I,onClick:(u,a,r)=>{r.resetZoom()},onHover:(u,a)=>{if(l&&!(a!=null&&a.length)&&(s(!1),t.interactions.onUnhover&&t.interactions.onUnhover(u)),!l&&(a!=null&&a.length)&&(s(!0),t.interactions.onHover)){const{index:r,datasetIndex:n}=a[0],o=j;t.interactions.onHover(u,n,r,o)}},getDatalabels:()=>t.graph.showDataLabels?{display:"auto",align:"center",anchor:"center",formatter:(u,a)=>{if(a.chart.getDatasetMeta(t.graph.stacked?0:a.datasetIndex).data[a.dataIndex].hidden)return"";const r=a.dataset.data[a.dataIndex],n=(r==null?void 0:r.label)||(typeof r=="number"?r:Array.isArray(r)?r.reduce((c,d,g)=>g===0?`${c} ${d}`:`${c}, ${d}`,""):"");return typeof r=="number"?Number.isInteger(n)?n:n.toFixed(2):n}}:{display:!1},getLegend:()=>({position:t.legend.position,display:t.legend.display,align:t.legend.align,labels:{boxHeight:6,boxWidth:6,usePointStyle:!0,filter:u=>{var a;return t.legend.useDataset?!((a=i.datasets[u.index])!=null&&a.hideLegend):!0}},onClick:I}),getToolTips:()=>{const u=a=>{var n;let r={};return(n=t==null?void 0:t.tooltip)!=null&&n.scientificNotation?(Math.abs(a)<ze||Math.abs(a)>Je)&&(r={roundScientificCoefficient:3}):r={scientific:!1},ve(Ne(a),r)};return{callbacks:{title:a=>{const{dataIndex:r}=a[0],n=t.graph.stacked?parseInt(String(r/i.labels.length)):r;return`${i.labels[n]}`},label:a=>{var b;const{dataIndex:r}=a,n=t.graph.stacked?r%i.datasets.length:a.datasetIndex,o=i.datasets.length>1?`${(b=i.datasets[n])==null?void 0:b.label}: `:"",c=a.dataset.data[r],d=typeof c=="object"?`${c.value||""} ${t.tooltip.showLabelsInTooltips&&c.label?"("+c.label+")":""}`:c,g=i!=null&&i.yUnit?`[${i==null?void 0:i.yUnit}]`:"";return`${o} ${u(d)} ${g}`}},padding:Ae,boxWidth:B,boxHeight:B,boxPadding:Ie,usePointStyle:!0}}}};Re.register(Ee,Ue,Be,Fe,Ve,Ge,Ze,qe,Xe,Ye);const ca=e=>{Me();const l=Pe(e),s=Le.useRef(null),{data:i,options:t,testId:y}=l,{generatedDatasets:j,getTitle:N,onClick:I,onHover:W,getDatalabels:R,getLegend:E,getToolTips:U}=ia(l);return H.jsx("div",{className:$e(M.chart,!t.chartStyling.width||!t.chartStyling.height?t.chartStyling.staticChartHeight?M.fixedHeight:M.stretchHeight:""),style:{width:t.chartStyling.width||"auto",height:t.chartStyling.height||"auto"},"data-testid":y,children:H.jsx(ye,{ref:s,data:{datasets:j,labels:t.graph.stacked?void 0:i.labels},options:{cutout:t.graph.cutout,onClick:I,responsive:!0,maintainAspectRatio:t.chartStyling.maintainAspectRatio,animation:t.chartStyling.performanceMode?!1:{duration:We.FAST},hover:{mode:"nearest",intersect:!0},onHover:W,plugins:{annotation:!1,title:N(),datalabels:R(),tooltip:U(),legend:E()}}})})},$=e=>{const{options:l}=Pe(e);return H.jsx(we,{options:l,children:H.jsx(ca,{...e})})};$.__docgenInfo={description:"",methods:[],displayName:"PieChartWithLegend",props:{chart:{required:!0,tsType:{name:"IPieChartData"},description:""},testId:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""}}};const h=["label 1","label 2","label 3"],C={label:"data1",data:[3,8,7]},_e={label:"data2",data:[1,2,3]},Te={label:"data3",data:[5,0,4]},da={label:"spacing data",offset:40,data:[3,8,7]},ua={label:"hover data",data:[3,8,7],hoverOffset:40},ke={label:"data",data:[{value:210,label:"label"},{value:333,label:"labal"},{value:248,label:"lebel"}]},ha={label:"data",data:[210,333,248]},pa={data:{labels:h,datasets:[C]}},ga={data:{labels:h,datasets:[C,_e,Te]}},ba={data:{labels:h,datasets:[C,_e,Te]},options:{title:"Stacked",graph:{stacked:!0}}},fa={data:{labels:h,datasets:[ke]},options:{title:"With custom datalabels",graph:{showDataLabels:!0}}},ma={data:{labels:h,datasets:[ha]},options:{title:"With value as datalabels",graph:{showDataLabels:!0}}},Ca={data:{labels:h,datasets:[ke]},options:{title:"With datalabels in tooltips",tooltip:{showLabelsInTooltips:!0}}},xa={data:{labels:h,datasets:[ua]},options:{title:"Hover offset"}},Da={data:{labels:h,datasets:[da]},options:{title:"Segment offset"}},Sa={data:{labels:h,datasets:[C]},options:{chartStyling:{performanceMode:!1}}},La={data:{labels:h,datasets:[C]},options:{title:"Cutout 50%",graph:{cutout:"50%"}}},Pa={data:{labels:h,datasets:[C]},options:{title:"Cutout 20 pixels",graph:{cutout:20}}},Ia={title:"PieChart",component:$,args:{chart:pa}},p=e=>H.jsx($,{...e}),A=p.bind({}),D=p.bind({});D.args={chart:ga};const S=p.bind({});S.args={chart:ba};const L=p.bind({});L.args={chart:fa};const P=p.bind({});P.args={chart:ma};const _=p.bind({});_.args={chart:Ca};const T=p.bind({});T.args={chart:Sa};const k=p.bind({});k.args={chart:La};const O=p.bind({});O.args={chart:Pa};const m=p.bind({});m.args={chart:xa};const v=p.bind({});m.args={chart:Da};var F,V,G;A.parameters={...A.parameters,docs:{...(F=A.parameters)==null?void 0:F.docs,source:{originalSource:`args => {
1
+ import{j as H}from"./jsx-runtime-W3oueGCa.js";import{r as Le}from"./index-YTOF1_EJ.js";import{A as Oe,P as He,C as w,g as je,T as Ie,L as B,a as Ae,d as ve,r as Ne,b as we,s as Me,c as $e,e as ye,f as We,h as Re,i as Ee,j as Ue,k as Be,l as Fe,p as Ve,m as Ge,n as Ze,o as qe,q as Xe,t as Ye}from"./legend-context-BxOj5cqZ.js";import{D as ze,a as Je}from"./bar-chart-const-Cgj9sgUU.js";import"./index-CgYGpm1H.js";const Ke="_chart_1jdnu_1",Qe="_fixedHeight_1jdnu_13",ea="_stretchHeight_1jdnu_19",M={chart:Ke,fixedHeight:Qe,stretchHeight:ea},aa=e=>({width:e==null?void 0:e.width,height:e==null?void 0:e.height,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)||!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)||!1,performanceMode:(e==null?void 0:e.performanceMode)??!0}),ta=e=>({tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)||!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),sa=e=>({showDataLabels:(e==null?void 0:e.showDataLabels)||!1,stacked:(e==null?void 0:e.stacked)||!1,cutout:(e==null?void 0:e.cutout)||0}),ra=e=>({display:(e==null?void 0:e.display)??!0,useDataset:(e==null?void 0:e.useDataset)||!1,position:(e==null?void 0:e.position)||He.Bottom,align:(e==null?void 0:e.align)||Oe.Center}),na=e=>({enableZoom:(e==null?void 0:e.enableZoom)||!1,enablePan:(e==null?void 0:e.enablePan)||!1}),oa=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover}),la=e=>({labels:(e==null?void 0:e.labels)||[],datasets:(e==null?void 0:e.datasets)||[]}),Pe=e=>{const l=(e==null?void 0:e.chart)||{},s=(l==null?void 0:l.options)||{};return{testId:(l==null?void 0:l.testId)??null,data:la(l==null?void 0:l.data),options:{title:(s==null?void 0:s.title)||"",chartStyling:aa(s==null?void 0:s.chartStyling),tooltip:ta(s==null?void 0:s.tooltip),graph:sa(s==null?void 0:s.graph),legend:ra(s==null?void 0:s.legend),chartOptions:na(s==null?void 0:s.chartOptions),interactions:oa(s==null?void 0:s.interactions)}}},ia=e=>{const[l,s]=Le.useState(!1),{data:i,options:t}=e,j=(u=>{var n;const a=[...u];if(t.graph.stacked){const o={label:((n=a==null?void 0:a[0])==null?void 0:n.label)??"",backgroundColor:[],borderColor:"",borderWidth:Number(a[0].borderWidth)||1,data:[],borderDash:[]};return i.labels.map((c,d)=>{a.map((g,b)=>{o.data.push(g.data[d]);const{backgroundColor:x}=g,{borderColor:f}=g;o.backgroundColor.push((Array.isArray(x)?x[d%((f==null?void 0:f.length)||1)]:x)||w[d]+`${99-10*b}`),o.borderColor=f??""})}),[o]}return a.map((o,c)=>{const{borderWidth:d="1"}=o??{},g=parseFloat(String(d))||1,b=w[c],x=o.borderColor||b,f=o.backgroundColor||je(w);return{...o,borderWidth:g,borderColor:x,backgroundColor:f}})})(i.datasets),N=()=>t.title!==""?{display:!0,text:e.options.title}:{},I=(u,a,r)=>{var o;const{chart:n}=r??{};if(a&&n){const{index:c=0}=a;if(n.toggleDataVisibility(c),n.update(),(o=t.interactions)!=null&&o.onLegendClick){const d=n.isDatasetVisible(c);t.interactions.onLegendClick(a.text,!d)}}};return{generatedDatasets:j,getTitle:N,legendClick:I,onClick:(u,a,r)=>{r.resetZoom()},onHover:(u,a)=>{if(l&&!(a!=null&&a.length)&&(s(!1),t.interactions.onUnhover&&t.interactions.onUnhover(u)),!l&&(a!=null&&a.length)&&(s(!0),t.interactions.onHover)){const{index:r,datasetIndex:n}=a[0],o=j;t.interactions.onHover(u,n,r,o)}},getDatalabels:()=>t.graph.showDataLabels?{display:"auto",align:"center",anchor:"center",formatter:(u,a)=>{if(a.chart.getDatasetMeta(t.graph.stacked?0:a.datasetIndex).data[a.dataIndex].hidden)return"";const r=a.dataset.data[a.dataIndex],n=(r==null?void 0:r.label)||(typeof r=="number"?r:Array.isArray(r)?r.reduce((c,d,g)=>g===0?`${c} ${d}`:`${c}, ${d}`,""):"");return typeof r=="number"?Number.isInteger(n)?n:n.toFixed(2):n}}:{display:!1},getLegend:()=>({position:t.legend.position,display:t.legend.display,align:t.legend.align,labels:{boxHeight:6,boxWidth:6,usePointStyle:!0,filter:u=>{var a;return t.legend.useDataset?!((a=i.datasets[u.index])!=null&&a.hideLegend):!0}},onClick:I}),getToolTips:()=>{const u=a=>{var n;let r={};return(n=t==null?void 0:t.tooltip)!=null&&n.scientificNotation?(Math.abs(a)<ze||Math.abs(a)>Je)&&(r={roundScientificCoefficient:3}):r={scientific:!1},ve(Ne(a),r)};return{callbacks:{title:a=>{const{dataIndex:r}=a[0],n=t.graph.stacked?parseInt(String(r/i.labels.length)):r;return`${i.labels[n]}`},label:a=>{var b;const{dataIndex:r}=a,n=t.graph.stacked?r%i.datasets.length:a.datasetIndex,o=i.datasets.length>1?`${(b=i.datasets[n])==null?void 0:b.label}: `:"",c=a.dataset.data[r],d=typeof c=="object"?`${c.value||""} ${t.tooltip.showLabelsInTooltips&&c.label?"("+c.label+")":""}`:c,g=i!=null&&i.yUnit?`[${i==null?void 0:i.yUnit}]`:"";return`${o} ${u(d)} ${g}`}},padding:Ae,boxWidth:B,boxHeight:B,boxPadding:Ie,usePointStyle:!0}}}};Re.register(Ee,Ue,Be,Fe,Ve,Ge,Ze,qe,Xe,Ye);const ca=e=>{Me();const l=Pe(e),s=Le.useRef(null),{data:i,options:t,testId:y}=l,{generatedDatasets:j,getTitle:N,onClick:I,onHover:W,getDatalabels:R,getLegend:E,getToolTips:U}=ia(l);return H.jsx("div",{className:$e(M.chart,!t.chartStyling.width||!t.chartStyling.height?t.chartStyling.staticChartHeight?M.fixedHeight:M.stretchHeight:""),style:{width:t.chartStyling.width||"auto",height:t.chartStyling.height||"auto"},"data-testid":y,children:H.jsx(ye,{ref:s,data:{datasets:j,labels:t.graph.stacked?void 0:i.labels},options:{cutout:t.graph.cutout,onClick:I,responsive:!0,maintainAspectRatio:t.chartStyling.maintainAspectRatio,animation:t.chartStyling.performanceMode?!1:{duration:We.FAST},hover:{mode:"nearest",intersect:!0},onHover:W,plugins:{annotation:!1,title:N(),datalabels:R(),tooltip:U(),legend:E()}}})})},$=e=>{const{options:l}=Pe(e);return H.jsx(we,{options:l,children:H.jsx(ca,{...e})})};$.__docgenInfo={description:"",methods:[],displayName:"PieChartWithLegend",props:{chart:{required:!0,tsType:{name:"IPieChartData"},description:""},testId:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""}}};const h=["label 1","label 2","label 3"],C={label:"data1",data:[3,8,7]},_e={label:"data2",data:[1,2,3]},Te={label:"data3",data:[5,0,4]},da={label:"spacing data",offset:40,data:[3,8,7]},ua={label:"hover data",data:[3,8,7],hoverOffset:40},ke={label:"data",data:[{value:210,label:"label"},{value:333,label:"labal"},{value:248,label:"lebel"}]},ha={label:"data",data:[210,333,248]},pa={data:{labels:h,datasets:[C]}},ga={data:{labels:h,datasets:[C,_e,Te]}},ba={data:{labels:h,datasets:[C,_e,Te]},options:{title:"Stacked",graph:{stacked:!0}}},fa={data:{labels:h,datasets:[ke]},options:{title:"With custom datalabels",graph:{showDataLabels:!0}}},ma={data:{labels:h,datasets:[ha]},options:{title:"With value as datalabels",graph:{showDataLabels:!0}}},Ca={data:{labels:h,datasets:[ke]},options:{title:"With datalabels in tooltips",tooltip:{showLabelsInTooltips:!0}}},xa={data:{labels:h,datasets:[ua]},options:{title:"Hover offset"}},Da={data:{labels:h,datasets:[da]},options:{title:"Segment offset"}},Sa={data:{labels:h,datasets:[C]},options:{chartStyling:{performanceMode:!1}}},La={data:{labels:h,datasets:[C]},options:{title:"Cutout 50%",graph:{cutout:"50%"}}},Pa={data:{labels:h,datasets:[C]},options:{title:"Cutout 20 pixels",graph:{cutout:20}}},Ia={title:"PieChart",component:$,args:{chart:pa}},p=e=>H.jsx($,{...e}),A=p.bind({}),D=p.bind({});D.args={chart:ga};const S=p.bind({});S.args={chart:ba};const L=p.bind({});L.args={chart:fa};const P=p.bind({});P.args={chart:ma};const _=p.bind({});_.args={chart:Ca};const T=p.bind({});T.args={chart:Sa};const k=p.bind({});k.args={chart:La};const O=p.bind({});O.args={chart:Pa};const m=p.bind({});m.args={chart:xa};const v=p.bind({});m.args={chart:Da};var F,V,G;A.parameters={...A.parameters,docs:{...(F=A.parameters)==null?void 0:F.docs,source:{originalSource:`args => {
2
2
  return <PieChart
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-CFRXHY34-DLpitdoa.js","./iframe-B41g-Bdk.js","./index-YTOF1_EJ.js","./jsx-runtime-W3oueGCa.js","./index-DHw5ixvP.js","./index-BhTLYoCu.js","./index-Dytf1aFS.js","./client-DnE3718B.js"])))=>i.map(i=>d[i]);
2
- import{_ as o}from"./iframe-B41g-Bdk.js";var s=Object.defineProperty,i=(e,r)=>{for(var t in r)s(e,t,{get:r[t],enumerable:!0})},n={};i(n,{parameters:()=>d});var _=Object.entries(globalThis.TAGS_OPTIONS??{}).reduce((e,r)=>{let[t,a]=r;return a.excludeFromDocsStories&&(e[t]=!0),e},{}),d={docs:{renderer:async()=>{let{DocsRenderer:e}=await o(async()=>{const{DocsRenderer:r}=await import("./DocsRenderer-CFRXHY34-DLpitdoa.js").then(t=>t.e);return{DocsRenderer:r}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return new e},stories:{filter:e=>{var r;return(e.tags||[]).filter(t=>_[t]).length===0&&!((r=e.parameters.docs)!=null&&r.disable)}}}};export{d as parameters};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-CFRXHY34-BfcJmjM4.js","./iframe-8p0_GgKU.js","./index-YTOF1_EJ.js","./jsx-runtime-W3oueGCa.js","./index-DHw5ixvP.js","./index-BhTLYoCu.js","./index-Dytf1aFS.js","./client-DnE3718B.js"])))=>i.map(i=>d[i]);
2
+ import{_ as o}from"./iframe-8p0_GgKU.js";var s=Object.defineProperty,i=(e,r)=>{for(var t in r)s(e,t,{get:r[t],enumerable:!0})},n={};i(n,{parameters:()=>d});var _=Object.entries(globalThis.TAGS_OPTIONS??{}).reduce((e,r)=>{let[t,a]=r;return a.excludeFromDocsStories&&(e[t]=!0),e},{}),d={docs:{renderer:async()=>{let{DocsRenderer:e}=await o(async()=>{const{DocsRenderer:r}=await import("./DocsRenderer-CFRXHY34-BfcJmjM4.js").then(t=>t.e);return{DocsRenderer:r}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return new e},stories:{filter:e=>{var r;return(e.tags||[]).filter(t=>_[t]).length===0&&!((r=e.parameters.docs)!=null&&r.disable)}}}};export{d as parameters};
@@ -1,3 +1,3 @@
1
- import{j as c}from"./jsx-runtime-W3oueGCa.js";import{r as v}from"./index-YTOF1_EJ.js";import{c as p,D as j}from"./DocsRenderer-CFRXHY34-DLpitdoa.js";import{e as E}from"./index-CgYGpm1H.js";import"./preview-coSInfHn.js";import"./iframe-B41g-Bdk.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";import"./index-Dytf1aFS.js";import"./client-DnE3718B.js";var g="DARK_MODE";function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},f(t)}var b;function A(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,n)}return e}function D(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?A(Object(e),!0).forEach(function(n){I(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):A(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function I(t,r,e){return r=M(r),r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function M(t){var r=R(t,"string");return f(r)==="symbol"?r:String(r)}function R(t,r){if(f(t)!=="object"||t===null)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var n=e.call(t,r);if(f(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function y(t){return L(t)||N(t)||K(t)||x()}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{j as c}from"./jsx-runtime-W3oueGCa.js";import{r as v}from"./index-YTOF1_EJ.js";import{c as p,D as j}from"./DocsRenderer-CFRXHY34-BfcJmjM4.js";import{e as E}from"./index-CgYGpm1H.js";import"./preview-BL8bTZrU.js";import"./iframe-8p0_GgKU.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";import"./index-Dytf1aFS.js";import"./client-DnE3718B.js";var g="DARK_MODE";function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},f(t)}var b;function A(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,n)}return e}function D(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?A(Object(e),!0).forEach(function(n){I(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):A(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function I(t,r,e){return r=M(r),r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function M(t){var r=R(t,"string");return f(r)==="symbol"?r:String(r)}function R(t,r){if(f(t)!=="object"||t===null)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var n=e.call(t,r);if(f(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function y(t){return L(t)||N(t)||K(t)||x()}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K(t,r){if(t){if(typeof t=="string")return O(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return O(t,r)}}function N(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function L(t){if(Array.isArray(t))return O(t)}function O(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}const{global:U}=__STORYBOOK_MODULE_GLOBAL__,{STORY_CHANGED:st,SET_STORIES:ct,DOCS_RENDERED:ft}=__STORYBOOK_MODULE_CORE_EVENTS__;var T=U,Y=T.document,h=T.window,C="sb-addon-themes-3";(b=h.matchMedia)===null||b===void 0||b.call(h,"(prefers-color-scheme: dark)");var S={classTarget:"body",dark:p.dark,darkClass:["dark"],light:p.light,lightClass:["light"],stylePreview:!1,userHasExplicitlySetTheTheme:!1},k=function(r){h.localStorage.setItem(C,JSON.stringify(r))},B=function(r,e){var n=e.current,a=e.darkClass,l=a===void 0?S.darkClass:a,o=e.lightClass,i=o===void 0?S.lightClass:o;if(n==="dark"){var u,s;(u=r.classList).remove.apply(u,y(d(i))),(s=r.classList).add.apply(s,y(d(l)))}else{var m,_;(m=r.classList).remove.apply(m,y(d(l))),(_=r.classList).add.apply(_,y(d(i)))}},d=function(r){var e=[];return e.concat(r).map(function(n){return n})},W=function(r){var e=Y.querySelector(r.classTarget);e&&B(e,r)},P=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=h.localStorage.getItem(C);if(typeof e=="string"){var n=JSON.parse(e);return r&&(r.dark&&!E(n.dark,r.dark)&&(n.dark=r.dark,k(n)),r.light&&!E(n.light,r.light)&&(n.light=r.light,k(n))),n}return D(D({},S),r)};W(P());function H(t,r){return q(t)||G(t,r)||$(t,r)||V()}function V(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $(t,r){if(t){if(typeof t=="string")return w(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return w(t,r)}}function w(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function G(t,r){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var n,a,l,o,i=[],u=!0,s=!1;try{if(l=(e=e.call(t)).next,r!==0)for(;!(u=(n=l.call(e)).done)&&(i.push(n.value),i.length!==r);u=!0);}catch(m){s=!0,a=m}finally{try{if(!u&&e.return!=null&&(o=e.return(),Object(o)!==o))return}finally{if(s)throw a}}return i}}function q(t){if(Array.isArray(t))return t}const{addons:J,useState:F,useEffect:z}=__STORYBOOK_MODULE_PREVIEW_API__;function Q(){var t=F(P().current==="dark"),r=H(t,2),e=r[0],n=r[1];return z(function(){var a=J.getChannel();return a.on(g,n),function(){return a.off(g,n)}},[]),e}const{definePreview:mt}=__STORYBOOK_MODULE_PREVIEW_API__,yt=[t=>c.jsx(c.Fragment,{children:c.jsx(t,{})}),t=>{const r=Q();return v.useEffect(()=>(document.documentElement.dataset.theme=r?"dark":"default",()=>{delete document.documentElement.dataset.theme}),[r]),c.jsx(t,{})}],X=t=>{const[r,e]=v.useState(!1);return v.useEffect(()=>{const n=a=>e(a);return t.context.channel.on(g,n),()=>{t.context.channel.off(g,n)}},[t.context.channel]),c.jsx(j,{...t,theme:r?p.dark:p.light})},dt={docs:{container:X},darkMode:{current:"light",stylePreview:!0}},pt=["autodocs"];export{yt as decorators,dt as parameters,pt as tags};
@@ -1,4 +1,4 @@
1
- import{j as g}from"./jsx-runtime-W3oueGCa.js";import{r as ye}from"./index-YTOF1_EJ.js";import{d as ve,r as Ae,z as ke,B as u,S as De,E as je,O as He,N as we,f as q,C as Me,A as Ee,P as Ne,Y as Pe,G as z,b as Ie,s as Ue,Q as qe,Z as ze,U as Ze,h as Fe,i as Ye,V as Ve,j as Xe,p as $e,m as Je,n as Qe,q as Ke,t as Ge}from"./legend-context-UUIiOgUg.js";import{j as et,u as tt,t as at,o as st,p as rt,l as lt,H as ot,L as nt,m as ct,n as dt}from"./legend-ow0wxTbS.js";import{D as it,a as ut}from"./bar-chart-const-Cgj9sgUU.js";import"./index-CgYGpm1H.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";const Z=(e,t)=>{let a={};return t?(Math.abs(e)<it||Math.abs(e)>ut)&&(a={roundScientificCoefficient:3}):a={scientific:!1},ve(Ae(e),a)},gt=(e,t)=>{var a;if((a=t==null?void 0:t.tooltip)!=null&&a.showLabelsInTooltips){const r=e[0],{label:s}=(r==null?void 0:r.dataset)??{};return s}},ht=(e,t)=>{var o;const{raw:a,dataset:r}=e??{},s=a==null?void 0:a.label,n=(o=t==null?void 0:t.tooltip)==null?void 0:o.scientificNotation;return`${s??(r==null?void 0:r.label)} ( x: ${Z(a==null?void 0:a.x,n)} , y: ${Z(a==null?void 0:a.y,n)} )`},mt=e=>{var t,a,r;return{enabled:(t=e==null?void 0:e.tooltip)==null?void 0:t.enabled,callbacks:{title:s=>gt(s,e),label:s=>ht(s,e)},backgroundColor:(a=e==null?void 0:e.tooltip)==null?void 0:a.backgroundColor,displayColors:(r=e==null?void 0:e.tooltip)==null?void 0:r.displayColors,padding:7}},F=({options:e,axisType:t=u.X,currentScale:a})=>{var C,T,p,b,L,f,w,y,M;const r=ke(e.direction),s=a||((T=(C=e==null?void 0:e.axes)==null?void 0:C[t])==null?void 0:T[0]),n=r&&t===u.Y||!r&&t===u.X,o=(s==null?void 0:s.gridLines)||{},x=()=>{var l;const c=r?u.Y:u.X;return t===c?(l=e==null?void 0:e.additionalAxesOptions)==null?void 0:l.reverse:!1},S=()=>{const c=e==null?void 0:e.additionalAxesOptions;return{...{stepSize:(s==null?void 0:s.stepSize)??(t===u.Y?c==null?void 0:c.stepSize:void 0)},includeBounds:!1,font:{size:je}}};return{type:De.Linear,position:s==null?void 0:s.position,beginAtZero:(p=e==null?void 0:e.additionalAxesOptions)==null?void 0:p.beginAtZero,reverse:x(),suggestedMax:(b=e==null?void 0:e.additionalAxesOptions)==null?void 0:b.suggestedMax,suggestedMin:(L=e==null?void 0:e.additionalAxesOptions)==null?void 0:L.suggestedMin,min:n?(f=e==null?void 0:e.additionalAxesOptions)==null?void 0:f.min:void 0,max:n?(w=e==null?void 0:e.additionalAxesOptions)==null?void 0:w.max:void 0,title:{display:!!((y=s==null?void 0:s.label)!=null&&y.length)||!!((M=s==null?void 0:s.unit)!=null&&M.length),text:(s==null?void 0:s.label)||(s==null?void 0:s.unit),padding:0},ticks:S(),grid:{...o}}},bt=e=>{const t=F({options:e,axisType:u.X}),a=F({options:e,axisType:u.Y});return{x:t,y:a}},ft=(e,t)=>{const{data:a,options:r}=e,{interactions:s,chartStyling:n}=r,[o,x]=ye.useState(!1),{legend:S,customLegendPlugin:C,legendClick:T}=et({chartRef:t,options:r}),{state:p}=tt(),{annotation:b}=p,f=(c=>c.map((l,R)=>{const{borderWidth:E=st}=l??{},_e=parseFloat(String(E))||1,U=Me[R],We=l.borderColor??U,Be=l.backgroundColor??U;return{...l,borderWidth:_e,borderColor:We,backgroundColor:Be}}))(a.datasets),w=(c,l,R)=>{R.resetZoom()},y=(c,l)=>{if(o&&!(l!=null&&l.length)&&(x(!1),s.onUnhover&&s.onUnhover(c)),!o&&(l!=null&&l.length)&&(x(!0),s.onHover)){const{index:R,datasetIndex:E}=l[0];s.onHover(c,E,R,f)}},M={onClick:w,onHover:y,...n,interactions:{onLegendClick:T,onHover:y},scales:bt(e==null?void 0:e.options),animation:n.performanceMode?{duration:q.NO}:{duration:q.FAST,onComplete:s==null?void 0:s.onAnimationComplete},plugins:{legend:{...S,display:!1,events:[]},customLegendPlugin:C,title:He(r),annotation:at(b),chartAreaBorder:{borderColor:we},datalabels:{display:r.graph.showDataLabels},tooltip:mt(r)}};return{generatedDatasets:f,scatterOptions:M}};var d=(e=>(e[e.TopToBottom=0]="TopToBottom",e[e.BottomToTop=1]="BottomToTop",e[e.LeftToRight=2]="LeftToRight",e[e.RightToLeft=3]="RightToLeft",e[e.TopLeftToBottomRight=4]="TopLeftToBottomRight",e[e.BottomRightToTopLeft=5]="BottomRightToTopLeft",e[e.BottomLeftToTopRight=6]="BottomLeftToTopRight",e[e.TopRightToBottomLeft=7]="TopRightToBottomLeft",e))(d||{});const xt=e=>({display:(e==null?void 0:e.display)??!1,gradientColors:(e==null?void 0:e.gradientColors)??Pe,direction:(e==null?void 0:e.direction)??d.BottomLeftToTopRight}),Ct=e=>({width:(e==null?void 0:e.width)??z,height:(e==null?void 0:e.height)??z,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)||!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)||!1,performanceMode:(e==null?void 0:e.performanceMode)??!0,gradient:xt(e==null?void 0:e.gradient)}),Tt=e=>({enabled:(e==null?void 0:e.enabled)??!0,tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)||!1,backgroundColor:(e==null?void 0:e.backgroundColor)||"#333",displayColors:(e==null?void 0:e.displayColors)||!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),pt=e=>({showMinorGridlines:(e==null?void 0:e.showMinorGridlines)??!1,showDataLabels:(e==null?void 0:e.showDataLabels)??!1}),St=e=>({display:(e==null?void 0:e.display)??!0,useDataset:(e==null?void 0:e.useDataset)||!1,position:(e==null?void 0:e.position)||Ne.BottomLeft,align:(e==null?void 0:e.align)||Ee.Center}),Lt=e=>({enableZoom:(e==null?void 0:e.enableZoom)||!1,enablePan:(e==null?void 0:e.enablePan)||!1}),yt=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover,onAnimationComplete:e==null?void 0:e.onAnimationComplete}),Rt=e=>({labels:(e==null?void 0:e.labels)||[],datasets:(e==null?void 0:e.datasets)||[]}),Ot=e=>e?e.map(t=>({...t,display:(t==null?void 0:t.display)??!0})):[],_t=e=>({showAnnotations:(e==null?void 0:e.showAnnotations)??!0,controlAnnotation:(e==null?void 0:e.controlAnnotation)||!1,annotationsData:Ot(e==null?void 0:e.annotationsData)}),Wt=e=>({x:(e==null?void 0:e.x)||[{}],y:(e==null?void 0:e.y)||[{}]}),Bt=e=>({reverse:(e==null?void 0:e.reverse)||!1,stacked:(e==null?void 0:e.stacked)||!1,beginAtZero:(e==null?void 0:e.beginAtZero)??!0,stepSize:e==null?void 0:e.stepSize,suggestedMin:e==null?void 0:e.suggestedMin,suggestedMax:e==null?void 0:e.suggestedMax,min:e==null?void 0:e.min,max:e==null?void 0:e.max}),Re=e=>{const t=(e==null?void 0:e.chart)||{},a=(t==null?void 0:t.options)||{};return{testId:(t==null?void 0:t.testId)??null,data:Rt(t==null?void 0:t.data),options:{title:(a==null?void 0:a.title)||"",axes:Wt(a==null?void 0:a.axes),additionalAxesOptions:Bt(a==null?void 0:a.additionalAxesOptions),direction:(a==null?void 0:a.direction)||rt.VERTICAL,chartStyling:Ct(a==null?void 0:a.chartStyling),tooltip:Tt(a==null?void 0:a.tooltip),graph:pt(a==null?void 0:a.graph),legend:St(a==null?void 0:a.legend),annotations:_t(a==null?void 0:a.annotations),chartOptions:Lt(a==null?void 0:a.chartOptions),interactions:yt(a==null?void 0:a.interactions)}}},vt=(e,t)=>{switch(e){case d.TopToBottom:return[t.left,t.top,t.left,t.bottom];case d.BottomToTop:return[t.left,t.bottom,t.left,t.top];case d.LeftToRight:return[t.left,t.top,t.right,t.top];case d.RightToLeft:return[t.right,t.top,t.left,t.top];case d.TopLeftToBottomRight:return[t.left,t.top,t.right,t.bottom];case d.BottomRightToTopLeft:return[t.right,t.bottom,t.left,t.top];case d.BottomLeftToTopRight:return[t.left,t.bottom,t.right,t.top];case d.TopRightToBottomLeft:return[t.right,t.top,t.left,t.bottom];default:return[t.left,t.bottom,t.right,t.top]}},At={id:"gradientBackgroundPlugin",beforeDraw:e=>{const{ctx:t,chartArea:a,options:r}=e;if(!t||!a)return;const s=r==null?void 0:r.gradient,{display:n=!1,gradientColors:o,direction:x=d.BottomLeftToTopRight}=s??{};if(!n||!o||o.length===0)return;const[S,C,T,p]=vt(x,a),b=t.createLinearGradient(S,C,T,p);o.forEach(({offset:L,color:f})=>{b.addColorStop(L,f)}),t.save(),t.globalCompositeOperation="destination-over",t.fillStyle=b,t.fillRect(a.left,a.top,a.right-a.left,a.bottom-a.top),t.restore()}},kt="_chart_1qlu1_1",Dt="_canvas_1qlu1_11",jt="_fixedHeight_1qlu1_20",Ht="_stretchHeight_1qlu1_26",wt="_squareAspectRatio_1qlu1_32",Y={chart:kt,canvas:Dt,fixedHeight:jt,stretchHeight:Ht,squareAspectRatio:wt};Fe.register(Ye,Ve,Xe,$e,Je,Qe,Ke,Ge,dt,At);const Mt=e=>{Ue();const t=ye.useRef(null),a=Re(e),{options:r,testId:s}=a,{scatterOptions:n,generatedDatasets:o}=ft(a,t);return g.jsx("div",{className:qe(r.chartStyling,Y),style:{width:r.chartStyling.width,height:r.chartStyling.height},"data-testid":s,children:g.jsx(lt,{backend:ot,context:window,children:g.jsxs("div",{className:Y.canvas,id:"canvas",children:[g.jsx(ze,{ref:t,data:{datasets:o},options:n,plugins:Ze(r.graph,r.legend)}),!!o.length&&g.jsx(nt,{chartRef:t,legendConfig:{options:r,generatedDatasets:o,chartType:ct.SCATTER}})]})})})},N=e=>{const{options:t}=Re(e);return g.jsx(Ie,{options:t,children:g.jsx(Mt,{...e})})};N.__docgenInfo={description:"",methods:[],displayName:"ScatterChartWithLegend",props:{chart:{required:!0,tsType:{name:"IScatterChartData"},description:""},testId:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""}}};const h=["label 1","label 2","label 3"],m={label:"Dataset 1",data:[{x:1,y:5},{x:3,y:7},{x:6,y:2},{x:8,y:6},{x:9,y:4}]},P={label:"Dataset 2",data:[{x:1,y:3},{x:4,y:5},{x:7,y:9},{x:10,y:2},{x:12,y:7}]},Et={label:"Dataset 3",data:[{x:2,y:8},{x:5,y:6},{x:8,y:10},{x:11,y:5},{x:14,y:9}]},Oe={label:"Dataset 4",data:[{x:2,y:8},{x:14,y:9}]},Nt={label:"Dataset 5",data:[{x:14,y:7,label:"Echo"},{x:3,y:18,label:"Lima"},{x:19,y:2,label:"Romeo"},{x:8,y:11,label:"Charlie"},{x:12,y:9,label:"Oscar"}]},Pt={label:"Dataset 6",data:[{x:15,y:3,label:"Hotel"},{x:9,y:14,label:"Tango"},{x:4,y:17,label:"Whiskey"},{x:11,y:7,label:"Juliet"},{x:13,y:1,label:"Zulu"}]},It={label:"Dataset Decimals",data:[{x:4.30021321123002,y:2.30021321123005},{x:5.12321321000003,y:3.23213210000037}]},I={data:{labels:h,datasets:[m]}},Ut={data:{labels:h,datasets:[m]},options:{chartStyling:{height:300,width:700}}},qt={data:{labels:h,datasets:[m,P,Et]}},zt={data:{labels:h,datasets:[m]},options:{title:"With Data Labels",graph:{showDataLabels:!0}}},Zt={data:{labels:h,datasets:[m,P,It]},options:{title:"With Tooltips",tooltip:{title:"Tooltip",showLabelsInTooltips:!0}}},Ft={data:{labels:h,datasets:[{...m,backgroundColor:"red",borderColor:"red"}]}},Yt={data:{labels:h,datasets:[m]},options:{title:"With Annotation",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"y",label:"Horizontal Annotation",value:2.5,color:"rgba(96, 32, 196, 0.5)"}]}}},Vt={data:{labels:h,datasets:[m,P,Oe]},options:{title:"With Axes Labels",axes:{x:[{label:"x axis"}],y:[{label:"y axis"}]}}},Xt={...I,options:{title:"With Gradient",chartStyling:{gradient:{display:!0}}}},$t={data:{datasets:[Nt,Pt,Oe]},options:{title:"With datapoint label showing when hovered",tooltip:{showLabelsInTooltips:!0}}},ra={title:"ScatterChart",component:N,args:{chart:I}},i=e=>g.jsx(N,{...e}),O=i.bind({});O.args={chart:I};const _=i.bind({});_.args={chart:Ut};const W=i.bind({});W.args={chart:qt};const B=i.bind({});B.args={chart:zt};const v=i.bind({});v.args={chart:Zt};const A=i.bind({});A.args={chart:Yt};const k=i.bind({});k.args={chart:Vt};const D=i.bind({});D.args={chart:Xt};const j=i.bind({});j.args={chart:$t};const H=i.bind({});H.args={chart:Ft};var V,X,$;O.parameters={...O.parameters,docs:{...(V=O.parameters)==null?void 0:V.docs,source:{originalSource:`args => {
1
+ import{j as g}from"./jsx-runtime-W3oueGCa.js";import{r as ye}from"./index-YTOF1_EJ.js";import{d as ve,r as Ae,z as ke,B as u,S as De,E as je,O as He,N as we,f as q,C as Me,A as Ee,P as Ne,Y as Pe,G as z,b as Ie,s as Ue,Q as qe,Z as ze,U as Ze,h as Fe,i as Ye,V as Ve,j as Xe,p as $e,m as Je,n as Qe,q as Ke,t as Ge}from"./legend-context-BxOj5cqZ.js";import{j as et,u as tt,t as at,o as st,p as rt,l as lt,H as ot,L as nt,m as ct,n as dt}from"./legend-CqbLApjH.js";import{D as it,a as ut}from"./bar-chart-const-Cgj9sgUU.js";import"./index-CgYGpm1H.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";const Z=(e,t)=>{let a={};return t?(Math.abs(e)<it||Math.abs(e)>ut)&&(a={roundScientificCoefficient:3}):a={scientific:!1},ve(Ae(e),a)},gt=(e,t)=>{var a;if((a=t==null?void 0:t.tooltip)!=null&&a.showLabelsInTooltips){const r=e[0],{label:s}=(r==null?void 0:r.dataset)??{};return s}},ht=(e,t)=>{var o;const{raw:a,dataset:r}=e??{},s=a==null?void 0:a.label,n=(o=t==null?void 0:t.tooltip)==null?void 0:o.scientificNotation;return`${s??(r==null?void 0:r.label)} ( x: ${Z(a==null?void 0:a.x,n)} , y: ${Z(a==null?void 0:a.y,n)} )`},mt=e=>{var t,a,r;return{enabled:(t=e==null?void 0:e.tooltip)==null?void 0:t.enabled,callbacks:{title:s=>gt(s,e),label:s=>ht(s,e)},backgroundColor:(a=e==null?void 0:e.tooltip)==null?void 0:a.backgroundColor,displayColors:(r=e==null?void 0:e.tooltip)==null?void 0:r.displayColors,padding:7}},F=({options:e,axisType:t=u.X,currentScale:a})=>{var C,T,p,b,L,f,w,y,M;const r=ke(e.direction),s=a||((T=(C=e==null?void 0:e.axes)==null?void 0:C[t])==null?void 0:T[0]),n=r&&t===u.Y||!r&&t===u.X,o=(s==null?void 0:s.gridLines)||{},x=()=>{var l;const c=r?u.Y:u.X;return t===c?(l=e==null?void 0:e.additionalAxesOptions)==null?void 0:l.reverse:!1},S=()=>{const c=e==null?void 0:e.additionalAxesOptions;return{...{stepSize:(s==null?void 0:s.stepSize)??(t===u.Y?c==null?void 0:c.stepSize:void 0)},includeBounds:!1,font:{size:je}}};return{type:De.Linear,position:s==null?void 0:s.position,beginAtZero:(p=e==null?void 0:e.additionalAxesOptions)==null?void 0:p.beginAtZero,reverse:x(),suggestedMax:(b=e==null?void 0:e.additionalAxesOptions)==null?void 0:b.suggestedMax,suggestedMin:(L=e==null?void 0:e.additionalAxesOptions)==null?void 0:L.suggestedMin,min:n?(f=e==null?void 0:e.additionalAxesOptions)==null?void 0:f.min:void 0,max:n?(w=e==null?void 0:e.additionalAxesOptions)==null?void 0:w.max:void 0,title:{display:!!((y=s==null?void 0:s.label)!=null&&y.length)||!!((M=s==null?void 0:s.unit)!=null&&M.length),text:(s==null?void 0:s.label)||(s==null?void 0:s.unit),padding:0},ticks:S(),grid:{...o}}},bt=e=>{const t=F({options:e,axisType:u.X}),a=F({options:e,axisType:u.Y});return{x:t,y:a}},ft=(e,t)=>{const{data:a,options:r}=e,{interactions:s,chartStyling:n}=r,[o,x]=ye.useState(!1),{legend:S,customLegendPlugin:C,legendClick:T}=et({chartRef:t,options:r}),{state:p}=tt(),{annotation:b}=p,f=(c=>c.map((l,R)=>{const{borderWidth:E=st}=l??{},_e=parseFloat(String(E))||1,U=Me[R],We=l.borderColor??U,Be=l.backgroundColor??U;return{...l,borderWidth:_e,borderColor:We,backgroundColor:Be}}))(a.datasets),w=(c,l,R)=>{R.resetZoom()},y=(c,l)=>{if(o&&!(l!=null&&l.length)&&(x(!1),s.onUnhover&&s.onUnhover(c)),!o&&(l!=null&&l.length)&&(x(!0),s.onHover)){const{index:R,datasetIndex:E}=l[0];s.onHover(c,E,R,f)}},M={onClick:w,onHover:y,...n,interactions:{onLegendClick:T,onHover:y},scales:bt(e==null?void 0:e.options),animation:n.performanceMode?{duration:q.NO}:{duration:q.FAST,onComplete:s==null?void 0:s.onAnimationComplete},plugins:{legend:{...S,display:!1,events:[]},customLegendPlugin:C,title:He(r),annotation:at(b),chartAreaBorder:{borderColor:we},datalabels:{display:r.graph.showDataLabels},tooltip:mt(r)}};return{generatedDatasets:f,scatterOptions:M}};var d=(e=>(e[e.TopToBottom=0]="TopToBottom",e[e.BottomToTop=1]="BottomToTop",e[e.LeftToRight=2]="LeftToRight",e[e.RightToLeft=3]="RightToLeft",e[e.TopLeftToBottomRight=4]="TopLeftToBottomRight",e[e.BottomRightToTopLeft=5]="BottomRightToTopLeft",e[e.BottomLeftToTopRight=6]="BottomLeftToTopRight",e[e.TopRightToBottomLeft=7]="TopRightToBottomLeft",e))(d||{});const xt=e=>({display:(e==null?void 0:e.display)??!1,gradientColors:(e==null?void 0:e.gradientColors)??Pe,direction:(e==null?void 0:e.direction)??d.BottomLeftToTopRight}),Ct=e=>({width:(e==null?void 0:e.width)??z,height:(e==null?void 0:e.height)??z,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)||!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)||!1,performanceMode:(e==null?void 0:e.performanceMode)??!0,gradient:xt(e==null?void 0:e.gradient)}),Tt=e=>({enabled:(e==null?void 0:e.enabled)??!0,tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)||!1,backgroundColor:(e==null?void 0:e.backgroundColor)||"#333",displayColors:(e==null?void 0:e.displayColors)||!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),pt=e=>({showMinorGridlines:(e==null?void 0:e.showMinorGridlines)??!1,showDataLabels:(e==null?void 0:e.showDataLabels)??!1}),St=e=>({display:(e==null?void 0:e.display)??!0,useDataset:(e==null?void 0:e.useDataset)||!1,position:(e==null?void 0:e.position)||Ne.BottomLeft,align:(e==null?void 0:e.align)||Ee.Center}),Lt=e=>({enableZoom:(e==null?void 0:e.enableZoom)||!1,enablePan:(e==null?void 0:e.enablePan)||!1}),yt=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover,onAnimationComplete:e==null?void 0:e.onAnimationComplete}),Rt=e=>({labels:(e==null?void 0:e.labels)||[],datasets:(e==null?void 0:e.datasets)||[]}),Ot=e=>e?e.map(t=>({...t,display:(t==null?void 0:t.display)??!0})):[],_t=e=>({showAnnotations:(e==null?void 0:e.showAnnotations)??!0,controlAnnotation:(e==null?void 0:e.controlAnnotation)||!1,annotationsData:Ot(e==null?void 0:e.annotationsData)}),Wt=e=>({x:(e==null?void 0:e.x)||[{}],y:(e==null?void 0:e.y)||[{}]}),Bt=e=>({reverse:(e==null?void 0:e.reverse)||!1,stacked:(e==null?void 0:e.stacked)||!1,beginAtZero:(e==null?void 0:e.beginAtZero)??!0,stepSize:e==null?void 0:e.stepSize,suggestedMin:e==null?void 0:e.suggestedMin,suggestedMax:e==null?void 0:e.suggestedMax,min:e==null?void 0:e.min,max:e==null?void 0:e.max}),Re=e=>{const t=(e==null?void 0:e.chart)||{},a=(t==null?void 0:t.options)||{};return{testId:(t==null?void 0:t.testId)??null,data:Rt(t==null?void 0:t.data),options:{title:(a==null?void 0:a.title)||"",axes:Wt(a==null?void 0:a.axes),additionalAxesOptions:Bt(a==null?void 0:a.additionalAxesOptions),direction:(a==null?void 0:a.direction)||rt.VERTICAL,chartStyling:Ct(a==null?void 0:a.chartStyling),tooltip:Tt(a==null?void 0:a.tooltip),graph:pt(a==null?void 0:a.graph),legend:St(a==null?void 0:a.legend),annotations:_t(a==null?void 0:a.annotations),chartOptions:Lt(a==null?void 0:a.chartOptions),interactions:yt(a==null?void 0:a.interactions)}}},vt=(e,t)=>{switch(e){case d.TopToBottom:return[t.left,t.top,t.left,t.bottom];case d.BottomToTop:return[t.left,t.bottom,t.left,t.top];case d.LeftToRight:return[t.left,t.top,t.right,t.top];case d.RightToLeft:return[t.right,t.top,t.left,t.top];case d.TopLeftToBottomRight:return[t.left,t.top,t.right,t.bottom];case d.BottomRightToTopLeft:return[t.right,t.bottom,t.left,t.top];case d.BottomLeftToTopRight:return[t.left,t.bottom,t.right,t.top];case d.TopRightToBottomLeft:return[t.right,t.top,t.left,t.bottom];default:return[t.left,t.bottom,t.right,t.top]}},At={id:"gradientBackgroundPlugin",beforeDraw:e=>{const{ctx:t,chartArea:a,options:r}=e;if(!t||!a)return;const s=r==null?void 0:r.gradient,{display:n=!1,gradientColors:o,direction:x=d.BottomLeftToTopRight}=s??{};if(!n||!o||o.length===0)return;const[S,C,T,p]=vt(x,a),b=t.createLinearGradient(S,C,T,p);o.forEach(({offset:L,color:f})=>{b.addColorStop(L,f)}),t.save(),t.globalCompositeOperation="destination-over",t.fillStyle=b,t.fillRect(a.left,a.top,a.right-a.left,a.bottom-a.top),t.restore()}},kt="_chart_1qlu1_1",Dt="_canvas_1qlu1_11",jt="_fixedHeight_1qlu1_20",Ht="_stretchHeight_1qlu1_26",wt="_squareAspectRatio_1qlu1_32",Y={chart:kt,canvas:Dt,fixedHeight:jt,stretchHeight:Ht,squareAspectRatio:wt};Fe.register(Ye,Ve,Xe,$e,Je,Qe,Ke,Ge,dt,At);const Mt=e=>{Ue();const t=ye.useRef(null),a=Re(e),{options:r,testId:s}=a,{scatterOptions:n,generatedDatasets:o}=ft(a,t);return g.jsx("div",{className:qe(r.chartStyling,Y),style:{width:r.chartStyling.width,height:r.chartStyling.height},"data-testid":s,children:g.jsx(lt,{backend:ot,context:window,children:g.jsxs("div",{className:Y.canvas,id:"canvas",children:[g.jsx(ze,{ref:t,data:{datasets:o},options:n,plugins:Ze(r.graph,r.legend)}),!!o.length&&g.jsx(nt,{chartRef:t,legendConfig:{options:r,generatedDatasets:o,chartType:ct.SCATTER}})]})})})},N=e=>{const{options:t}=Re(e);return g.jsx(Ie,{options:t,children:g.jsx(Mt,{...e})})};N.__docgenInfo={description:"",methods:[],displayName:"ScatterChartWithLegend",props:{chart:{required:!0,tsType:{name:"IScatterChartData"},description:""},testId:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""}}};const h=["label 1","label 2","label 3"],m={label:"Dataset 1",data:[{x:1,y:5},{x:3,y:7},{x:6,y:2},{x:8,y:6},{x:9,y:4}]},P={label:"Dataset 2",data:[{x:1,y:3},{x:4,y:5},{x:7,y:9},{x:10,y:2},{x:12,y:7}]},Et={label:"Dataset 3",data:[{x:2,y:8},{x:5,y:6},{x:8,y:10},{x:11,y:5},{x:14,y:9}]},Oe={label:"Dataset 4",data:[{x:2,y:8},{x:14,y:9}]},Nt={label:"Dataset 5",data:[{x:14,y:7,label:"Echo"},{x:3,y:18,label:"Lima"},{x:19,y:2,label:"Romeo"},{x:8,y:11,label:"Charlie"},{x:12,y:9,label:"Oscar"}]},Pt={label:"Dataset 6",data:[{x:15,y:3,label:"Hotel"},{x:9,y:14,label:"Tango"},{x:4,y:17,label:"Whiskey"},{x:11,y:7,label:"Juliet"},{x:13,y:1,label:"Zulu"}]},It={label:"Dataset Decimals",data:[{x:4.30021321123002,y:2.30021321123005},{x:5.12321321000003,y:3.23213210000037}]},I={data:{labels:h,datasets:[m]}},Ut={data:{labels:h,datasets:[m]},options:{chartStyling:{height:300,width:700}}},qt={data:{labels:h,datasets:[m,P,Et]}},zt={data:{labels:h,datasets:[m]},options:{title:"With Data Labels",graph:{showDataLabels:!0}}},Zt={data:{labels:h,datasets:[m,P,It]},options:{title:"With Tooltips",tooltip:{title:"Tooltip",showLabelsInTooltips:!0}}},Ft={data:{labels:h,datasets:[{...m,backgroundColor:"red",borderColor:"red"}]}},Yt={data:{labels:h,datasets:[m]},options:{title:"With Annotation",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"y",label:"Horizontal Annotation",value:2.5,color:"rgba(96, 32, 196, 0.5)"}]}}},Vt={data:{labels:h,datasets:[m,P,Oe]},options:{title:"With Axes Labels",axes:{x:[{label:"x axis"}],y:[{label:"y axis"}]}}},Xt={...I,options:{title:"With Gradient",chartStyling:{gradient:{display:!0}}}},$t={data:{datasets:[Nt,Pt,Oe]},options:{title:"With datapoint label showing when hovered",tooltip:{showLabelsInTooltips:!0}}},ra={title:"ScatterChart",component:N,args:{chart:I}},i=e=>g.jsx(N,{...e}),O=i.bind({});O.args={chart:I};const _=i.bind({});_.args={chart:Ut};const W=i.bind({});W.args={chart:qt};const B=i.bind({});B.args={chart:zt};const v=i.bind({});v.args={chart:Zt};const A=i.bind({});A.args={chart:Yt};const k=i.bind({});k.args={chart:Vt};const D=i.bind({});D.args={chart:Xt};const j=i.bind({});j.args={chart:$t};const H=i.bind({});H.args={chart:Ft};var V,X,$;O.parameters={...O.parameters,docs:{...(V=O.parameters)==null?void 0:V.docs,source:{originalSource:`args => {
2
2
  return <ScatterChart
3
3
  // eslint-disable-next-line react/jsx-props-no-spreading
4
4
  {...args} />;
@@ -15,6 +15,7 @@ export interface ICommonDataset {
15
15
  backgroundColor?: string | string[];
16
16
  borderWidth?: number;
17
17
  data: ICommonDataValue[];
18
+ hidden?: boolean;
18
19
  }
19
20
  export interface ICommonScales extends Partial<Record<string, LinearScaleOptions>> {
20
21
  x: LinearScaleOptions;
@@ -1,8 +1,9 @@
1
1
  import { Chart } from 'chart.js';
2
2
  import { TLegendDataset, TLegendDatasets } from '../legend-interface';
3
3
  import { RESET_STATE, TOGGLE_DATA_VISIBILITY } from './legend-action-types';
4
- import { ICommonAnnotationElement } from '../../common.interface';
4
+ import { ICommonAnnotationElement, ICommonDataset } from '../../common.interface';
5
5
  export interface ILegendState {
6
+ datasets: ICommonDataset[];
6
7
  annotation: ICommonAnnotationElement[];
7
8
  }
8
9
  export type TLegendAction = {
package/dist/iframe.html CHANGED
@@ -509,7 +509,7 @@
509
509
  }
510
510
  </script>
511
511
 
512
- <script type="module" crossorigin src="./assets/iframe-B41g-Bdk.js"></script>
512
+ <script type="module" crossorigin src="./assets/iframe-8p0_GgKU.js"></script>
513
513
  </head>
514
514
 
515
515
  <body>
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import * as React from "react";
7
7
  import React__default, { forwardRef, useRef, useEffect, createContext as createContext$1, memo, useLayoutEffect, useState, useCallback, useMemo, isValidElement, cloneElement, useContext, useReducer } from "react";
8
8
  import { round as round$1, displayNumber, isCloseTo, roundByMagnitude } from "@oliasoft-open-source/units";
9
9
  import cx from "classnames";
10
- import { isEmpty, isNil, startCase, isArray as isArray$1, some, has, cloneDeep, defaultTo, findIndex, set as set$1, debounce as debounce$2, map as map$2, find, get as get$1, noop as noop$2 } from "lodash";
10
+ import { isEmpty, isNil, startCase, isArray as isArray$1, some, has, cloneDeep, defaultTo, set as set$1, findIndex, debounce as debounce$2, map as map$2, find, get as get$1, noop as noop$2 } from "lodash";
11
11
  import { produce } from "immer";
12
12
  import { Portal, Icon, Menu, Tooltip as Tooltip$1, Button, Popover, Field, InputGroup, NumberInput, InputGroupAddon, Select, ButtonGroup, Spacer, Flex, Text } from "@oliasoft-open-source/react-ui-library";
13
13
  /*!
@@ -22993,44 +22993,55 @@ const computeEllipseGeometry = (ellipsePoints, xScale, yScale) => {
22993
22993
  const cy = yScale.getPixelForValue(centerY);
22994
22994
  return { cx: cx2, cy, radiusX, radiusY, angle };
22995
22995
  };
22996
+ const shouldExecute = (chart2) => {
22997
+ return chart2.data.datasets.some(
22998
+ (dataset) => dataset.data.some(
22999
+ (item) => !!item.ellipsePoints
23000
+ )
23001
+ );
23002
+ };
22996
23003
  const ellipsisAnnotationPlugin = {
22997
23004
  id: "ellipsisAnnotationPlugin",
22998
23005
  afterDatasetsDraw(chart2) {
22999
- var _a2, _b2;
23006
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
23007
+ if (!shouldExecute(chart2)) return;
23000
23008
  const ctx = chart2 == null ? void 0 : chart2.ctx;
23001
23009
  const xScale = (_a2 = chart2 == null ? void 0 : chart2.scales) == null ? void 0 : _a2.x;
23002
23010
  const yScale = (_b2 = chart2 == null ? void 0 : chart2.scales) == null ? void 0 : _b2.y;
23003
- ctx.save();
23004
23011
  const chartArea = chart2 == null ? void 0 : chart2.chartArea;
23005
- if (chartArea) {
23006
- ctx.beginPath();
23007
- ctx.rect(
23008
- chartArea.left,
23009
- chartArea.top,
23010
- chartArea.right - chartArea.left,
23011
- chartArea.bottom - chartArea.top
23012
- );
23013
- ctx.clip();
23014
- }
23015
- chart2.data.datasets.forEach((dataset) => {
23012
+ if (!xScale || !yScale || !chartArea) return;
23013
+ (_c = ctx == null ? void 0 : ctx.save) == null ? void 0 : _c.call(ctx);
23014
+ (_d = ctx == null ? void 0 : ctx.beginPath) == null ? void 0 : _d.call(ctx);
23015
+ (_e = ctx == null ? void 0 : ctx.rect) == null ? void 0 : _e.call(
23016
+ ctx,
23017
+ chartArea.left,
23018
+ chartArea.top,
23019
+ chartArea.right - chartArea.left,
23020
+ chartArea.bottom - chartArea.top
23021
+ );
23022
+ (_f = ctx == null ? void 0 : ctx.clip) == null ? void 0 : _f.call(ctx);
23023
+ (_h = (_g = chart2 == null ? void 0 : chart2.data) == null ? void 0 : _g.datasets) == null ? void 0 : _h.forEach((dataset) => {
23024
+ var _a3;
23016
23025
  const customDataset = dataset;
23017
- customDataset.data.forEach((item) => {
23018
- const { ellipsePoints } = item;
23026
+ (_a3 = customDataset == null ? void 0 : customDataset.data) == null ? void 0 : _a3.forEach((item) => {
23027
+ var _a4, _b3, _c2, _d2, _e2;
23028
+ const { ellipsePoints } = item ?? {};
23019
23029
  if (!ellipsePoints) return;
23020
23030
  const { cx: cx2, cy, radiusX, radiusY, angle } = computeEllipseGeometry(
23021
23031
  ellipsePoints,
23022
23032
  xScale,
23023
23033
  yScale
23024
23034
  );
23025
- ctx.save();
23026
- ctx.beginPath();
23027
- ctx.ellipse(cx2, cy, radiusX, radiusY, angle, 0, 2 * Math.PI);
23035
+ (_a4 = ctx == null ? void 0 : ctx.save) == null ? void 0 : _a4.call(ctx);
23036
+ (_b3 = ctx == null ? void 0 : ctx.beginPath) == null ? void 0 : _b3.call(ctx);
23037
+ (_c2 = ctx == null ? void 0 : ctx.ellipse) == null ? void 0 : _c2.call(ctx, cx2, cy, radiusX, radiusY, angle, 0, 2 * Math.PI);
23028
23038
  ctx.strokeStyle = customDataset.borderColor || DEFAULT_COLOR;
23029
23039
  ctx.lineWidth = customDataset.borderWidth || 1;
23030
- ctx.stroke();
23031
- ctx.restore();
23040
+ (_d2 = ctx == null ? void 0 : ctx.stroke) == null ? void 0 : _d2.call(ctx);
23041
+ (_e2 = ctx == null ? void 0 : ctx.restore) == null ? void 0 : _e2.call(ctx);
23032
23042
  });
23033
23043
  });
23044
+ (_i = ctx == null ? void 0 : ctx.restore) == null ? void 0 : _i.call(ctx);
23034
23045
  }
23035
23046
  };
23036
23047
  const chart$3 = "_chart_e3qdd_1";
@@ -25379,8 +25390,8 @@ const getAxisTypeFromKey = (string) => {
25379
25390
  return ((_a2 = string == null ? void 0 : string.match(/[^0-9/]+/gi)) == null ? void 0 : _a2[0]) ?? "";
25380
25391
  };
25381
25392
  const isPrimitiveValue = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null;
25382
- const getChartKey = (state, options, languageKey) => {
25383
- return hash({ state, options, languageKey }, { unorderedObjects: true });
25393
+ const getChartKey = (state, languageKey) => {
25394
+ return hash({ state, languageKey }, { unorderedObjects: true });
25384
25395
  };
25385
25396
  const useChartFunctions = ({
25386
25397
  chartRef,
@@ -26659,6 +26670,7 @@ const getDraggableData = (options) => {
26659
26670
  const TOGGLE_DATA_VISIBILITY = "TOGGLE_DATA_VISIBILITY";
26660
26671
  const RESET_STATE = "RESET_STATE";
26661
26672
  const legendInitialState = {
26673
+ datasets: [],
26662
26674
  annotation: []
26663
26675
  };
26664
26676
  const legendReducer = (state, action) => {
@@ -26678,6 +26690,11 @@ const legendReducer = (state, action) => {
26678
26690
  );
26679
26691
  if (datasetIndex >= 0) {
26680
26692
  chartInstance == null ? void 0 : chartInstance.setDatasetVisibility(datasetIndex, !isDatasetVisible);
26693
+ set$1(
26694
+ updatedState,
26695
+ ["datasets", datasetIndex, "hidden"],
26696
+ isDatasetVisible
26697
+ );
26681
26698
  if (dataset == null ? void 0 : dataset.displayGroup) {
26682
26699
  const group = dataset.displayGroup;
26683
26700
  datasets.forEach((ds, ix) => {
@@ -26686,6 +26703,7 @@ const legendReducer = (state, action) => {
26686
26703
  Number(ix),
26687
26704
  !isDatasetVisible
26688
26705
  );
26706
+ set$1(updatedState, ["datasets", ix, "hidden"], isDatasetVisible);
26689
26707
  }
26690
26708
  });
26691
26709
  }
@@ -26954,6 +26972,15 @@ const useLegendState = ({ chartRef, options }) => {
26954
26972
  interactions: { onLegendClick },
26955
26973
  legend: { customLegend }
26956
26974
  } = options ?? {};
26975
+ useEffect(() => {
26976
+ var _a2;
26977
+ (_a2 = state == null ? void 0 : state.datasets) == null ? void 0 : _a2.forEach((ds, ix) => {
26978
+ var _a3, _b2;
26979
+ const isHidden2 = (ds == null ? void 0 : ds.hidden) ?? false;
26980
+ (_a3 = chartRef == null ? void 0 : chartRef.current) == null ? void 0 : _a3.setDatasetVisibility(Number(ix), !isHidden2);
26981
+ (_b2 = chartRef == null ? void 0 : chartRef.current) == null ? void 0 : _b2.update();
26982
+ });
26983
+ }, [state]);
26957
26984
  const legendClick = useCallback(
26958
26985
  (_2, legendItem2) => {
26959
26986
  var _a2;
@@ -28075,19 +28102,21 @@ const createLegendStyle = (legendPosition, chart2) => {
28075
28102
  };
28076
28103
  const LegendItems = ({
28077
28104
  items,
28105
+ legendState,
28078
28106
  datasets,
28079
28107
  legendClick,
28080
28108
  chartType
28081
28109
  }) => /* @__PURE__ */ jsx("div", { className: styles$3.legendItems, children: items == null ? void 0 : items.map((item, index2) => {
28082
- var _a2;
28110
+ var _a2, _b2, _c;
28083
28111
  if ((_a2 = datasets == null ? void 0 : datasets[item == null ? void 0 : item.datasetIndex]) == null ? void 0 : _a2.hideLegend) {
28084
28112
  return null;
28085
28113
  }
28114
+ const isHidden2 = (_c = (_b2 = legendState == null ? void 0 : legendState.datasets) == null ? void 0 : _b2[item == null ? void 0 : item.datasetIndex]) == null ? void 0 : _c.hidden;
28086
28115
  return /* @__PURE__ */ jsx(
28087
28116
  LegendItem,
28088
28117
  {
28089
28118
  index: index2,
28090
- hidden: item == null ? void 0 : item.hidden,
28119
+ hidden: isHidden2 ?? (item == null ? void 0 : item.hidden),
28091
28120
  dataset: datasets == null ? void 0 : datasets[item == null ? void 0 : item.datasetIndex],
28092
28121
  handleClick: (_2) => legendClick(_2, item),
28093
28122
  chartType
@@ -28105,6 +28134,7 @@ const LegendPanel = forwardRef(
28105
28134
  chartRef,
28106
28135
  options
28107
28136
  });
28137
+ const { state: legendState } = useLegend() ?? {};
28108
28138
  const [legendEnabled, setLegendEnabled] = useState((legend2 == null ? void 0 : legend2.display) ?? true);
28109
28139
  const items = useGeneratedLabels(chartRef, generatedDatasets);
28110
28140
  const style = createLegendStyle(legendPosition, chart2);
@@ -28132,6 +28162,7 @@ const LegendPanel = forwardRef(
28132
28162
  LegendItems,
28133
28163
  {
28134
28164
  items,
28165
+ legendState,
28135
28166
  datasets,
28136
28167
  legendClick,
28137
28168
  chartType
@@ -28392,7 +28423,7 @@ const LineChart = (props) => {
28392
28423
  ] }) })
28393
28424
  ]
28394
28425
  },
28395
- getChartKey(state, options, languageKey)
28426
+ getChartKey(state, languageKey)
28396
28427
  );
28397
28428
  };
28398
28429
  const LineChartWithLegend = (props) => {
@@ -1,16 +1,12 @@
1
- import { Dispatch, RefObject } from '../../../../node_modules/react';
2
- import { Chart } from 'chart.js';
3
1
  import { IState } from '../state/state.interfaces';
4
2
  import { ILineChartOptions } from '../line-chart.interface';
5
3
  interface IUseChartState {
6
- chartRef: RefObject<Chart>;
7
4
  options: ILineChartOptions;
8
5
  state: IState;
9
- dispatch: Dispatch<any>;
10
6
  persistenceId?: string;
11
7
  }
12
8
  /**
13
9
  * Hook for managing the state of the chart.
14
10
  */
15
- export declare const useChartState: ({ chartRef, options, state, dispatch, persistenceId, }: IUseChartState) => void;
11
+ export declare const useChartState: ({ options, state, persistenceId, }: IUseChartState) => void;
16
12
  export {};
@@ -1,5 +1,3 @@
1
- import { RefObject } from '../../../../../node_modules/react';
2
- import { Chart } from 'chart.js';
3
1
  import { ILineChartOptions, TGeneratedLineChartDatasets } from '../../line-chart.interface';
4
2
  import { IState } from '../../state/state.interfaces';
5
3
  /**
@@ -8,4 +6,4 @@ import { IState } from '../../state/state.interfaces';
8
6
  * - supports optional padding when `autoAxisPadding` is set
9
7
  * - otherwise does not set min/max (falls back to chart.js default)
10
8
  */
11
- export declare const autoScale: (options: ILineChartOptions, state: IState, generatedDatasets: TGeneratedLineChartDatasets, chartRef: RefObject<Chart>) => {};
9
+ export declare const autoScale: (options: ILineChartOptions, state: IState, generatedDatasets: TGeneratedLineChartDatasets) => {};
@@ -1,5 +1,5 @@
1
- import { ILineRange } from '../line-chart.interface';
2
1
  import { TPrimitive } from '../../common/common.interface';
2
+ import { IState } from '../state/state.interfaces';
3
3
  export declare const toNum: (value: string | number) => any;
4
4
  export declare const isLessThanMax: (value: string | number, max: string | number) => boolean;
5
5
  export declare const isGreaterThanMin: (value: string | number, min: string | number) => boolean;
@@ -17,16 +17,8 @@ export declare const generateAxisId: (axisType: string, index?: number, hasMulti
17
17
  @returns {string} e.g. x1 => x
18
18
  */
19
19
  export declare const getAxisTypeFromKey: (string: string) => string;
20
- /**
21
- * Generates a key based on an array of values. The key changes
22
- * if any of the values in the array change.
23
- */
24
- export declare const generateKey: (values: Array<any>) => string;
25
20
  /**
26
21
  * Checks if a value is a primitive value (which includes strings, numbers, booleans, and null).
27
22
  */
28
23
  export declare const isPrimitiveValue: (value: TPrimitive) => value is string | number | boolean | null;
29
- /**
30
- * Validates a range object to ensure none of its properties are null, undefined, or empty strings.
31
- */
32
- export declare const isRangeValid: (r?: ILineRange) => boolean;
24
+ export declare const getChartKey: (state: IState, languageKey: string) => string;
@@ -1,18 +1,19 @@
1
1
  import { ActiveElement, Chart, Chart as ChartJS, ChartEvent, LegendItem, Plugin, TooltipItem } from 'chart.js';
2
- import { IPieDataValue, IPiesDataLabelsOptions } from './pie-chart.interface';
2
+ import { IGeneratedPieChartDataset, IPieDataValue, IPiesDataLabelsOptions } from './pie-chart.interface';
3
3
  import { IPieChartDefaultProps } from './pie-chart-defalut-props.interface';
4
4
  import { UnusedParameter } from '../common/common.interface';
5
5
  interface ILegendPlugin extends Plugin {
6
6
  chart?: Chart;
7
7
  }
8
8
  export declare const usePieChartConfig: (chart: IPieChartDefaultProps) => {
9
- generatedDatasets: {
9
+ generatedDatasets: IGeneratedPieChartDataset[] | {
10
10
  borderWidth: number;
11
11
  borderColor: string;
12
12
  backgroundColor: string | string[];
13
13
  data: IPieDataValue[];
14
14
  hideLegend?: boolean;
15
15
  label?: string;
16
+ hidden?: boolean;
16
17
  }[];
17
18
  getTitle: () => {
18
19
  display: boolean;
package/dist/project.json CHANGED
@@ -1 +1 @@
1
- {"generatedAt":1747126158209,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@storybook/testing-library":"0.2.2","eslint-plugin-vitest":null,"eslint-plugin-vitest-globals":"1.5.0","vitest":"3.1.3"},"hasRouterPackage":false,"packageManager":{"type":"yarn","agent":"yarn"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","portableStoriesFileCount":0,"applicationFileCount":0,"storybookVersion":"8.6.12","storybookVersionSpecifier":"^8.6.12","language":"javascript","storybookPackages":{"@storybook/blocks":{"version":"8.6.12"},"@storybook/react":{"version":"8.6.12"},"@storybook/react-vite":{"version":"8.6.12"},"@storybook/testing-library":{"version":"0.2.2"},"eslint-plugin-storybook":{"version":"0.12.0"},"storybook":{"version":"8.6.12"}},"addons":{"@storybook/addon-actions":{"version":"8.6.12"},"@storybook/addon-docs":{"version":"8.6.12"},"storybook-dark-mode":{"version":"4.0.2"},"@storybook/addon-mdx-gfm":{"version":"8.6.12"}}}
1
+ {"generatedAt":1747234870191,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@storybook/testing-library":"0.2.2","eslint-plugin-vitest":null,"eslint-plugin-vitest-globals":"1.5.0","vitest":"3.1.3"},"hasRouterPackage":false,"packageManager":{"type":"yarn","agent":"yarn"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","portableStoriesFileCount":0,"applicationFileCount":0,"storybookVersion":"8.6.12","storybookVersionSpecifier":"^8.6.12","language":"javascript","storybookPackages":{"@storybook/blocks":{"version":"8.6.12"},"@storybook/react":{"version":"8.6.12"},"@storybook/react-vite":{"version":"8.6.12"},"@storybook/testing-library":{"version":"0.2.2"},"eslint-plugin-storybook":{"version":"0.12.0"},"storybook":{"version":"8.6.12"}},"addons":{"@storybook/addon-actions":{"version":"8.6.12"},"@storybook/addon-docs":{"version":"8.6.12"},"storybook-dark-mode":{"version":"4.0.2"},"@storybook/addon-mdx-gfm":{"version":"8.6.12"}}}
@@ -15,6 +15,7 @@ export interface ICommonDataset {
15
15
  backgroundColor?: string | string[];
16
16
  borderWidth?: number;
17
17
  data: ICommonDataValue[];
18
+ hidden?: boolean;
18
19
  }
19
20
  export interface ICommonScales extends Partial<Record<string, LinearScaleOptions>> {
20
21
  x: LinearScaleOptions;
@@ -1,8 +1,9 @@
1
1
  import { Chart } from 'chart.js';
2
2
  import { TLegendDataset, TLegendDatasets } from '../legend-interface';
3
3
  import { RESET_STATE, TOGGLE_DATA_VISIBILITY } from './legend-action-types';
4
- import { ICommonAnnotationElement } from '../../common.interface';
4
+ import { ICommonAnnotationElement, ICommonDataset } from '../../common.interface';
5
5
  export interface ILegendState {
6
+ datasets: ICommonDataset[];
6
7
  annotation: ICommonAnnotationElement[];
7
8
  }
8
9
  export type TLegendAction = {
@@ -1,4 +1,3 @@
1
- import { ILineChartOptions } from '../line-chart.interface';
2
1
  import { TPrimitive } from '../../common/common.interface';
3
2
  import { IState } from '../state/state.interfaces';
4
3
  export declare const toNum: (value: string | number) => any;
@@ -22,4 +21,4 @@ export declare const getAxisTypeFromKey: (string: string) => string;
22
21
  * Checks if a value is a primitive value (which includes strings, numbers, booleans, and null).
23
22
  */
24
23
  export declare const isPrimitiveValue: (value: TPrimitive) => value is string | number | boolean | null;
25
- export declare const getChartKey: (state: IState, options: ILineChartOptions, languageKey: string) => string;
24
+ export declare const getChartKey: (state: IState, languageKey: string) => string;
@@ -1,18 +1,19 @@
1
1
  import { ActiveElement, Chart, Chart as ChartJS, ChartEvent, LegendItem, Plugin, TooltipItem } from 'chart.js';
2
- import { IPieDataValue, IPiesDataLabelsOptions } from './pie-chart.interface';
2
+ import { IGeneratedPieChartDataset, IPieDataValue, IPiesDataLabelsOptions } from './pie-chart.interface';
3
3
  import { IPieChartDefaultProps } from './pie-chart-defalut-props.interface';
4
4
  import { UnusedParameter } from '../common/common.interface';
5
5
  interface ILegendPlugin extends Plugin {
6
6
  chart?: Chart;
7
7
  }
8
8
  export declare const usePieChartConfig: (chart: IPieChartDefaultProps) => {
9
- generatedDatasets: {
9
+ generatedDatasets: IGeneratedPieChartDataset[] | {
10
10
  borderWidth: number;
11
11
  borderColor: string;
12
12
  backgroundColor: string | string[];
13
13
  data: IPieDataValue[];
14
14
  hideLegend?: boolean;
15
15
  label?: string;
16
+ hidden?: boolean;
16
17
  }[];
17
18
  getTitle: () => {
18
19
  display: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "5.1.2",
3
+ "version": "5.1.3-beta-2",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
6
6
  "resolutions": {