@automattic/charts 0.2.0 → 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.
Files changed (56) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/bar-chart/index.cjs.js +2 -0
  3. package/dist/components/bar-chart/index.cjs.js.map +1 -0
  4. package/dist/components/bar-chart/index.js +2 -0
  5. package/dist/components/bar-chart/index.js.map +1 -0
  6. package/dist/components/bar-chart/style.css +95 -0
  7. package/dist/components/grid-control/index.cjs.js +2 -0
  8. package/dist/components/grid-control/index.cjs.js.map +1 -0
  9. package/dist/components/grid-control/index.js +2 -0
  10. package/dist/components/grid-control/index.js.map +1 -0
  11. package/dist/components/grid-control/style.css +95 -0
  12. package/dist/components/legend/index.cjs.js +2 -0
  13. package/dist/components/legend/index.cjs.js.map +1 -0
  14. package/dist/components/legend/index.js +2 -0
  15. package/dist/components/legend/index.js.map +1 -0
  16. package/dist/components/legend/style.css +95 -0
  17. package/dist/components/line-chart/index.cjs.js +2 -0
  18. package/dist/components/line-chart/index.cjs.js.map +1 -0
  19. package/dist/components/line-chart/index.js +2 -0
  20. package/dist/components/line-chart/index.js.map +1 -0
  21. package/dist/components/line-chart/style.css +95 -0
  22. package/dist/components/pie-chart/index.cjs.js +2 -0
  23. package/dist/components/pie-chart/index.cjs.js.map +1 -0
  24. package/dist/components/pie-chart/index.js +2 -0
  25. package/dist/components/pie-chart/index.js.map +1 -0
  26. package/dist/components/pie-chart/style.css +95 -0
  27. package/dist/components/pie-semi-circle-chart/index.cjs.js +2 -0
  28. package/dist/components/pie-semi-circle-chart/index.cjs.js.map +1 -0
  29. package/dist/components/pie-semi-circle-chart/index.js +2 -0
  30. package/dist/components/pie-semi-circle-chart/index.js.map +1 -0
  31. package/dist/components/pie-semi-circle-chart/style.css +95 -0
  32. package/dist/components/tooltip/index.cjs.js +2 -0
  33. package/dist/components/tooltip/index.cjs.js.map +1 -0
  34. package/dist/components/tooltip/index.js +2 -0
  35. package/dist/components/tooltip/index.js.map +1 -0
  36. package/dist/components/tooltip/style.css +95 -0
  37. package/dist/index.d.ts +16386 -0
  38. package/dist/index.js +2 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/index.mjs +2 -0
  41. package/dist/index.mjs.map +1 -0
  42. package/dist/providers/theme/index.cjs.js +2 -0
  43. package/dist/providers/theme/index.cjs.js.map +1 -0
  44. package/dist/providers/theme/index.js +2 -0
  45. package/dist/providers/theme/index.js.map +1 -0
  46. package/dist/providers/theme/style.css +95 -0
  47. package/dist/style.css +95 -0
  48. package/package.json +35 -13
  49. package/rollup.config.mjs +142 -0
  50. package/src/components/bar-chart/bar-chart.tsx +7 -7
  51. package/src/components/pie-chart/pie-chart.tsx +12 -10
  52. package/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx +4 -4
  53. package/src/components/tooltip/base-tooltip.tsx +1 -1
  54. package/src/hooks/use-chart-mouse-handler.ts +1 -1
  55. package/src/providers/theme/theme-provider.tsx +1 -1
  56. package/tsup.config.js +0 -26
