@oliasoft-open-source/charts-library 5.5.0-beta-1 → 5.5.0-beta-3
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.
- package/dist/assets/{Color-AVL7NMMY-zaNUeRlM.js → Color-AVL7NMMY-Cvup177w.js} +1 -1
- package/dist/assets/{DocsRenderer-PQXLIZUC-Bx-B9-KR.js → DocsRenderer-PQXLIZUC-C8oenzCg.js} +2 -2
- package/dist/assets/{bar-chart.stories-7JsLHcG3.js → bar-chart.stories-De78SDiD.js} +1 -1
- package/dist/assets/client-DsbWhmXk.js +1 -0
- package/dist/assets/{components-BRtSYMX1.js → components-Bhnu9xjs.js} +1 -1
- package/dist/assets/{get-draggableData-DLG_9bYP.js → get-draggableData-Ci7DAhgp.js} +1 -1
- package/dist/assets/{iframe-BB_acgFo.js → iframe-DmiD_XLI.js} +5 -5
- package/dist/assets/{legend-DjGWzEoG.js → legend-DLSpTR0Q.js} +1 -1
- package/dist/assets/{legend-context-DYd0_91O.js → legend-context-0FoVt6TR.js} +3 -3
- package/dist/assets/{line-chart-Dr0Umbr0.js → line-chart-VpvCvObG.js} +1 -1
- package/dist/assets/{line-chart.stories-IpGXM2oK.js → line-chart.stories-SIfsugaw.js} +1 -1
- package/dist/assets/{line-chart.test-case.stories-C8qzoxBG.js → line-chart.test-case.stories-B9eK7kjq.js} +1 -1
- package/dist/assets/{pie-chart.stories-CCG8Hazm.js → pie-chart.stories-CHMHYc28.js} +1 -1
- package/dist/assets/{react-18-ChWqu3Oz.js → react-18-DVWhm1ZL.js} +1 -1
- package/dist/assets/{react-DgulxvbH.js → react-CG8Fu59u.js} +1 -1
- package/dist/assets/{scatter-chart.stories-D4Z0da7a.js → scatter-chart.stories-HJi4Ssg8.js} +1 -1
- package/dist/common/helpers/callout-helpers/callout-helpers.d.ts +6 -0
- package/dist/iframe.html +1 -1
- package/dist/index.js +90 -12
- package/dist/line-chart/plugins/callout-plugin/helpers.d.ts +1 -0
- package/dist/project.json +1 -1
- package/dist/src/components/common/helpers/callout-helpers/callout-helpers.d.ts +6 -0
- package/dist/src/components/line-chart/plugins/callout-plugin/helpers.d.ts +1 -0
- package/package.json +1 -1
- package/dist/assets/client-BU8uqlt-.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_t as e,at as t,dt as n}from"./iframe-BB_acgFo.js";import{W as r}from"./legend-context-DYd0_91O.js";import{v as i,w as a}from"./legend-DjGWzEoG.js";import"./get-draggableData-DLG_9bYP.js";import{t as o}from"./line-chart-Dr0Umbr0.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={title:`LineChart / Test Cases`,component:o,args:{chart:{data:{datasets:u},options:{title:`Chart title`,chartStyling:{height:`100%`}}}}};const f=()=>(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}}}}),p=()=>(0,l.jsx)(o,{chart:c}),m=()=>{let[e,t]=(0,s.useState)(u),[n,i]=(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)(a,{label:`Reset to Initial State`,colored:!0,onClick:()=>{t(u),i(e=>e+1),p(!0),x(!1)}}),(0,l.jsx)(a,{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),i(e=>e+1)),n===49&&(console.log(`Async injection complete`),h(!1))},n*40)},disabled:m}),(0,l.jsx)(a,{label:`Set Invalid Dataset`,onClick:()=>{t([{label:`Broken Dataset`,borderColor:`red`}])}}),(0,l.jsx)(a,{label:`Set Empty Dataset`,onClick:()=>{t([])}}),(0,l.jsx)(a,{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)(a,{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)(a,{label:`Toggle size`,onClick:()=>d(!c)}),(0,l.jsx)(a,{label:`Toggle Axis Type`,onClick:()=>{y(e=>e===`linear`?`logarithmic`:`linear`)}}),(0,l.jsx)(a,{label:`Toggle Aspect Ratio`,onClick:()=>{_(e=>!e)}}),(0,l.jsx)(a,{label:`Spam Re-renders`,onClick:()=>{let e=0,t=setInterval(()=>{i(e=>e+1),e++,e===100&&clearInterval(t)},30)}}),(0,l.jsx)(a,{label:f?`Unmount Chart`:`Remount Chart`,onClick:()=>p(e=>!e)}),(0,l.jsx)(a,{label:`Manual Re-render`,onClick:()=>i(e=>e+1)}),(0,l.jsx)(a,{label:`Empty Dataset`,onClick:()=>t([])}),(0,l.jsx)(a,{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)(a,{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)(a,{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)(a,{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)(a,{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`})})]})};f.__docgenInfo={description:``,methods:[],displayName:`PartialRangeWithSimilarValues`},p.__docgenInfo={description:``,methods:[],displayName:`closeToValueInDifferentAxes`},m.__docgenInfo={description:``,methods:[],displayName:`StressTest`},f.parameters={...f.parameters,docs:{...f.parameters?.docs,source:{originalSource:`() => {
|
|
1
|
+
import{_t as e,at as t,dt as n}from"./iframe-DmiD_XLI.js";import{W as r}from"./legend-context-0FoVt6TR.js";import{v as i,w as a}from"./legend-DLSpTR0Q.js";import"./get-draggableData-Ci7DAhgp.js";import{t as o}from"./line-chart-VpvCvObG.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={title:`LineChart / Test Cases`,component:o,args:{chart:{data:{datasets:u},options:{title:`Chart title`,chartStyling:{height:`100%`}}}}};const f=()=>(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}}}}),p=()=>(0,l.jsx)(o,{chart:c}),m=()=>{let[e,t]=(0,s.useState)(u),[n,i]=(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)(a,{label:`Reset to Initial State`,colored:!0,onClick:()=>{t(u),i(e=>e+1),p(!0),x(!1)}}),(0,l.jsx)(a,{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),i(e=>e+1)),n===49&&(console.log(`Async injection complete`),h(!1))},n*40)},disabled:m}),(0,l.jsx)(a,{label:`Set Invalid Dataset`,onClick:()=>{t([{label:`Broken Dataset`,borderColor:`red`}])}}),(0,l.jsx)(a,{label:`Set Empty Dataset`,onClick:()=>{t([])}}),(0,l.jsx)(a,{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)(a,{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)(a,{label:`Toggle size`,onClick:()=>d(!c)}),(0,l.jsx)(a,{label:`Toggle Axis Type`,onClick:()=>{y(e=>e===`linear`?`logarithmic`:`linear`)}}),(0,l.jsx)(a,{label:`Toggle Aspect Ratio`,onClick:()=>{_(e=>!e)}}),(0,l.jsx)(a,{label:`Spam Re-renders`,onClick:()=>{let e=0,t=setInterval(()=>{i(e=>e+1),e++,e===100&&clearInterval(t)},30)}}),(0,l.jsx)(a,{label:f?`Unmount Chart`:`Remount Chart`,onClick:()=>p(e=>!e)}),(0,l.jsx)(a,{label:`Manual Re-render`,onClick:()=>i(e=>e+1)}),(0,l.jsx)(a,{label:`Empty Dataset`,onClick:()=>t([])}),(0,l.jsx)(a,{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)(a,{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)(a,{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)(a,{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)(a,{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`})})]})};f.__docgenInfo={description:``,methods:[],displayName:`PartialRangeWithSimilarValues`},p.__docgenInfo={description:``,methods:[],displayName:`closeToValueInDifferentAxes`},m.__docgenInfo={description:``,methods:[],displayName:`StressTest`},f.parameters={...f.parameters,docs:{...f.parameters?.docs,source:{originalSource:`() => {
|
|
2
2
|
return <LineChart chart={{
|
|
3
3
|
data: {
|
|
4
4
|
datasets: [{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_t as e,at as t,dt as n}from"./iframe-
|
|
1
|
+
import{_t as e,at as t,dt as n}from"./iframe-DmiD_XLI.js";import{B as r,Ct as i,F as a,Mt as o,Nt as s,Ot as c,Pt as l,Q as u,X as ee,Z as d,b as f,et as p,ht as m,it as h,j as g,jt as _,kt as te,mt as ne,n as re,q as ie,u as ae,vt as oe,wt as se,x as ce,xt as le}from"./legend-context-0FoVt6TR.js";import{n as ue,t as de}from"./bar-chart-const-D_44J3Hs.js";var v=e(u(),1),y=e(n(),1),b={chart:`_chart_1jdnu_1`,fixedHeight:`_fixedHeight_1jdnu_13`,stretchHeight:`_stretchHeight_1jdnu_19`,zoomForm:`_zoomForm_1jdnu_32`,zoomReset:`_zoomReset_1jdnu_40`,help:`_help_1jdnu_43`,autoWeight:`_autoWeight_1jdnu_47`},x=e=>({width:e?.width,height:e?.height,maintainAspectRatio:e?.maintainAspectRatio||!1,staticChartHeight:e?.staticChartHeight||!1,performanceMode:e?.performanceMode??!0}),S=e=>({tooltips:e?.tooltips??!0,showLabelsInTooltips:e?.showLabelsInTooltips||!1,scientificNotation:e?.scientificNotation??!0}),fe=e=>({showDataLabels:e?.showDataLabels||!1,stacked:e?.stacked||!1,cutout:e?.cutout||0}),C=e=>({display:e?.display??!0,useDataset:e?.useDataset||!1,position:e?.position||g.Bottom,align:e?.align||ce.Center}),w=e=>({enableZoom:e?.enableZoom||!1,enablePan:e?.enablePan||!1}),T=e=>({onLegendClick:e?.onLegendClick,onHover:e?.onHover,onUnhover:e?.onUnhover}),E=e=>({labels:e?.labels||[],datasets:e?.datasets||[]});const D=e=>{let t=e?.chart||{},n=t?.options||{};return{testId:t?.testId??null,data:E(t?.data),options:{title:n?.title||``,chartStyling:x(n?.chartStyling),tooltip:S(n?.tooltip),graph:fe(n?.graph),legend:C(n?.legend),chartOptions:w(n?.chartOptions),interactions:T(n?.interactions)}}},O=e=>{let[t,n]=(0,y.useState)(!1),{data:i,options:a}=e,o=(e=>{let t=[...e];if(a.graph.stacked){let e={label:t?.[0]?.label??``,backgroundColor:[],borderColor:``,borderWidth:Number(t[0].borderWidth)||1,data:[],borderDash:[]};return i.labels.map((n,i)=>{t.map((t,n)=>{e.data.push(t.data[i]);let{backgroundColor:a}=t,{borderColor:o}=t;e.backgroundColor.push((Array.isArray(a)?a[i%(o?.length||1)]:a)||r[i]+`${99-10*n}`),e.borderColor=o??``})}),[e]}return t.map((e,t)=>{let{borderWidth:n=`1`}=e??{},i=parseFloat(String(n))||1,a=r[t],o=e.borderColor||a,s=e.backgroundColor||ae(r);return{...e,borderWidth:i,borderColor:o,backgroundColor:s}})})(i.datasets),s=()=>a.title===``?{}:{display:!0,text:e.options.title},c=(e,t,n)=>{let{chart:r}=n??{};if(t&&r){let{index:e=0}=t;if(r.toggleDataVisibility(e),r.update(),a.interactions?.onLegendClick){let n=r.isDatasetVisible(e);a.interactions.onLegendClick(t.text,!n)}}};return{generatedDatasets:o,getTitle:s,legendClick:c,onClick:(e,t,n)=>{n.resetZoom()},onHover:(e,r)=>{if(t&&!r?.length&&(n(!1),a.interactions.onUnhover&&a.interactions.onUnhover(e)),!t&&r?.length&&(n(!0),a.interactions.onHover)){let{index:t,datasetIndex:n}=r[0],i=o;a.interactions.onHover(e,n,t,i)}},getDatalabels:()=>a.graph.showDataLabels?{display:`auto`,align:`center`,anchor:`center`,formatter:(e,t)=>{if(t.chart.getDatasetMeta(a.graph.stacked?0:t.datasetIndex).data[t.dataIndex].hidden)return``;let n=t.dataset.data[t.dataIndex],r=n?.label||(typeof n==`number`?n:Array.isArray(n)?n.reduce((e,t,n)=>n===0?`${e} ${t}`:`${e}, ${t}`,``):``);return typeof n==`number`?Number.isInteger(r)?r:r.toFixed(2):r}}:{display:!1},getLegend:()=>({position:a.legend.position,display:a.legend.display,align:a.legend.align,labels:{boxHeight:6,boxWidth:6,usePointStyle:!0,filter:e=>a.legend.useDataset?!i.datasets[e.index]?.hideLegend:!0},onClick:c}),getToolTips:()=>{let e=e=>{let t={};return a?.tooltip?.scientificNotation?(Math.abs(e)<1e-4||Math.abs(e)>1e7)&&(t={roundScientificCoefficient:3}):t={scientific:!1},p(h(e),t)};return{callbacks:{title:e=>{let{dataIndex:t}=e[0],n=a.graph.stacked?parseInt(String(t/i.labels.length)):t;return`${i.labels[n]}`},label:t=>{let{dataIndex:n}=t,r=a.graph.stacked?n%i.datasets.length:t.datasetIndex,o=i.datasets.length>1?`${i.datasets[r]?.label}: `:``,s=t.dataset.data[n],c=typeof s==`object`?`${s.value||``} ${a.tooltip.showLabelsInTooltips&&s.label?`(`+s.label+`)`:``}`:s,l=i?.yUnit?`[${i?.yUnit}]`:``;return`${o} ${e(c)} ${l}`}},padding:8,boxWidth:12,boxHeight:12,boxPadding:4,usePointStyle:!0}}}};var k=e(t(),1);se.register(c,i,te,le,o,l,s,_,m,ne);var A=e=>{f();let t=D(e),n=(0,y.useRef)(null),{data:r,options:i,testId:o}=t,{generatedDatasets:s,getTitle:c,onClick:l,onHover:u,getDatalabels:ee,getLegend:d,getToolTips:p}=O(t);return(0,k.jsx)(`div`,{className:(0,v.default)(b.chart,!i.chartStyling.width||!i.chartStyling.height?i.chartStyling.staticChartHeight?b.fixedHeight:b.stretchHeight:``),style:{width:i.chartStyling.width||`auto`,height:i.chartStyling.height||`auto`},"data-testid":o,children:(0,k.jsx)(oe,{ref:n,data:{datasets:s,labels:i.graph.stacked?void 0:r.labels},options:{cutout:i.graph.cutout,onClick:l,responsive:!0,maintainAspectRatio:i.chartStyling.maintainAspectRatio,animation:i.chartStyling.performanceMode?!1:{duration:a.FAST},hover:{mode:`nearest`,intersect:!0},onHover:u,plugins:{annotation:!1,title:c(),datalabels:ee(),tooltip:p(),legend:d()}}})})},j=e=>{let{options:t}=D(e);return(0,k.jsx)(re,{options:t,children:(0,k.jsx)(A,{...e})})};j.__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:``}}};var M=[`label 1`,`label 2`,`label 3`],N={label:`data1`,data:[3,8,7]},P={label:`data2`,data:[1,2,3]},F={label:`data3`,data:[5,0,4]},I={label:`spacing data`,offset:40,data:[3,8,7]},L={label:`hover data`,data:[3,8,7],hoverOffset:40},R={label:`data`,data:[{value:210,label:`label`},{value:333,label:`labal`},{value:248,label:`lebel`}]},z={label:`data`,data:[210,333,248]},B={data:{labels:M,datasets:[N]}},V={data:{labels:M,datasets:[N,P,F]}},pe={data:{labels:M,datasets:[N,P,F]},options:{title:`Stacked`,graph:{stacked:!0}}},me={data:{labels:M,datasets:[R]},options:{title:`With custom datalabels`,graph:{showDataLabels:!0}}},he={data:{labels:M,datasets:[z]},options:{title:`With value as datalabels`,graph:{showDataLabels:!0}}},ge={data:{labels:M,datasets:[R]},options:{title:`With datalabels in tooltips`,tooltip:{showLabelsInTooltips:!0}}},_e={data:{labels:M,datasets:[L]},options:{title:`Hover offset`}},ve={data:{labels:M,datasets:[I]},options:{title:`Segment offset`}},ye={data:{labels:M,datasets:[N]},options:{chartStyling:{performanceMode:!1}}},be={data:{labels:M,datasets:[N]},options:{title:`Cutout 50%`,graph:{cutout:`50%`}}},xe={data:{labels:M,datasets:[N]},options:{title:`Cutout 20 pixels`,graph:{cutout:20}}},Se={title:`PieChart`,component:j,args:{chart:B}},H=e=>(0,k.jsx)(j,{...e});const U=H.bind({}),W=H.bind({});W.args={chart:V};const G=H.bind({});G.args={chart:pe};const K=H.bind({});K.args={chart:me};const q=H.bind({});q.args={chart:he};const J=H.bind({});J.args={chart:ge};const Y=H.bind({});Y.args={chart:ye};const X=H.bind({});X.args={chart:be};const Z=H.bind({});Z.args={chart:xe};const Q=H.bind({});Q.args={chart:_e};const $=H.bind({});Q.args={chart:ve},U.parameters={...U.parameters,docs:{...U.parameters?.docs,source:{originalSource:`args => {
|
|
2
2
|
return <PieChart
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args} />;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_t as e,dt as t}from"./iframe-
|
|
1
|
+
import{_t as e,dt as t}from"./iframe-DmiD_XLI.js";import{t as n}from"./client-DsbWhmXk.js";var r=e(t(),1),i=e(n(),1),a=new Map;function o(){return globalThis.IS_REACT_ACT_ENVIRONMENT}var s=({callback:e,children:t})=>{let n=r.useRef();return r.useLayoutEffect(()=>{n.current!==e&&(n.current=e,e())},[e]),t};typeof Promise.withResolvers>`u`&&(Promise.withResolvers=()=>{let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}});var c=async(e,t,n)=>{let i=await u(t,n);if(o()){i.render(e);return}let{promise:a,resolve:c}=Promise.withResolvers();return i.render(r.createElement(s,{callback:c},e)),a},l=(e,t)=>{let n=a.get(e);n&&(n.unmount(),a.delete(e))},u=async(e,t)=>{let n=a.get(e);return n||(n=i.createRoot(e,t),a.set(e,n)),n};export{c as renderElement,l as unmountElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_t as e,dt as t}from"./iframe-
|
|
1
|
+
import{_t as e,dt as t}from"./iframe-DmiD_XLI.js";var n=e(t(),1),r={},i=n.createContext(r);function a(e){let t=n.useContext(i);return n.useMemo(function(){return typeof e==`function`?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?typeof e.components==`function`?e.components(r):e.components||r:a(e.components),n.createElement(i.Provider,{value:t},e.children)}export{o as MDXProvider,a as useMDXComponents};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_t as e,at as t,dt as n}from"./iframe-
|
|
1
|
+
import{_t as e,at as t,dt as n}from"./iframe-DmiD_XLI.js";import{At as r,B as i,C as a,Ct as o,F as s,G as c,K as l,L as u,M as d,Mt as f,Nt as p,Ot as m,Pt as h,R as ee,b as g,et as _,g as v,h as y,ht as b,it as te,j as ne,mt as re,n as ie,p as ae,wt as oe,x as se,y as ce,yt as le}from"./legend-context-0FoVt6TR.js";import{J as ue,Y as de,d as fe,f as pe,g as me,i as he,p as ge,q as _e,r as ve,t as ye}from"./legend-DLSpTR0Q.js";import{n as be,t as xe}from"./bar-chart-const-D_44J3Hs.js";var x=e(n(),1);const S=(e,t)=>{let n={};return t?(Math.abs(e)<1e-4||Math.abs(e)>1e7)&&(n={roundScientificCoefficient:3}):n={scientific:!1},_(te(e),n)};var C=(e,t)=>{if(t?.tooltip?.showLabelsInTooltips){let{label:t}=e[0]?.dataset??{};return t}},w=(e,t)=>{let{raw:n,dataset:r}=e??{},i=n?.label,a=t?.tooltip?.scientificNotation;return`${i??r?.label} ( x: ${S(n?.x,a)} , y: ${S(n?.y,a)} )`};const T=e=>({enabled:e?.tooltip?.enabled,callbacks:{title:t=>C(t,e),label:t=>w(t,e)},backgroundColor:e?.tooltip?.backgroundColor,displayColors:e?.tooltip?.displayColors,padding:7});var E=({options:e,axisType:t=a.X,currentScale:n})=>{let r=ce(e.direction),i=n||e?.axes?.[t]?.[0],o=r&&t===a.Y||!r&&t===a.X,s=i?.gridLines||{};return{type:d.Linear,position:i?.position,beginAtZero:e?.additionalAxesOptions?.beginAtZero,reverse:(()=>t===(r?a.Y:a.X)?e?.additionalAxesOptions?.reverse:!1)(),suggestedMax:e?.additionalAxesOptions?.suggestedMax,suggestedMin:e?.additionalAxesOptions?.suggestedMin,min:o?e?.additionalAxesOptions?.min:void 0,max:o?e?.additionalAxesOptions?.max:void 0,title:{display:!!i?.label?.length||!!i?.unit?.length,text:i?.label||i?.unit,padding:0},ticks:(()=>{let n=e?.additionalAxesOptions;return{stepSize:i?.stepSize??(t===a.Y?n?.stepSize:void 0),includeBounds:!1,font:{size:12}}})(),grid:{...s}}};const D=e=>({x:E({options:e,axisType:a.X}),y:E({options:e,axisType:a.Y})}),O=(e,t)=>{let{data:n,options:r}=e,{interactions:a,chartStyling:o}=r,[c,l]=(0,x.useState)(!1),{legend:u,customLegendPlugin:d,legendClick:f}=pe({chartRef:t,options:r}),{state:p}=ge(),{annotation:m}=p,h=(e=>e.map((e,t)=>{let{borderWidth:n=1}=e??{},r=parseFloat(String(n))||1,a=i[t],o=e.borderColor??a,s=e.backgroundColor??a;return{...e,borderWidth:r,borderColor:o,backgroundColor:s}}))(n.datasets),g=(e,t,n)=>{n.resetZoom()},_=(e,t)=>{if(c&&!t?.length&&(l(!1),a.onUnhover&&a.onUnhover(e)),!c&&t?.length&&(l(!0),a.onHover)){let{index:n,datasetIndex:r}=t[0];a.onHover(e,r,n,h)}};return{generatedDatasets:h,scatterOptions:{onClick:g,onHover:_,...o,interactions:{onLegendClick:f,onHover:_},scales:D(e?.options),animation:o.performanceMode?{duration:s.NO}:{duration:s.FAST,onComplete:a?.onAnimationComplete},plugins:{legend:{...u,display:!1,events:[]},customLegendPlugin:d,title:v(r),annotation:fe(m),chartAreaBorder:{borderColor:ee},datalabels:{display:r.graph.showDataLabels},tooltip:T(r)}}}};let k=function(e){return 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}({});var A=e=>({display:e?.display??!1,gradientColors:e?.gradientColors??l,direction:e?.direction??k.BottomLeftToTopRight}),j=e=>({width:e?.width??`auto`,height:e?.height??`auto`,maintainAspectRatio:e?.maintainAspectRatio||!1,staticChartHeight:e?.staticChartHeight||!1,performanceMode:e?.performanceMode??!0,gradient:A(e?.gradient)}),M=e=>({enabled:e?.enabled??!0,tooltips:e?.tooltips??!0,showLabelsInTooltips:e?.showLabelsInTooltips||!1,backgroundColor:e?.backgroundColor||`#333`,displayColors:e?.displayColors||!1,scientificNotation:e?.scientificNotation??!0}),Se=e=>({showMinorGridlines:e?.showMinorGridlines??!1,showDataLabels:e?.showDataLabels??!1}),Ce=e=>({display:e?.display??!0,useDataset:e?.useDataset||!1,position:e?.position||ne.BottomLeft,align:e?.align||se.Center}),we=e=>({enableZoom:e?.enableZoom||!1,enablePan:e?.enablePan||!1}),Te=e=>({onLegendClick:e?.onLegendClick,onHover:e?.onHover,onUnhover:e?.onUnhover,onAnimationComplete:e?.onAnimationComplete}),Ee=e=>({labels:e?.labels||[],datasets:e?.datasets||[]}),De=e=>e?e.map(e=>({...e,display:e?.display??!0})):[],Oe=e=>({showAnnotations:e?.showAnnotations??!0,controlAnnotation:e?.controlAnnotation||!1,annotationsData:De(e?.annotationsData)}),ke=e=>({x:e?.x||[{}],y:e?.y||[{}]}),Ae=e=>({reverse:e?.reverse||!1,stacked:e?.stacked||!1,beginAtZero:e?.beginAtZero??!0,stepSize:e?.stepSize,suggestedMin:e?.suggestedMin,suggestedMax:e?.suggestedMax,min:e?.min,max:e?.max});const N=e=>{let t=e?.chart||{},n=t?.options||{};return{testId:t?.testId??null,data:Ee(t?.data),options:{title:n?.title||``,axes:ke(n?.axes),additionalAxesOptions:Ae(n?.additionalAxesOptions),direction:n?.direction||ve.VERTICAL,chartStyling:j(n?.chartStyling),tooltip:M(n?.tooltip),graph:Se(n?.graph),legend:Ce(n?.legend),annotations:Oe(n?.annotations),chartOptions:we(n?.chartOptions),interactions:Te(n?.interactions)}}};var je=(e,t)=>{switch(e){case k.TopToBottom:return[t.left,t.top,t.left,t.bottom];case k.BottomToTop:return[t.left,t.bottom,t.left,t.top];case k.LeftToRight:return[t.left,t.top,t.right,t.top];case k.RightToLeft:return[t.right,t.top,t.left,t.top];case k.TopLeftToBottomRight:return[t.left,t.top,t.right,t.bottom];case k.BottomRightToTopLeft:return[t.right,t.bottom,t.left,t.top];case k.BottomLeftToTopRight:return[t.left,t.bottom,t.right,t.top];case k.TopRightToBottomLeft:return[t.right,t.top,t.left,t.bottom];default:return[t.left,t.bottom,t.right,t.top]}};const Me={id:`gradientBackgroundPlugin`,beforeDraw:e=>{let{ctx:t,chartArea:n,options:r}=e;if(!t||!n)return;let{display:i=!1,gradientColors:a,direction:o=k.BottomLeftToTopRight}=r?.gradient??{};if(!i||!a||a.length===0)return;let[s,c,l,u]=je(o,n),d=t.createLinearGradient(s,c,l,u);a.forEach(({offset:e,color:t})=>{d.addColorStop(e,t)}),t.save(),t.globalCompositeOperation=`destination-over`,t.fillStyle=d,t.fillRect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.restore()}};var P={chart:`_chart_1qlu1_1`,canvas:`_canvas_1qlu1_11`,fixedHeight:`_fixedHeight_1qlu1_20`,stretchHeight:`_stretchHeight_1qlu1_26`,squareAspectRatio:`_squareAspectRatio_1qlu1_32`,zoomForm:`_zoomForm_1qlu1_43`,zoomReset:`_zoomReset_1qlu1_51`,help:`_help_1qlu1_54`,autoWeight:`_autoWeight_1qlu1_58`},F=e(t(),1);oe.register(m,r,o,f,h,p,b,re,de,Me);var Ne=e=>{g();let t=(0,x.useRef)(null),n=N(e),{options:r,testId:i}=n,{scatterOptions:a,generatedDatasets:o}=O(n,t);return(0,F.jsx)(`div`,{className:ae(r.chartStyling,P),style:{width:r.chartStyling.width,height:r.chartStyling.height},"data-testid":i,children:(0,F.jsx)(_e,{backend:ue,context:window,children:(0,F.jsxs)(`div`,{className:P.canvas,id:`canvas`,children:[(0,F.jsx)(le,{ref:t,data:{datasets:o},options:a,plugins:y(r.graph,r.legend)}),!!o.length&&(0,F.jsx)(ye,{chartRef:t,legendConfig:{options:r,generatedDatasets:o,chartType:he.SCATTER}})]})})})},I=e=>{let{options:t}=N(e);return(0,F.jsx)(ie,{options:t,children:(0,F.jsx)(Ne,{...e})})};I.__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:``}}};var L=[`label 1`,`label 2`,`label 3`],R={label:`Dataset 1`,data:[{x:1,y:5},{x:3,y:7},{x:6,y:2},{x:8,y:6},{x:9,y:4}]},z={label:`Dataset 2`,data:[{x:1,y:3},{x:4,y:5},{x:7,y:9},{x:10,y:2},{x:12,y:7}]},Pe={label:`Dataset 3`,data:[{x:2,y:8},{x:5,y:6},{x:8,y:10},{x:11,y:5},{x:14,y:9}]},B={label:`Dataset 4`,data:[{x:2,y:8},{x:14,y:9}]},Fe={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`}]},Ie={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`}]},Le={label:`Dataset Decimals`,data:[{x:4.30021321123002,y:2.30021321123005},{x:5.12321321000003,y:3.23213210000037}]},V={data:{labels:L,datasets:[R]}},Re={data:{labels:L,datasets:[R]},options:{chartStyling:{height:300,width:700}}},ze={data:{labels:L,datasets:[R,z,Pe]}},Be={data:{labels:L,datasets:[R]},options:{title:`With Data Labels`,graph:{showDataLabels:!0}}},Ve={data:{labels:L,datasets:[R,z,Le]},options:{title:`With Tooltips`,tooltip:{title:`Tooltip`,showLabelsInTooltips:!0}}},He={data:{labels:L,datasets:[{...R,backgroundColor:`red`,borderColor:`red`}]}},Ue={data:{labels:L,datasets:[R]},options:{title:`With Annotation`,annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:`y`,label:`Horizontal Annotation`,value:2.5,color:`rgba(96, 32, 196, 0.5)`}]}}},We={data:{labels:L,datasets:[R,z,B]},options:{title:`With Axes Labels`,axes:{x:[{label:`x axis`}],y:[{label:`y axis`}]}}},Ge={...V,options:{title:`With Gradient`,chartStyling:{gradient:{display:!0}}}},H={data:{datasets:[Fe,Ie,B]},options:{title:`With datapoint label showing when hovered`,tooltip:{showLabelsInTooltips:!0}}},Ke={title:`ScatterChart`,component:I,args:{chart:V}},U=e=>(0,F.jsx)(I,{...e});const W=U.bind({});W.args={chart:V};const G=U.bind({});G.args={chart:Re};const K=U.bind({});K.args={chart:ze};const q=U.bind({});q.args={chart:Be};const J=U.bind({});J.args={chart:Ve};const Y=U.bind({});Y.args={chart:Ue};const X=U.bind({});X.args={chart:We};const Z=U.bind({});Z.args={chart:Ge};const Q=U.bind({});Q.args={chart:H};const $=U.bind({});$.args={chart:He},W.parameters={...W.parameters,docs:{...W.parameters?.docs,source:{originalSource:`args => {
|
|
2
2
|
return <ScatterChart
|
|
3
3
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
4
|
{...args} />;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ICommonAnnotationsData } from '../../common.interface';
|
|
2
|
+
type TCalloutCfg = NonNullable<NonNullable<ICommonAnnotationsData['labelConfig']>['callout']>;
|
|
3
|
+
export declare const resolveCalloutXAdjust: (ctx: any, refAnnotation: ICommonAnnotationsData, calloutCfg: TCalloutCfg, index: number) => any;
|
|
4
|
+
export declare const resolveCalloutYAdjust: (ctx: any, refAnnotation: ICommonAnnotationsData, calloutCfg: TCalloutCfg, index: number) => any;
|
|
5
|
+
export declare const isCalloutAnchorInChartArea: (ctx: any, refAnnotation: ICommonAnnotationsData, margin?: number) => boolean;
|
|
6
|
+
export {};
|
package/dist/iframe.html
CHANGED
|
@@ -529,7 +529,7 @@
|
|
|
529
529
|
}
|
|
530
530
|
</script>
|
|
531
531
|
|
|
532
|
-
<script type="module" crossorigin src="./assets/iframe-
|
|
532
|
+
<script type="module" crossorigin src="./assets/iframe-DmiD_XLI.js"></script>
|
|
533
533
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-Dr7BywEQ.js">
|
|
534
534
|
|
|
535
535
|
</head>
|
package/dist/index.js
CHANGED
|
@@ -19305,6 +19305,79 @@ function addTransparency(input, alpha$1, out = "rgb") {
|
|
|
19305
19305
|
const c = color$3.alpha(a);
|
|
19306
19306
|
return out === "hex" ? c.toHex() : c.toRgbString();
|
|
19307
19307
|
}
|
|
19308
|
+
var getXScale = (chart$4, axisId) => {
|
|
19309
|
+
if (axisId && chart$4?.scales?.[axisId]) return chart$4.scales[axisId];
|
|
19310
|
+
if (chart$4?.scales?.x) return chart$4.scales.x;
|
|
19311
|
+
const key = Object.keys(chart$4?.scales ?? {})?.find((k) => k?.toLowerCase()?.includes("x"));
|
|
19312
|
+
return key ? chart$4?.scales?.[key] : void 0;
|
|
19313
|
+
};
|
|
19314
|
+
var getYScale = (chart$4, axisId) => {
|
|
19315
|
+
if (axisId && chart$4?.scales?.[axisId]) return chart$4.scales[axisId];
|
|
19316
|
+
if (chart$4?.scales?.y) return chart$4.scales.y;
|
|
19317
|
+
const key = Object.keys(chart$4?.scales ?? {})?.find((k) => k?.toLowerCase()?.includes("y"));
|
|
19318
|
+
return key ? chart$4?.scales?.[key] : void 0;
|
|
19319
|
+
};
|
|
19320
|
+
const resolveCalloutXAdjust = (ctx, refAnnotation, calloutCfg, index$2) => {
|
|
19321
|
+
if (typeof calloutCfg?.xAdjust === "function") return calloutCfg?.xAdjust?.(ctx);
|
|
19322
|
+
const chart$4 = ctx?.chart;
|
|
19323
|
+
const scale = getXScale(chart$4, refAnnotation?.annotationAxis);
|
|
19324
|
+
const xVal = refAnnotation?.xValue;
|
|
19325
|
+
if (!scale || typeof xVal !== "number") return 0;
|
|
19326
|
+
const area = chart$4?.chartArea;
|
|
19327
|
+
const halfW = ((ctx?.element)?.width ?? 0) / 2;
|
|
19328
|
+
const margin = calloutCfg?.margin ?? 8;
|
|
19329
|
+
const basePx = scale?.getPixelForValue(xVal);
|
|
19330
|
+
let dx = 0;
|
|
19331
|
+
if (typeof calloutCfg?.xAdjust === "number") dx = scale?.getPixelForValue(calloutCfg.xAdjust) - basePx;
|
|
19332
|
+
else dx = (index$2 % 2 === 0 ? 1 : -1) * 60;
|
|
19333
|
+
let cx$1 = basePx + dx;
|
|
19334
|
+
if (cx$1 - halfW < area.left + margin) {
|
|
19335
|
+
dx += area.left + margin + halfW - cx$1;
|
|
19336
|
+
cx$1 = basePx + dx;
|
|
19337
|
+
} else if (cx$1 + halfW > area.right - margin) {
|
|
19338
|
+
dx += area.right - margin - halfW - cx$1;
|
|
19339
|
+
cx$1 = basePx + dx;
|
|
19340
|
+
}
|
|
19341
|
+
return dx;
|
|
19342
|
+
};
|
|
19343
|
+
const resolveCalloutYAdjust = (ctx, refAnnotation, calloutCfg, index$2) => {
|
|
19344
|
+
if (typeof calloutCfg?.yAdjust === "function") return calloutCfg.yAdjust(ctx);
|
|
19345
|
+
const chart$4 = ctx?.chart;
|
|
19346
|
+
const scale = getYScale(chart$4, refAnnotation?.annotationAxis);
|
|
19347
|
+
const yVal = refAnnotation?.yValue;
|
|
19348
|
+
if (!scale || typeof yVal !== "number") return 0;
|
|
19349
|
+
const area = chart$4?.chartArea;
|
|
19350
|
+
const halfH = ((ctx?.element)?.height ?? 0) / 2;
|
|
19351
|
+
const margin = calloutCfg?.margin ?? 8;
|
|
19352
|
+
const basePx = scale?.getPixelForValue(yVal);
|
|
19353
|
+
let dy = 0;
|
|
19354
|
+
if (typeof calloutCfg?.yAdjust === "number") dy = scale?.getPixelForValue(calloutCfg.yAdjust) - basePx;
|
|
19355
|
+
else dy = -40 - Math.floor(index$2 / 2) * 22;
|
|
19356
|
+
let cy = basePx + dy;
|
|
19357
|
+
if (cy - halfH < area.top + margin) {
|
|
19358
|
+
dy += area.top + margin + halfH - cy;
|
|
19359
|
+
cy = basePx + dy;
|
|
19360
|
+
} else if (cy + halfH > area.bottom - margin) {
|
|
19361
|
+
dy += area.bottom - margin - halfH - cy;
|
|
19362
|
+
cy = basePx + dy;
|
|
19363
|
+
}
|
|
19364
|
+
return dy;
|
|
19365
|
+
};
|
|
19366
|
+
var isInRange = (v, min, max) => v >= min && v <= max;
|
|
19367
|
+
const isCalloutAnchorInChartArea = (ctx, refAnnotation, margin = 0) => {
|
|
19368
|
+
const chart$4 = ctx?.chart;
|
|
19369
|
+
const area = chart$4?.chartArea;
|
|
19370
|
+
if (!chart$4 || !area) return true;
|
|
19371
|
+
const xScale = getXScale(chart$4, refAnnotation.annotationAxis);
|
|
19372
|
+
const yScale = getYScale(chart$4, refAnnotation.annotationAxis);
|
|
19373
|
+
const xVal = refAnnotation.xValue;
|
|
19374
|
+
const yVal = refAnnotation.yValue;
|
|
19375
|
+
if (!xScale || !yScale) return false;
|
|
19376
|
+
if (typeof xVal !== "number" || typeof yVal !== "number") return false;
|
|
19377
|
+
const x = xScale.getPixelForValue(xVal);
|
|
19378
|
+
const y = yScale.getPixelForValue(yVal);
|
|
19379
|
+
return isInRange(x, area.left + margin, area.right - margin) && isInRange(y, area.top + margin, area.bottom - margin);
|
|
19380
|
+
};
|
|
19308
19381
|
var handleLineEnter = (element, chart$4, annotation$1) => {
|
|
19309
19382
|
chart$4.canvas.style.cursor = CursorStyle.Pointer;
|
|
19310
19383
|
if (element.options.scaleID?.includes(AxisType.X)) {
|
|
@@ -19439,7 +19512,6 @@ const generateAnn = (ann, index$2) => {
|
|
|
19439
19512
|
[AnnotationType$1.ELLIPSE]: defLabel
|
|
19440
19513
|
}[type] || defLabel;
|
|
19441
19514
|
const enter = ({ element }, { chart: chart$4 }) => {
|
|
19442
|
-
console.log("enter");
|
|
19443
19515
|
switch (type) {
|
|
19444
19516
|
case AnnotationType$1.LINE:
|
|
19445
19517
|
handleLineEnter(element, chart$4, ann);
|
|
@@ -19509,10 +19581,6 @@ var getCalloutAnnotation = (refAnnotation, index$2) => {
|
|
|
19509
19581
|
...baseRest,
|
|
19510
19582
|
label: { display: false }
|
|
19511
19583
|
};
|
|
19512
|
-
const side = index$2 % 2 === 0 ? 1 : -1;
|
|
19513
|
-
const row = Math.floor(index$2 / 2);
|
|
19514
|
-
const xAdjust = typeof calloutCfg.xAdjust === "number" ? calloutCfg.xAdjust : side * 60;
|
|
19515
|
-
const yAdjust = typeof calloutCfg.yAdjust === "number" ? calloutCfg.yAdjust : -40 - row * 22;
|
|
19516
19584
|
const color$3 = calloutCfg?.color ?? "hsl(60, 10.34482759%, 12.5%)";
|
|
19517
19585
|
const font = calloutCfg?.font ?? `12px "Roobert", "Noto Sans", sans-serif`;
|
|
19518
19586
|
const borderColor = calloutCfg?.borderColor ?? "transparent";
|
|
@@ -19531,8 +19599,13 @@ var getCalloutAnnotation = (refAnnotation, index$2) => {
|
|
|
19531
19599
|
borderColor,
|
|
19532
19600
|
borderWidth: BORDER_WIDTH.INITIAL,
|
|
19533
19601
|
padding: 5,
|
|
19534
|
-
|
|
19535
|
-
|
|
19602
|
+
display: (ctx) => (refAnnotation.display ?? true) && isCalloutAnchorInChartArea(ctx, refAnnotation, calloutCfg.margin ?? 0),
|
|
19603
|
+
xAdjust: (ctx) => {
|
|
19604
|
+
return resolveCalloutXAdjust(ctx, refAnnotation, calloutCfg, index$2);
|
|
19605
|
+
},
|
|
19606
|
+
yAdjust: (ctx) => {
|
|
19607
|
+
return resolveCalloutYAdjust(ctx, refAnnotation, calloutCfg, index$2);
|
|
19608
|
+
},
|
|
19536
19609
|
resizable: false,
|
|
19537
19610
|
displayDragCoordinates: false,
|
|
19538
19611
|
enableDrag: true,
|
|
@@ -20015,11 +20088,15 @@ const isWithinChartArea = ({ x, y, chartArea, scales: scales$1, metrics, resizab
|
|
|
20015
20088
|
}
|
|
20016
20089
|
const xScale = scales$1?.[xScaleID];
|
|
20017
20090
|
const yScale = scales$1?.[yScaleID];
|
|
20018
|
-
if (!
|
|
20019
|
-
const
|
|
20020
|
-
const
|
|
20021
|
-
const
|
|
20022
|
-
const
|
|
20091
|
+
if (!xScale || !yScale) return false;
|
|
20092
|
+
const xValueLeft = xScale?.getValueForPixel(chartArea.left) ?? NaN;
|
|
20093
|
+
const xValueRight = xScale?.getValueForPixel(chartArea.right) ?? NaN;
|
|
20094
|
+
const yValueBottom = yScale?.getValueForPixel(chartArea.bottom) ?? NaN;
|
|
20095
|
+
const yValueTop = yScale?.getValueForPixel(chartArea.top) ?? NaN;
|
|
20096
|
+
const minX = Math.min(xValueLeft, xValueRight);
|
|
20097
|
+
const maxX = Math.max(xValueLeft, xValueRight);
|
|
20098
|
+
const minY = Math.min(yValueBottom, yValueTop);
|
|
20099
|
+
const maxY = Math.max(yValueBottom, yValueTop);
|
|
20023
20100
|
if (annotationType === AnnotationType$1.POINT || annotationType === AnnotationType$1.LABEL) return (x !== void 0 ? x >= minX && x <= maxX : true) && (y !== void 0 ? y >= minY && y <= maxY : true);
|
|
20024
20101
|
if (annotationType === AnnotationType$1.BOX && metrics.width !== void 0 && metrics.height !== void 0) {
|
|
20025
20102
|
const boxXMin = x !== void 0 ? x - metrics.width / 2 : void 0;
|
|
@@ -20302,6 +20379,7 @@ const calloutConnectorPlugin = {
|
|
|
20302
20379
|
const labelEl = elements$1.find((el) => el.options && el.options.id === opt.id);
|
|
20303
20380
|
const fromEl = elements$1.find((el) => el.options && el.options.id === connector.fromId);
|
|
20304
20381
|
if (!labelEl || !fromEl) return;
|
|
20382
|
+
if (labelEl.options?.display === false) return;
|
|
20305
20383
|
const { startX, startY, endX, endY } = computeConnectorPoints(fromEl, labelEl, connector) ?? {};
|
|
20306
20384
|
const ctx = chart$4?.ctx;
|
|
20307
20385
|
ctx?.save?.();
|
package/dist/project.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1764236762860,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{"@storybook/testing-library":"0.2.2","eslint-plugin-vitest":"0.5.4","eslint-plugin-vitest-globals":"1.5.0","vitest":"4.0.4"},"hasRouterPackage":false,"packageManager":{"type":"yarn","agent":"yarn","nodeLinker":"undefined"},"typescriptOptions":{"reactDocgen":"react-docgen"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","portableStoriesFileCount":0,"applicationFileCount":0,"storybookVersion":"9.1.16","language":"javascript","storybookPackages":{"@storybook/react-vite":{"version":"9.1.16"},"@storybook/testing-library":{"version":"0.2.2"},"eslint-plugin-storybook":{"version":"9.1.16"},"storybook":{"version":"9.1.16"}},"addons":{"@storybook/addon-themes":{"version":"9.1.16"},"@storybook/addon-docs":{"version":"9.1.16"}}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ICommonAnnotationsData } from '../../common.interface';
|
|
2
|
+
type TCalloutCfg = NonNullable<NonNullable<ICommonAnnotationsData['labelConfig']>['callout']>;
|
|
3
|
+
export declare const resolveCalloutXAdjust: (ctx: any, refAnnotation: ICommonAnnotationsData, calloutCfg: TCalloutCfg, index: number) => any;
|
|
4
|
+
export declare const resolveCalloutYAdjust: (ctx: any, refAnnotation: ICommonAnnotationsData, calloutCfg: TCalloutCfg, index: number) => any;
|
|
5
|
+
export declare const isCalloutAnchorInChartArea: (ctx: any, refAnnotation: ICommonAnnotationsData, margin?: number) => boolean;
|
|
6
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "5.5.0-beta-
|
|
3
|
+
"version": "5.5.0-beta-3",
|
|
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": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ft as e,it as t}from"./iframe-BB_acgFo.js";var n=e((e=>{var n=t();e.createRoot=n.createRoot,e.hydrateRoot=n.hydrateRoot}));export{n as t};
|