@oliasoft-open-source/charts-library 5.1.5 → 5.2.0-beta-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.
- package/dist/assets/Color-YHDXOIA2-_rJfMMp0.js +1 -0
- package/dist/assets/DocsRenderer-CFRXHY34-BpHeeG43.js +1 -0
- package/dist/assets/bar-chart-const-DT-Qreyz.js +1 -0
- package/dist/assets/bar-chart.stories-B2hnXIDm.js +145 -0
- package/dist/assets/chunk-2PTXLE6R-Dj3Lydxc.js +1 -0
- package/dist/assets/chunk-H6MOWX77-Ds8Hqw1O.js +1 -0
- package/dist/assets/chunk-NUUEMKO5-w5N4r9dW.js +56 -0
- package/dist/assets/chunk-PRSJUHPQ-B1J-18Q5.js +2 -0
- package/dist/assets/chunk-XP5HYGXS-DyEAuB1b.js +1 -0
- package/dist/assets/client-BvIKjR7y.js +1 -0
- package/dist/assets/components-B8oW7xs1.js +1 -0
- package/dist/assets/components-CqwGF0Y6.js +534 -0
- package/dist/assets/docs-tools-CnZ6t1zZ.js +8 -0
- package/dist/assets/entry-preview-CO5fIUlY.js +2 -0
- package/dist/assets/entry-preview-docs-BVt62RwF.js +48 -0
- package/dist/assets/fast-deep-equal-Cl3Z6ltL.js +1 -0
- package/dist/assets/get-custom-legend-plugin-example-DlEN0LEe.js +1 -0
- package/dist/assets/get-draggableData-6LoYbWyK.js +2 -0
- package/dist/assets/iframe-BjAYWlbk.js +226 -0
- package/dist/assets/jsx-runtime-qP9Zu-3U.js +1 -0
- package/dist/assets/legend-ChMeFKa6.js +1261 -0
- package/dist/assets/legend-context-BtHYPzro.js +47 -0
- package/dist/assets/line-chart-BY2E9pFt.js +6 -0
- package/dist/assets/line-chart.stories-BaapO9ba.js +1162 -0
- package/dist/assets/{line-chart.test-case.stories-MkRygT1i.js → line-chart.test-case.stories-Ccs20N5x.js} +4 -4
- package/dist/assets/pie-chart.stories-D5ALwqBw.js +45 -0
- package/dist/assets/preview-Ba4CwQIJ.js +1 -0
- package/dist/assets/preview-CYPcIR3-.js +1 -0
- package/dist/assets/preview-D_SbBdlL.js +3 -0
- package/dist/assets/react-18-COcty78B.js +1 -0
- package/dist/assets/react-B_00WdD4.js +1 -0
- package/dist/assets/react-Blf7liVR.js +1 -0
- package/dist/assets/react-Vdx8ObgF.js +1 -0
- package/dist/assets/react-dom-CbTiFsso.js +8 -0
- package/dist/assets/scatter-chart.stories-o6B12CBB.js +41 -0
- package/dist/assets/test-utils-D7be-ahs.js +1 -0
- package/dist/iframe.html +1 -1
- package/dist/index.js +39035 -29588
- package/dist/project.json +1 -1
- package/package.json +5 -5
- package/dist/assets/Color-YHDXOIA2-Bq81z8oe.js +0 -1
- package/dist/assets/DocsRenderer-CFRXHY34-CrxXBgm2.js +0 -580
- package/dist/assets/bar-chart-const-Cgj9sgUU.js +0 -1
- package/dist/assets/bar-chart.stories-CskKjwzY.js +0 -136
- package/dist/assets/chunk-XP5HYGXS-D5tuasO7.js +0 -1
- package/dist/assets/client-DnE3718B.js +0 -1
- package/dist/assets/entry-preview-CqdghNTQ.js +0 -2
- package/dist/assets/entry-preview-docs-Cet2djRm.js +0 -46
- package/dist/assets/get-custom-legend-plugin-example-Bx2dNJXg.js +0 -1
- package/dist/assets/get-draggableData-BuAjVvlk.js +0 -2
- package/dist/assets/iframe-Covr22ew.js +0 -217
- package/dist/assets/index-BhTLYoCu.js +0 -24
- package/dist/assets/index-CgYGpm1H.js +0 -1
- package/dist/assets/index-DHw5ixvP.js +0 -1
- package/dist/assets/index-Dytf1aFS.js +0 -8
- package/dist/assets/index-YTOF1_EJ.js +0 -9
- package/dist/assets/index-uDG1oqxT.js +0 -1
- package/dist/assets/jsx-runtime-W3oueGCa.js +0 -9
- package/dist/assets/legend-C1G_eM07.js +0 -1367
- package/dist/assets/legend-context-D335GXn0.js +0 -68
- package/dist/assets/line-chart-Df7xumu-.js +0 -6
- package/dist/assets/line-chart.stories-mXxv_jdM.js +0 -1162
- package/dist/assets/pie-chart.stories-CKrEnHPR.js +0 -45
- package/dist/assets/preview-CtUZNZ56.js +0 -2
- package/dist/assets/preview-DD_OYowb.js +0 -1
- package/dist/assets/preview-sKP0fxxa.js +0 -3
- package/dist/assets/react-18-BdgjDjvZ.js +0 -1
- package/dist/assets/scatter-chart.stories-DTnV_CPW.js +0 -41
- package/dist/assets/test-utils-BBHUGUfi.js +0 -9
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import{j as H}from"./jsx-runtime-W3oueGCa.js";import{r as Le}from"./index-YTOF1_EJ.js";import{A as Oe,P as He,C as w,g as je,T as Ie,L as B,a as Ae,d as ve,r as Ne,b as we,s as Me,c as $e,e as ye,f as We,h as Re,i as Ee,j as Ue,k as Be,l as Fe,p as Ve,m as Ge,n as Ze,o as qe,q as Xe,t as Ye}from"./legend-context-D335GXn0.js";import{D as ze,a as Je}from"./bar-chart-const-Cgj9sgUU.js";import"./index-CgYGpm1H.js";const Ke="_chart_1jdnu_1",Qe="_fixedHeight_1jdnu_13",ea="_stretchHeight_1jdnu_19",M={chart:Ke,fixedHeight:Qe,stretchHeight:ea},aa=e=>({width:e==null?void 0:e.width,height:e==null?void 0:e.height,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)||!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)||!1,performanceMode:(e==null?void 0:e.performanceMode)??!0}),ta=e=>({tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)||!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),sa=e=>({showDataLabels:(e==null?void 0:e.showDataLabels)||!1,stacked:(e==null?void 0:e.stacked)||!1,cutout:(e==null?void 0:e.cutout)||0}),ra=e=>({display:(e==null?void 0:e.display)??!0,useDataset:(e==null?void 0:e.useDataset)||!1,position:(e==null?void 0:e.position)||He.Bottom,align:(e==null?void 0:e.align)||Oe.Center}),na=e=>({enableZoom:(e==null?void 0:e.enableZoom)||!1,enablePan:(e==null?void 0:e.enablePan)||!1}),oa=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover}),la=e=>({labels:(e==null?void 0:e.labels)||[],datasets:(e==null?void 0:e.datasets)||[]}),Pe=e=>{const l=(e==null?void 0:e.chart)||{},s=(l==null?void 0:l.options)||{};return{testId:(l==null?void 0:l.testId)??null,data:la(l==null?void 0:l.data),options:{title:(s==null?void 0:s.title)||"",chartStyling:aa(s==null?void 0:s.chartStyling),tooltip:ta(s==null?void 0:s.tooltip),graph:sa(s==null?void 0:s.graph),legend:ra(s==null?void 0:s.legend),chartOptions:na(s==null?void 0:s.chartOptions),interactions:oa(s==null?void 0:s.interactions)}}},ia=e=>{const[l,s]=Le.useState(!1),{data:i,options:t}=e,j=(u=>{var n;const a=[...u];if(t.graph.stacked){const o={label:((n=a==null?void 0:a[0])==null?void 0:n.label)??"",backgroundColor:[],borderColor:"",borderWidth:Number(a[0].borderWidth)||1,data:[],borderDash:[]};return i.labels.map((c,d)=>{a.map((g,b)=>{o.data.push(g.data[d]);const{backgroundColor:x}=g,{borderColor:f}=g;o.backgroundColor.push((Array.isArray(x)?x[d%((f==null?void 0:f.length)||1)]:x)||w[d]+`${99-10*b}`),o.borderColor=f??""})}),[o]}return a.map((o,c)=>{const{borderWidth:d="1"}=o??{},g=parseFloat(String(d))||1,b=w[c],x=o.borderColor||b,f=o.backgroundColor||je(w);return{...o,borderWidth:g,borderColor:x,backgroundColor:f}})})(i.datasets),N=()=>t.title!==""?{display:!0,text:e.options.title}:{},I=(u,a,r)=>{var o;const{chart:n}=r??{};if(a&&n){const{index:c=0}=a;if(n.toggleDataVisibility(c),n.update(),(o=t.interactions)!=null&&o.onLegendClick){const d=n.isDatasetVisible(c);t.interactions.onLegendClick(a.text,!d)}}};return{generatedDatasets:j,getTitle:N,legendClick:I,onClick:(u,a,r)=>{r.resetZoom()},onHover:(u,a)=>{if(l&&!(a!=null&&a.length)&&(s(!1),t.interactions.onUnhover&&t.interactions.onUnhover(u)),!l&&(a!=null&&a.length)&&(s(!0),t.interactions.onHover)){const{index:r,datasetIndex:n}=a[0],o=j;t.interactions.onHover(u,n,r,o)}},getDatalabels:()=>t.graph.showDataLabels?{display:"auto",align:"center",anchor:"center",formatter:(u,a)=>{if(a.chart.getDatasetMeta(t.graph.stacked?0:a.datasetIndex).data[a.dataIndex].hidden)return"";const r=a.dataset.data[a.dataIndex],n=(r==null?void 0:r.label)||(typeof r=="number"?r:Array.isArray(r)?r.reduce((c,d,g)=>g===0?`${c} ${d}`:`${c}, ${d}`,""):"");return typeof r=="number"?Number.isInteger(n)?n:n.toFixed(2):n}}:{display:!1},getLegend:()=>({position:t.legend.position,display:t.legend.display,align:t.legend.align,labels:{boxHeight:6,boxWidth:6,usePointStyle:!0,filter:u=>{var a;return t.legend.useDataset?!((a=i.datasets[u.index])!=null&&a.hideLegend):!0}},onClick:I}),getToolTips:()=>{const u=a=>{var n;let r={};return(n=t==null?void 0:t.tooltip)!=null&&n.scientificNotation?(Math.abs(a)<ze||Math.abs(a)>Je)&&(r={roundScientificCoefficient:3}):r={scientific:!1},ve(Ne(a),r)};return{callbacks:{title:a=>{const{dataIndex:r}=a[0],n=t.graph.stacked?parseInt(String(r/i.labels.length)):r;return`${i.labels[n]}`},label:a=>{var b;const{dataIndex:r}=a,n=t.graph.stacked?r%i.datasets.length:a.datasetIndex,o=i.datasets.length>1?`${(b=i.datasets[n])==null?void 0:b.label}: `:"",c=a.dataset.data[r],d=typeof c=="object"?`${c.value||""} ${t.tooltip.showLabelsInTooltips&&c.label?"("+c.label+")":""}`:c,g=i!=null&&i.yUnit?`[${i==null?void 0:i.yUnit}]`:"";return`${o} ${u(d)} ${g}`}},padding:Ae,boxWidth:B,boxHeight:B,boxPadding:Ie,usePointStyle:!0}}}};Re.register(Ee,Ue,Be,Fe,Ve,Ge,Ze,qe,Xe,Ye);const ca=e=>{Me();const l=Pe(e),s=Le.useRef(null),{data:i,options:t,testId:y}=l,{generatedDatasets:j,getTitle:N,onClick:I,onHover:W,getDatalabels:R,getLegend:E,getToolTips:U}=ia(l);return H.jsx("div",{className:$e(M.chart,!t.chartStyling.width||!t.chartStyling.height?t.chartStyling.staticChartHeight?M.fixedHeight:M.stretchHeight:""),style:{width:t.chartStyling.width||"auto",height:t.chartStyling.height||"auto"},"data-testid":y,children:H.jsx(ye,{ref:s,data:{datasets:j,labels:t.graph.stacked?void 0:i.labels},options:{cutout:t.graph.cutout,onClick:I,responsive:!0,maintainAspectRatio:t.chartStyling.maintainAspectRatio,animation:t.chartStyling.performanceMode?!1:{duration:We.FAST},hover:{mode:"nearest",intersect:!0},onHover:W,plugins:{annotation:!1,title:N(),datalabels:R(),tooltip:U(),legend:E()}}})})},$=e=>{const{options:l}=Pe(e);return H.jsx(we,{options:l,children:H.jsx(ca,{...e})})};$.__docgenInfo={description:"",methods:[],displayName:"PieChartWithLegend",props:{chart:{required:!0,tsType:{name:"IPieChartData"},description:""},testId:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""}}};const h=["label 1","label 2","label 3"],C={label:"data1",data:[3,8,7]},_e={label:"data2",data:[1,2,3]},Te={label:"data3",data:[5,0,4]},da={label:"spacing data",offset:40,data:[3,8,7]},ua={label:"hover data",data:[3,8,7],hoverOffset:40},ke={label:"data",data:[{value:210,label:"label"},{value:333,label:"labal"},{value:248,label:"lebel"}]},ha={label:"data",data:[210,333,248]},pa={data:{labels:h,datasets:[C]}},ga={data:{labels:h,datasets:[C,_e,Te]}},ba={data:{labels:h,datasets:[C,_e,Te]},options:{title:"Stacked",graph:{stacked:!0}}},fa={data:{labels:h,datasets:[ke]},options:{title:"With custom datalabels",graph:{showDataLabels:!0}}},ma={data:{labels:h,datasets:[ha]},options:{title:"With value as datalabels",graph:{showDataLabels:!0}}},Ca={data:{labels:h,datasets:[ke]},options:{title:"With datalabels in tooltips",tooltip:{showLabelsInTooltips:!0}}},xa={data:{labels:h,datasets:[ua]},options:{title:"Hover offset"}},Da={data:{labels:h,datasets:[da]},options:{title:"Segment offset"}},Sa={data:{labels:h,datasets:[C]},options:{chartStyling:{performanceMode:!1}}},La={data:{labels:h,datasets:[C]},options:{title:"Cutout 50%",graph:{cutout:"50%"}}},Pa={data:{labels:h,datasets:[C]},options:{title:"Cutout 20 pixels",graph:{cutout:20}}},Ia={title:"PieChart",component:$,args:{chart:pa}},p=e=>H.jsx($,{...e}),A=p.bind({}),D=p.bind({});D.args={chart:ga};const S=p.bind({});S.args={chart:ba};const L=p.bind({});L.args={chart:fa};const P=p.bind({});P.args={chart:ma};const _=p.bind({});_.args={chart:Ca};const T=p.bind({});T.args={chart:Sa};const k=p.bind({});k.args={chart:La};const O=p.bind({});O.args={chart:Pa};const m=p.bind({});m.args={chart:xa};const v=p.bind({});m.args={chart:Da};var F,V,G;A.parameters={...A.parameters,docs:{...(F=A.parameters)==null?void 0:F.docs,source:{originalSource:`args => {
|
|
2
|
-
return <PieChart
|
|
3
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
|
-
{...args} />;
|
|
5
|
-
}`,...(G=(V=A.parameters)==null?void 0:V.docs)==null?void 0:G.source}}};var Z,q,X;D.parameters={...D.parameters,docs:{...(Z=D.parameters)==null?void 0:Z.docs,source:{originalSource:`args => {
|
|
6
|
-
return <PieChart
|
|
7
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
8
|
-
{...args} />;
|
|
9
|
-
}`,...(X=(q=D.parameters)==null?void 0:q.docs)==null?void 0:X.source}}};var Y,z,J;S.parameters={...S.parameters,docs:{...(Y=S.parameters)==null?void 0:Y.docs,source:{originalSource:`args => {
|
|
10
|
-
return <PieChart
|
|
11
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
12
|
-
{...args} />;
|
|
13
|
-
}`,...(J=(z=S.parameters)==null?void 0:z.docs)==null?void 0:J.source}}};var K,Q,ee;L.parameters={...L.parameters,docs:{...(K=L.parameters)==null?void 0:K.docs,source:{originalSource:`args => {
|
|
14
|
-
return <PieChart
|
|
15
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
16
|
-
{...args} />;
|
|
17
|
-
}`,...(ee=(Q=L.parameters)==null?void 0:Q.docs)==null?void 0:ee.source}}};var ae,te,se;P.parameters={...P.parameters,docs:{...(ae=P.parameters)==null?void 0:ae.docs,source:{originalSource:`args => {
|
|
18
|
-
return <PieChart
|
|
19
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
20
|
-
{...args} />;
|
|
21
|
-
}`,...(se=(te=P.parameters)==null?void 0:te.docs)==null?void 0:se.source}}};var re,ne,oe;_.parameters={..._.parameters,docs:{...(re=_.parameters)==null?void 0:re.docs,source:{originalSource:`args => {
|
|
22
|
-
return <PieChart
|
|
23
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
24
|
-
{...args} />;
|
|
25
|
-
}`,...(oe=(ne=_.parameters)==null?void 0:ne.docs)==null?void 0:oe.source}}};var le,ie,ce;T.parameters={...T.parameters,docs:{...(le=T.parameters)==null?void 0:le.docs,source:{originalSource:`args => {
|
|
26
|
-
return <PieChart
|
|
27
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
28
|
-
{...args} />;
|
|
29
|
-
}`,...(ce=(ie=T.parameters)==null?void 0:ie.docs)==null?void 0:ce.source}}};var de,ue,he;k.parameters={...k.parameters,docs:{...(de=k.parameters)==null?void 0:de.docs,source:{originalSource:`args => {
|
|
30
|
-
return <PieChart
|
|
31
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
32
|
-
{...args} />;
|
|
33
|
-
}`,...(he=(ue=k.parameters)==null?void 0:ue.docs)==null?void 0:he.source}}};var pe,ge,be;O.parameters={...O.parameters,docs:{...(pe=O.parameters)==null?void 0:pe.docs,source:{originalSource:`args => {
|
|
34
|
-
return <PieChart
|
|
35
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
36
|
-
{...args} />;
|
|
37
|
-
}`,...(be=(ge=O.parameters)==null?void 0:ge.docs)==null?void 0:be.source}}};var fe,me,Ce;m.parameters={...m.parameters,docs:{...(fe=m.parameters)==null?void 0:fe.docs,source:{originalSource:`args => {
|
|
38
|
-
return <PieChart
|
|
39
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
40
|
-
{...args} />;
|
|
41
|
-
}`,...(Ce=(me=m.parameters)==null?void 0:me.docs)==null?void 0:Ce.source}}};var xe,De,Se;v.parameters={...v.parameters,docs:{...(xe=v.parameters)==null?void 0:xe.docs,source:{originalSource:`args => {
|
|
42
|
-
return <PieChart
|
|
43
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
44
|
-
{...args} />;
|
|
45
|
-
}`,...(Se=(De=v.parameters)==null?void 0:De.docs)==null?void 0:Se.source}}};const Aa=["Default","MultipleSets","MultipleSetsStacked","Datalabels","DatalabelsValues","DatalabelsInTooltips","Animated","Doughnut","DoughnutFixedCutout","HoverOffset","SegmentOffset"];export{T as Animated,L as Datalabels,_ as DatalabelsInTooltips,P as DatalabelsValues,A as Default,k as Doughnut,O as DoughnutFixedCutout,m as HoverOffset,D as MultipleSets,S as MultipleSetsStacked,v as SegmentOffset,Aa as __namedExportsOrder,Ia as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-CFRXHY34-CrxXBgm2.js","./iframe-Covr22ew.js","./index-YTOF1_EJ.js","./jsx-runtime-W3oueGCa.js","./index-DHw5ixvP.js","./index-BhTLYoCu.js","./index-Dytf1aFS.js","./client-DnE3718B.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as o}from"./iframe-Covr22ew.js";var s=Object.defineProperty,i=(e,r)=>{for(var t in r)s(e,t,{get:r[t],enumerable:!0})},n={};i(n,{parameters:()=>d});var _=Object.entries(globalThis.TAGS_OPTIONS??{}).reduce((e,r)=>{let[t,a]=r;return a.excludeFromDocsStories&&(e[t]=!0),e},{}),d={docs:{renderer:async()=>{let{DocsRenderer:e}=await o(async()=>{const{DocsRenderer:r}=await import("./DocsRenderer-CFRXHY34-CrxXBgm2.js").then(t=>t.e);return{DocsRenderer:r}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return new e},stories:{filter:e=>{var r;return(e.tags||[]).filter(t=>_[t]).length===0&&!((r=e.parameters.docs)!=null&&r.disable)}}}};export{d as parameters};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let p;const S=new Uint8Array(16);function A(){if(!p&&(p=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!p))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return p(S)}const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function D(e,t=0){return o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]}const I=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),h={randomUUID:I};function f(e,t,r){if(h.randomUUID&&!e)return h.randomUUID();e=e||{};const n=e.random||(e.rng||A)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,D(n)}const{addons:v}=__STORYBOOK_MODULE_PREVIEW_API__,{ImplicitActionsDuringRendering:U}=__STORYBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__,{global:d}=__STORYBOOK_MODULE_GLOBAL__;var w="storybook/actions",j=`${w}/action-event`,V={depth:10,clearOnStoryChange:!0,limit:50},E=(e,t)=>{let r=Object.getPrototypeOf(e);return!r||t(r)?r:E(r,t)},C=e=>!!(typeof e=="object"&&e&&E(e,t=>/^Synthetic(?:Base)?Event$/.test(t.constructor.name))&&typeof e.persist=="function"),K=e=>{if(C(e)){let t=Object.create(e.constructor.prototype,Object.getOwnPropertyDescriptors(e));t.persist();let r=Object.getOwnPropertyDescriptor(t,"view"),n=r==null?void 0:r.value;return typeof n=="object"&&(n==null?void 0:n.constructor.name)==="Window"&&Object.defineProperty(t,"view",{...r,value:Object.create(n.constructor.prototype)}),t}return e},L=()=>typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?f():Date.now().toString(36)+Math.random().toString(36).substring(2);function _(e,t={}){let r={...V,...t},n=function(...s){var g,O;if(t.implicit){let y=(g="__STORYBOOK_PREVIEW__"in d?d.__STORYBOOK_PREVIEW__:void 0)==null?void 0:g.storyRenders.find(l=>l.phase==="playing"||l.phase==="rendering");if(y){let l=!((O=globalThis==null?void 0:globalThis.FEATURES)!=null&&O.disallowImplicitActionsInRenderV8),R=new U({phase:y.phase,name:e,deprecated:l});if(l)console.warn(R);else throw R}}let i=v.getChannel(),c=L(),a=5,u=s.map(K),b=s.length>1?u:u[0],x={id:c,count:0,data:{name:e,args:b},options:{...r,maxDepth:a+(r.depth||3),allowFunction:r.allowFunction||!1}};i.emit(j,x)};return n.isAction=!0,n.implicit=t.implicit,n}var T=(e,t)=>typeof t[e]>"u"&&!(e in t),B=e=>{let{initialArgs:t,argTypes:r,id:n,parameters:{actions:s}}=e;if(!s||s.disable||!s.argTypesRegex||!r)return{};let i=new RegExp(s.argTypesRegex);return Object.entries(r).filter(([c])=>!!i.test(c)).reduce((c,[a,u])=>(T(a,t)&&(c[a]=_(a,{implicit:!0,id:n})),c),{})},M=e=>{let{initialArgs:t,argTypes:r,parameters:{actions:n}}=e;return n!=null&&n.disable||!r?{}:Object.entries(r).filter(([s,i])=>!!i.action).reduce((s,[i,c])=>(T(i,t)&&(s[i]=_(typeof c.action=="string"?c.action:i)),s),{})},Y=[M,B],m=!1,P=e=>{let{parameters:{actions:t}}=e;if(!(t!=null&&t.disable)&&!m&&"__STORYBOOK_TEST_ON_MOCK_CALL__"in d&&typeof d.__STORYBOOK_TEST_ON_MOCK_CALL__=="function"){let r=d.__STORYBOOK_TEST_ON_MOCK_CALL__;r((n,s)=>{let i=n.getMockName();i!=="spy"&&(!/^next\/.*::/.test(i)||["next/router::useRouter()","next/navigation::useRouter()","next/navigation::redirect","next/cache::","next/headers::cookies().set","next/headers::cookies().delete","next/headers::headers().set","next/headers::headers().delete"].some(c=>i.startsWith(c)))&&_(i)(s)}),m=!0}},N=[P];export{Y as argsEnhancers,N as loaders};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as c}from"./jsx-runtime-W3oueGCa.js";import{r as v}from"./index-YTOF1_EJ.js";import{c as p,D as j}from"./DocsRenderer-CFRXHY34-CrxXBgm2.js";import{e as E}from"./index-CgYGpm1H.js";import"./preview-CtUZNZ56.js";import"./iframe-Covr22ew.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";import"./index-Dytf1aFS.js";import"./client-DnE3718B.js";var g="DARK_MODE";function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},f(t)}var b;function A(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,n)}return e}function D(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?A(Object(e),!0).forEach(function(n){I(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):A(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function I(t,r,e){return r=M(r),r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function M(t){var r=R(t,"string");return f(r)==="symbol"?r:String(r)}function R(t,r){if(f(t)!=="object"||t===null)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var n=e.call(t,r);if(f(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function y(t){return L(t)||N(t)||K(t)||x()}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K(t,r){if(t){if(typeof t=="string")return O(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return O(t,r)}}function N(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function L(t){if(Array.isArray(t))return O(t)}function O(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}const{global:U}=__STORYBOOK_MODULE_GLOBAL__,{STORY_CHANGED:st,SET_STORIES:ct,DOCS_RENDERED:ft}=__STORYBOOK_MODULE_CORE_EVENTS__;var T=U,Y=T.document,h=T.window,C="sb-addon-themes-3";(b=h.matchMedia)===null||b===void 0||b.call(h,"(prefers-color-scheme: dark)");var S={classTarget:"body",dark:p.dark,darkClass:["dark"],light:p.light,lightClass:["light"],stylePreview:!1,userHasExplicitlySetTheTheme:!1},k=function(r){h.localStorage.setItem(C,JSON.stringify(r))},B=function(r,e){var n=e.current,a=e.darkClass,l=a===void 0?S.darkClass:a,o=e.lightClass,i=o===void 0?S.lightClass:o;if(n==="dark"){var u,s;(u=r.classList).remove.apply(u,y(d(i))),(s=r.classList).add.apply(s,y(d(l)))}else{var m,_;(m=r.classList).remove.apply(m,y(d(l))),(_=r.classList).add.apply(_,y(d(i)))}},d=function(r){var e=[];return e.concat(r).map(function(n){return n})},W=function(r){var e=Y.querySelector(r.classTarget);e&&B(e,r)},P=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=h.localStorage.getItem(C);if(typeof e=="string"){var n=JSON.parse(e);return r&&(r.dark&&!E(n.dark,r.dark)&&(n.dark=r.dark,k(n)),r.light&&!E(n.light,r.light)&&(n.light=r.light,k(n))),n}return D(D({},S),r)};W(P());function H(t,r){return q(t)||G(t,r)||$(t,r)||V()}function V(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $(t,r){if(t){if(typeof t=="string")return w(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return w(t,r)}}function w(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function G(t,r){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var n,a,l,o,i=[],u=!0,s=!1;try{if(l=(e=e.call(t)).next,r!==0)for(;!(u=(n=l.call(e)).done)&&(i.push(n.value),i.length!==r);u=!0);}catch(m){s=!0,a=m}finally{try{if(!u&&e.return!=null&&(o=e.return(),Object(o)!==o))return}finally{if(s)throw a}}return i}}function q(t){if(Array.isArray(t))return t}const{addons:J,useState:F,useEffect:z}=__STORYBOOK_MODULE_PREVIEW_API__;function Q(){var t=F(P().current==="dark"),r=H(t,2),e=r[0],n=r[1];return z(function(){var a=J.getChannel();return a.on(g,n),function(){return a.off(g,n)}},[]),e}const{definePreview:mt}=__STORYBOOK_MODULE_PREVIEW_API__,yt=[t=>c.jsx(c.Fragment,{children:c.jsx(t,{})}),t=>{const r=Q();return v.useEffect(()=>(document.documentElement.dataset.theme=r?"dark":"default",()=>{delete document.documentElement.dataset.theme}),[r]),c.jsx(t,{})}],X=t=>{const[r,e]=v.useState(!1);return v.useEffect(()=>{const n=a=>e(a);return t.context.channel.on(g,n),()=>{t.context.channel.off(g,n)}},[t.context.channel]),c.jsx(j,{...t,theme:r?p.dark:p.light})},dt={docs:{container:X},darkMode:{current:"light",stylePreview:!0}},pt=["autodocs"];export{yt as decorators,dt as parameters,pt as tags};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s}from"./index-YTOF1_EJ.js";import{c as l}from"./client-DnE3718B.js";import"./index-BhTLYoCu.js";var n=new Map;function m(){return globalThis.IS_REACT_ACT_ENVIRONMENT}var a=({callback:e,children:r})=>{let t=s.useRef();return s.useLayoutEffect(()=>{t.current!==e&&(t.current=e,e())},[e]),r};typeof Promise.withResolvers>"u"&&(Promise.withResolvers=()=>{let e=null,r=null;return{promise:new Promise((t,o)=>{e=t,r=o}),resolve:e,reject:r}});var v=async(e,r,t)=>{let o=await c(r,t);if(m()){o.render(e);return}let{promise:i,resolve:u}=Promise.withResolvers();return o.render(s.createElement(a,{callback:u},e)),i},f=(e,r)=>{let t=n.get(e);t&&(t.unmount(),n.delete(e))},c=async(e,r)=>{let t=n.get(e);return t||(t=l.createRoot(e,r),n.set(e,t)),t};export{v as renderElement,f as unmountElement};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{j as g}from"./jsx-runtime-W3oueGCa.js";import{r as ye}from"./index-YTOF1_EJ.js";import{d as ve,r as Ae,z as ke,B as u,S as De,E as je,O as He,N as we,f as q,C as Me,A as Ee,P as Ne,Y as Pe,G as z,b as Ie,s as Ue,Q as qe,Z as ze,U as Ze,h as Fe,i as Ye,V as Ve,j as Xe,p as $e,m as Je,n as Qe,q as Ke,t as Ge}from"./legend-context-D335GXn0.js";import{j as et,u as tt,t as at,o as st,p as rt,l as lt,H as ot,L as nt,m as ct,n as dt}from"./legend-C1G_eM07.js";import{D as it,a as ut}from"./bar-chart-const-Cgj9sgUU.js";import"./index-CgYGpm1H.js";import"./index-DHw5ixvP.js";import"./index-BhTLYoCu.js";const Z=(e,t)=>{let a={};return t?(Math.abs(e)<it||Math.abs(e)>ut)&&(a={roundScientificCoefficient:3}):a={scientific:!1},ve(Ae(e),a)},gt=(e,t)=>{var a;if((a=t==null?void 0:t.tooltip)!=null&&a.showLabelsInTooltips){const r=e[0],{label:s}=(r==null?void 0:r.dataset)??{};return s}},ht=(e,t)=>{var o;const{raw:a,dataset:r}=e??{},s=a==null?void 0:a.label,n=(o=t==null?void 0:t.tooltip)==null?void 0:o.scientificNotation;return`${s??(r==null?void 0:r.label)} ( x: ${Z(a==null?void 0:a.x,n)} , y: ${Z(a==null?void 0:a.y,n)} )`},mt=e=>{var t,a,r;return{enabled:(t=e==null?void 0:e.tooltip)==null?void 0:t.enabled,callbacks:{title:s=>gt(s,e),label:s=>ht(s,e)},backgroundColor:(a=e==null?void 0:e.tooltip)==null?void 0:a.backgroundColor,displayColors:(r=e==null?void 0:e.tooltip)==null?void 0:r.displayColors,padding:7}},F=({options:e,axisType:t=u.X,currentScale:a})=>{var C,T,p,b,L,f,w,y,M;const r=ke(e.direction),s=a||((T=(C=e==null?void 0:e.axes)==null?void 0:C[t])==null?void 0:T[0]),n=r&&t===u.Y||!r&&t===u.X,o=(s==null?void 0:s.gridLines)||{},x=()=>{var l;const c=r?u.Y:u.X;return t===c?(l=e==null?void 0:e.additionalAxesOptions)==null?void 0:l.reverse:!1},S=()=>{const c=e==null?void 0:e.additionalAxesOptions;return{...{stepSize:(s==null?void 0:s.stepSize)??(t===u.Y?c==null?void 0:c.stepSize:void 0)},includeBounds:!1,font:{size:je}}};return{type:De.Linear,position:s==null?void 0:s.position,beginAtZero:(p=e==null?void 0:e.additionalAxesOptions)==null?void 0:p.beginAtZero,reverse:x(),suggestedMax:(b=e==null?void 0:e.additionalAxesOptions)==null?void 0:b.suggestedMax,suggestedMin:(L=e==null?void 0:e.additionalAxesOptions)==null?void 0:L.suggestedMin,min:n?(f=e==null?void 0:e.additionalAxesOptions)==null?void 0:f.min:void 0,max:n?(w=e==null?void 0:e.additionalAxesOptions)==null?void 0:w.max:void 0,title:{display:!!((y=s==null?void 0:s.label)!=null&&y.length)||!!((M=s==null?void 0:s.unit)!=null&&M.length),text:(s==null?void 0:s.label)||(s==null?void 0:s.unit),padding:0},ticks:S(),grid:{...o}}},bt=e=>{const t=F({options:e,axisType:u.X}),a=F({options:e,axisType:u.Y});return{x:t,y:a}},ft=(e,t)=>{const{data:a,options:r}=e,{interactions:s,chartStyling:n}=r,[o,x]=ye.useState(!1),{legend:S,customLegendPlugin:C,legendClick:T}=et({chartRef:t,options:r}),{state:p}=tt(),{annotation:b}=p,f=(c=>c.map((l,R)=>{const{borderWidth:E=st}=l??{},_e=parseFloat(String(E))||1,U=Me[R],We=l.borderColor??U,Be=l.backgroundColor??U;return{...l,borderWidth:_e,borderColor:We,backgroundColor:Be}}))(a.datasets),w=(c,l,R)=>{R.resetZoom()},y=(c,l)=>{if(o&&!(l!=null&&l.length)&&(x(!1),s.onUnhover&&s.onUnhover(c)),!o&&(l!=null&&l.length)&&(x(!0),s.onHover)){const{index:R,datasetIndex:E}=l[0];s.onHover(c,E,R,f)}},M={onClick:w,onHover:y,...n,interactions:{onLegendClick:T,onHover:y},scales:bt(e==null?void 0:e.options),animation:n.performanceMode?{duration:q.NO}:{duration:q.FAST,onComplete:s==null?void 0:s.onAnimationComplete},plugins:{legend:{...S,display:!1,events:[]},customLegendPlugin:C,title:He(r),annotation:at(b),chartAreaBorder:{borderColor:we},datalabels:{display:r.graph.showDataLabels},tooltip:mt(r)}};return{generatedDatasets:f,scatterOptions:M}};var d=(e=>(e[e.TopToBottom=0]="TopToBottom",e[e.BottomToTop=1]="BottomToTop",e[e.LeftToRight=2]="LeftToRight",e[e.RightToLeft=3]="RightToLeft",e[e.TopLeftToBottomRight=4]="TopLeftToBottomRight",e[e.BottomRightToTopLeft=5]="BottomRightToTopLeft",e[e.BottomLeftToTopRight=6]="BottomLeftToTopRight",e[e.TopRightToBottomLeft=7]="TopRightToBottomLeft",e))(d||{});const xt=e=>({display:(e==null?void 0:e.display)??!1,gradientColors:(e==null?void 0:e.gradientColors)??Pe,direction:(e==null?void 0:e.direction)??d.BottomLeftToTopRight}),Ct=e=>({width:(e==null?void 0:e.width)??z,height:(e==null?void 0:e.height)??z,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)||!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)||!1,performanceMode:(e==null?void 0:e.performanceMode)??!0,gradient:xt(e==null?void 0:e.gradient)}),Tt=e=>({enabled:(e==null?void 0:e.enabled)??!0,tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)||!1,backgroundColor:(e==null?void 0:e.backgroundColor)||"#333",displayColors:(e==null?void 0:e.displayColors)||!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),pt=e=>({showMinorGridlines:(e==null?void 0:e.showMinorGridlines)??!1,showDataLabels:(e==null?void 0:e.showDataLabels)??!1}),St=e=>({display:(e==null?void 0:e.display)??!0,useDataset:(e==null?void 0:e.useDataset)||!1,position:(e==null?void 0:e.position)||Ne.BottomLeft,align:(e==null?void 0:e.align)||Ee.Center}),Lt=e=>({enableZoom:(e==null?void 0:e.enableZoom)||!1,enablePan:(e==null?void 0:e.enablePan)||!1}),yt=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover,onAnimationComplete:e==null?void 0:e.onAnimationComplete}),Rt=e=>({labels:(e==null?void 0:e.labels)||[],datasets:(e==null?void 0:e.datasets)||[]}),Ot=e=>e?e.map(t=>({...t,display:(t==null?void 0:t.display)??!0})):[],_t=e=>({showAnnotations:(e==null?void 0:e.showAnnotations)??!0,controlAnnotation:(e==null?void 0:e.controlAnnotation)||!1,annotationsData:Ot(e==null?void 0:e.annotationsData)}),Wt=e=>({x:(e==null?void 0:e.x)||[{}],y:(e==null?void 0:e.y)||[{}]}),Bt=e=>({reverse:(e==null?void 0:e.reverse)||!1,stacked:(e==null?void 0:e.stacked)||!1,beginAtZero:(e==null?void 0:e.beginAtZero)??!0,stepSize:e==null?void 0:e.stepSize,suggestedMin:e==null?void 0:e.suggestedMin,suggestedMax:e==null?void 0:e.suggestedMax,min:e==null?void 0:e.min,max:e==null?void 0:e.max}),Re=e=>{const t=(e==null?void 0:e.chart)||{},a=(t==null?void 0:t.options)||{};return{testId:(t==null?void 0:t.testId)??null,data:Rt(t==null?void 0:t.data),options:{title:(a==null?void 0:a.title)||"",axes:Wt(a==null?void 0:a.axes),additionalAxesOptions:Bt(a==null?void 0:a.additionalAxesOptions),direction:(a==null?void 0:a.direction)||rt.VERTICAL,chartStyling:Ct(a==null?void 0:a.chartStyling),tooltip:Tt(a==null?void 0:a.tooltip),graph:pt(a==null?void 0:a.graph),legend:St(a==null?void 0:a.legend),annotations:_t(a==null?void 0:a.annotations),chartOptions:Lt(a==null?void 0:a.chartOptions),interactions:yt(a==null?void 0:a.interactions)}}},vt=(e,t)=>{switch(e){case d.TopToBottom:return[t.left,t.top,t.left,t.bottom];case d.BottomToTop:return[t.left,t.bottom,t.left,t.top];case d.LeftToRight:return[t.left,t.top,t.right,t.top];case d.RightToLeft:return[t.right,t.top,t.left,t.top];case d.TopLeftToBottomRight:return[t.left,t.top,t.right,t.bottom];case d.BottomRightToTopLeft:return[t.right,t.bottom,t.left,t.top];case d.BottomLeftToTopRight:return[t.left,t.bottom,t.right,t.top];case d.TopRightToBottomLeft:return[t.right,t.top,t.left,t.bottom];default:return[t.left,t.bottom,t.right,t.top]}},At={id:"gradientBackgroundPlugin",beforeDraw:e=>{const{ctx:t,chartArea:a,options:r}=e;if(!t||!a)return;const s=r==null?void 0:r.gradient,{display:n=!1,gradientColors:o,direction:x=d.BottomLeftToTopRight}=s??{};if(!n||!o||o.length===0)return;const[S,C,T,p]=vt(x,a),b=t.createLinearGradient(S,C,T,p);o.forEach(({offset:L,color:f})=>{b.addColorStop(L,f)}),t.save(),t.globalCompositeOperation="destination-over",t.fillStyle=b,t.fillRect(a.left,a.top,a.right-a.left,a.bottom-a.top),t.restore()}},kt="_chart_1qlu1_1",Dt="_canvas_1qlu1_11",jt="_fixedHeight_1qlu1_20",Ht="_stretchHeight_1qlu1_26",wt="_squareAspectRatio_1qlu1_32",Y={chart:kt,canvas:Dt,fixedHeight:jt,stretchHeight:Ht,squareAspectRatio:wt};Fe.register(Ye,Ve,Xe,$e,Je,Qe,Ke,Ge,dt,At);const Mt=e=>{Ue();const t=ye.useRef(null),a=Re(e),{options:r,testId:s}=a,{scatterOptions:n,generatedDatasets:o}=ft(a,t);return g.jsx("div",{className:qe(r.chartStyling,Y),style:{width:r.chartStyling.width,height:r.chartStyling.height},"data-testid":s,children:g.jsx(lt,{backend:ot,context:window,children:g.jsxs("div",{className:Y.canvas,id:"canvas",children:[g.jsx(ze,{ref:t,data:{datasets:o},options:n,plugins:Ze(r.graph,r.legend)}),!!o.length&&g.jsx(nt,{chartRef:t,legendConfig:{options:r,generatedDatasets:o,chartType:ct.SCATTER}})]})})})},N=e=>{const{options:t}=Re(e);return g.jsx(Ie,{options:t,children:g.jsx(Mt,{...e})})};N.__docgenInfo={description:"",methods:[],displayName:"ScatterChartWithLegend",props:{chart:{required:!0,tsType:{name:"IScatterChartData"},description:""},testId:{required:!1,tsType:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},description:""}}};const h=["label 1","label 2","label 3"],m={label:"Dataset 1",data:[{x:1,y:5},{x:3,y:7},{x:6,y:2},{x:8,y:6},{x:9,y:4}]},P={label:"Dataset 2",data:[{x:1,y:3},{x:4,y:5},{x:7,y:9},{x:10,y:2},{x:12,y:7}]},Et={label:"Dataset 3",data:[{x:2,y:8},{x:5,y:6},{x:8,y:10},{x:11,y:5},{x:14,y:9}]},Oe={label:"Dataset 4",data:[{x:2,y:8},{x:14,y:9}]},Nt={label:"Dataset 5",data:[{x:14,y:7,label:"Echo"},{x:3,y:18,label:"Lima"},{x:19,y:2,label:"Romeo"},{x:8,y:11,label:"Charlie"},{x:12,y:9,label:"Oscar"}]},Pt={label:"Dataset 6",data:[{x:15,y:3,label:"Hotel"},{x:9,y:14,label:"Tango"},{x:4,y:17,label:"Whiskey"},{x:11,y:7,label:"Juliet"},{x:13,y:1,label:"Zulu"}]},It={label:"Dataset Decimals",data:[{x:4.30021321123002,y:2.30021321123005},{x:5.12321321000003,y:3.23213210000037}]},I={data:{labels:h,datasets:[m]}},Ut={data:{labels:h,datasets:[m]},options:{chartStyling:{height:300,width:700}}},qt={data:{labels:h,datasets:[m,P,Et]}},zt={data:{labels:h,datasets:[m]},options:{title:"With Data Labels",graph:{showDataLabels:!0}}},Zt={data:{labels:h,datasets:[m,P,It]},options:{title:"With Tooltips",tooltip:{title:"Tooltip",showLabelsInTooltips:!0}}},Ft={data:{labels:h,datasets:[{...m,backgroundColor:"red",borderColor:"red"}]}},Yt={data:{labels:h,datasets:[m]},options:{title:"With Annotation",annotations:{showAnnotations:!0,annotationsData:[{annotationAxis:"y",label:"Horizontal Annotation",value:2.5,color:"rgba(96, 32, 196, 0.5)"}]}}},Vt={data:{labels:h,datasets:[m,P,Oe]},options:{title:"With Axes Labels",axes:{x:[{label:"x axis"}],y:[{label:"y axis"}]}}},Xt={...I,options:{title:"With Gradient",chartStyling:{gradient:{display:!0}}}},$t={data:{datasets:[Nt,Pt,Oe]},options:{title:"With datapoint label showing when hovered",tooltip:{showLabelsInTooltips:!0}}},ra={title:"ScatterChart",component:N,args:{chart:I}},i=e=>g.jsx(N,{...e}),O=i.bind({});O.args={chart:I};const _=i.bind({});_.args={chart:Ut};const W=i.bind({});W.args={chart:qt};const B=i.bind({});B.args={chart:zt};const v=i.bind({});v.args={chart:Zt};const A=i.bind({});A.args={chart:Yt};const k=i.bind({});k.args={chart:Vt};const D=i.bind({});D.args={chart:Xt};const j=i.bind({});j.args={chart:$t};const H=i.bind({});H.args={chart:Ft};var V,X,$;O.parameters={...O.parameters,docs:{...(V=O.parameters)==null?void 0:V.docs,source:{originalSource:`args => {
|
|
2
|
-
return <ScatterChart
|
|
3
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
4
|
-
{...args} />;
|
|
5
|
-
}`,...($=(X=O.parameters)==null?void 0:X.docs)==null?void 0:$.source}}};var J,Q,K;_.parameters={..._.parameters,docs:{...(J=_.parameters)==null?void 0:J.docs,source:{originalSource:`args => {
|
|
6
|
-
return <ScatterChart
|
|
7
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
8
|
-
{...args} />;
|
|
9
|
-
}`,...(K=(Q=_.parameters)==null?void 0:Q.docs)==null?void 0:K.source}}};var G,ee,te;W.parameters={...W.parameters,docs:{...(G=W.parameters)==null?void 0:G.docs,source:{originalSource:`args => {
|
|
10
|
-
return <ScatterChart
|
|
11
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
12
|
-
{...args} />;
|
|
13
|
-
}`,...(te=(ee=W.parameters)==null?void 0:ee.docs)==null?void 0:te.source}}};var ae,se,re;B.parameters={...B.parameters,docs:{...(ae=B.parameters)==null?void 0:ae.docs,source:{originalSource:`args => {
|
|
14
|
-
return <ScatterChart
|
|
15
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
16
|
-
{...args} />;
|
|
17
|
-
}`,...(re=(se=B.parameters)==null?void 0:se.docs)==null?void 0:re.source}}};var le,oe,ne;v.parameters={...v.parameters,docs:{...(le=v.parameters)==null?void 0:le.docs,source:{originalSource:`args => {
|
|
18
|
-
return <ScatterChart
|
|
19
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
20
|
-
{...args} />;
|
|
21
|
-
}`,...(ne=(oe=v.parameters)==null?void 0:oe.docs)==null?void 0:ne.source}}};var ce,de,ie;A.parameters={...A.parameters,docs:{...(ce=A.parameters)==null?void 0:ce.docs,source:{originalSource:`args => {
|
|
22
|
-
return <ScatterChart
|
|
23
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
24
|
-
{...args} />;
|
|
25
|
-
}`,...(ie=(de=A.parameters)==null?void 0:de.docs)==null?void 0:ie.source}}};var ue,ge,he;k.parameters={...k.parameters,docs:{...(ue=k.parameters)==null?void 0:ue.docs,source:{originalSource:`args => {
|
|
26
|
-
return <ScatterChart
|
|
27
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
28
|
-
{...args} />;
|
|
29
|
-
}`,...(he=(ge=k.parameters)==null?void 0:ge.docs)==null?void 0:he.source}}};var me,be,fe;D.parameters={...D.parameters,docs:{...(me=D.parameters)==null?void 0:me.docs,source:{originalSource:`args => {
|
|
30
|
-
return <ScatterChart
|
|
31
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
32
|
-
{...args} />;
|
|
33
|
-
}`,...(fe=(be=D.parameters)==null?void 0:be.docs)==null?void 0:fe.source}}};var xe,Ce,Te;j.parameters={...j.parameters,docs:{...(xe=j.parameters)==null?void 0:xe.docs,source:{originalSource:`args => {
|
|
34
|
-
return <ScatterChart
|
|
35
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
36
|
-
{...args} />;
|
|
37
|
-
}`,...(Te=(Ce=j.parameters)==null?void 0:Ce.docs)==null?void 0:Te.source}}};var pe,Se,Le;H.parameters={...H.parameters,docs:{...(pe=H.parameters)==null?void 0:pe.docs,source:{originalSource:`args => {
|
|
38
|
-
return <ScatterChart
|
|
39
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
40
|
-
{...args} />;
|
|
41
|
-
}`,...(Le=(Se=H.parameters)==null?void 0:Se.docs)==null?void 0:Le.source}}};const la=["Default","StyledChart","MultipleDatasets","WithDataLabels","WithTooltips","WithAnnotation","WithAxesLabels","WithGradient","WithDatapointsHavingLabel","CustomPointColor"];export{H as CustomPointColor,O as Default,W as MultipleDatasets,_ as StyledChart,A as WithAnnotation,k as WithAxesLabels,B as WithDataLabels,j as WithDatapointsHavingLabel,D as WithGradient,v as WithTooltips,la as __namedExportsOrder,ra as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as Oe,g as Ue}from"./index-YTOF1_EJ.js";import{r as Pe}from"./index-BhTLYoCu.js";function Se(p,y){for(var v=0;v<y.length;v++){const d=y[v];if(typeof d!="string"&&!Array.isArray(d)){for(const h in d)if(h!=="default"&&!(h in p)){const l=Object.getOwnPropertyDescriptor(d,h);l&&Object.defineProperty(p,h,l.get?l:{enumerable:!0,get:()=>d[h]})}}}return Object.freeze(Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}))}var A={exports:{}},u={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-dom-test-utils.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var z;function Re(){if(z)return u;z=1;var p=Oe(),y=Pe();function v(e){var n=e,t=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(t=n.return),e=n.return;while(e)}return n.tag===3?t:null}function d(e){if(v(e)!==e)throw Error("Unable to find node on an unmounted component.")}function h(e){var n=e.alternate;if(!n){if(n=v(e),n===null)throw Error("Unable to find node on an unmounted component.");return n!==e?null:e}for(var t=e,r=n;;){var i=t.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){t=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===t)return d(i),e;if(s===r)return d(i),n;s=s.sibling}throw Error("Unable to find node on an unmounted component.")}if(t.return!==r.return)t=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===t){o=!0,t=i,r=s;break}if(a===r){o=!0,r=i,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,r=i;break}if(a===r){o=!0,r=s,t=i;break}a=a.sibling}if(!o)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(t.alternate!==r)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(t.tag!==3)throw Error("Unable to find node on an unmounted component.");return t.stateNode.current===t?e:n}var l=Object.assign;function P(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function k(){return!0}function K(){return!1}function c(e){function n(t,r,i,s,o){this._reactName=t,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?k:K,this.isPropagationStopped=K,this}return l(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=k)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=k)},persist:function(){},isPersistent:k}),n}var g={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$=c(g),w=l({},g,{view:0,detail:0});c(w);var S,R,C,_=l({},w,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:I,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==C&&(C&&e.type==="mousemove"?(S=e.screenX-C.screenX,R=e.screenY-C.screenY):R=S=0,C=e),S)},movementY:function(e){return"movementY"in e?e.movementY:R}});c(_);var G=l({},_,{dataTransfer:0});c(G);var J=l({},w,{relatedTarget:0});c(J);var Q=l({},g,{animationName:0,elapsedTime:0,pseudoElement:0});c(Q);var ee=l({},g,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}});c(ee);var te=l({},g,{data:0});c(te);var ne={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},re={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},oe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ie(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=oe[e])?!!n[e]:!1}function I(){return ie}var se=l({},w,{key:function(e){if(e.key){var n=ne[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=P(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?re[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:I,charCode:function(e){return e.type==="keypress"?P(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?P(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}});c(se);var ae=l({},_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0});c(ae);var ue=l({},w,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:I});c(ue);var le=l({},g,{propertyName:0,elapsedTime:0,pseudoElement:0});c(le);var ce=l({},_,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0});c(ce);function pe(e,n,t,r,i,s,o,a,b){var f=Array.prototype.slice.call(arguments,3);try{n.apply(t,f)}catch(Me){this.onError(Me)}}var E=!1,T=null,M=!1,N=null,de={onError:function(e){E=!0,T=e}};function fe(e,n,t,r,i,s,o,a,b){E=!1,T=null,pe.apply(de,arguments)}function he(e,n,t,r,i,s,o,a,b){if(fe.apply(this,arguments),E){if(E){var f=T;E=!1,T=null}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");M||(M=!0,N=f)}}var L=Array.isArray,D=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,me=D[0],ye=D[1],ve=D[2],ge=D[3],we=D[4],Ce=p.unstable_act;function Ee(){}function De(e,n){if(!e)return[];if(e=h(e),!e)return[];for(var t=e,r=[];;){if(t.tag===5||t.tag===6||t.tag===1||t.tag===0){var i=t.stateNode;n(i)&&r.push(i)}if(t.child)t.child.return=t,t=t.child;else{if(t===e)return r;for(;!t.sibling;){if(!t.return||t.return===e)return r;t=t.return}t.sibling.return=t.return,t=t.sibling}}}function m(e,n){if(e&&!e._reactInternals){var t=String(e);throw e=L(e)?"an array":e&&e.nodeType===1&&e.tagName?"a DOM node":t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t,Error(n+"(...): the first argument must be a React class instance. Instead received: "+(e+"."))}}function O(e){return!(!e||e.nodeType!==1||!e.tagName)}function x(e){return O(e)?!1:e!=null&&typeof e.render=="function"&&typeof e.setState=="function"}function W(e,n){return x(e)?e._reactInternals.type===n:!1}function U(e,n){return m(e,"findAllInRenderedTree"),e?De(e._reactInternals,n):[]}function Y(e,n){return m(e,"scryRenderedDOMComponentsWithClass"),U(e,function(t){if(O(t)){var r=t.className;typeof r!="string"&&(r=t.getAttribute("class")||"");var i=r.split(/\s+/);if(!L(n)){if(n===void 0)throw Error("TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.");n=n.split(/\s+/)}return n.every(function(s){return i.indexOf(s)!==-1})}return!1})}function X(e,n){return m(e,"scryRenderedDOMComponentsWithTag"),U(e,function(t){return O(t)&&t.tagName.toUpperCase()===n.toUpperCase()})}function F(e,n){return m(e,"scryRenderedComponentsWithType"),U(e,function(t){return W(t,n)})}function j(e,n,t){var r=e.type||"unknown-event";e.currentTarget=ye(t),he(r,n,void 0,e),e.currentTarget=null}function q(e,n,t){for(var r=[];e;){r.push(e);do e=e.return;while(e&&e.tag!==5);e=e||null}for(e=r.length;0<e--;)n(r[e],"captured",t);for(e=0;e<r.length;e++)n(r[e],"bubbled",t)}function V(e,n){var t=e.stateNode;if(!t)return null;var r=ve(t);if(!r)return null;t=r[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(t&&typeof t!="function")throw Error("Expected `"+n+"` listener to be a function, instead got a value of `"+typeof t+"` type.");return t}function be(e,n,t){e&&t&&t._reactName&&(n=V(e,t._reactName))&&(t._dispatchListeners==null&&(t._dispatchListeners=[]),t._dispatchInstances==null&&(t._dispatchInstances=[]),t._dispatchListeners.push(n),t._dispatchInstances.push(e))}function ke(e,n,t){var r=t._reactName;n==="captured"&&(r+="Capture"),(n=V(e,r))&&(t._dispatchListeners==null&&(t._dispatchListeners=[]),t._dispatchInstances==null&&(t._dispatchInstances=[]),t._dispatchListeners.push(n),t._dispatchInstances.push(e))}var B={},_e=new Set(["mouseEnter","mouseLeave","pointerEnter","pointerLeave"]);function Te(e){return function(n,t){if(p.isValidElement(n))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering.");if(x(n))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.");var r="on"+e[0].toUpperCase()+e.slice(1),i=new Ee;i.target=n,i.type=e.toLowerCase();var s=me(n),o=new $(r,i.type,s,i,n);o.persist(),l(o,t),_e.has(e)?o&&o._reactName&&be(o._targetInst,null,o):o&&o._reactName&&q(o._targetInst,ke,o),y.unstable_batchedUpdates(function(){if(ge(n),o){var a=o._dispatchListeners,b=o._dispatchInstances;if(L(a))for(var f=0;f<a.length&&!o.isPropagationStopped();f++)j(o,a[f],b[f]);else a&&j(o,a,b);o._dispatchListeners=null,o._dispatchInstances=null,o.isPersistent()||o.constructor.release(o)}if(M)throw a=N,M=!1,N=null,a}),we()}}return"blur cancel click close contextMenu copy cut auxClick doubleClick dragEnd dragStart drop focus input invalid keyDown keyPress keyUp mouseDown mouseUp paste pause play pointerCancel pointerDown pointerUp rateChange reset resize seeked submit touchCancel touchEnd touchStart volumeChange drag dragEnter dragExit dragLeave dragOver mouseMove mouseOut mouseOver pointerMove pointerOut pointerOver scroll toggle touchMove wheel abort animationEnd animationIteration animationStart canPlay canPlayThrough durationChange emptied encrypted ended error gotPointerCapture load loadedData loadedMetadata loadStart lostPointerCapture playing progress seeking stalled suspend timeUpdate transitionEnd waiting mouseEnter mouseLeave pointerEnter pointerLeave change select beforeInput compositionEnd compositionStart compositionUpdate".split(" ").forEach(function(e){B[e]=Te(e)}),u.Simulate=B,u.act=Ce,u.findAllInRenderedTree=U,u.findRenderedComponentWithType=function(e,n){if(m(e,"findRenderedComponentWithType"),e=F(e,n),e.length!==1)throw Error("Did not find exactly one match (found: "+e.length+") for componentType:"+n);return e[0]},u.findRenderedDOMComponentWithClass=function(e,n){if(m(e,"findRenderedDOMComponentWithClass"),e=Y(e,n),e.length!==1)throw Error("Did not find exactly one match (found: "+e.length+") for class:"+n);return e[0]},u.findRenderedDOMComponentWithTag=function(e,n){if(m(e,"findRenderedDOMComponentWithTag"),e=X(e,n),e.length!==1)throw Error("Did not find exactly one match (found: "+e.length+") for tag:"+n);return e[0]},u.isCompositeComponent=x,u.isCompositeComponentWithType=W,u.isDOMComponent=O,u.isDOMComponentElement=function(e){return!!(e&&p.isValidElement(e)&&e.tagName)},u.isElement=function(e){return p.isValidElement(e)},u.isElementOfType=function(e,n){return p.isValidElement(e)&&e.type===n},u.mockComponent=function(e,n){return n=n||e.mockTagName||"div",e.prototype.render.mockImplementation(function(){return p.createElement(n,null,this.props.children)}),this},u.nativeTouchData=function(e,n){return{touches:[{pageX:e,pageY:n}]}},u.renderIntoDocument=function(e){var n=document.createElement("div");return y.render(e,n)},u.scryRenderedComponentsWithType=F,u.scryRenderedDOMComponentsWithClass=Y,u.scryRenderedDOMComponentsWithTag=X,u.traverseTwoPhase=q,u}var H;function Ie(){return H||(H=1,A.exports=Re()),A.exports}var Z=Ie();const Ne=Ue(Z),Ae=Se({__proto__:null,default:Ne},[Z]);export{Ae as t};
|