@@ -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-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
8
+ position: relative;
9
+ text-align: center;
10
+ }
11
+ .pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
12
+ margin-top: 1rem;
13
+ }
14
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
15
+ margin-bottom: 0px;
16
+ font-weight: 600;
17
+ font-size: 16px;
18
+ }
19
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
20
+ margin-top: 0px;
21
+ font-size: 14px;
22
+ }
23
+ .line-chart-module__line-chart__ITM3d {
24
+ position: relative;
25
+ }
26
+ .line-chart-module__line-chart__tooltip__aqcme {
27
+ background: #fff;
28
+ padding: 0.5rem;
29
+ }
30
+ .line-chart-module__line-chart__tooltip-date__4Dzab {
31
+ font-weight: bold;
32
+ padding-bottom: 10px;
33
+ }
34
+ .line-chart-module__line-chart__tooltip-row__6A37G {
35
+ display: flex;
36
+ align-items: center;
37
+ padding: 4px 0;
38
+ justify-content: space-between;
39
+ }
40
+ .line-chart-module__line-chart__tooltip-label__IvnFF {
41
+ font-weight: 500;
42
+ padding-right: 1rem;
43
+ }
44
+ .grid-control-module__grid-control__KOnZN .visx-line {
45
+ stroke: #d7d6d6;
46
+ stroke-width: 1px;
47
+ shape-rendering: crispEdges;
48
+ }
49
+ .legend-module__legend--horizontal__IUN13 {
50
+ display: flex;
51
+ flex-direction: row;
52
+ flex-wrap: wrap;
53
+ gap: 16px;
54
+ }
55
+ .legend-module__legend--vertical__Scfzo {
56
+ display: flex;
57
+ flex-direction: column;
58
+ gap: 8px;
59
+ }
60
+
61
+ .legend-module__legend-item__feemn {
62
+ display: flex;
63
+ align-items: center;
64
+ gap: 8px;
65
+ font-size: 0.875rem;
66
+ }
67
+
68
+ .legend-module__legend-item-swatch__nRyXf {
69
+ border-radius: 2px;
70
+ }
71
+
72
+ .legend-module__legend-item-label__ksx6I {
73
+ color: var(--jp-gray-80, #2c3338);
74
+ display: flex;
75
+ align-items: center;
76
+ gap: 0.5rem;
77
+ }
78
+
79
+ .legend-module__legend-item-value__d9x1j {
80
+ font-weight: 500;
81
+ }
82
+ .base-tooltip-module__tooltip__OfX6n {
83
+ padding: 0.5rem;
84
+ background-color: rgba(0, 0, 0, 0.85);
85
+ color: white;
86
+ border-radius: 4px;
87
+ font-size: 14px;
88
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
89
+ position: absolute;
90
+ pointer-events: none;
91
+ transform: translate(-50%, -100%);
92
+ }
93
+ .pie-chart-module__pie-chart__R12Vh {
94
+ position: relative;
95
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),l=require("@visx/event"),a=require("@visx/group"),t=require("@visx/shape/lib/shapes/Pie"),i=require("@visx/text"),s=require("@visx/tooltip"),o=require("clsx"),r=require("react"),n=require("@visx/legend"),d=require("@visx/scale");const c=r.createContext({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});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"},m=({items:l,className:a,orientation:t="horizontal"})=>{const i=d.scaleOrdinal({domain:l.map((e=>e.label)),range:l.map((e=>e.color))});return e.jsx("div",{className:o(u.legend,u[`legend--${t}`],a),role:"list",children:e.jsx(n.LegendOrdinal,{scale:i,direction:h[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 v=({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)]}),g=({data:l,top:a,left:t,component:i=v,children:s,className:o})=>e.jsx("div",{className:p,style:{top:a,left:t},role:"tooltip",children:s||l&&e.jsx(i,{data:l,className:o})});var x="pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9",_="pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y",j="pie-semi-circle-chart-module__label__nPqOg",b="pie-semi-circle-chart-module__note__LpBZQ";exports.PieSemiCircleChart=({data:n,width:d=500,label:u,note:h,className:p,withTooltips:v=!1,clockwise:F=!0,thickness:f=.4,showLegend:N,legendOrientation:C})=>{const k=r.useContext(c),{tooltipOpen:w,tooltipLeft:q,tooltipTop:y,tooltipData:D,hideTooltip:A,showTooltip:P}=s.useTooltip(),T=d/2,L=d/2,M=d/2,I=M*(1-f+.03),O=n.map(((e,l)=>({...e,index:l}))),z=F?-Math.PI/2:Math.PI/2,S=F?Math.PI/2:-Math.PI/2,R={value:e=>e.value,sort:(e,l)=>l.value-e.value,fill:e=>e.color||k.colors[e.index%k.colors.length]},B=r.useCallback(((e,a)=>{const t=l.localPoint(e);t&&P({tooltipData:a.data,tooltipLeft:t.x,tooltipTop:t.y-10})}),[P]),W=r.useCallback((()=>{A()}),[A]),G=r.useCallback((e=>l=>{B(l,e)}),[B]),X=n.map(((e,l)=>({label:e.label,value:e.valueDisplay||e.value.toString(),color:R.fill({...e,index:l})})));return e.jsxs("div",{className:o("pie-semi-circle-chart",x,p),children:[e.jsx("svg",{width:d,height:L,children:e.jsxs(a.Group,{top:T,left:T,children:[e.jsx(t,{data:O,pieValue:R.value,outerRadius:M,innerRadius:I,cornerRadius:3,padAngle:.03,startAngle:z,endAngle:S,pieSort:R.sort,children:l=>l.arcs.map((a=>e.jsx("g",{onMouseMove:G(a),onMouseLeave:W,children:e.jsx("path",{d:l.path(a)||"",fill:R.fill(a.data)})},a.data.label)))}),e.jsxs(a.Group,{children:[e.jsx(i.Text,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:j,children:u}),e.jsx(i.Text,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:b,children:h})]})]})}),v&&w&&D&&e.jsx(g,{data:{label:D.label,value:D.value,valueDisplay:D.valueDisplay},top:y||0,left:q||0}),N&&e.jsx(m,{items:X,orientation:C,className:_})]})};
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/tooltip/base-tooltip.tsx","../../../src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx"],"sourcesContent":[null,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","DefaultTooltipContent","data","valueDisplay","BaseTooltip","top","left","component","Component","style","note","withTooltips","clockwise","thickness","showLegend","legendOrientation","providerTheme","useContext","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","centerX","radius","innerRadius","dataWithIndex","d","index","startAngle","Math","PI","endAngle","accessors","sort","a","b","length","handleMouseMove","useCallback","event","arc","coords","localPoint","x","y","handleMouseLeave","handleArcMouseMove","legendItems","toString","Group","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","path","Text","textAnchor","verticalAnchor","Legend"],"mappings":"qRAKA,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,M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e,GAAc,EACpBd,KAAOa,GAAe,IAItBL,GACDrC,MAAC0F,EACA,CAAArG,MAAQoF,EACRlF,YAAc+C,EACdhD,UAAYY,MAId"}
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import{localPoint as i}from"@visx/event";import{Group as a}from"@visx/group";import o from"@visx/shape/lib/shapes/Pie";import{Text as r}from"@visx/text";import{useTooltip as n}from"@visx/tooltip";import d from"clsx";import{createContext as s,useContext as c,useCallback as m}from"react";import{LegendOrdinal as h}from"@visx/legend";import{scaleOrdinal as p}from"@visx/scale";const v=s({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"},_=({items:t,className:i,orientation:a="horizontal"})=>{const o=p({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e("div",{className:d(g.legend,g[`legend--${a}`],i),role:"list",children:e(h,{scale:o,direction:u[a],shape:"rect",shapeWidth:16,shapeHeight:16,className:g["legend-items"],children:i=>e("div",{className:g[`legend--${a}`],children:i.map((i=>{var a,o;return l("div",{className:g["legend-item"],children:[e("svg",{width:16,height:16,children:e("rect",{width:16,height:16,fill:i.value,className:g["legend-item-swatch"]})}),l("span",{className:g["legend-item-label"],children:[i.text,(null===(a=t.find((e=>e.label===i.text)))||void 0===a?void 0:a.value)&&e("span",{className:g["legend-item-value"],children:null===(o=t.find((e=>e.label===i.text)))||void 0===o?void 0:o.value})]})]},i.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)]}),b=({data:l,top:t,left:i,component:a=x,children:o,className:r})=>e("div",{className:f,style:{top:t,left:i},role:"tooltip",children:o||l&&e(a,{data:l,className:r})});var F="pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9",N="pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y",w="pie-semi-circle-chart-module__label__nPqOg",k="pie-semi-circle-chart-module__note__LpBZQ";const y=({data:t,width:s=500,label:h,note:p,className:g,withTooltips:u=!1,clockwise:f=!0,thickness:x=.4,showLegend:y,legendOrientation:D})=>{const A=c(v),{tooltipOpen:C,tooltipLeft:M,tooltipTop:I,tooltipData:L,hideTooltip:P,showTooltip:z}=n(),T=s/2,O=s/2,R=s/2,S=R*(1-x+.03),j=t.map(((e,l)=>({...e,index:l}))),B=f?-Math.PI/2:Math.PI/2,W=f?Math.PI/2:-Math.PI/2,X={value:e=>e.value,sort:(e,l)=>l.value-e.value,fill:e=>e.color||A.colors[e.index%A.colors.length]},$=m(((e,l)=>{const t=i(e);t&&z({tooltipData:l.data,tooltipLeft:t.x,tooltipTop:t.y-10})}),[z]),q=m((()=>{P()}),[P]),H=m((e=>l=>{$(l,e)}),[$]),Q=t.map(((e,l)=>({label:e.label,value:e.valueDisplay||e.value.toString(),color:X.fill({...e,index:l})})));return l("div",{className:d("pie-semi-circle-chart",F,g),children:[e("svg",{width:s,height:O,children:l(a,{top:T,left:T,children:[e(o,{data:j,pieValue:X.value,outerRadius:R,innerRadius:S,cornerRadius:3,padAngle:.03,startAngle:B,endAngle:W,pieSort:X.sort,children:l=>l.arcs.map((t=>e("g",{onMouseMove:H(t),onMouseLeave:q,children:e("path",{d:l.path(t)||"",fill:X.fill(t.data)})},t.data.label)))}),l(a,{children:[e(r,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:w,children:h}),e(r,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:k,children:p})]})]})}),u&&C&&L&&e(b,{data:{label:L.label,value:L.value,valueDisplay:L.valueDisplay},top:I||0,left:M||0}),y&&e(_,{items:Q,orientation:D,className:N})]})};export{y as PieSemiCircleChart};
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/tooltip/base-tooltip.tsx","../../../src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx"],"sourcesContent":[null,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","DefaultTooltipContent","data","valueDisplay","BaseTooltip","top","left","component","Component","style","PieSemiCircleChart","note","withTooltips","clockwise","thickness","showLegend","legendOrientation","providerTheme","useContext","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","centerX","radius","innerRadius","dataWithIndex","d","index","startAngle","Math","PI","endAngle","accessors","sort","a","b","length","handleMouseMove","useCallback","event","arc","coords","localPoint","x","y","handleMouseLeave","handleArcMouseMove","legendItems","toString","Group","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","path","Text","textAnchor","verticalAnchor","Legend"],"mappings":"ubAKA,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,C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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
+ .line-chart-module__line-chart__ITM3d {
11
+ position: relative;
12
+ }
13
+ .line-chart-module__line-chart__tooltip__aqcme {
14
+ background: #fff;
15
+ padding: 0.5rem;
16
+ }
17
+ .line-chart-module__line-chart__tooltip-date__4Dzab {
18
+ font-weight: bold;
19
+ padding-bottom: 10px;
20
+ }
21
+ .line-chart-module__line-chart__tooltip-row__6A37G {
22
+ display: flex;
23
+ align-items: center;
24
+ padding: 4px 0;
25
+ justify-content: space-between;
26
+ }
27
+ .line-chart-module__line-chart__tooltip-label__IvnFF {
28
+ font-weight: 500;
29
+ padding-right: 1rem;
30
+ }
31
+ .grid-control-module__grid-control__KOnZN .visx-line {
32
+ stroke: #d7d6d6;
33
+ stroke-width: 1px;
34
+ shape-rendering: crispEdges;
35
+ }
36
+ .legend-module__legend--horizontal__IUN13 {
37
+ display: flex;
38
+ flex-direction: row;
39
+ flex-wrap: wrap;
40
+ gap: 16px;
41
+ }
42
+ .legend-module__legend--vertical__Scfzo {
43
+ display: flex;
44
+ flex-direction: column;
45
+ gap: 8px;
46
+ }
47
+
48
+ .legend-module__legend-item__feemn {
49
+ display: flex;
50
+ align-items: center;
51
+ gap: 8px;
52
+ font-size: 0.875rem;
53
+ }
54
+
55
+ .legend-module__legend-item-swatch__nRyXf {
56
+ border-radius: 2px;
57
+ }
58
+
59
+ .legend-module__legend-item-label__ksx6I {
60
+ color: var(--jp-gray-80, #2c3338);
61
+ display: flex;
62
+ align-items: center;
63
+ gap: 0.5rem;
64
+ }
65
+
66
+ .legend-module__legend-item-value__d9x1j {
67
+ font-weight: 500;
68
+ }
69
+ .base-tooltip-module__tooltip__OfX6n {
70
+ padding: 0.5rem;
71
+ background-color: rgba(0, 0, 0, 0.85);
72
+ color: white;
73
+ border-radius: 4px;
74
+ font-size: 14px;
75
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
76
+ position: absolute;
77
+ pointer-events: none;
78
+ transform: translate(-50%, -100%);
79
+ }
80
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
81
+ position: relative;
82
+ text-align: center;
83
+ }
84
+ .pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
85
+ margin-top: 1rem;
86
+ }
87
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
88
+ margin-bottom: 0px;
89
+ font-weight: 600;
90
+ font-size: 16px;
91
+ }
92
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
93
+ margin-top: 0px;
94
+ font-size: 14px;
95
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var l=require("react/jsx-runtime"),e="base-tooltip-module__tooltip__OfX6n";const t=({data:e})=>l.jsxs(l.Fragment,{children:[null==e?void 0:e.label,": ",(null==e?void 0:e.valueDisplay)||(null==e?void 0:e.value)]});exports.BaseTooltip=({data:a,top:o,left:s,component:i=t,children:n,className:r})=>l.jsx("div",{className:e,style:{top:o,left:s},role:"tooltip",children:n||a&&l.jsx(i,{data:a,className:r})});
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../src/components/tooltip/base-tooltip.tsx"],"sourcesContent":[null],"names":["DefaultTooltipContent","data","_jsxs","label","valueDisplay","value","top","left","component","Component","children","className","_jsx","styles","style","role","jsx"],"mappings":"wFAmCA,MAAMA,EAAwB,EAAIC,UACjCC,6BACGD,aAAA,EAAAA,EAAME,MAAK,MAAMF,aAAI,EAAJA,EAAMG,gBAAgBH,eAAAA,EAAMI,8BAItB,EAC1BJ,OACAK,MACAC,OACAC,UAAWC,EAAYT,EACvBU,WACAC,eAGCC,MAAK,MAAA,CAAAD,UAAYE,EAAiBC,MAAQ,CAAER,MAAKC,QAASQ,KAAK,UAC5DL,SAAAA,GAAcT,GAAQW,EAACI,IAAAP,GAAUR,KAAOA,EAAOU,UAAYA"}
@@ -0,0 +1,2 @@
1
+ import{jsx as l,jsxs as t,Fragment as a}from"react/jsx-runtime";var e="base-tooltip-module__tooltip__OfX6n";const o=({data:l})=>t(a,{children:[null==l?void 0:l.label,": ",(null==l?void 0:l.valueDisplay)||(null==l?void 0:l.value)]}),i=({data:t,top:a,left:i,component:d=o,children:n,className:s})=>l("div",{className:e,style:{top:a,left:i},role:"tooltip",children:n||t&&l(d,{data:t,className:s})});export{i as BaseTooltip};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/tooltip/base-tooltip.tsx"],"sourcesContent":[null],"names":["DefaultTooltipContent","data","_jsxs","label","valueDisplay","value","BaseTooltip","top","left","component","Component","children","className","_jsx","styles","style","role"],"mappings":"4GAmCA,MAAMA,EAAwB,EAAIC,UACjCC,eACGD,aAAA,EAAAA,EAAME,MAAK,MAAMF,aAAI,EAAJA,EAAMG,gBAAgBH,eAAAA,EAAMI,UAIpCC,EAAc,EAC1BL,OACAM,MACAC,OACAC,UAAWC,EAAYV,EACvBW,WACAC,eAGCC,EAAK,MAAA,CAAAD,UAAYE,EAAiBC,MAAQ,CAAER,MAAKC,QAASQ,KAAK,UAC5DL,SAAAA,GAAcV,GAAQY,EAACH,GAAUT,KAAOA,EAAOW,UAAYA"}
@@ -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
+ .legend-module__legend--horizontal__IUN13 {
53
+ display: flex;
54
+ flex-direction: row;
55
+ flex-wrap: wrap;
56
+ gap: 16px;
57
+ }
58
+ .legend-module__legend--vertical__Scfzo {
59
+ display: flex;
60
+ flex-direction: column;
61
+ gap: 8px;
62
+ }
63
+
64
+ .legend-module__legend-item__feemn {
65
+ display: flex;
66
+ align-items: center;
67
+ gap: 8px;
68
+ font-size: 0.875rem;
69
+ }
70
+
71
+ .legend-module__legend-item-swatch__nRyXf {
72
+ border-radius: 2px;
73
+ }
74
+
75
+ .legend-module__legend-item-label__ksx6I {
76
+ color: var(--jp-gray-80, #2c3338);
77
+ display: flex;
78
+ align-items: center;
79
+ gap: 0.5rem;
80
+ }
81
+
82
+ .legend-module__legend-item-value__d9x1j {
83
+ font-weight: 500;
84
+ }
85
+ .base-tooltip-module__tooltip__OfX6n {
86
+ padding: 0.5rem;
87
+ background-color: rgba(0, 0, 0, 0.85);
88
+ color: white;
89
+ border-radius: 4px;
90
+ font-size: 14px;
91
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
92
+ position: absolute;
93
+ pointer-events: none;
94
+ transform: translate(-50%, -100%);
95
+ }