@automattic/charts 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/components/bar-chart/index.cjs.js +2 -0
- package/dist/components/bar-chart/index.cjs.js.map +1 -0
- package/dist/components/bar-chart/index.js +2 -0
- package/dist/components/bar-chart/index.js.map +1 -0
- package/dist/components/bar-chart/style.css +95 -0
- package/dist/components/grid-control/index.cjs.js +2 -0
- package/dist/components/grid-control/index.cjs.js.map +1 -0
- package/dist/components/grid-control/index.js +2 -0
- package/dist/components/grid-control/index.js.map +1 -0
- package/dist/components/grid-control/style.css +95 -0
- package/dist/components/legend/index.cjs.js +2 -0
- package/dist/components/legend/index.cjs.js.map +1 -0
- package/dist/components/legend/index.js +2 -0
- package/dist/components/legend/index.js.map +1 -0
- package/dist/components/legend/style.css +95 -0
- package/dist/components/line-chart/index.cjs.js +2 -0
- package/dist/components/line-chart/index.cjs.js.map +1 -0
- package/dist/components/line-chart/index.js +2 -0
- package/dist/components/line-chart/index.js.map +1 -0
- package/dist/components/line-chart/style.css +95 -0
- package/dist/components/pie-chart/index.cjs.js +2 -0
- package/dist/components/pie-chart/index.cjs.js.map +1 -0
- package/dist/components/pie-chart/index.js +2 -0
- package/dist/components/pie-chart/index.js.map +1 -0
- package/dist/components/pie-chart/style.css +95 -0
- package/dist/components/pie-semi-circle-chart/index.cjs.js +2 -0
- package/dist/components/pie-semi-circle-chart/index.cjs.js.map +1 -0
- package/dist/components/pie-semi-circle-chart/index.js +2 -0
- package/dist/components/pie-semi-circle-chart/index.js.map +1 -0
- package/dist/components/pie-semi-circle-chart/style.css +95 -0
- package/dist/components/tooltip/index.cjs.js +2 -0
- package/dist/components/tooltip/index.cjs.js.map +1 -0
- package/dist/components/tooltip/index.js +2 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/components/tooltip/style.css +95 -0
- package/dist/index.d.ts +16105 -6
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/providers/theme/index.cjs.js +2 -0
- package/dist/providers/theme/index.cjs.js.map +1 -0
- package/dist/providers/theme/index.js +2 -0
- package/dist/providers/theme/index.js.map +1 -0
- package/dist/providers/theme/style.css +95 -0
- package/dist/style.css +95 -0
- package/package.json +35 -13
- package/rollup.config.mjs +142 -0
- package/src/components/bar-chart/bar-chart.tsx +7 -7
- package/src/components/pie-chart/pie-chart.tsx +12 -10
- package/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx +4 -4
- package/src/components/tooltip/base-tooltip.tsx +1 -1
- package/src/hooks/use-chart-mouse-handler.ts +1 -1
- package/src/providers/theme/theme-provider.tsx +1 -1
- package/dist/index.css +0 -2
- package/dist/index.css.map +0 -1
- package/dist/index.d.mts +0 -287
- package/tsup.config.js +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.2] - 2025-01-03
|
|
9
|
+
### Changed
|
|
10
|
+
- Switching esbuild to rollup for better treeshaking. [#40817]
|
|
11
|
+
- Updated package dependencies. [#40798]
|
|
12
|
+
|
|
8
13
|
## [0.2.1] - 2024-12-31
|
|
9
14
|
### Added
|
|
10
15
|
- Added dist to mirror repo [#40776]
|
|
@@ -37,5 +42,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
37
42
|
- Fixed lints following ESLint rule changes for TS [#40584]
|
|
38
43
|
- Fixing a bug in Chart storybook data. [#40640]
|
|
39
44
|
|
|
45
|
+
[0.2.2]: https://github.com/Automattic/charts/compare/v0.2.1...v0.2.2
|
|
40
46
|
[0.2.1]: https://github.com/Automattic/charts/compare/v0.2.0...v0.2.1
|
|
41
47
|
[0.2.0]: https://github.com/Automattic/charts/compare/v0.1.0...v0.2.0
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("@visx/axis"),a=require("@visx/event"),t=require("@visx/group"),i=require("@visx/scale"),o=require("@visx/shape"),r=require("@visx/tooltip"),s=require("clsx"),n=require("react"),d=require("@visx/grid"),c=require("@visx/legend");const h=n.createContext({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});var g="grid-control-module__grid-control__KOnZN";const m=({width:l,height:a,xScale:t,yScale:i,gridVisibility:o="x",top:r=0})=>e.jsxs("g",{transform:`translate(0, ${r})`,className:g,children:[o.includes("x")&&e.jsx(d.GridRows,{scale:t,width:l}),o.includes("y")&&e.jsx(d.GridColumns,{scale:i,height:a})]});var u={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const v={horizontal:"row",vertical:"column"},x=({items:l,className:a,orientation:t="horizontal"})=>{const o=i.scaleOrdinal({domain:l.map((e=>e.label)),range:l.map((e=>e.color))});return e.jsx("div",{className:s(u.legend,u[`legend--${t}`],a),role:"list",children:e.jsx(c.LegendOrdinal,{scale:o,direction:v[t],shape:"rect",shapeWidth:16,shapeHeight:16,className:u["legend-items"],children:a=>e.jsx("div",{className:u[`legend--${t}`],children:a.map((a=>{var t,i;return e.jsxs("div",{className:u["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:a.value,className:u["legend-item-swatch"]})}),e.jsxs("span",{className:u["legend-item-label"],children:[a.text,(null===(t=l.find((e=>e.label===a.text)))||void 0===t?void 0:t.value)&&e.jsx("span",{className:u["legend-item-value"],children:null===(i=l.find((e=>e.label===a.text)))||void 0===i?void 0:i.value})]})]},a.text)}))})})})};var p="base-tooltip-module__tooltip__OfX6n";const b=({data:l})=>e.jsxs(e.Fragment,{children:[null==l?void 0:l.label,": ",(null==l?void 0:l.valueDisplay)||(null==l?void 0:l.value)]}),_=({data:l,top:a,left:t,component:i=b,children:o,className:r})=>e.jsx("div",{className:p,style:{top:a,left:t},role:"tooltip",children:o||l&&e.jsx(i,{data:l,className:r})});var j={"bar-chart":"bar-chart-module__bar-chart__lmYNi","bar-chart-legend":"bar-chart-module__bar-chart-legend__vgKKq"};const f=({data:d,width:c=500,height:g=500,margin:u={top:20,right:20,bottom:40,left:40},withTooltips:v=!1,showLegend:p=!1,legendOrientation:b="horizontal",className:f,gridVisibility:N="x"})=>{var w;const y=n.useContext(h),{tooltipOpen:F,tooltipLeft:C,tooltipTop:q,tooltipData:L,hideTooltip:k,showTooltip:B}=r.useTooltip(),S=n.useCallback(((e,l,t,i,o)=>{const r=a.localPoint(e);r&&B({tooltipData:{value:l,xLabel:t,yLabel:i,seriesIndex:o},tooltipLeft:r.x,tooltipTop:r.y-10})}),[B]),D=n.useCallback((()=>{k()}),[k]);if(!(null==d?void 0:d.length))return e.jsx("div",{className:s("bar-chart-empty",j["bat-chart-empty"]),children:"Empty..."});const z=u,O=c-z.left-z.right,T=g-z.top-z.bottom,M=null===(w=d[0].data)||void 0===w?void 0:w.map((e=>(null==e?void 0:e.label)||"")),$=i.scaleBand({range:[0,O],domain:M,padding:.2}),A=i.scaleBand({range:[0,$.bandwidth()],domain:d.map(((e,l)=>l.toString())),padding:.1}),G=i.scaleLinear({range:[T,0],domain:[0,Math.max(...d.map((e=>Math.max(...e.data.map((e=>(null==e?void 0:e.value)||0))))))]}),I=d.map(((e,l)=>({label:e.label,value:"",color:y.colors[l%y.colors.length]})));return e.jsxs("div",{className:s("bar-chart",f,j["bar-chart"]),children:[e.jsx("svg",{width:c,height:g,children:e.jsxs(t.Group,{left:z.left,top:z.top,children:[e.jsx(m,{width:O,height:T,xScale:$,yScale:G,gridVisibility:N}),d.map(((l,a)=>e.jsx(t.Group,{children:l.data.map((t=>{var i,r;const s=$((null==t?void 0:t.label)||"");if(void 0===s)return null;const n=A.bandwidth(),d=s+(null!==(i=A(a.toString()))&&void 0!==i?i:0);return e.jsx(o.Bar,{x:d,y:G(t.value),width:n,height:T-(null!==(r=G(t.value))&&void 0!==r?r:0),fill:y.colors[a%y.colors.length],onMouseMove:v?e=>S(e,t.value,(null==t?void 0:t.label)||"",l.label,a):void 0,onMouseLeave:v?D:void 0},`bar-${a}-${t.label}`)}))},a))),e.jsx(l.AxisLeft,{scale:G}),e.jsx(l.AxisBottom,{scale:$,top:T})]})}),v&&F&&L&&e.jsx(_,{top:q||0,left:C||0,children:e.jsxs("div",{children:[e.jsx("div",{children:L.yLabel}),e.jsxs("div",{children:[L.xLabel,": ",L.value]})]})}),p&&e.jsx(x,{items:I,orientation:b,className:j["bar-chart-legend"]})]})};f.displayName="BarChart",exports.BarChart=f;
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/providers/theme/themes.ts","../../../src/providers/theme/theme-provider.tsx","../../../src/components/grid-control/grid-control.tsx","../../../src/components/legend/base-legend.tsx","../../../src/components/tooltip/base-tooltip.tsx","../../../src/components/bar-chart/bar-chart.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["ThemeContext","createContext","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","GridControl","width","height","xScale","yScale","gridVisibility","top","_jsxs","transform","className","styles","children","includes","_jsx","GridRows","scale","GridColumns","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","clsx","legend","role","jsx","LegendOrdinal","direction","shape","shapeWidth","shapeHeight","labels","jsxs","fill","value","text","_a","find","_b","DefaultTooltipContent","data","valueDisplay","BaseTooltip","left","component","Component","style","BarChart","margin","right","bottom","withTooltips","showLegend","legendOrientation","theme","useContext","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","handleMouseMove","useCallback","event","xLabel","yLabel","seriesIndex","coords","localPoint","x","y","handleMouseLeave","length","margins","xMax","yMax","d","scaleBand","padding","innerScale","bandwidth","_","i","toString","scaleLinear","Math","max","series","legendItems","group","index","Group","xPos","undefined","barWidth","barX","Bar","onMouseMove","onMouseLeave","AxisLeft","AxisBottom","Legend","displayName"],"mappings":"8RAKA,MCEMA,EAAeC,EAAAA,cDFY,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,sDEVhB,MAAMC,EAAqC,EAC1CC,QACAC,SACAC,SACAC,SACAC,iBAAiB,IACjBC,MAAM,KAGLC,EAAAA,KAAG,IAAA,CAAAC,UAAY,gBAAiBF,KAAUG,UAAYC,EAAwBC,SAAA,CAC3EN,EAAeO,SAAU,MAASC,MAACC,EAAAA,SAAQ,CAACC,MAAQZ,EAASF,MAAQA,IACrEI,EAAeO,SAAU,MAASC,MAACG,EAAWA,YAAA,CAACD,MAAQX,EAASF,OAASA,yXCD9E,MAAMe,EAA6B,CAClCC,WAAY,MACZC,SAAU,UAGEC,EAAgC,EAC5CC,QACAZ,YACAa,cAAc,iBAEd,MAAMC,EAAcC,EAAAA,aAAc,CACjCC,OAAQJ,EAAMK,KAAKC,GAAQA,EAAKC,QAChCC,MAAOR,EAAMK,KAAKC,GAAQA,EAAKG,UAGhC,OACCjB,MACC,MAAA,CAAAJ,UAAYsB,EAAMrB,EAAOsB,OAAQtB,EAAQ,WAAYY,KAAkB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IsE,EAAOtE,MAAOiD,QAUZ2B,EAClDK,aAAejD,EAAesB,OAAmBsB,GAP3C,OAAQ3B,KAAiBU,EAAE3D,QASjC,KAtBSiD,KA0BdhE,MAACiG,EAAQA,SAAA,CAAC/F,MAAQX,IAClBS,EAAAqB,IAAC6E,aAAW,CAAAhG,MAAQZ,EAASG,IAAMgF,SAInC1B,GAAgBK,GAAeG,GAChCvD,EAAAA,IAACsC,EAAY,CAAA7C,IAAM6D,GAAc,EAAIf,KAAOc,GAAe,WAC1D3D,EACCkC,KAAA,MAAA,CAAA9B,SAAA,CAAAE,EAAAA,IAAA,MAAA,CAAAF,SAAOyD,EAAYQ,SACnBrE,EAAAkC,KAAA,MAAA,CAAA9B,SAAA,CACGyD,EAAYO,YAAYP,EAAYzB,cAMxCkB,GACDhD,EAAAqB,IAAC8E,EACA,CAAA3F,MAAQ8E,EACR7E,YAAcwC,EACdrD,UAAYC,EAAQ,wBAItB,EAGH8C,EAASyD,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,jsx as l,Fragment as t}from"react/jsx-runtime";import{AxisLeft as a,AxisBottom as i}from"@visx/axis";import{localPoint as o}from"@visx/event";import{Group as r}from"@visx/group";import{scaleOrdinal as d,scaleBand as n,scaleLinear as s}from"@visx/scale";import{Bar as c}from"@visx/shape";import{useTooltip as m}from"@visx/tooltip";import h from"clsx";import{createContext as g,useContext as v,useCallback as p}from"react";import{GridRows as u,GridColumns as b}from"@visx/grid";import{LegendOrdinal as _}from"@visx/legend";const f=g({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});var x="grid-control-module__grid-control__KOnZN";const N=({width:t,height:a,xScale:i,yScale:o,gridVisibility:r="x",top:d=0})=>e("g",{transform:`translate(0, ${d})`,className:x,children:[r.includes("x")&&l(u,{scale:i,width:t}),r.includes("y")&&l(b,{scale:o,height:a})]});var y={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const w={horizontal:"row",vertical:"column"},F=({items:t,className:a,orientation:i="horizontal"})=>{const o=d({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return l("div",{className:h(y.legend,y[`legend--${i}`],a),role:"list",children:l(_,{scale:o,direction:w[i],shape:"rect",shapeWidth:16,shapeHeight:16,className:y["legend-items"],children:a=>l("div",{className:y[`legend--${i}`],children:a.map((a=>{var i,o;return e("div",{className:y["legend-item"],children:[l("svg",{width:16,height:16,children:l("rect",{width:16,height:16,fill:a.value,className:y["legend-item-swatch"]})}),e("span",{className:y["legend-item-label"],children:[a.text,(null===(i=t.find((e=>e.label===a.text)))||void 0===i?void 0:i.value)&&l("span",{className:y["legend-item-value"],children:null===(o=t.find((e=>e.label===a.text)))||void 0===o?void 0:o.value})]})]},a.text)}))})})})};var C="base-tooltip-module__tooltip__OfX6n";const L=({data:l})=>e(t,{children:[null==l?void 0:l.label,": ",(null==l?void 0:l.valueDisplay)||(null==l?void 0:l.value)]}),S=({data:e,top:t,left:a,component:i=L,children:o,className:r})=>l("div",{className:C,style:{top:t,left:a},role:"tooltip",children:o||e&&l(i,{data:e,className:r})});var k={"bar-chart":"bar-chart-module__bar-chart__lmYNi","bar-chart-legend":"bar-chart-module__bar-chart-legend__vgKKq"};const D=({data:t,width:d=500,height:g=500,margin:u={top:20,right:20,bottom:40,left:40},withTooltips:b=!1,showLegend:_=!1,legendOrientation:x="horizontal",className:y,gridVisibility:w="x"})=>{var C;const L=v(f),{tooltipOpen:D,tooltipLeft:z,tooltipTop:M,tooltipData:T,hideTooltip:$,showTooltip:O}=m(),B=p(((e,l,t,a,i)=>{const r=o(e);r&&O({tooltipData:{value:l,xLabel:t,yLabel:a,seriesIndex:i},tooltipLeft:r.x,tooltipTop:r.y-10})}),[O]),I=p((()=>{$()}),[$]);if(!(null==t?void 0:t.length))return l("div",{className:h("bar-chart-empty",k["bat-chart-empty"]),children:"Empty..."});const K=u,V=d-K.left-K.right,j=g-K.top-K.bottom,A=null===(C=t[0].data)||void 0===C?void 0:C.map((e=>(null==e?void 0:e.label)||"")),W=n({range:[0,V],domain:A,padding:.2}),X=n({range:[0,W.bandwidth()],domain:t.map(((e,l)=>l.toString())),padding:.1}),q=s({range:[j,0],domain:[0,Math.max(...t.map((e=>Math.max(...e.data.map((e=>(null==e?void 0:e.value)||0))))))]}),E=t.map(((e,l)=>({label:e.label,value:"",color:L.colors[l%L.colors.length]})));return e("div",{className:h("bar-chart",y,k["bar-chart"]),children:[l("svg",{width:d,height:g,children:e(r,{left:K.left,top:K.top,children:[l(N,{width:V,height:j,xScale:W,yScale:q,gridVisibility:w}),t.map(((e,t)=>l(r,{children:e.data.map((a=>{var i,o;const r=W((null==a?void 0:a.label)||"");if(void 0===r)return null;const d=X.bandwidth(),n=r+(null!==(i=X(t.toString()))&&void 0!==i?i:0);return l(c,{x:n,y:q(a.value),width:d,height:j-(null!==(o=q(a.value))&&void 0!==o?o:0),fill:L.colors[t%L.colors.length],onMouseMove:b?l=>B(l,a.value,(null==a?void 0:a.label)||"",e.label,t):void 0,onMouseLeave:b?I:void 0},`bar-${t}-${a.label}`)}))},t))),l(a,{scale:q}),l(i,{scale:W,top:j})]})}),b&&D&&T&&l(S,{top:M||0,left:z||0,children:e("div",{children:[l("div",{children:T.yLabel}),e("div",{children:[T.xLabel,": ",T.value]})]})}),_&&l(F,{items:E,orientation:x,className:k["bar-chart-legend"]})]})};D.displayName="BarChart";export{D as BarChart};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/providers/theme/themes.ts","../../../src/providers/theme/theme-provider.tsx","../../../src/components/grid-control/grid-control.tsx","../../../src/components/legend/base-legend.tsx","../../../src/components/tooltip/base-tooltip.tsx","../../../src/components/bar-chart/bar-chart.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["ThemeContext","createContext","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","GridControl","width","height","xScale","yScale","gridVisibility","top","_jsxs","transform","className","styles","children","includes","_jsx","GridRows","scale","GridColumns","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","clsx","legend","role","LegendOrdinal","direction","shape","shapeWidth","shapeHeight","labels","fill","value","text","_a","find","_b","DefaultTooltipContent","data","valueDisplay","BaseTooltip","left","component","Component","style","BarChart","margin","right","bottom","withTooltips","showLegend","legendOrientation","theme","useContext","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","handleMouseMove","useCallback","event","xLabel","yLabel","seriesIndex","coords","localPoint","x","y","handleMouseLeave","length","margins","xMax","yMax","d","scaleBand","padding","innerScale","bandwidth","_","i","toString","scaleLinear","Math","max","series","legendItems","group","index","Group","xPos","undefined","barWidth","barX","Bar","onMouseMove","onMouseLeave","AxisLeft","AxisBottom","Legend","displayName"],"mappings":"0hBAKA,MCEMA,EAAeC,EDFY,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,sDEVhB,MAAMC,EAAqC,EAC1CC,QACAC,SACAC,SACAC,SACAC,iBAAiB,IACjBC,MAAM,KAGLC,EAAG,IAAA,CAAAC,UAAY,gBAAiBF,KAAUG,UAAYC,EAAwBC,SAAA,CAC3EN,EAAeO,SAAU,MAASC,EAACC,EAAQ,CAACC,MAAQZ,EAASF,MAAQA,IACrEI,EAA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rG,OAASkF,WAASvC,EAAAzC,EAAQiF,EAAE5C,sBAAW,GACvCD,KAAOqB,EAAMpE,OAAQkF,EAAcd,EAAMpE,OAAOwF,QAChDyB,YAAchD,EAXac,GAC5BF,EAAiBE,EAAOa,EAAE5C,OAAO4C,aAAC,EAADA,EAAGzD,QAAS,GAAIoE,EAAOpE,MAAO+C,QAUZ2B,EAClDK,aAAejD,EAAesB,OAAmBsB,GAP3C,OAAQ3B,KAAiBU,EAAEzD,QASjC,KAtBS+C,KA0Bd9D,EAAC+F,EAAQ,CAAC7F,MAAQX,IAClBS,EAACgG,EAAW,CAAA9F,MAAQZ,EAASG,IAAM8E,SAInC1B,GAAgBK,GAAeG,GAChCrD,EAACoC,EAAY,CAAA3C,IAAM2D,GAAc,EAAIf,KAAOc,GAAe,WAC1DzD,EACC,MAAA,CAAAI,SAAA,CAAAE,EAAA,MAAA,CAAAF,SAAOuD,EAAYQ,SACnBnE,EAAA,MAAA,CAAAI,SAAA,CACGuD,EAAYO,YAAYP,EAAYzB,cAMxCkB,GACD9C,EAACiG,EACA,CAAAzF,MAAQ4E,EACR3E,YAAcsC,EACdnD,UAAYC,EAAQ,wBAItB,EAGH4C,EAASyD,YAAc"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.pie-chart-module__pie-chart__R12Vh {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
|
|
5
|
+
position: relative;
|
|
6
|
+
text-align: center;
|
|
7
|
+
}
|
|
8
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
|
|
9
|
+
margin-top: 1rem;
|
|
10
|
+
}
|
|
11
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
|
|
12
|
+
margin-bottom: 0px;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
}
|
|
16
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
|
|
17
|
+
margin-top: 0px;
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
}
|
|
20
|
+
.line-chart-module__line-chart__ITM3d {
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
.line-chart-module__line-chart__tooltip__aqcme {
|
|
24
|
+
background: #fff;
|
|
25
|
+
padding: 0.5rem;
|
|
26
|
+
}
|
|
27
|
+
.line-chart-module__line-chart__tooltip-date__4Dzab {
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
padding-bottom: 10px;
|
|
30
|
+
}
|
|
31
|
+
.line-chart-module__line-chart__tooltip-row__6A37G {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
padding: 4px 0;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
}
|
|
37
|
+
.line-chart-module__line-chart__tooltip-label__IvnFF {
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
padding-right: 1rem;
|
|
40
|
+
}
|
|
41
|
+
.grid-control-module__grid-control__KOnZN .visx-line {
|
|
42
|
+
stroke: #d7d6d6;
|
|
43
|
+
stroke-width: 1px;
|
|
44
|
+
shape-rendering: crispEdges;
|
|
45
|
+
}
|
|
46
|
+
.legend-module__legend--horizontal__IUN13 {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
gap: 16px;
|
|
51
|
+
}
|
|
52
|
+
.legend-module__legend--vertical__Scfzo {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.legend-module__legend-item__feemn {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 8px;
|
|
62
|
+
font-size: 0.875rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.legend-module__legend-item-swatch__nRyXf {
|
|
66
|
+
border-radius: 2px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.legend-module__legend-item-label__ksx6I {
|
|
70
|
+
color: var(--jp-gray-80, #2c3338);
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: 0.5rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.legend-module__legend-item-value__d9x1j {
|
|
77
|
+
font-weight: 500;
|
|
78
|
+
}
|
|
79
|
+
.base-tooltip-module__tooltip__OfX6n {
|
|
80
|
+
padding: 0.5rem;
|
|
81
|
+
background-color: rgba(0, 0, 0, 0.85);
|
|
82
|
+
color: white;
|
|
83
|
+
border-radius: 4px;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
86
|
+
position: absolute;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
transform: translate(-50%, -100%);
|
|
89
|
+
}
|
|
90
|
+
.bar-chart-module__bar-chart__lmYNi {
|
|
91
|
+
position: relative;
|
|
92
|
+
}
|
|
93
|
+
.bar-chart-module__bar-chart-legend__vgKKq {
|
|
94
|
+
margin-top: 1rem;
|
|
95
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=require("react/jsx-runtime"),i=require("@visx/grid");require("react");var e="grid-control-module__grid-control__KOnZN";exports.GridControl=({width:s,height:t,xScale:l,yScale:a,gridVisibility:c="x",top:d=0})=>r.jsxs("g",{transform:`translate(0, ${d})`,className:e,children:[c.includes("x")&&r.jsx(i.GridRows,{scale:l,width:s}),c.includes("y")&&r.jsx(i.GridColumns,{scale:a,height:t})]});
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/grid-control/grid-control.tsx"],"sourcesContent":[null],"names":["width","height","xScale","yScale","gridVisibility","top","_jsxs","transform","className","styles","children","includes","_jsx","GridRows","scale","GridColumns"],"mappings":"8JAK2C,EAC1CA,QACAC,SACAC,SACAC,SACAC,iBAAiB,IACjBC,MAAM,KAGLC,EAAAA,KAAG,IAAA,CAAAC,UAAY,gBAAiBF,KAAUG,UAAYC,EAAwBC,SAAA,CAC3EN,EAAeO,SAAU,MAASC,MAACC,EAAAA,SAAQ,CAACC,MAAQZ,EAASF,MAAQA,IACrEI,EAAeO,SAAU,MAASC,MAACG,EAAWA,YAAA,CAACD,MAAQX,EAASF,OAASA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as i,jsx as r}from"react/jsx-runtime";import{GridRows as t,GridColumns as e}from"@visx/grid";import"react";var o="grid-control-module__grid-control__KOnZN";const c=({width:c,height:l,xScale:a,yScale:s,gridVisibility:d="x",top:n=0})=>i("g",{transform:`translate(0, ${n})`,className:o,children:[d.includes("x")&&r(t,{scale:a,width:c}),d.includes("y")&&r(e,{scale:s,height:l})]});export{c as GridControl};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/grid-control/grid-control.tsx"],"sourcesContent":[null],"names":["GridControl","width","height","xScale","yScale","gridVisibility","top","_jsxs","transform","className","styles","children","includes","_jsx","GridRows","scale","GridColumns"],"mappings":"wKAKM,MAAAA,EAAqC,EAC1CC,QACAC,SACAC,SACAC,SACAC,iBAAiB,IACjBC,MAAM,KAGLC,EAAG,IAAA,CAAAC,UAAY,gBAAiBF,KAAUG,UAAYC,EAAwBC,SAAA,CAC3EN,EAAeO,SAAU,MAASC,EAACC,EAAQ,CAACC,MAAQZ,EAASF,MAAQA,IACrEI,EAAeO,SAAU,MAASC,EAACG,EAAW,CAACD,MAAQX,EAASF,OAASA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.bar-chart-module__bar-chart__lmYNi {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.bar-chart-module__bar-chart-legend__vgKKq {
|
|
5
|
+
margin-top: 1rem;
|
|
6
|
+
}
|
|
7
|
+
.pie-chart-module__pie-chart__R12Vh {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
|
|
11
|
+
position: relative;
|
|
12
|
+
text-align: center;
|
|
13
|
+
}
|
|
14
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
|
|
15
|
+
margin-top: 1rem;
|
|
16
|
+
}
|
|
17
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
|
|
18
|
+
margin-bottom: 0px;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
}
|
|
22
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
|
|
23
|
+
margin-top: 0px;
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
}
|
|
26
|
+
.line-chart-module__line-chart__ITM3d {
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
.line-chart-module__line-chart__tooltip__aqcme {
|
|
30
|
+
background: #fff;
|
|
31
|
+
padding: 0.5rem;
|
|
32
|
+
}
|
|
33
|
+
.line-chart-module__line-chart__tooltip-date__4Dzab {
|
|
34
|
+
font-weight: bold;
|
|
35
|
+
padding-bottom: 10px;
|
|
36
|
+
}
|
|
37
|
+
.line-chart-module__line-chart__tooltip-row__6A37G {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
padding: 4px 0;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
}
|
|
43
|
+
.line-chart-module__line-chart__tooltip-label__IvnFF {
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
padding-right: 1rem;
|
|
46
|
+
}
|
|
47
|
+
.base-tooltip-module__tooltip__OfX6n {
|
|
48
|
+
padding: 0.5rem;
|
|
49
|
+
background-color: rgba(0, 0, 0, 0.85);
|
|
50
|
+
color: white;
|
|
51
|
+
border-radius: 4px;
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
54
|
+
position: absolute;
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
transform: translate(-50%, -100%);
|
|
57
|
+
}
|
|
58
|
+
.legend-module__legend--horizontal__IUN13 {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
gap: 16px;
|
|
63
|
+
}
|
|
64
|
+
.legend-module__legend--vertical__Scfzo {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
gap: 8px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.legend-module__legend-item__feemn {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: 8px;
|
|
74
|
+
font-size: 0.875rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.legend-module__legend-item-swatch__nRyXf {
|
|
78
|
+
border-radius: 2px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.legend-module__legend-item-label__ksx6I {
|
|
82
|
+
color: var(--jp-gray-80, #2c3338);
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: 0.5rem;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.legend-module__legend-item-value__d9x1j {
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
}
|
|
91
|
+
.grid-control-module__grid-control__KOnZN .visx-line {
|
|
92
|
+
stroke: #d7d6d6;
|
|
93
|
+
stroke-width: 1px;
|
|
94
|
+
shape-rendering: crispEdges;
|
|
95
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("@visx/legend"),i=require("@visx/scale"),n=require("clsx");require("react");var a={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const d={horizontal:"row",vertical:"column"};exports.Legend=({items:t,className:s,orientation:r="horizontal"})=>{const c=i.scaleOrdinal({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e.jsx("div",{className:n(a.legend,a[`legend--${r}`],s),role:"list",children:e.jsx(l.LegendOrdinal,{scale:c,direction:d[r],shape:"rect",shapeWidth:16,shapeHeight:16,className:a["legend-items"],children:l=>e.jsx("div",{className:a[`legend--${r}`],children:l.map((l=>{var i,n;return e.jsxs("div",{className:a["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:l.value,className:a["legend-item-swatch"]})}),e.jsxs("span",{className:a["legend-item-label"],children:[l.text,(null===(i=t.find((e=>e.label===l.text)))||void 0===i?void 0:i.value)&&e.jsx("span",{className:a["legend-item-value"],children:null===(n=t.find((e=>e.label===l.text)))||void 0===n?void 0:n.value})]})]},l.text)}))})})})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/legend/base-legend.tsx"],"sourcesContent":[null],"names":["orientationToFlexDirection","horizontal","vertical","items","className","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","role","children","jsx","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","jsxs","width","height","fill","value","text","_a","find","_b"],"mappings":"wfAeA,MAAMA,EAA6B,CAClCC,WAAY,MACZC,SAAU,yBAGkC,EAC5CC,QACAC,YACAC,cAAc,iBAEd,MAAMC,EAAcC,EAAAA,aAAc,CACjCC,OAAQL,EAAMM,KAAKC,GAAQA,EAAKC,QAChCC,MAAOT,EAAMM,KAAKC,GAAQA,EAAKG,UAGhC,OACCC,MACC,MAAA,CAAAV,UAAYW,EAAMC,EAAOC,OAAQD,EAAQ,WAAYX,KAAkBD,GACvEc,KAAK,OAELC,SAAAL,EAAAM,IAACC,gBACA,CAAAC,MAAQhB,EACRiB,UAAYvB,EAA4BK,GACxCmB,MAAM,OACNC,WAAa,GACbC,YAAc,GACdtB,UAAYY,EAAQ,yBAElBW,GACDb,EAAAA,IAAK,MAAA,CAAAV,UAAYY,EAAQ,WAAYX,cAClCsB,EAAOlB,KAAKE,YAAS,OACtBiB,EAAwBC,KAAA,MAAA,CAAAzB,UAAYY,EAAQ,eAC3CG,SAAA,CAAAL,MAAA,MAAA,CAAKgB,MAAQ,GAAKC,OAAS,GAC1BZ,SAAAL,EAAAA,IAAA,OAAA,CACCgB,MAAQ,GACRC,OAAS,GACTC,KAAOrB,EAAMsB,MACb7B,UAAYY,EAAQ,0BAGtBY,EAAMC,KAAA,OAAA,CAAAzB,UAAYY,EAAQ,qBAAqBG,SAAA,CAC5CR,EAAMuB,MACyC,QAA/CC,EAAAhC,EAAMiC,MAAM1B,GAAQA,EAAKC,QAAUA,EAAMuB,cAAM,IAAAC,OAAA,EAAAA,EAAEF,QAClDnB,EAAAM,IAAA,OAAA,CAAMhB,UAAYY,EAAQ,qBACvBG,SAA+C,QAA/CkB,EAAAlC,EAAMiC,MAAM1B,GAAQA,EAAKC,QAAUA,EAAMuB,cAAM,IAAAG,OAAA,EAAAA,EAAEJ,aAb5CtB,EAAMuB,KAkBjB,SAKJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{LegendOrdinal as i}from"@visx/legend";import{scaleOrdinal as n}from"@visx/scale";import t from"clsx";import"react";var a={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const d={horizontal:"row",vertical:"column"},m=({items:m,className:r,orientation:o="horizontal"})=>{const s=n({domain:m.map((e=>e.label)),range:m.map((e=>e.color))});return e("div",{className:t(a.legend,a[`legend--${o}`],r),role:"list",children:e(i,{scale:s,direction:d[o],shape:"rect",shapeWidth:16,shapeHeight:16,className:a["legend-items"],children:i=>e("div",{className:a[`legend--${o}`],children:i.map((i=>{var n,t;return l("div",{className:a["legend-item"],children:[e("svg",{width:16,height:16,children:e("rect",{width:16,height:16,fill:i.value,className:a["legend-item-swatch"]})}),l("span",{className:a["legend-item-label"],children:[i.text,(null===(n=m.find((e=>e.label===i.text)))||void 0===n?void 0:n.value)&&e("span",{className:a["legend-item-value"],children:null===(t=m.find((e=>e.label===i.text)))||void 0===t?void 0:t.value})]})]},i.text)}))})})})};export{m as Legend};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/legend/base-legend.tsx"],"sourcesContent":[null],"names":["orientationToFlexDirection","horizontal","vertical","BaseLegend","items","className","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","role","children","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","width","height","fill","value","text","_a","find","_b"],"mappings":"8hBAeA,MAAMA,EAA6B,CAClCC,WAAY,MACZC,SAAU,UAGEC,EAAgC,EAC5CC,QACAC,YACAC,cAAc,iBAEd,MAAMC,EAAcC,EAAc,CACjCC,OAAQL,EAAMM,KAAKC,GAAQA,EAAKC,QAChCC,MAAOT,EAAMM,KAAKC,GAAQA,EAAKG,UAGhC,OACCC,EACC,MAAA,CAAAV,UAAYW,EAAMC,EAAOC,OAAQD,EAAQ,WAAYX,KAAkBD,GACvEc,KAAK,OAELC,SAAAL,EAACM,EACA,CAAAC,MAAQf,EACRgB,UAAYvB,EAA4BM,GACxCkB,MAAM,OACNC,WAAa,GACbC,YAAc,GACdrB,UAAYY,EAAQ,yBAElBU,GACDZ,EAAK,MAAA,CAAAV,UAAYY,EAAQ,WAAYX,cAClCqB,EAAOjB,KAAKE,YAAS,OACtBgB,EAAwB,MAAA,CAAAvB,UAAYY,EAAQ,eAC3CG,SAAA,CAAAL,EAAA,MAAA,CAAKc,MAAQ,GAAKC,OAAS,GAC1BV,SAAAL,EAAA,OAAA,CACCc,MAAQ,GACRC,OAAS,GACTC,KAAOnB,EAAMoB,MACb3B,UAAYY,EAAQ,0BAGtBW,EAAM,OAAA,CAAAvB,UAAYY,EAAQ,qBAAqBG,SAAA,CAC5CR,EAAMqB,MACyC,QAA/CC,EAAA9B,EAAM+B,MAAMxB,GAAQA,EAAKC,QAAUA,EAAMqB,cAAM,IAAAC,OAAA,EAAAA,EAAEF,QAClDjB,EAAA,OAAA,CAAMV,UAAYY,EAAQ,qBACvBG,SAA+C,QAA/CgB,EAAAhC,EAAM+B,MAAMxB,GAAQA,EAAKC,QAAUA,EAAMqB,cAAM,IAAAG,OAAA,EAAAA,EAAEJ,aAb5CpB,EAAMqB,KAkBjB,SAKJ"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.bar-chart-module__bar-chart__lmYNi {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.bar-chart-module__bar-chart-legend__vgKKq {
|
|
5
|
+
margin-top: 1rem;
|
|
6
|
+
}
|
|
7
|
+
.pie-chart-module__pie-chart__R12Vh {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
|
|
11
|
+
position: relative;
|
|
12
|
+
text-align: center;
|
|
13
|
+
}
|
|
14
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
|
|
15
|
+
margin-top: 1rem;
|
|
16
|
+
}
|
|
17
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
|
|
18
|
+
margin-bottom: 0px;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
}
|
|
22
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
|
|
23
|
+
margin-top: 0px;
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
}
|
|
26
|
+
.line-chart-module__line-chart__ITM3d {
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
.line-chart-module__line-chart__tooltip__aqcme {
|
|
30
|
+
background: #fff;
|
|
31
|
+
padding: 0.5rem;
|
|
32
|
+
}
|
|
33
|
+
.line-chart-module__line-chart__tooltip-date__4Dzab {
|
|
34
|
+
font-weight: bold;
|
|
35
|
+
padding-bottom: 10px;
|
|
36
|
+
}
|
|
37
|
+
.line-chart-module__line-chart__tooltip-row__6A37G {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
padding: 4px 0;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
}
|
|
43
|
+
.line-chart-module__line-chart__tooltip-label__IvnFF {
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
padding-right: 1rem;
|
|
46
|
+
}
|
|
47
|
+
.grid-control-module__grid-control__KOnZN .visx-line {
|
|
48
|
+
stroke: #d7d6d6;
|
|
49
|
+
stroke-width: 1px;
|
|
50
|
+
shape-rendering: crispEdges;
|
|
51
|
+
}
|
|
52
|
+
.base-tooltip-module__tooltip__OfX6n {
|
|
53
|
+
padding: 0.5rem;
|
|
54
|
+
background-color: rgba(0, 0, 0, 0.85);
|
|
55
|
+
color: white;
|
|
56
|
+
border-radius: 4px;
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
59
|
+
position: absolute;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
transform: translate(-50%, -100%);
|
|
62
|
+
}
|
|
63
|
+
.legend-module__legend--horizontal__IUN13 {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: row;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
gap: 16px;
|
|
68
|
+
}
|
|
69
|
+
.legend-module__legend--vertical__Scfzo {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: 8px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.legend-module__legend-item__feemn {
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: 8px;
|
|
79
|
+
font-size: 0.875rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.legend-module__legend-item-swatch__nRyXf {
|
|
83
|
+
border-radius: 2px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.legend-module__legend-item-label__ksx6I {
|
|
87
|
+
color: var(--jp-gray-80, #2c3338);
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: 0.5rem;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.legend-module__legend-item-value__d9x1j {
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("@visx/xychart"),t=require("clsx"),i=require("react"),a=require("@visx/legend"),o=require("@visx/scale");const n=i.createContext({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});var r={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const s={horizontal:"row",vertical:"column"},d=({items:l,className:i,orientation:n="horizontal"})=>{const d=o.scaleOrdinal({domain:l.map((e=>e.label)),range:l.map((e=>e.color))});return e.jsx("div",{className:t(r.legend,r[`legend--${n}`],i),role:"list",children:e.jsx(a.LegendOrdinal,{scale:d,direction:s[n],shape:"rect",shapeWidth:16,shapeHeight:16,className:r["legend-items"],children:t=>e.jsx("div",{className:r[`legend--${n}`],children:t.map((t=>{var i,a;return e.jsxs("div",{className:r["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:t.value,className:r["legend-item-swatch"]})}),e.jsxs("span",{className:r["legend-item-label"],children:[t.text,(null===(i=l.find((e=>e.label===t.text)))||void 0===i?void 0:i.value)&&e.jsx("span",{className:r["legend-item-value"],children:null===(a=l.find((e=>e.label===t.text)))||void 0===a?void 0:a.value})]})]},t.text)}))})})})};var c={"line-chart":"line-chart-module__line-chart__ITM3d","line-chart__tooltip":"line-chart-module__line-chart__tooltip__aqcme","line-chart__tooltip-date":"line-chart-module__line-chart__tooltip-date__4Dzab","line-chart__tooltip-row":"line-chart-module__line-chart__tooltip-row__6A37G","line-chart__tooltip-label":"line-chart-module__line-chart__tooltip-label__IvnFF"};const h=({tooltipData:l})=>{var t;const i=null===(t=null==l?void 0:l.nearestDatum)||void 0===t?void 0:t.datum;if(!i)return null;const a=Object.entries((null==l?void 0:l.datumByKey)||{}).map((([e,{datum:l}])=>({key:e,value:l.value}))).sort(((e,l)=>l.value-e.value));return e.jsxs("div",{className:c["line-chart__tooltip"],children:[e.jsx("div",{className:c["line-chart__tooltip-date"],children:i.date.toLocaleDateString()}),a.map((l=>e.jsxs("div",{className:c["line-chart__tooltip-row"],children:[e.jsxs("span",{className:c["line-chart__tooltip-label"],children:[l.key,":"]}),e.jsx("span",{className:c["line-chart__tooltip-value"],children:l.value})]},l.key)))]})},m=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"});exports.LineChart=({data:a,width:o,height:r,margin:s={top:20,right:20,bottom:40,left:40},className:_,withTooltips:u=!0,showLegend:g=!1,legendOrientation:v="horizontal"})=>{const p=i.useContext(n);if(!(null==a?void 0:a.length))return e.jsx("div",{className:t("line-chart-empty",c["line-chart-empty"]),children:"Empty..."});const x=a.map(((e,l)=>({label:e.label,value:"",color:p.colors[l%p.colors.length]}))),j={xAccessor:e=>e.date,yAccessor:e=>e.value},b=l.buildChartTheme({backgroundColor:p.backgroundColor,colors:p.colors,gridStyles:p.gridStyles,tickLength:(null==p?void 0:p.tickLength)||0,gridColor:(null==p?void 0:p.gridColor)||"",gridColorDark:(null==p?void 0:p.gridColorDark)||""});return e.jsxs("div",{className:t("line-chart",c["line-chart"],_),children:[e.jsxs(l.XYChart,{theme:b,width:o,height:r,margin:s,xScale:{type:"time"},yScale:{type:"linear",nice:!0},children:[e.jsx(l.AnimatedGrid,{columns:!1,numTicks:4}),e.jsx(l.AnimatedAxis,{orientation:"bottom",numTicks:5,tickFormat:m}),e.jsx(l.AnimatedAxis,{orientation:"left",numTicks:4}),a.map(((t,i)=>e.jsx(l.AnimatedLineSeries,{dataKey:null==t?void 0:t.label,data:t.data,...j,stroke:b.colors[i%b.colors.length],strokeWidth:2},null==t?void 0:t.label))),u&&e.jsx(l.Tooltip,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:h})]}),g&&e.jsx(d,{items:x,orientation:v,className:c["line-chart-legend"]})]})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/providers/theme/themes.ts","../../../src/providers/theme/theme-provider.tsx","../../../src/components/legend/base-legend.tsx","../../../src/components/line-chart/line-chart.tsx"],"sourcesContent":[null,null,null,null],"names":["ThemeContext","createContext","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","className","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","role","children","jsx","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","jsxs","width","height","fill","value","text","_a","find","_b","renderTooltip","tooltipData","nearestDatum","datum","tooltipPoints","Object","entries","datumByKey","key","sort","a","b","date","toLocaleDateString","point","formatDateTick","Date","undefined","month","day","data","margin","top","right","bottom","left","withTooltips","showLegend","legendOrientation","providerTheme","useContext","length","legendItems","group","index","accessors","xAccessor","d","yAccessor","theme","buildChartTheme","XYChart","xScale","type","yScale","nice","AnimatedGrid","columns","numTicks","AnimatedAxis","tickFormat","seriesData","AnimatedLineSeries","dataKey","Tooltip","snapTooltipToDatumX","snapTooltipToDatumY","showSeriesGlyphs","Legend"],"mappings":"mKAKA,MCEMA,EAAeC,EAAAA,cDFY,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,uXEAhB,MAAMC,EAA6B,CAClCC,WAAY,MACZC,SAAU,UAGEC,EAAgC,EAC5CC,QACAC,YACAC,cAAc,iBAEd,MAAMC,EAAcC,EAAAA,aAAc,CACjCC,OAAQL,EAAMM,KAAKC,GAAQA,EAAKC,QAChCC,MAAOT,EAAMM,KAAKC,GAAQA,EAAKG,UAGhC,OACCC,MACC,MAAA,CAAAV,UAAYW,EAAMC,EAAOC,OAAQD,EAAQ,WAAYX,KAAkBD,GACvEc,KAAK,OAELC,SAAAL,EAAAM,IAACC,gBACA,CAAAC,MAAQhB,EACRiB,UAAYxB,EAA4BM,GACxCmB,MAAM,OACNC,WAAa,GACbC,YAAc,GACdtB,UAAYY,EAAQ,yBAElBW,GACDb,EAAAA,IAAK,MAAA,CAAAV,UAAYY,EAAQ,WAAYX,cAClCsB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,SAAA,CAEvCL,EAAAA,IAACsE,EAAAA,aAAY,CAACC,SAAU,EAAQC,SAAW,IAC3CxE,MAACyE,EAAYA,aAAA,CAAClF,YAAY,SAASiF,SAAW,EAAIE,WAAanC,IAC/DvC,EAAAA,IAACyE,EAAAA,aAAa,CAAAlF,YAAY,OAAOiF,SAAW,IAE1C5B,EAAKjD,KAAK,CAAEgF,EAAYjB,IACzB1D,EAAAA,IAAC4E,EAAAA,oBAEAC,QAAUF,eAAAA,EAAY9E,MACtB+C,KAAO+B,EAAW/B,QACbe,EACL/E,OAASmF,EAAMrF,OAAQgF,EAAQK,EAAMrF,OAAO6E,QAC5C1E,YAAc,GALR8F,aAAU,EAAVA,EAAY9E,SASlBqD,GACDlD,EAAAM,IAACwE,EAAOA,QAAA,CACPC,qBACA,EAAAC,uBACAC,kBAAgB,EAChBzD,cAAgBA,OAKjB2B,GACDnD,EAAAA,IAACkF,EAAM,CACN7F,MAAQmE,EACRjE,YAAc6D,EACd9D,UAAYY,EAAQ,yBAItB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{buildChartTheme as t,XYChart as o,AnimatedGrid as a,AnimatedAxis as i,AnimatedLineSeries as n,Tooltip as r}from"@visx/xychart";import d from"clsx";import{createContext as c,useContext as s}from"react";import{LegendOrdinal as m}from"@visx/legend";import{scaleOrdinal as h}from"@visx/scale";const _=c({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});var g={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const u={horizontal:"row",vertical:"column"},v=({items:t,className:o,orientation:a="horizontal"})=>{const i=h({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e("div",{className:d(g.legend,g[`legend--${a}`],o),role:"list",children:e(m,{scale:i,direction:u[a],shape:"rect",shapeWidth:16,shapeHeight:16,className:g["legend-items"],children:o=>e("div",{className:g[`legend--${a}`],children:o.map((o=>{var a,i;return l("div",{className:g["legend-item"],children:[e("svg",{width:16,height:16,children:e("rect",{width:16,height:16,fill:o.value,className:g["legend-item-swatch"]})}),l("span",{className:g["legend-item-label"],children:[o.text,(null===(a=t.find((e=>e.label===o.text)))||void 0===a?void 0:a.value)&&e("span",{className:g["legend-item-value"],children:null===(i=t.find((e=>e.label===o.text)))||void 0===i?void 0:i.value})]})]},o.text)}))})})})};var p={"line-chart":"line-chart-module__line-chart__ITM3d","line-chart__tooltip":"line-chart-module__line-chart__tooltip__aqcme","line-chart__tooltip-date":"line-chart-module__line-chart__tooltip-date__4Dzab","line-chart__tooltip-row":"line-chart-module__line-chart__tooltip-row__6A37G","line-chart__tooltip-label":"line-chart-module__line-chart__tooltip-label__IvnFF"};const k=({tooltipData:t})=>{var o;const a=null===(o=null==t?void 0:t.nearestDatum)||void 0===o?void 0:o.datum;if(!a)return null;const i=Object.entries((null==t?void 0:t.datumByKey)||{}).map((([e,{datum:l}])=>({key:e,value:l.value}))).sort(((e,l)=>l.value-e.value));return l("div",{className:p["line-chart__tooltip"],children:[e("div",{className:p["line-chart__tooltip-date"],children:a.date.toLocaleDateString()}),i.map((t=>l("div",{className:p["line-chart__tooltip-row"],children:[l("span",{className:p["line-chart__tooltip-label"],children:[t.key,":"]}),e("span",{className:p["line-chart__tooltip-value"],children:t.value})]},t.key)))]})},b=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"}),y=({data:c,width:m,height:h,margin:g={top:20,right:20,bottom:40,left:40},className:u,withTooltips:y=!0,showLegend:F=!1,legendOrientation:N="horizontal"})=>{const f=s(_);if(!(null==c?void 0:c.length))return e("div",{className:d("line-chart-empty",p["line-chart-empty"]),children:"Empty..."});const w=c.map(((e,l)=>({label:e.label,value:"",color:f.colors[l%f.colors.length]}))),x={xAccessor:e=>e.date,yAccessor:e=>e.value},C=t({backgroundColor:f.backgroundColor,colors:f.colors,gridStyles:f.gridStyles,tickLength:(null==f?void 0:f.tickLength)||0,gridColor:(null==f?void 0:f.gridColor)||"",gridColorDark:(null==f?void 0:f.gridColorDark)||""});return l("div",{className:d("line-chart",p["line-chart"],u),children:[l(o,{theme:C,width:m,height:h,margin:g,xScale:{type:"time"},yScale:{type:"linear",nice:!0},children:[e(a,{columns:!1,numTicks:4}),e(i,{orientation:"bottom",numTicks:5,tickFormat:b}),e(i,{orientation:"left",numTicks:4}),c.map(((l,t)=>e(n,{dataKey:null==l?void 0:l.label,data:l.data,...x,stroke:C.colors[t%C.colors.length],strokeWidth:2},null==l?void 0:l.label))),y&&e(r,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:k})]}),F&&e(v,{items:w,orientation:N,className:p["line-chart-legend"]})]})};export{y as LineChart};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/providers/theme/themes.ts","../../../src/providers/theme/theme-provider.tsx","../../../src/components/legend/base-legend.tsx","../../../src/components/line-chart/line-chart.tsx"],"sourcesContent":[null,null,null,null],"names":["ThemeContext","createContext","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","className","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","role","children","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","width","height","fill","value","text","_a","find","_b","renderTooltip","tooltipData","nearestDatum","datum","tooltipPoints","Object","entries","datumByKey","key","sort","a","b","date","toLocaleDateString","point","formatDateTick","Date","undefined","month","day","LineChart","data","margin","top","right","bottom","left","withTooltips","showLegend","legendOrientation","providerTheme","useContext","length","legendItems","group","index","accessors","xAccessor","d","yAccessor","theme","buildChartTheme","XYChart","xScale","type","yScale","nice","AnimatedGrid","columns","numTicks","AnimatedAxis","tickFormat","seriesData","AnimatedLineSeries","dataKey","Tooltip","snapTooltipToDatumX","snapTooltipToDatumY","showSeriesGlyphs","Legend"],"mappings":"0VAKA,MCEMA,EAAeC,EDFY,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,uXEAhB,MAAMC,EAA6B,CAClCC,WAAY,MACZC,SAAU,UAGEC,EAAgC,EAC5CC,QACAC,YACAC,cAAc,iBAEd,MAAMC,EAAcC,EAAc,CACjCC,OAAQL,EAAMM,KAAKC,GAAQA,EAAKC,QAChCC,MAAOT,EAAMM,KAAKC,GAAQA,EAAKG,UAGhC,OACCC,EACC,MAAA,CAAAV,UAAYW,EAAMC,EAAOC,OAAQD,EAAQ,WAAYX,KAAkBD,GACvEc,KAAK,OAELC,SAAAL,EAACM,EACA,CAAAC,MAAQf,EACRgB,UAAYvB,EAA4BM,GACxCkB,MAAM,OACNC,WAAa,GACbC,YAAc,GACdrB,UAAYY,EAAQ,yBAElBU,GACDZ,EAAK,MAAA,CAAAV,UAAYY,EAAQ,WAAYX,cAClCqB,EAAOjB,KAAKE,YAAS,OACtBgB,EAAwB,MAAA,CAAAvB,UAAYY,EAAQ,eAC3CG,SAAA,CAAAL,EAAA,MAAA,CAAKc,MAAQ,GAAKC,OAAS,GAC1BV,SAAAL,EAAA,OAAA,CACCc,MAAQ,GACRC,OAAS,GACTC,KAAOnB,EAAMoB,MACb3B,UAAYY,EAAQ,0BAGtBW,EAAM,OAAA,CAAAvB,UAAYY,EAAQ,qBAAqBG,SAAA,CAC5CR,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7E,SASlBoD,GACDjD,EAAC6E,EAAO,CACPC,qBACA,EAAAC,uBACAC,kBAAgB,EAChB1D,cAAgBA,OAKjB4B,GACDlD,EAACiF,EAAM,CACN5F,MAAQkE,EACRhE,YAAc4D,EACd7D,UAAYY,EAAQ,yBAItB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.bar-chart-module__bar-chart__lmYNi {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.bar-chart-module__bar-chart-legend__vgKKq {
|
|
5
|
+
margin-top: 1rem;
|
|
6
|
+
}
|
|
7
|
+
.pie-chart-module__pie-chart__R12Vh {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
|
|
11
|
+
position: relative;
|
|
12
|
+
text-align: center;
|
|
13
|
+
}
|
|
14
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
|
|
15
|
+
margin-top: 1rem;
|
|
16
|
+
}
|
|
17
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
|
|
18
|
+
margin-bottom: 0px;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
}
|
|
22
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
|
|
23
|
+
margin-top: 0px;
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
}
|
|
26
|
+
.grid-control-module__grid-control__KOnZN .visx-line {
|
|
27
|
+
stroke: #d7d6d6;
|
|
28
|
+
stroke-width: 1px;
|
|
29
|
+
shape-rendering: crispEdges;
|
|
30
|
+
}
|
|
31
|
+
.base-tooltip-module__tooltip__OfX6n {
|
|
32
|
+
padding: 0.5rem;
|
|
33
|
+
background-color: rgba(0, 0, 0, 0.85);
|
|
34
|
+
color: white;
|
|
35
|
+
border-radius: 4px;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
38
|
+
position: absolute;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
transform: translate(-50%, -100%);
|
|
41
|
+
}
|
|
42
|
+
.legend-module__legend--horizontal__IUN13 {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
gap: 16px;
|
|
47
|
+
}
|
|
48
|
+
.legend-module__legend--vertical__Scfzo {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.legend-module__legend-item__feemn {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 8px;
|
|
58
|
+
font-size: 0.875rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.legend-module__legend-item-swatch__nRyXf {
|
|
62
|
+
border-radius: 2px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.legend-module__legend-item-label__ksx6I {
|
|
66
|
+
color: var(--jp-gray-80, #2c3338);
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 0.5rem;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.legend-module__legend-item-value__d9x1j {
|
|
73
|
+
font-weight: 500;
|
|
74
|
+
}
|
|
75
|
+
.line-chart-module__line-chart__ITM3d {
|
|
76
|
+
position: relative;
|
|
77
|
+
}
|
|
78
|
+
.line-chart-module__line-chart__tooltip__aqcme {
|
|
79
|
+
background: #fff;
|
|
80
|
+
padding: 0.5rem;
|
|
81
|
+
}
|
|
82
|
+
.line-chart-module__line-chart__tooltip-date__4Dzab {
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
padding-bottom: 10px;
|
|
85
|
+
}
|
|
86
|
+
.line-chart-module__line-chart__tooltip-row__6A37G {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
padding: 4px 0;
|
|
90
|
+
justify-content: space-between;
|
|
91
|
+
}
|
|
92
|
+
.line-chart-module__line-chart__tooltip-label__IvnFF {
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
padding-right: 1rem;
|
|
95
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("@visx/group"),t=require("@visx/shape"),o=require("clsx"),i=require("react"),a=require("@visx/event"),n=require("@visx/tooltip"),s=require("@visx/legend"),r=require("@visx/scale");const d={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},c=i.createContext(d);var u={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const h={horizontal:"row",vertical:"column"},p=({items:l,className:t,orientation:i="horizontal"})=>{const a=r.scaleOrdinal({domain:l.map((e=>e.label)),range:l.map((e=>e.color))});return e.jsx("div",{className:o(u.legend,u[`legend--${i}`],t),role:"list",children:e.jsx(s.LegendOrdinal,{scale:a,direction:h[i],shape:"rect",shapeWidth:16,shapeHeight:16,className:u["legend-items"],children:t=>e.jsx("div",{className:u[`legend--${i}`],children:t.map((t=>{var o,i;return e.jsxs("div",{className:u["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:t.value,className:u["legend-item-swatch"]})}),e.jsxs("span",{className:u["legend-item-label"],children:[t.text,(null===(o=l.find((e=>e.label===t.text)))||void 0===o?void 0:o.value)&&e.jsx("span",{className:u["legend-item-value"],children:null===(i=l.find((e=>e.label===t.text)))||void 0===i?void 0:i.value})]})]},t.text)}))})})})};var g="base-tooltip-module__tooltip__OfX6n";const m=({data:l})=>e.jsxs(e.Fragment,{children:[null==l?void 0:l.label,": ",(null==l?void 0:l.valueDisplay)||(null==l?void 0:l.value)]}),v=({data:l,top:t,left:o,component:i=m,children:a,className:n})=>e.jsx("div",{className:g,style:{top:t,left:o},role:"tooltip",children:a||l&&e.jsx(i,{data:l,className:n})});var x={"pie-chart":"pie-chart-module__pie-chart__R12Vh"};exports.PieChart=({data:s,width:r=500,height:u=500,withTooltips:h=!1,innerRadius:g=0,className:m,showLegend:_,legendOrientation:f})=>{const j=i.useContext(c),{onMouseMove:F,onMouseLeave:b,tooltipOpen:C,tooltipData:N,tooltipLeft:w,tooltipTop:k}=(({withTooltips:e})=>{const{tooltipOpen:l,tooltipLeft:t,tooltipTop:o,tooltipData:s,hideTooltip:r,showTooltip:d}=n.useTooltip();return{onMouseMove:i.useCallback(((l,t)=>{if(!e)return;const o=a.localPoint(l);o&&d({tooltipData:t,tooltipLeft:o.x,tooltipTop:o.y-10})}),[e,d]),onMouseLeave:i.useCallback((()=>{e&&r()}),[e,r]),tooltipOpen:l,tooltipData:s||null,tooltipLeft:t,tooltipTop:o}})({withTooltips:h}),L=Math.min(r,u)/2,M=r/2,T=u/2,q={value:e=>e.value,fill:e=>(null==e?void 0:e.color)||j.colors[e.index]},D=s.map(((e,l)=>({label:e.label,value:e.value.toString(),color:j.colors[l%j.colors.length]})));return e.jsxs("div",{className:o("pie-chart",x["pie-chart"],m),children:[e.jsx("svg",{width:r,height:u,children:e.jsx(l.Group,{top:T,left:M,children:e.jsx(t.Pie,{data:s,pieValue:q.value,outerRadius:L-20,innerRadius:g,children:l=>l.arcs.map(((t,o)=>{const[i,a]=l.path.centroid(t),n=t.endAngle-t.startAngle>=.25,s=e=>F(e,t.data),r={d:l.path(t)||"",fill:q.fill(t)};return h&&(r.onMouseMove=s,r.onMouseLeave=b),e.jsxs("g",{children:[e.jsx("path",{...r}),n&&e.jsx("text",{x:i,y:a,dy:".33em",fill:j.labelBackgroundColor||d.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none",children:t.data.label})]},`arc-${o}`)}))})})}),_&&e.jsx(p,{items:D,orientation:f,className:x["pie-chart-legend"]}),h&&C&&N&&e.jsx(v,{data:N,top:k||0,left:w||0,style:{transform:"translate(-50%, -100%)"}})]})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/hooks/use-chart-mouse-handler.ts","../../../src/providers/theme/themes.ts","../../../src/providers/theme/theme-provider.tsx","../../../src/components/legend/base-legend.tsx","../../../src/components/tooltip/base-tooltip.tsx","../../../src/components/pie-chart/pie-chart.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","className","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","role","children","jsx","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","jsxs","width","height","fill","value","text","_a","find","_b","DefaultTooltipContent","data","valueDisplay","BaseTooltip","top","left","component","Component","style","withTooltips","innerRadius","showLegend","legendOrientation","providerTheme","useContext","onMouseMove","onMouseLeave","tooltipOpen","tooltipData","tooltipLeft","tooltipTop","hideTooltip","showTooltip","useTooltip","useCallback","event","coords","localPoint","x","y","useChartMouseHandler","radius","Math","min","centerX","centerY","accessors","d","index","legendItems","toString","length","Group","Pie","pieValue","outerRadius","pie","arcs","arc","centroidX","centroidY","path","centroid","hasSpaceForLabel","endAngle","startAngle","handleMouseMove","pathProps","dy","fontSize","textAnchor","pointerEvents","Legend","transform"],"mappings":"8OA6CA,MCxCMA,EAA2B,CAChCC,gBAAiB,UACjBC,qBAAs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,IAkBhB,UAOL3B,GACDnC,EAAAA,IAACsF,EAAM,CACNjG,MAAQ0E,EACRxE,YAAc6C,EACd9C,UAAYY,EAAQ,sBAIpB+B,GAAgBQ,GAAeC,GAChC1C,MAAC2B,EAAW,CACXF,KAAOiB,EACPd,IAAMgB,GAAc,EACpBf,KAAOc,GAAe,EACtBX,MAAQ,CACPuD,UAAW,8BAKd"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import{Group as o}from"@visx/group";import{Pie as i}from"@visx/shape";import a from"clsx";import{useCallback as n,createContext as r,useContext as d}from"react";import{localPoint as s}from"@visx/event";import{useTooltip as c}from"@visx/tooltip";import{LegendOrdinal as p}from"@visx/legend";import{scaleOrdinal as m}from"@visx/scale";const h={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},g=r(h);var u={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const v={horizontal:"row",vertical:"column"},_=({items:t,className:o,orientation:i="horizontal"})=>{const n=m({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e("div",{className:a(u.legend,u[`legend--${i}`],o),role:"list",children:e(p,{scale:n,direction:v[i],shape:"rect",shapeWidth:16,shapeHeight:16,className:u["legend-items"],children:o=>e("div",{className:u[`legend--${i}`],children:o.map((o=>{var i,a;return l("div",{className:u["legend-item"],children:[e("svg",{width:16,height:16,children:e("rect",{width:16,height:16,fill:o.value,className:u["legend-item-swatch"]})}),l("span",{className:u["legend-item-label"],children:[o.text,(null===(i=t.find((e=>e.label===o.text)))||void 0===i?void 0:i.value)&&e("span",{className:u["legend-item-value"],children:null===(a=t.find((e=>e.label===o.text)))||void 0===a?void 0:a.value})]})]},o.text)}))})})})};var f="base-tooltip-module__tooltip__OfX6n";const x=({data:e})=>l(t,{children:[null==e?void 0:e.label,": ",(null==e?void 0:e.valueDisplay)||(null==e?void 0:e.value)]}),F=({data:l,top:t,left:o,component:i=x,children:a,className:n})=>e("div",{className:f,style:{top:t,left:o},role:"tooltip",children:a||l&&e(i,{data:l,className:n})});var b={"pie-chart":"pie-chart-module__pie-chart__R12Vh"};const N=({data:t,width:r=500,height:p=500,withTooltips:m=!1,innerRadius:u=0,className:v,showLegend:f,legendOrientation:x})=>{const N=d(g),{onMouseMove:w,onMouseLeave:C,tooltipOpen:M,tooltipData:k,tooltipLeft:D,tooltipTop:L}=(({withTooltips:e})=>{const{tooltipOpen:l,tooltipLeft:t,tooltipTop:o,tooltipData:i,hideTooltip:a,showTooltip:r}=c();return{onMouseMove:n(((l,t)=>{if(!e)return;const o=s(l);o&&r({tooltipData:t,tooltipLeft:o.x,tooltipTop:o.y-10})}),[e,r]),onMouseLeave:n((()=>{e&&a()}),[e,a]),tooltipOpen:l,tooltipData:i||null,tooltipLeft:t,tooltipTop:o}})({withTooltips:m}),T=Math.min(r,p)/2,y=r/2,z=p/2,A={value:e=>e.value,fill:e=>(null==e?void 0:e.color)||N.colors[e.index]},O=t.map(((e,l)=>({label:e.label,value:e.value.toString(),color:N.colors[l%N.colors.length]})));return l("div",{className:a("pie-chart",b["pie-chart"],v),children:[e("svg",{width:r,height:p,children:e(o,{top:z,left:y,children:e(i,{data:t,pieValue:A.value,outerRadius:T-20,innerRadius:u,children:t=>t.arcs.map(((o,i)=>{const[a,n]=t.path.centroid(o),r=o.endAngle-o.startAngle>=.25,d=e=>w(e,o.data),s={d:t.path(o)||"",fill:A.fill(o)};return m&&(s.onMouseMove=d,s.onMouseLeave=C),l("g",{children:[e("path",{...s}),r&&e("text",{x:a,y:n,dy:".33em",fill:N.labelBackgroundColor||h.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none",children:o.data.label})]},`arc-${i}`)}))})})}),f&&e(_,{items:O,orientation:x,className:b["pie-chart-legend"]}),m&&M&&k&&e(F,{data:k,top:L||0,left:D||0,style:{transform:"translate(-50%, -100%)"}})]})};export{N as PieChart};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/use-chart-mouse-handler.ts","../../../src/providers/theme/themes.ts","../../../src/providers/theme/theme-provider.tsx","../../../src/components/legend/base-legend.tsx","../../../src/components/tooltip/base-tooltip.tsx","../../../src/components/pie-chart/pie-chart.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","className","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","role","children","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","width","height","fill","value","text","_a","find","_b","DefaultTooltipContent","data","valueDisplay","BaseTooltip","top","left","component","Component","style","PieChart","withTooltips","innerRadius","showLegend","legendOrientation","providerTheme","useContext","onMouseMove","onMouseLeave","tooltipOpen","tooltipData","tooltipLeft","tooltipTop","hideTooltip","showTooltip","useTooltip","useCallback","event","coords","localPoint","x","y","useChartMouseHandler","radius","Math","min","centerX","centerY","accessors","d","index","legendItems","toString","length","Group","Pie","pieValue","outerRadius","pie","arcs","arc","centroidX","centroidY","path","centroid","hasSpaceForLabel","endAngle","startAngle","handleMouseMove","pathProps","dy","fontSize","textAnchor","pointerEvents","Legend","transform"],"mappings":"6YA6CA,MCxCMA,EAA2B,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACt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