@oliasoft-open-source/charts-library 5.5.0 → 5.6.1

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 (43) hide show
  1. package/dist/assets/{Color-AVL7NMMY-DslOJdIH.js → Color-AVL7NMMY-BhIWok9f.js} +1 -1
  2. package/dist/assets/{DocsRenderer-PQXLIZUC-BiQzcNLO.js → DocsRenderer-PQXLIZUC-l5sNhr4I.js} +2 -2
  3. package/dist/assets/bar-chart.stories-DFidSeui.js +145 -0
  4. package/dist/assets/client-wRWi0_mZ.js +1 -0
  5. package/dist/assets/{components-prYN4JAE.js → components-Chhe1HuF.js} +1 -1
  6. package/dist/assets/{get-draggableData-1oZD82KQ.js → get-draggableData-CgSzQCju.js} +2 -2
  7. package/dist/assets/{iframe-DomYTowy.js → iframe-cITPFXiZ.js} +5 -5
  8. package/dist/assets/{legend-C854veju.js → legend-DREhMczt.js} +142 -123
  9. package/dist/assets/legend-context-BNa2-E_P.js +28 -0
  10. package/dist/assets/line-chart-iy0xMQat.js +1 -0
  11. package/dist/assets/line-chart.stories-ZXuIC102.js +1207 -0
  12. package/dist/assets/line-chart.test-case.stories-BKahQPMm.js +1545 -0
  13. package/dist/assets/pie-chart.stories-DzIuCVdV.js +45 -0
  14. package/dist/assets/{react-18-BE1hRK-o.js → react-18-Dekepht0.js} +1 -1
  15. package/dist/assets/{react-Di-Jgalc.js → react-Cwqzj5I1.js} +1 -1
  16. package/dist/assets/scatter-chart.stories-BMyGRe3F.js +41 -0
  17. package/dist/common/common.interface.d.ts +3 -0
  18. package/dist/common/helpers/callout-helpers/callout-helpers.d.ts +6 -0
  19. package/dist/common/helpers/enums.d.ts +2 -1
  20. package/dist/common/helpers/get-chart-annotation.d.ts +5 -3
  21. package/dist/common/helpers/get-chart-from-ctx.d.ts +1 -0
  22. package/dist/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +1 -0
  23. package/dist/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +7 -0
  24. package/dist/common/plugins/annotation-dragger-plugin/enums.d.ts +2 -1
  25. package/dist/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +1 -1
  26. package/dist/iframe.html +1 -1
  27. package/dist/index.js +18 -14
  28. package/dist/index.json +1 -1
  29. package/dist/line-chart/hooks/use-chart-options.d.ts +4 -1
  30. package/dist/line-chart/plugins/callout-plugin/callout-plugin.d.ts +11 -0
  31. package/dist/line-chart/plugins/callout-plugin/helpers.d.ts +26 -0
  32. package/dist/project.json +1 -1
  33. package/dist/src/components/common/hooks/use-update-annotations.d.ts +0 -3
  34. package/package.json +3 -4
  35. package/dist/assets/bar-chart.stories-BSrCvMWq.js +0 -145
  36. package/dist/assets/client-pKq9BHla.js +0 -1
  37. package/dist/assets/legend-context-1H9KQ-2n.js +0 -47
  38. package/dist/assets/line-chart-CraAaKF1.js +0 -1
  39. package/dist/assets/line-chart.stories-DyM3ZVYD.js +0 -1174
  40. package/dist/assets/line-chart.test-case.stories-BHdzgxeT.js +0 -430
  41. package/dist/assets/pie-chart.stories-B395IqJr.js +0 -45
  42. package/dist/assets/scatter-chart.stories-upN9mASr.js +0 -41
  43. /package/dist/assets/{bar-chart-const-D_44J3Hs.js → bar-chart-const-KaipikFs.js} +0 -0
@@ -0,0 +1,1545 @@
1
+ import{_t as e,at as t,dt as n}from"./iframe-cITPFXiZ.js";import{rt as r}from"./legend-context-BNa2-E_P.js";import{T as i,y as a}from"./legend-DREhMczt.js";import"./get-draggableData-CgSzQCju.js";import{t as o}from"./line-chart-iy0xMQat.js";var s=e(n(),1),c={controlsPortalId:`chartOne-plan-view-chart-controls`,data:{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:[]}]}]},options:{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:[]}}},l=e(t(),1),u=[{label:`Dataset 1`,data:[{x:0,y:0},{x:5,y:25}]}],d={data:{datasets:u},options:{title:`Chart title`,chartStyling:{height:`100%`}}},f={title:`LineChart / Test Cases`,component:o,args:{chart:d}};const p=()=>(0,l.jsx)(o,{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}}}}),m=()=>(0,l.jsx)(o,{chart:c}),h=()=>{let[e,t]=(0,s.useState)(u),[n,a]=(0,s.useState)(0),[c,d]=(0,s.useState)(!1),[f,p]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[g,_]=(0,s.useState)(!0),[v,y]=(0,s.useState)(`linear`),[b,x]=(0,s.useState)(!1),S=(0,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:2,color:`red`,label:`Draggable Point`,labelConfig:{font:`bold 8px ${r}`,color:`rgba(0,0,0,0.7)`}}]},chartStyling:{height:`100%`,squareAspectRatio:g},additionalAxesOptions:{chartScaleType:v},legend:{display:!1}}),[e,g,v]),C=(0,s.useMemo)(()=>({data:{datasets:e},options:S}),[e,S]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,marginBottom:16},children:[(0,l.jsx)(i,{label:`Reset to Initial State`,colored:!0,onClick:()=>{t(u),a(e=>e+1),p(!0),x(!1)}}),(0,l.jsx)(i,{label:`Async Dataset + Unmount`,onClick:()=>{h(!0);let e=[];for(let n=0;n<50;n++)setTimeout(()=>{e.push({label:`DS ${n+1}`,data:[{x:n,y:Math.random()*100},{x:n+1,y:Math.random()*100}],borderColor:`hsl(${n*(360/50)}, 100%, 50%)`}),t([...e]),n===15&&(console.warn(`Forcing unmount mid-update`),p(!1)),n===25&&(console.warn(`Remounting chart`),p(!0),a(e=>e+1)),n===49&&(console.log(`Async injection complete`),h(!1))},n*40)},disabled:m}),(0,l.jsx)(i,{label:`Set Invalid Dataset`,onClick:()=>{t([{label:`Broken Dataset`,borderColor:`red`}])}}),(0,l.jsx)(i,{label:`Set Empty Dataset`,onClick:()=>{t([])}}),(0,l.jsx)(i,{label:`Mixed Data Formats`,onClick:()=>{t([{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`}])}}),(0,l.jsx)(i,{label:`Bad Axis Ref`,onClick:()=>{t([{label:`Bad Y Axis Ref`,yAxisID:`y-missing`,data:[{x:1,y:1},{x:2,y:2}],borderColor:`purple`}])}}),(0,l.jsx)(i,{label:`Toggle size`,onClick:()=>d(!c)}),(0,l.jsx)(i,{label:`Toggle Axis Type`,onClick:()=>{y(e=>e===`linear`?`logarithmic`:`linear`)}}),(0,l.jsx)(i,{label:`Toggle Aspect Ratio`,onClick:()=>{_(e=>!e)}}),(0,l.jsx)(i,{label:`Spam Re-renders`,onClick:()=>{let e=0,t=setInterval(()=>{a(e=>e+1),e++,e===100&&clearInterval(t)},30)}}),(0,l.jsx)(i,{label:f?`Unmount Chart`:`Remount Chart`,onClick:()=>p(e=>!e)}),(0,l.jsx)(i,{label:`Manual Re-render`,onClick:()=>a(e=>e+1)}),(0,l.jsx)(i,{label:`Empty Dataset`,onClick:()=>t([])}),(0,l.jsx)(i,{label:`Add 5k Points Slowly`,onClick:()=>{t([{label:`Big 5k Points`,data:Array.from({length:5e3},(e,t)=>({x:t,y:Math.sin(t/100)*100})),borderColor:`orange`}])}}),(0,l.jsx)(i,{label:`Dataset With Invalid Point`,onClick:()=>{t([{label:`Corrupt Point Dataset`,data:[{x:0,y:10},{x:1},{y:20},null,void 0,`bad-value`,{x:5,y:50}],borderColor:`red`}])}}),(0,l.jsx)(i,{label:`Malformed Dataset Combo`,onClick:()=>{t([{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`}])}}),(0,l.jsx)(i,{label:`Cycle Big Load (Async)`,onClick:()=>{let e=[];for(let t=0;t<4;t++){let n=Array.from({length:3e3},(e,t)=>({x:t,y:Math.random()*100}));e.push({label:`Stream DS ${t+1}`,data:n,borderColor:`hsl(${t*90}, 100%, 50%)`})}let n=0,r=setInterval(()=>{t(e.slice(0,n+1)),n++,n===e.length&&clearInterval(r)},500)}}),(0,l.jsx)(i,{label:`Timed Unmount During Drag`,onClick:()=>{x(!0),p(!0),setTimeout(()=>{p(!1),x(!1)},5e3)},disabled:b})]}),b&&(0,l.jsx)(`span`,{style:{color:`crimson`,fontWeight:`bold`},children:`⏱ Unmounting in 5s – start dragging!`}),(0,l.jsx)(`div`,{style:{height:c?300:null,width:c?300:null,padding:`var(--padding)`,overflow:`auto`},children:f?(0,l.jsx)(o,{chart:C},n):(0,l.jsx)(`div`,{style:{padding:40,textAlign:`center`},children:`Chart unmounted`})})]})},g=()=>{let[e,t]=(0,s.useState)([{type:`point`,labelOffsetPx:50,xValue:2,yValue:100,radius:4,color:`rgba(128, 128, 128, 1)`,pointStyle:`triangle`,label:`annotation 1`,labelConfig:{position:`right`,color:`rgba(128, 128, 128, 1)`,callout:{enabled:!0}}}]),[n,r]=(0,s.useState)(`annotation 1`),i=[{label:`16/9-C-16`,lineTension:0,borderColor:`#e25112`,pointBackgroundColor:`#e25112`,pointHoverRadius:0,pointHitRadius:0,pointRadius:2,pointBorderWidth:2,borderWidth:2,fill:!1,data:[{y:0,x:0,label:[]},{y:30,x:0,label:[]},{y:60,x:0,label:[]},{y:90,x:0,label:[]},{y:120,x:0,label:[]},{y:150,x:0,label:[]},{y:180,x:0,label:[]},{y:210,x:0,label:[]},{y:240,x:0,label:[]},{y:270,x:0,label:[]},{y:300,x:0,label:[]},{y:330,x:0,label:[]},{y:360,x:0,label:[]},{y:390,x:0,label:[]},{y:400,x:0,label:[]},{y:419.9982,x:.1453,label:[]},{y:449.9718,x:.9078,label:[]},{y:479.8845,x:2.3231,label:[]},{y:509.6999,x:4.3892,label:[]},{y:539.3817,x:7.1038,label:[]},{y:568.8936,x:10.4635,label:[]},{y:569.3544,x:10.5213,label:[]},{y:598.3054,x:14.1545,label:[]},{y:627.7172,x:17.8456,label:[]},{y:657.1289,x:21.5367,label:[]},{y:686.5407,x:25.2278,label:[]},{y:715.9525,x:28.9188,label:[]},{y:745.3643,x:32.6099,label:[]},{y:804.1878,x:39.992,label:[]},{y:833.5996,x:43.6831,label:[]},{y:863.0113,x:47.3742,label:[]},{y:892.4231,x:51.0653,label:[]},{y:921.8349,x:54.7563,label:[]},{y:951.2467,x:58.4474,label:[]},{y:980.6584,x:62.1385,label:[]},{y:1010.0674,x:65.7954,label:[]},{y:1039.4763,x:69.4299,label:[]},{y:1068.8881,x:73.0986,label:[]},{y:1098.2999,x:76.7897,label:[]},{y:1127.7116,x:80.4807,label:[]},{y:1157.1234,x:84.1718,label:[]},{y:1186.5352,x:87.8629,label:[]},{y:1215.947,x:91.554,label:[]},{y:1245.3587,x:95.245,label:[]},{y:1274.7705,x:98.9361,label:[]},{y:1304.1823,x:102.6272,label:[]},{y:1333.5941,x:106.3183,label:[]},{y:1363.0058,x:110.0093,label:[]},{y:1392.4176,x:113.7004,label:[]},{y:1421.8294,x:117.3915,label:[]},{y:1451.2411,x:121.0825,label:[]},{y:1480.6529,x:124.7736,label:[]},{y:1510.0647,x:128.4647,label:[]},{y:1539.4765,x:132.1558,label:[]},{y:1568.8882,x:135.8468,label:[]},{y:1598.3,x:139.5379,label:[]},{y:1627.7118,x:143.229,label:[]},{y:1657.1236,x:146.9201,label:[]},{y:1686.5353,x:150.6111,label:[]},{y:1715.9471,x:154.3022,label:[]},{y:1745.3589,x:157.9933,label:[]},{y:1774.7706,x:161.6843,label:[]},{y:1804.1824,x:165.3754,label:[]},{y:1833.5942,x:169.0665,label:[]},{y:1863.006,x:172.7576,label:[]},{y:1892.4177,x:176.4486,label:[]},{y:1903.9079,x:177.8906,label:[]},{y:1921.8305,x:180.284,label:[]},{y:1951.2325,x:184.8347,label:[]},{y:1980.5894,x:190.1546,label:[]},{y:2009.8654,x:196.2372,label:[]},{y:2039.0247,x:203.0751,label:[]},{y:2068.0319,x:210.6599,label:[]},{y:2096.8516,x:218.9825,label:[]},{y:2125.4487,x:228.0327,label:[]},{y:2153.7883,x:237.7994,label:[]},{y:2181.836,x:248.2708,label:[]},{y:2209.5576,x:259.434,label:[]},{y:2236.9192,x:271.2756,label:[]},{y:2263.8876,x:283.781,label:[]},{y:2290.4299,x:296.935,label:[]},{y:2316.5138,x:310.7217,label:[]},{y:2342.1074,x:325.1241,label:[]},{y:2367.1796,x:340.1249,label:[]},{y:2391.6999,x:355.7056,label:[]},{y:2415.6384,x:371.8473,label:[]},{y:2438.9658,x:388.5303,label:[]},{y:2461.6539,x:405.7344,label:[]},{y:2483.6749,x:423.4384,label:[]},{y:2505.0021,x:441.621,label:[]},{y:2525.6093,x:460.2599,label:[]},{y:2545.4716,x:479.3325,label:[]},{y:2550.4401,x:484.2884,label:[]},{y:2564.5931,x:499.1889,label:[]},{y:2582.9606,x:520.6713,label:[]},{y:2600.4389,x:543.6622,label:[]},{y:2616.8951,x:567.9865,label:[]},{y:2632.2039,x:593.4591,label:[]},{y:2646.2488,x:619.8861,label:[]},{y:2657.1619,x:643.0591,label:[]},{y:2658.9386,x:647.0604,label:[]},{y:2671.1078,x:674.4667,label:[]},{y:2683.277,x:701.8731,label:[]},{y:2695.4463,x:729.2794,label:[]},{y:2707.6155,x:756.6858,label:[]},{y:2719.7847,x:784.0921,label:[]},{y:2731.954,x:811.4984,label:[]},{y:2744.1232,x:838.9048,label:[]},{y:2756.2924,x:866.3111,label:[]},{y:2768.4617,x:893.7174,label:[]},{y:2780.6309,x:921.1238,label:[]},{y:2792.8001,x:948.5301,label:[]},{y:2804.9693,x:975.9365,label:[]},{y:2817.1386,x:1003.3428,label:[]},{y:2829.3078,x:1030.7491,label:[]},{y:2841.477,x:1058.1555,label:[]},{y:2853.6463,x:1085.5618,label:[]},{y:2865.8155,x:1112.9682,label:[]},{y:2877.9847,x:1140.3745,label:[]},{y:2890.1539,x:1167.7808,label:[]},{y:2902.3232,x:1195.1872,label:[]},{y:2914.4924,x:1222.5935,label:[]},{y:2926.6616,x:1249.9999,label:[]},{y:2938.8309,x:1277.4062,label:[]},{y:2951.0001,x:1304.8125,label:[]},{y:2963.1693,x:1332.2189,label:[]},{y:2975.3386,x:1359.6252,label:[]},{y:2987.5078,x:1387.0316,label:[]},{y:2999.677,x:1414.4379,label:[]},{y:3011.8462,x:1441.8442,label:[]},{y:3024.0155,x:1469.2506,label:[]},{y:3036.1847,x:1496.6569,label:[]},{y:3048.3539,x:1524.0632,label:[]},{y:3060.5232,x:1551.4696,label:[]},{y:3072.6924,x:1578.8759,label:[]},{y:3084.8616,x:1606.2823,label:[]},{y:3097.0309,x:1633.6886,label:[]},{y:3109.2001,x:1661.0949,label:[]},{y:3133.5385,x:1715.9076,label:[]},{y:3145.7078,x:1743.314,label:[]},{y:3157.877,x:1770.7203,label:[]},{y:3170.0462,x:1798.1266,label:[]},{y:3182.1915,x:1825.5436,label:[]},{y:3206.4821,x:1880.3775,label:[]},{y:3218.6513,x:1907.7838,label:[]},{y:3242.9898,x:1962.5965,label:[]},{y:3303.8876,x:2098.6264,label:[]},{y:3316.0671,x:2125.8324,label:[]},{y:3328.2364,x:2153.2388,label:[]},{y:3340.4056,x:2180.6451,label:[]},{y:3352.5748,x:2208.0514,label:[]},{y:3364.744,x:2235.4578,label:[]},{y:3376.9133,x:2262.8641,label:[]},{y:3389.0825,x:2290.2705,label:[]},{y:3401.2517,x:2317.6768,label:[]},{y:3413.421,x:2345.0831,label:[]},{y:3425.5902,x:2372.4895,label:[]},{y:3437.7594,x:2399.8958,label:[]},{y:3449.9287,x:2427.3022,label:[]},{y:3462.0979,x:2454.7085,label:[]},{y:3472.1213,x:2477.2822,label:[]},{y:3474.2312,x:2482.1309,label:[]},{y:3484.8166,x:2510.1876,label:[]},{y:3493.0003,x:2539.0391,label:[]},{y:3498.72,x:2568.4657,label:[]},{y:3499.9842,x:2577.6599,label:[]},{y:3502.5335,x:2598.189,label:[]},{y:3506.2262,x:2627.9269,label:[]},{y:3509.919,x:2657.6648,label:[]},{y:3513.6118,x:2687.4026,label:[]},{y:3517.3045,x:2717.1405,label:[]},{y:3520.9973,x:2746.8784,label:[]},{y:3524.6901,x:2776.6163,label:[]},{y:3528.3828,x:2806.3542,label:[]},{y:3532.0756,x:2836.0921,label:[]},{y:3535.7684,x:2865.83,label:[]},{y:3539.4612,x:2895.5679,label:[]},{y:3543.1539,x:2925.3058,label:[]},{y:3546.8467,x:2955.0436,label:[]},{y:3550.5395,x:2984.7815,label:[]},{y:3554.2322,x:3014.5194,label:[]},{y:3557.925,x:3044.2573,label:[]},{y:3561.6178,x:3073.9952,label:[]},{y:3565.3105,x:3103.7331,label:[]},{y:3569.0033,x:3133.471,label:[]},{y:3572.6961,x:3163.2089,label:[]},{y:3576.3888,x:3192.9467,label:[]},{y:3580.0816,x:3222.6846,label:[]},{y:3583.7744,x:3252.4225,label:[]},{y:3587.4671,x:3282.1604,label:[]},{y:3591.1599,x:3311.8983,label:[]},{y:3594.8527,x:3341.6362,label:[]},{y:3598.5455,x:3371.3741,label:[]},{y:3599.9856,x:3382.9719,label:[]},{y:3602.2382,x:3401.112,label:[]},{y:3605.931,x:3430.8499,label:[]},{y:3609.6238,x:3460.5877,label:[]},{y:3613.3165,x:3490.3256,label:[]},{y:3617.0093,x:3520.0635,label:[]},{y:3620.7021,x:3549.8014,label:[]},{y:3624.3948,x:3579.5393,label:[]},{y:3628.0876,x:3609.2772,label:[]},{y:3631.7804,x:3639.0151,label:[]},{y:3635.4731,x:3668.753,label:[]},{y:3639.1659,x:3698.4909,label:[]},{y:3642.8587,x:3728.2287,label:[]},{y:3646.5514,x:3757.9666,label:[]},{y:3650.2442,x:3787.7045,label:[]},{y:3653.937,x:3817.4424,label:[]},{y:3657.6298,x:3847.1803,label:[]},{y:3661.3225,x:3876.9182,label:[]},{y:3665.0153,x:3906.6561,label:[]},{y:3668.7081,x:3936.394,label:[]},{y:3672.4008,x:3966.1318,label:[]},{y:3676.0936,x:3995.8697,label:[]},{y:3679.7864,x:4025.6076,label:[]},{y:3683.4791,x:4055.3455,label:[]},{y:3687.1719,x:4085.0834,label:[]},{y:3690.8647,x:4114.8213,label:[]},{y:3694.5574,x:4144.5592,label:[]},{y:3698.2502,x:4174.2971,label:[]},{y:3701.943,x:4204.035,label:[]},{y:3705.6357,x:4233.7728,label:[]},{y:3709.3285,x:4263.5107,label:[]},{y:3713.0213,x:4293.2486,label:[]},{y:3716.7141,x:4322.9865,label:[]},{y:3720.4068,x:4352.7244,label:[]},{y:3724.0996,x:4382.4623,label:[]},{y:3727.7924,x:4412.2002,label:[]},{y:3731.4851,x:4441.9381,label:[]},{y:3735.1779,x:4471.676,label:[]},{y:3738.8707,x:4501.4138,label:[]},{y:3742.5634,x:4531.1517,label:[]},{y:3746.2562,x:4560.8896,label:[]},{y:3749.949,x:4590.6275,label:[]},{y:3753.6417,x:4620.3654,label:[]},{y:3757.3345,x:4650.1033,label:[]},{y:3761.0273,x:4679.8412,label:[]},{y:3764.72,x:4709.5791,label:[]},{y:3768.4128,x:4739.3169,label:[]},{y:3772.1056,x:4769.0548,label:[]},{y:3775.7984,x:4798.7927,label:[]},{y:3779.4911,x:4828.5306,label:[]},{y:3783.1839,x:4858.2685,label:[]},{y:3786.8767,x:4888.0064,label:[]},{y:3790.5694,x:4917.7443,label:[]},{y:3794.2622,x:4947.4822,label:[]},{y:3797.955,x:4977.2201,label:[]},{y:3801.6477,x:5006.9579,label:[]},{y:3805.3405,x:5036.6958,label:[]},{y:3809.0333,x:5066.4337,label:[]},{y:3809.7189,x:5067.0389,label:[]},{y:3810.7189,x:5067.0389,label:[]}],wellOffset:[-3.4,.11]}];return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:16,alignItems:`center`},children:[(0,l.jsx)(`span`,{children:`Label for first annotation:`}),(0,l.jsx)(`input`,{value:n,onChange:e=>{let n=e.target.value;r(n),t(e=>e.map((e,t)=>t===0?{...e,label:n}:e))},style:{padding:4,minWidth:180}}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>{t(e=>{let t=e.length,n=i[0].data,r={type:`point`,labelOffsetPx:50,xValue:n[t]?.x??n[n.length-1].x,yValue:100+t*10,radius:4,color:`rgba(128, 128, 128, 1)`,pointStyle:`triangle`,label:`annotation ${t+1}`,labelConfig:{position:`right`,color:`rgba(128, 128, 128, 1)`,callout:{enabled:!0}}};return[...e,r]})},children:`Add annotation`})]}),(0,l.jsx)(o,{chart:{...d,data:{datasets:i},options:{...d.options,legend:{display:!1},annotations:{showAnnotations:!0,enableDragAnnotation:!0,enableCalloutAnnotation:!0,annotationsData:e}}}})]})};p.__docgenInfo={description:``,methods:[],displayName:`PartialRangeWithSimilarValues`},m.__docgenInfo={description:``,methods:[],displayName:`closeToValueInDifferentAxes`},h.__docgenInfo={description:``,methods:[],displayName:`StressTest`},g.__docgenInfo={description:``,methods:[],displayName:`DynamicCalloutAnnotations`},p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`() => {
2
+ return <LineChart chart={{
3
+ data: {
4
+ datasets: [{
5
+ label: 'Duration %',
6
+ lineTension: '0',
7
+ pointHitRadius: 10,
8
+ borderColor: '#dc3912',
9
+ pointBackgroundColor: '#dc3912',
10
+ borderWidth: 2,
11
+ pointRadius: 4,
12
+ data: [{
13
+ x: 3,
14
+ y: 0
15
+ }, {
16
+ x: 3,
17
+ y: 100
18
+ }],
19
+ yAxisID: 'y2'
20
+ }]
21
+ },
22
+ options: {
23
+ direction: 'vertical',
24
+ axes: {
25
+ x: [{
26
+ label: 'Duration (TempSim long) [d]',
27
+ position: 'bottom'
28
+ }],
29
+ y: [{
30
+ label: 'Probability'
31
+ }, {
32
+ label: 'Percentage [%]'
33
+ }]
34
+ },
35
+ annotations: {
36
+ annotationsData: [{
37
+ annotationAxis: 'y2',
38
+ color: 'darkgrey',
39
+ value: 16
40
+ }, {
41
+ displayDragCoordinates: false,
42
+ color: '#ff9900',
43
+ label: 'P16',
44
+ dragAxis: 'y',
45
+ enableDrag: true,
46
+ resizable: false,
47
+ type: 'box',
48
+ xMax: 3,
49
+ xMin: 3,
50
+ yMax: 17,
51
+ yMin: 15,
52
+ yScaleID: 'y2'
53
+ }, {
54
+ annotationAxis: 'y2',
55
+ color: 'darkgrey',
56
+ value: 66
57
+ }, {
58
+ displayDragCoordinates: false,
59
+ color: '#109618',
60
+ label: 'P66',
61
+ dragAxis: 'y',
62
+ enableDrag: true,
63
+ resizable: false,
64
+ type: 'box',
65
+ xMax: 3,
66
+ xMin: 3,
67
+ yMax: 67,
68
+ yMin: 65,
69
+ yScaleID: 'y2'
70
+ }, {
71
+ annotationAxis: 'y2',
72
+ color: 'darkgrey',
73
+ value: 78
74
+ }, {
75
+ displayDragCoordinates: false,
76
+ color: '#990099',
77
+ label: 'P78',
78
+ dragAxis: 'y',
79
+ enableDrag: true,
80
+ resizable: false,
81
+ type: 'box',
82
+ xMax: 3,
83
+ xMin: 3,
84
+ yMax: 79,
85
+ yMin: 77,
86
+ yScaleID: 'y2'
87
+ }, {
88
+ annotationAxis: 'y2',
89
+ color: 'darkgrey',
90
+ value: 90
91
+ }, {
92
+ displayDragCoordinates: false,
93
+ color: '#0099c6',
94
+ label: 'P90',
95
+ dragAxis: 'y',
96
+ enableDrag: true,
97
+ resizable: false,
98
+ type: 'box',
99
+ xMax: 3,
100
+ xMin: 3,
101
+ yMax: 91,
102
+ yMin: 89,
103
+ yScaleID: 'y2'
104
+ }],
105
+ enableDragAnnotation: true,
106
+ showAnnotations: true
107
+ },
108
+ additionalAxesOptions: {
109
+ range: {
110
+ x: {
111
+ min: 3
112
+ }
113
+ },
114
+ chartScaleType: 'linear',
115
+ reverse: false
116
+ },
117
+ graph: {
118
+ showMinorGridlines: true
119
+ },
120
+ chartStyling: {
121
+ height: '100%'
122
+ },
123
+ chartOptions: {
124
+ showPoints: false,
125
+ enableDragAnnotation: true
126
+ }
127
+ }
128
+ }} />;
129
+ }`,...p.parameters?.docs?.source}}},m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`() => {
130
+ return <LineChart chart={planView} />;
131
+ }`,...m.parameters?.docs?.source}}},h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:`() => {
132
+ const [datasets, setDatasets] = useState(basicDS);
133
+ const [chartKey, setChartKey] = useState(0);
134
+ const [isSmall, setIsSmall] = useState(false);
135
+ const [showChart, setShowChart] = useState(true);
136
+ const [loading, setLoading] = useState(false);
137
+ const [aspectRatio, setAspectRatio] = useState(true);
138
+ const [xAxisType, setXAxisType] = useState('linear');
139
+ const [timerRunning, setTimerRunning] = useState(false);
140
+ const baseOptions = useMemo(() => ({
141
+ title: 'Stress Tester',
142
+ axes: {
143
+ x: [{
144
+ label: 'X Axis'
145
+ }],
146
+ y: [{
147
+ label: 'Y Axis'
148
+ }]
149
+ },
150
+ chartOptions: {
151
+ enableDragAnnotation: true
152
+ },
153
+ annotations: {
154
+ showAnnotations: true,
155
+ enableDragAnnotation: true,
156
+ annotationsData: [{
157
+ enableDrag: true,
158
+ type: 'box',
159
+ xMin: 3.5,
160
+ xMax: 4,
161
+ yMin: 5,
162
+ yMax: 10,
163
+ color: 'rgba(255, 0, 0, 0.3)',
164
+ label: 'DRAG ME!'
165
+ }, {
166
+ type: 'point',
167
+ enableDrag: true,
168
+ xValue: 1,
169
+ yValue: 10,
170
+ radius: DEFAULT_POINT_RADIUS,
171
+ color: 'red',
172
+ label: 'Draggable Point',
173
+ labelConfig: {
174
+ font: \`bold 8px \${DEFAULT_FONT_FAMILY}\`,
175
+ color: 'rgba(0,0,0,0.7)'
176
+ }
177
+ }]
178
+ },
179
+ chartStyling: {
180
+ height: '100%',
181
+ squareAspectRatio: aspectRatio
182
+ },
183
+ additionalAxesOptions: {
184
+ chartScaleType: xAxisType
185
+ },
186
+ legend: {
187
+ display: false
188
+ }
189
+ }), [datasets, aspectRatio, xAxisType]);
190
+ const chartConfig = useMemo(() => ({
191
+ data: {
192
+ datasets
193
+ },
194
+ options: baseOptions
195
+ }), [datasets, baseOptions]);
196
+ const startTimedUnmount = () => {
197
+ setTimerRunning(true);
198
+ setShowChart(true);
199
+ setTimeout(() => {
200
+ setShowChart(false);
201
+ setTimerRunning(false);
202
+ }, 5000);
203
+ };
204
+ const resetChart = () => {
205
+ setDatasets(basicDS);
206
+ setChartKey(k => k + 1);
207
+ setShowChart(true);
208
+ setTimerRunning(false);
209
+ };
210
+ const injectDatasetsAsync = () => {
211
+ setLoading(true);
212
+ const buffer = [];
213
+ const total = 50;
214
+ const delay = 40;
215
+ for (let i = 0; i < total; i++) {
216
+ setTimeout(() => {
217
+ buffer.push({
218
+ label: \`DS \${i + 1}\`,
219
+ data: [{
220
+ x: i,
221
+ y: Math.random() * 100
222
+ }, {
223
+ x: i + 1,
224
+ y: Math.random() * 100
225
+ }],
226
+ borderColor: \`hsl(\${i * (360 / total)}, 100%, 50%)\`
227
+ });
228
+ setDatasets([...buffer]);
229
+ if (i === 15) {
230
+ console.warn('Forcing unmount mid-update');
231
+ setShowChart(false);
232
+ }
233
+ if (i === 25) {
234
+ console.warn('Remounting chart');
235
+ setShowChart(true);
236
+ setChartKey(prev => prev + 1);
237
+ }
238
+ if (i === total - 1) {
239
+ console.log('Async injection complete');
240
+ setLoading(false);
241
+ }
242
+ }, i * delay);
243
+ }
244
+ };
245
+ const setInvalidDataset = () => {
246
+ setDatasets([{
247
+ label: 'Broken Dataset',
248
+ borderColor: 'red'
249
+ }]);
250
+ };
251
+ const setEmptyDataset = () => {
252
+ setDatasets([]);
253
+ };
254
+ const setMixedDataTypes = () => {
255
+ setDatasets([{
256
+ label: 'X/Y Points',
257
+ data: [{
258
+ x: 0,
259
+ y: 0
260
+ }, {
261
+ x: 1,
262
+ y: 1
263
+ }],
264
+ borderColor: 'green'
265
+ }, {
266
+ label: 'Y Only Array',
267
+ data: [2, 4, 6],
268
+ borderColor: 'blue'
269
+ }]);
270
+ };
271
+ const setMissingAxisRef = () => {
272
+ setDatasets([{
273
+ label: 'Bad Y Axis Ref',
274
+ yAxisID: 'y-missing',
275
+ data: [{
276
+ x: 1,
277
+ y: 1
278
+ }, {
279
+ x: 2,
280
+ y: 2
281
+ }],
282
+ borderColor: 'purple'
283
+ }]);
284
+ };
285
+ const addBigDataset = () => {
286
+ const data = Array.from({
287
+ length: 5000
288
+ }, (_, i) => ({
289
+ x: i,
290
+ y: Math.sin(i / 100) * 100
291
+ }));
292
+ setDatasets([{
293
+ label: 'Big 5k Points',
294
+ data,
295
+ borderColor: 'orange'
296
+ }]);
297
+ };
298
+ const addDatasetWithInvalidPoint = () => {
299
+ setDatasets([{
300
+ label: 'Corrupt Point Dataset',
301
+ data: [{
302
+ x: 0,
303
+ y: 10
304
+ }, {
305
+ x: 1
306
+ },
307
+ // missing y
308
+ {
309
+ y: 20
310
+ },
311
+ // missing x
312
+ null, undefined, 'bad-value', {
313
+ x: 5,
314
+ y: 50
315
+ }],
316
+ borderColor: 'red'
317
+ }]);
318
+ };
319
+ const addMalformedDatasetCombo = () => {
320
+ setDatasets([{
321
+ label: 'Valid A',
322
+ data: [{
323
+ x: 0,
324
+ y: 1
325
+ }, {
326
+ x: 1,
327
+ y: 2
328
+ }],
329
+ borderColor: 'blue'
330
+ }, {
331
+ label: 'Corrupt',
332
+ data: 'not-an-array',
333
+ borderColor: 'red'
334
+ }, {
335
+ label: 'Valid B',
336
+ data: [{
337
+ x: 0,
338
+ y: 3
339
+ }, {
340
+ x: 1,
341
+ y: 4
342
+ }],
343
+ borderColor: 'green'
344
+ }]);
345
+ };
346
+ const streamLargeData = () => {
347
+ const allDS = [];
348
+ for (let j = 0; j < 4; j++) {
349
+ const data = Array.from({
350
+ length: 3000
351
+ }, (_, i) => ({
352
+ x: i,
353
+ y: Math.random() * 100
354
+ }));
355
+ allDS.push({
356
+ label: \`Stream DS \${j + 1}\`,
357
+ data,
358
+ borderColor: \`hsl(\${j * 90}, 100%, 50%)\`
359
+ });
360
+ }
361
+ let step = 0;
362
+ const interval = setInterval(() => {
363
+ setDatasets(allDS.slice(0, step + 1));
364
+ step++;
365
+ if (step === allDS.length) clearInterval(interval);
366
+ }, 500);
367
+ };
368
+ const cycleXAxisType = () => {
369
+ setXAxisType(prev => prev === 'linear' ? 'logarithmic' : 'linear');
370
+ };
371
+ const toggleAspectRatio = () => {
372
+ setAspectRatio(prev => !prev);
373
+ };
374
+ const spamReRenders = () => {
375
+ let count = 0;
376
+ const interval = setInterval(() => {
377
+ setChartKey(prev => prev + 1);
378
+ count++;
379
+ if (count === 100) clearInterval(interval);
380
+ }, 30);
381
+ };
382
+ return <>
383
+ <div style={{
384
+ display: 'flex',
385
+ gap: 8,
386
+ flexWrap: 'wrap',
387
+ marginBottom: 16
388
+ }}>
389
+ <Button label="Reset to Initial State" colored onClick={resetChart} />
390
+ <Button label="Async Dataset + Unmount" onClick={injectDatasetsAsync} disabled={loading} />
391
+ <Button label="Set Invalid Dataset" onClick={setInvalidDataset} />
392
+ <Button label="Set Empty Dataset" onClick={setEmptyDataset} />
393
+ <Button label="Mixed Data Formats" onClick={setMixedDataTypes} />
394
+ <Button label="Bad Axis Ref" onClick={setMissingAxisRef} />
395
+ <Button label="Toggle size" onClick={() => setIsSmall(!isSmall)} />
396
+ <Button label="Toggle Axis Type" onClick={cycleXAxisType} />
397
+ <Button label="Toggle Aspect Ratio" onClick={toggleAspectRatio} />
398
+ <Button label="Spam Re-renders" onClick={spamReRenders} />
399
+ <Button label={showChart ? 'Unmount Chart' : 'Remount Chart'} onClick={() => setShowChart(s => !s)} />
400
+ <Button label="Manual Re-render" onClick={() => setChartKey(k => k + 1)} />
401
+ <Button label="Empty Dataset" onClick={() => setDatasets([])} />
402
+ <Button label="Add 5k Points Slowly" onClick={addBigDataset} />
403
+ <Button label="Dataset With Invalid Point" onClick={addDatasetWithInvalidPoint} />
404
+ <Button label="Malformed Dataset Combo" onClick={addMalformedDatasetCombo} />
405
+ <Button label="Cycle Big Load (Async)" onClick={streamLargeData} />
406
+ <Button label="Timed Unmount During Drag" onClick={startTimedUnmount} disabled={timerRunning} />
407
+ </div>
408
+
409
+ {timerRunning && <span style={{
410
+ color: 'crimson',
411
+ fontWeight: 'bold'
412
+ }}>
413
+ ⏱ Unmounting in 5s – start dragging!
414
+ </span>}
415
+
416
+ <div style={{
417
+ height: isSmall ? 300 : null,
418
+ width: isSmall ? 300 : null,
419
+ padding: 'var(--padding)',
420
+ overflow: 'auto'
421
+ }}>
422
+ {showChart ? <LineChart key={chartKey} chart={chartConfig} /> : <div style={{
423
+ padding: 40,
424
+ textAlign: 'center'
425
+ }}>
426
+ Chart unmounted
427
+ </div>}
428
+ </div>
429
+ </>;
430
+ }`,...h.parameters?.docs?.source}}},g.parameters={...g.parameters,docs:{...g.parameters?.docs,source:{originalSource:`() => {
431
+ const [annotations, setAnnotations] = useState([{
432
+ type: 'point',
433
+ labelOffsetPx: 50,
434
+ xValue: 2,
435
+ yValue: 100,
436
+ radius: 4,
437
+ color: 'rgba(128, 128, 128, 1)',
438
+ pointStyle: 'triangle',
439
+ label: 'annotation 1',
440
+ labelConfig: {
441
+ position: 'right',
442
+ color: 'rgba(128, 128, 128, 1)',
443
+ callout: {
444
+ enabled: true
445
+ }
446
+ }
447
+ }]);
448
+ const [labelInput, setLabelInput] = useState('annotation 1');
449
+ const dataset1 = [{
450
+ label: '16/9-C-16',
451
+ lineTension: 0,
452
+ borderColor: '#e25112',
453
+ pointBackgroundColor: '#e25112',
454
+ pointHoverRadius: 0,
455
+ pointHitRadius: 0,
456
+ pointRadius: 2,
457
+ pointBorderWidth: 2,
458
+ borderWidth: 2,
459
+ fill: false,
460
+ data: [{
461
+ y: 0,
462
+ x: 0,
463
+ label: []
464
+ }, {
465
+ y: 30,
466
+ x: 0,
467
+ label: []
468
+ }, {
469
+ y: 60,
470
+ x: 0,
471
+ label: []
472
+ }, {
473
+ y: 90,
474
+ x: 0,
475
+ label: []
476
+ }, {
477
+ y: 120,
478
+ x: 0,
479
+ label: []
480
+ }, {
481
+ y: 150,
482
+ x: 0,
483
+ label: []
484
+ }, {
485
+ y: 180,
486
+ x: 0,
487
+ label: []
488
+ }, {
489
+ y: 210,
490
+ x: 0,
491
+ label: []
492
+ }, {
493
+ y: 240,
494
+ x: 0,
495
+ label: []
496
+ }, {
497
+ y: 270,
498
+ x: 0,
499
+ label: []
500
+ }, {
501
+ y: 300,
502
+ x: 0,
503
+ label: []
504
+ }, {
505
+ y: 330,
506
+ x: 0,
507
+ label: []
508
+ }, {
509
+ y: 360,
510
+ x: 0,
511
+ label: []
512
+ }, {
513
+ y: 390,
514
+ x: 0,
515
+ label: []
516
+ }, {
517
+ y: 400,
518
+ x: 0,
519
+ label: []
520
+ }, {
521
+ y: 419.9982,
522
+ x: 0.1453,
523
+ label: []
524
+ }, {
525
+ y: 449.9718,
526
+ x: 0.9078,
527
+ label: []
528
+ }, {
529
+ y: 479.8845,
530
+ x: 2.3231,
531
+ label: []
532
+ }, {
533
+ y: 509.6999,
534
+ x: 4.3892,
535
+ label: []
536
+ }, {
537
+ y: 539.3817,
538
+ x: 7.1038,
539
+ label: []
540
+ }, {
541
+ y: 568.8936,
542
+ x: 10.4635,
543
+ label: []
544
+ }, {
545
+ y: 569.3544,
546
+ x: 10.5213,
547
+ label: []
548
+ }, {
549
+ y: 598.3054,
550
+ x: 14.1545,
551
+ label: []
552
+ }, {
553
+ y: 627.7172,
554
+ x: 17.8456,
555
+ label: []
556
+ }, {
557
+ y: 657.1289,
558
+ x: 21.5367,
559
+ label: []
560
+ }, {
561
+ y: 686.5407,
562
+ x: 25.2278,
563
+ label: []
564
+ }, {
565
+ y: 715.9525,
566
+ x: 28.9188,
567
+ label: []
568
+ }, {
569
+ y: 745.3643,
570
+ x: 32.6099,
571
+ label: []
572
+ }, {
573
+ y: 804.1878,
574
+ x: 39.992,
575
+ label: []
576
+ }, {
577
+ y: 833.5996,
578
+ x: 43.6831,
579
+ label: []
580
+ }, {
581
+ y: 863.0113,
582
+ x: 47.3742,
583
+ label: []
584
+ }, {
585
+ y: 892.4231,
586
+ x: 51.0653,
587
+ label: []
588
+ }, {
589
+ y: 921.8349,
590
+ x: 54.7563,
591
+ label: []
592
+ }, {
593
+ y: 951.2467,
594
+ x: 58.4474,
595
+ label: []
596
+ }, {
597
+ y: 980.6584,
598
+ x: 62.1385,
599
+ label: []
600
+ }, {
601
+ y: 1010.0674,
602
+ x: 65.7954,
603
+ label: []
604
+ }, {
605
+ y: 1039.4763,
606
+ x: 69.4299,
607
+ label: []
608
+ }, {
609
+ y: 1068.8881,
610
+ x: 73.0986,
611
+ label: []
612
+ }, {
613
+ y: 1098.2999,
614
+ x: 76.7897,
615
+ label: []
616
+ }, {
617
+ y: 1127.7116,
618
+ x: 80.4807,
619
+ label: []
620
+ }, {
621
+ y: 1157.1234,
622
+ x: 84.1718,
623
+ label: []
624
+ }, {
625
+ y: 1186.5352,
626
+ x: 87.8629,
627
+ label: []
628
+ }, {
629
+ y: 1215.947,
630
+ x: 91.554,
631
+ label: []
632
+ }, {
633
+ y: 1245.3587,
634
+ x: 95.245,
635
+ label: []
636
+ }, {
637
+ y: 1274.7705,
638
+ x: 98.9361,
639
+ label: []
640
+ }, {
641
+ y: 1304.1823,
642
+ x: 102.6272,
643
+ label: []
644
+ }, {
645
+ y: 1333.5941,
646
+ x: 106.3183,
647
+ label: []
648
+ }, {
649
+ y: 1363.0058,
650
+ x: 110.0093,
651
+ label: []
652
+ }, {
653
+ y: 1392.4176,
654
+ x: 113.7004,
655
+ label: []
656
+ }, {
657
+ y: 1421.8294,
658
+ x: 117.3915,
659
+ label: []
660
+ }, {
661
+ y: 1451.2411,
662
+ x: 121.0825,
663
+ label: []
664
+ }, {
665
+ y: 1480.6529,
666
+ x: 124.7736,
667
+ label: []
668
+ }, {
669
+ y: 1510.0647,
670
+ x: 128.4647,
671
+ label: []
672
+ }, {
673
+ y: 1539.4765,
674
+ x: 132.1558,
675
+ label: []
676
+ }, {
677
+ y: 1568.8882,
678
+ x: 135.8468,
679
+ label: []
680
+ }, {
681
+ y: 1598.3,
682
+ x: 139.5379,
683
+ label: []
684
+ }, {
685
+ y: 1627.7118,
686
+ x: 143.229,
687
+ label: []
688
+ }, {
689
+ y: 1657.1236,
690
+ x: 146.9201,
691
+ label: []
692
+ }, {
693
+ y: 1686.5353,
694
+ x: 150.6111,
695
+ label: []
696
+ }, {
697
+ y: 1715.9471,
698
+ x: 154.3022,
699
+ label: []
700
+ }, {
701
+ y: 1745.3589,
702
+ x: 157.9933,
703
+ label: []
704
+ }, {
705
+ y: 1774.7706,
706
+ x: 161.6843,
707
+ label: []
708
+ }, {
709
+ y: 1804.1824,
710
+ x: 165.3754,
711
+ label: []
712
+ }, {
713
+ y: 1833.5942,
714
+ x: 169.0665,
715
+ label: []
716
+ }, {
717
+ y: 1863.006,
718
+ x: 172.7576,
719
+ label: []
720
+ }, {
721
+ y: 1892.4177,
722
+ x: 176.4486,
723
+ label: []
724
+ }, {
725
+ y: 1903.9079,
726
+ x: 177.8906,
727
+ label: []
728
+ }, {
729
+ y: 1921.8305,
730
+ x: 180.284,
731
+ label: []
732
+ }, {
733
+ y: 1951.2325,
734
+ x: 184.8347,
735
+ label: []
736
+ }, {
737
+ y: 1980.5894,
738
+ x: 190.1546,
739
+ label: []
740
+ }, {
741
+ y: 2009.8654,
742
+ x: 196.2372,
743
+ label: []
744
+ }, {
745
+ y: 2039.0247,
746
+ x: 203.0751,
747
+ label: []
748
+ }, {
749
+ y: 2068.0319,
750
+ x: 210.6599,
751
+ label: []
752
+ }, {
753
+ y: 2096.8516,
754
+ x: 218.9825,
755
+ label: []
756
+ }, {
757
+ y: 2125.4487,
758
+ x: 228.0327,
759
+ label: []
760
+ }, {
761
+ y: 2153.7883,
762
+ x: 237.7994,
763
+ label: []
764
+ }, {
765
+ y: 2181.836,
766
+ x: 248.2708,
767
+ label: []
768
+ }, {
769
+ y: 2209.5576,
770
+ x: 259.434,
771
+ label: []
772
+ }, {
773
+ y: 2236.9192,
774
+ x: 271.2756,
775
+ label: []
776
+ }, {
777
+ y: 2263.8876,
778
+ x: 283.781,
779
+ label: []
780
+ }, {
781
+ y: 2290.4299,
782
+ x: 296.935,
783
+ label: []
784
+ }, {
785
+ y: 2316.5138,
786
+ x: 310.7217,
787
+ label: []
788
+ }, {
789
+ y: 2342.1074,
790
+ x: 325.1241,
791
+ label: []
792
+ }, {
793
+ y: 2367.1796,
794
+ x: 340.1249,
795
+ label: []
796
+ }, {
797
+ y: 2391.6999,
798
+ x: 355.7056,
799
+ label: []
800
+ }, {
801
+ y: 2415.6384,
802
+ x: 371.8473,
803
+ label: []
804
+ }, {
805
+ y: 2438.9658,
806
+ x: 388.5303,
807
+ label: []
808
+ }, {
809
+ y: 2461.6539,
810
+ x: 405.7344,
811
+ label: []
812
+ }, {
813
+ y: 2483.6749,
814
+ x: 423.4384,
815
+ label: []
816
+ }, {
817
+ y: 2505.0021,
818
+ x: 441.621,
819
+ label: []
820
+ }, {
821
+ y: 2525.6093,
822
+ x: 460.2599,
823
+ label: []
824
+ }, {
825
+ y: 2545.4716,
826
+ x: 479.3325,
827
+ label: []
828
+ }, {
829
+ y: 2550.4401,
830
+ x: 484.2884,
831
+ label: []
832
+ }, {
833
+ y: 2564.5931,
834
+ x: 499.1889,
835
+ label: []
836
+ }, {
837
+ y: 2582.9606,
838
+ x: 520.6713,
839
+ label: []
840
+ }, {
841
+ y: 2600.4389,
842
+ x: 543.6622,
843
+ label: []
844
+ }, {
845
+ y: 2616.8951,
846
+ x: 567.9865,
847
+ label: []
848
+ }, {
849
+ y: 2632.2039,
850
+ x: 593.4591,
851
+ label: []
852
+ }, {
853
+ y: 2646.2488,
854
+ x: 619.8861,
855
+ label: []
856
+ }, {
857
+ y: 2657.1619,
858
+ x: 643.0591,
859
+ label: []
860
+ }, {
861
+ y: 2658.9386,
862
+ x: 647.0604,
863
+ label: []
864
+ }, {
865
+ y: 2671.1078,
866
+ x: 674.4667,
867
+ label: []
868
+ }, {
869
+ y: 2683.277,
870
+ x: 701.8731,
871
+ label: []
872
+ }, {
873
+ y: 2695.4463,
874
+ x: 729.2794,
875
+ label: []
876
+ }, {
877
+ y: 2707.6155,
878
+ x: 756.6858,
879
+ label: []
880
+ }, {
881
+ y: 2719.7847,
882
+ x: 784.0921,
883
+ label: []
884
+ }, {
885
+ y: 2731.954,
886
+ x: 811.4984,
887
+ label: []
888
+ }, {
889
+ y: 2744.1232,
890
+ x: 838.9048,
891
+ label: []
892
+ }, {
893
+ y: 2756.2924,
894
+ x: 866.3111,
895
+ label: []
896
+ }, {
897
+ y: 2768.4617,
898
+ x: 893.7174,
899
+ label: []
900
+ }, {
901
+ y: 2780.6309,
902
+ x: 921.1238,
903
+ label: []
904
+ }, {
905
+ y: 2792.8001,
906
+ x: 948.5301,
907
+ label: []
908
+ }, {
909
+ y: 2804.9693,
910
+ x: 975.9365,
911
+ label: []
912
+ }, {
913
+ y: 2817.1386,
914
+ x: 1003.3428,
915
+ label: []
916
+ }, {
917
+ y: 2829.3078,
918
+ x: 1030.7491,
919
+ label: []
920
+ }, {
921
+ y: 2841.477,
922
+ x: 1058.1555,
923
+ label: []
924
+ }, {
925
+ y: 2853.6463,
926
+ x: 1085.5618,
927
+ label: []
928
+ }, {
929
+ y: 2865.8155,
930
+ x: 1112.9682,
931
+ label: []
932
+ }, {
933
+ y: 2877.9847,
934
+ x: 1140.3745,
935
+ label: []
936
+ }, {
937
+ y: 2890.1539,
938
+ x: 1167.7808,
939
+ label: []
940
+ }, {
941
+ y: 2902.3232,
942
+ x: 1195.1872,
943
+ label: []
944
+ }, {
945
+ y: 2914.4924,
946
+ x: 1222.5935,
947
+ label: []
948
+ }, {
949
+ y: 2926.6616,
950
+ x: 1249.9999,
951
+ label: []
952
+ }, {
953
+ y: 2938.8309,
954
+ x: 1277.4062,
955
+ label: []
956
+ }, {
957
+ y: 2951.0001,
958
+ x: 1304.8125,
959
+ label: []
960
+ }, {
961
+ y: 2963.1693,
962
+ x: 1332.2189,
963
+ label: []
964
+ }, {
965
+ y: 2975.3386,
966
+ x: 1359.6252,
967
+ label: []
968
+ }, {
969
+ y: 2987.5078,
970
+ x: 1387.0316,
971
+ label: []
972
+ }, {
973
+ y: 2999.677,
974
+ x: 1414.4379,
975
+ label: []
976
+ }, {
977
+ y: 3011.8462,
978
+ x: 1441.8442,
979
+ label: []
980
+ }, {
981
+ y: 3024.0155,
982
+ x: 1469.2506,
983
+ label: []
984
+ }, {
985
+ y: 3036.1847,
986
+ x: 1496.6569,
987
+ label: []
988
+ }, {
989
+ y: 3048.3539,
990
+ x: 1524.0632,
991
+ label: []
992
+ }, {
993
+ y: 3060.5232,
994
+ x: 1551.4696,
995
+ label: []
996
+ }, {
997
+ y: 3072.6924,
998
+ x: 1578.8759,
999
+ label: []
1000
+ }, {
1001
+ y: 3084.8616,
1002
+ x: 1606.2823,
1003
+ label: []
1004
+ }, {
1005
+ y: 3097.0309,
1006
+ x: 1633.6886,
1007
+ label: []
1008
+ }, {
1009
+ y: 3109.2001,
1010
+ x: 1661.0949,
1011
+ label: []
1012
+ }, {
1013
+ y: 3133.5385,
1014
+ x: 1715.9076,
1015
+ label: []
1016
+ }, {
1017
+ y: 3145.7078,
1018
+ x: 1743.314,
1019
+ label: []
1020
+ }, {
1021
+ y: 3157.877,
1022
+ x: 1770.7203,
1023
+ label: []
1024
+ }, {
1025
+ y: 3170.0462,
1026
+ x: 1798.1266,
1027
+ label: []
1028
+ }, {
1029
+ y: 3182.1915,
1030
+ x: 1825.5436,
1031
+ label: []
1032
+ }, {
1033
+ y: 3206.4821,
1034
+ x: 1880.3775,
1035
+ label: []
1036
+ }, {
1037
+ y: 3218.6513,
1038
+ x: 1907.7838,
1039
+ label: []
1040
+ }, {
1041
+ y: 3242.9898,
1042
+ x: 1962.5965,
1043
+ label: []
1044
+ }, {
1045
+ y: 3303.8876,
1046
+ x: 2098.6264,
1047
+ label: []
1048
+ }, {
1049
+ y: 3316.0671,
1050
+ x: 2125.8324,
1051
+ label: []
1052
+ }, {
1053
+ y: 3328.2364,
1054
+ x: 2153.2388,
1055
+ label: []
1056
+ }, {
1057
+ y: 3340.4056,
1058
+ x: 2180.6451,
1059
+ label: []
1060
+ }, {
1061
+ y: 3352.5748,
1062
+ x: 2208.0514,
1063
+ label: []
1064
+ }, {
1065
+ y: 3364.744,
1066
+ x: 2235.4578,
1067
+ label: []
1068
+ }, {
1069
+ y: 3376.9133,
1070
+ x: 2262.8641,
1071
+ label: []
1072
+ }, {
1073
+ y: 3389.0825,
1074
+ x: 2290.2705,
1075
+ label: []
1076
+ }, {
1077
+ y: 3401.2517,
1078
+ x: 2317.6768,
1079
+ label: []
1080
+ }, {
1081
+ y: 3413.421,
1082
+ x: 2345.0831,
1083
+ label: []
1084
+ }, {
1085
+ y: 3425.5902,
1086
+ x: 2372.4895,
1087
+ label: []
1088
+ }, {
1089
+ y: 3437.7594,
1090
+ x: 2399.8958,
1091
+ label: []
1092
+ }, {
1093
+ y: 3449.9287,
1094
+ x: 2427.3022,
1095
+ label: []
1096
+ }, {
1097
+ y: 3462.0979,
1098
+ x: 2454.7085,
1099
+ label: []
1100
+ }, {
1101
+ y: 3472.1213,
1102
+ x: 2477.2822,
1103
+ label: []
1104
+ }, {
1105
+ y: 3474.2312,
1106
+ x: 2482.1309,
1107
+ label: []
1108
+ }, {
1109
+ y: 3484.8166,
1110
+ x: 2510.1876,
1111
+ label: []
1112
+ }, {
1113
+ y: 3493.0003,
1114
+ x: 2539.0391,
1115
+ label: []
1116
+ }, {
1117
+ y: 3498.72,
1118
+ x: 2568.4657,
1119
+ label: []
1120
+ }, {
1121
+ y: 3499.9842,
1122
+ x: 2577.6599,
1123
+ label: []
1124
+ }, {
1125
+ y: 3502.5335,
1126
+ x: 2598.189,
1127
+ label: []
1128
+ }, {
1129
+ y: 3506.2262,
1130
+ x: 2627.9269,
1131
+ label: []
1132
+ }, {
1133
+ y: 3509.919,
1134
+ x: 2657.6648,
1135
+ label: []
1136
+ }, {
1137
+ y: 3513.6118,
1138
+ x: 2687.4026,
1139
+ label: []
1140
+ }, {
1141
+ y: 3517.3045,
1142
+ x: 2717.1405,
1143
+ label: []
1144
+ }, {
1145
+ y: 3520.9973,
1146
+ x: 2746.8784,
1147
+ label: []
1148
+ }, {
1149
+ y: 3524.6901,
1150
+ x: 2776.6163,
1151
+ label: []
1152
+ }, {
1153
+ y: 3528.3828,
1154
+ x: 2806.3542,
1155
+ label: []
1156
+ }, {
1157
+ y: 3532.0756,
1158
+ x: 2836.0921,
1159
+ label: []
1160
+ }, {
1161
+ y: 3535.7684,
1162
+ x: 2865.83,
1163
+ label: []
1164
+ }, {
1165
+ y: 3539.4612,
1166
+ x: 2895.5679,
1167
+ label: []
1168
+ }, {
1169
+ y: 3543.1539,
1170
+ x: 2925.3058,
1171
+ label: []
1172
+ }, {
1173
+ y: 3546.8467,
1174
+ x: 2955.0436,
1175
+ label: []
1176
+ }, {
1177
+ y: 3550.5395,
1178
+ x: 2984.7815,
1179
+ label: []
1180
+ }, {
1181
+ y: 3554.2322,
1182
+ x: 3014.5194,
1183
+ label: []
1184
+ }, {
1185
+ y: 3557.925,
1186
+ x: 3044.2573,
1187
+ label: []
1188
+ }, {
1189
+ y: 3561.6178,
1190
+ x: 3073.9952,
1191
+ label: []
1192
+ }, {
1193
+ y: 3565.3105,
1194
+ x: 3103.7331,
1195
+ label: []
1196
+ }, {
1197
+ y: 3569.0033,
1198
+ x: 3133.471,
1199
+ label: []
1200
+ }, {
1201
+ y: 3572.6961,
1202
+ x: 3163.2089,
1203
+ label: []
1204
+ }, {
1205
+ y: 3576.3888,
1206
+ x: 3192.9467,
1207
+ label: []
1208
+ }, {
1209
+ y: 3580.0816,
1210
+ x: 3222.6846,
1211
+ label: []
1212
+ }, {
1213
+ y: 3583.7744,
1214
+ x: 3252.4225,
1215
+ label: []
1216
+ }, {
1217
+ y: 3587.4671,
1218
+ x: 3282.1604,
1219
+ label: []
1220
+ }, {
1221
+ y: 3591.1599,
1222
+ x: 3311.8983,
1223
+ label: []
1224
+ }, {
1225
+ y: 3594.8527,
1226
+ x: 3341.6362,
1227
+ label: []
1228
+ }, {
1229
+ y: 3598.5455,
1230
+ x: 3371.3741,
1231
+ label: []
1232
+ }, {
1233
+ y: 3599.9856,
1234
+ x: 3382.9719,
1235
+ label: []
1236
+ }, {
1237
+ y: 3602.2382,
1238
+ x: 3401.112,
1239
+ label: []
1240
+ }, {
1241
+ y: 3605.931,
1242
+ x: 3430.8499,
1243
+ label: []
1244
+ }, {
1245
+ y: 3609.6238,
1246
+ x: 3460.5877,
1247
+ label: []
1248
+ }, {
1249
+ y: 3613.3165,
1250
+ x: 3490.3256,
1251
+ label: []
1252
+ }, {
1253
+ y: 3617.0093,
1254
+ x: 3520.0635,
1255
+ label: []
1256
+ }, {
1257
+ y: 3620.7021,
1258
+ x: 3549.8014,
1259
+ label: []
1260
+ }, {
1261
+ y: 3624.3948,
1262
+ x: 3579.5393,
1263
+ label: []
1264
+ }, {
1265
+ y: 3628.0876,
1266
+ x: 3609.2772,
1267
+ label: []
1268
+ }, {
1269
+ y: 3631.7804,
1270
+ x: 3639.0151,
1271
+ label: []
1272
+ }, {
1273
+ y: 3635.4731,
1274
+ x: 3668.753,
1275
+ label: []
1276
+ }, {
1277
+ y: 3639.1659,
1278
+ x: 3698.4909,
1279
+ label: []
1280
+ }, {
1281
+ y: 3642.8587,
1282
+ x: 3728.2287,
1283
+ label: []
1284
+ }, {
1285
+ y: 3646.5514,
1286
+ x: 3757.9666,
1287
+ label: []
1288
+ }, {
1289
+ y: 3650.2442,
1290
+ x: 3787.7045,
1291
+ label: []
1292
+ }, {
1293
+ y: 3653.937,
1294
+ x: 3817.4424,
1295
+ label: []
1296
+ }, {
1297
+ y: 3657.6298,
1298
+ x: 3847.1803,
1299
+ label: []
1300
+ }, {
1301
+ y: 3661.3225,
1302
+ x: 3876.9182,
1303
+ label: []
1304
+ }, {
1305
+ y: 3665.0153,
1306
+ x: 3906.6561,
1307
+ label: []
1308
+ }, {
1309
+ y: 3668.7081,
1310
+ x: 3936.394,
1311
+ label: []
1312
+ }, {
1313
+ y: 3672.4008,
1314
+ x: 3966.1318,
1315
+ label: []
1316
+ }, {
1317
+ y: 3676.0936,
1318
+ x: 3995.8697,
1319
+ label: []
1320
+ }, {
1321
+ y: 3679.7864,
1322
+ x: 4025.6076,
1323
+ label: []
1324
+ }, {
1325
+ y: 3683.4791,
1326
+ x: 4055.3455,
1327
+ label: []
1328
+ }, {
1329
+ y: 3687.1719,
1330
+ x: 4085.0834,
1331
+ label: []
1332
+ }, {
1333
+ y: 3690.8647,
1334
+ x: 4114.8213,
1335
+ label: []
1336
+ }, {
1337
+ y: 3694.5574,
1338
+ x: 4144.5592,
1339
+ label: []
1340
+ }, {
1341
+ y: 3698.2502,
1342
+ x: 4174.2971,
1343
+ label: []
1344
+ }, {
1345
+ y: 3701.943,
1346
+ x: 4204.035,
1347
+ label: []
1348
+ }, {
1349
+ y: 3705.6357,
1350
+ x: 4233.7728,
1351
+ label: []
1352
+ }, {
1353
+ y: 3709.3285,
1354
+ x: 4263.5107,
1355
+ label: []
1356
+ }, {
1357
+ y: 3713.0213,
1358
+ x: 4293.2486,
1359
+ label: []
1360
+ }, {
1361
+ y: 3716.7141,
1362
+ x: 4322.9865,
1363
+ label: []
1364
+ }, {
1365
+ y: 3720.4068,
1366
+ x: 4352.7244,
1367
+ label: []
1368
+ }, {
1369
+ y: 3724.0996,
1370
+ x: 4382.4623,
1371
+ label: []
1372
+ }, {
1373
+ y: 3727.7924,
1374
+ x: 4412.2002,
1375
+ label: []
1376
+ }, {
1377
+ y: 3731.4851,
1378
+ x: 4441.9381,
1379
+ label: []
1380
+ }, {
1381
+ y: 3735.1779,
1382
+ x: 4471.676,
1383
+ label: []
1384
+ }, {
1385
+ y: 3738.8707,
1386
+ x: 4501.4138,
1387
+ label: []
1388
+ }, {
1389
+ y: 3742.5634,
1390
+ x: 4531.1517,
1391
+ label: []
1392
+ }, {
1393
+ y: 3746.2562,
1394
+ x: 4560.8896,
1395
+ label: []
1396
+ }, {
1397
+ y: 3749.949,
1398
+ x: 4590.6275,
1399
+ label: []
1400
+ }, {
1401
+ y: 3753.6417,
1402
+ x: 4620.3654,
1403
+ label: []
1404
+ }, {
1405
+ y: 3757.3345,
1406
+ x: 4650.1033,
1407
+ label: []
1408
+ }, {
1409
+ y: 3761.0273,
1410
+ x: 4679.8412,
1411
+ label: []
1412
+ }, {
1413
+ y: 3764.72,
1414
+ x: 4709.5791,
1415
+ label: []
1416
+ }, {
1417
+ y: 3768.4128,
1418
+ x: 4739.3169,
1419
+ label: []
1420
+ }, {
1421
+ y: 3772.1056,
1422
+ x: 4769.0548,
1423
+ label: []
1424
+ }, {
1425
+ y: 3775.7984,
1426
+ x: 4798.7927,
1427
+ label: []
1428
+ }, {
1429
+ y: 3779.4911,
1430
+ x: 4828.5306,
1431
+ label: []
1432
+ }, {
1433
+ y: 3783.1839,
1434
+ x: 4858.2685,
1435
+ label: []
1436
+ }, {
1437
+ y: 3786.8767,
1438
+ x: 4888.0064,
1439
+ label: []
1440
+ }, {
1441
+ y: 3790.5694,
1442
+ x: 4917.7443,
1443
+ label: []
1444
+ }, {
1445
+ y: 3794.2622,
1446
+ x: 4947.4822,
1447
+ label: []
1448
+ }, {
1449
+ y: 3797.955,
1450
+ x: 4977.2201,
1451
+ label: []
1452
+ }, {
1453
+ y: 3801.6477,
1454
+ x: 5006.9579,
1455
+ label: []
1456
+ }, {
1457
+ y: 3805.3405,
1458
+ x: 5036.6958,
1459
+ label: []
1460
+ }, {
1461
+ y: 3809.0333,
1462
+ x: 5066.4337,
1463
+ label: []
1464
+ }, {
1465
+ y: 3809.7189,
1466
+ x: 5067.0389,
1467
+ label: []
1468
+ }, {
1469
+ y: 3810.7189,
1470
+ x: 5067.0389,
1471
+ label: []
1472
+ }],
1473
+ wellOffset: [-3.4, 0.11]
1474
+ }];
1475
+ const handleLabelChange = event => {
1476
+ const value = event.target.value;
1477
+ setLabelInput(value);
1478
+ setAnnotations(prev => prev.map((ann, index) => index === 0 ? {
1479
+ ...ann,
1480
+ label: value
1481
+ } : ann));
1482
+ };
1483
+ const handleAddAnnotation = () => {
1484
+ setAnnotations(prev => {
1485
+ const nextIndex = prev.length;
1486
+ const data = dataset1[0].data;
1487
+ const baseX = data[nextIndex]?.x ?? data[data.length - 1].x;
1488
+ const baseY = 100 + nextIndex * 10;
1489
+ const newAnnotation = {
1490
+ type: 'point',
1491
+ labelOffsetPx: 50,
1492
+ xValue: baseX,
1493
+ yValue: baseY,
1494
+ radius: 4,
1495
+ color: 'rgba(128, 128, 128, 1)',
1496
+ pointStyle: 'triangle',
1497
+ label: \`annotation \${nextIndex + 1}\`,
1498
+ labelConfig: {
1499
+ position: 'right',
1500
+ color: 'rgba(128, 128, 128, 1)',
1501
+ callout: {
1502
+ enabled: true
1503
+ }
1504
+ }
1505
+ };
1506
+ return [...prev, newAnnotation];
1507
+ });
1508
+ };
1509
+ return <>
1510
+ <div style={{
1511
+ display: 'flex',
1512
+ gap: 8,
1513
+ marginBottom: 16,
1514
+ alignItems: 'center'
1515
+ }}>
1516
+ <span>Label for first annotation:</span>
1517
+ <input value={labelInput} onChange={handleLabelChange} style={{
1518
+ padding: 4,
1519
+ minWidth: 180
1520
+ }} />
1521
+ <button type="button" onClick={handleAddAnnotation}>
1522
+ Add annotation
1523
+ </button>
1524
+ </div>
1525
+
1526
+ <LineChart chart={{
1527
+ ...basicChart,
1528
+ data: {
1529
+ datasets: dataset1
1530
+ },
1531
+ options: {
1532
+ ...basicChart.options,
1533
+ legend: {
1534
+ display: false
1535
+ },
1536
+ annotations: {
1537
+ showAnnotations: true,
1538
+ enableDragAnnotation: true,
1539
+ enableCalloutAnnotation: true,
1540
+ annotationsData: annotations
1541
+ }
1542
+ }
1543
+ }} />
1544
+ </>;
1545
+ }`,...g.parameters?.docs?.source}}};const _=[`PartialRangeWithSimilarValues`,`closeToValueInDifferentAxes`,`StressTest`,`DynamicCalloutAnnotations`];export{g as DynamicCalloutAnnotations,p as PartialRangeWithSimilarValues,h as StressTest,_ as __namedExportsOrder,m as closeToValueInDifferentAxes,f as default};