@automattic/charts 0.2.3 → 0.4.0

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 (106) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/components/bar-chart/index.js +2 -2
  3. package/dist/cjs/components/bar-chart/index.js.map +1 -1
  4. package/dist/cjs/components/bar-chart/style.css +94 -5
  5. package/dist/cjs/components/grid-control/index.js +2 -2
  6. package/dist/cjs/components/grid-control/index.js.map +1 -1
  7. package/dist/cjs/components/grid-control/style.css +94 -2
  8. package/dist/cjs/components/legend/index.js +2 -2
  9. package/dist/cjs/components/legend/index.js.map +1 -1
  10. package/dist/cjs/components/legend/style.css +94 -2
  11. package/dist/cjs/components/line-chart/index.js +2 -2
  12. package/dist/cjs/components/line-chart/index.js.map +1 -1
  13. package/dist/cjs/components/line-chart/style.css +94 -3
  14. package/dist/cjs/components/pie-chart/index.js +2 -2
  15. package/dist/cjs/components/pie-chart/index.js.map +1 -1
  16. package/dist/cjs/components/pie-chart/style.css +94 -4
  17. package/dist/cjs/components/pie-semi-circle-chart/index.js +2 -2
  18. package/dist/cjs/components/pie-semi-circle-chart/index.js.map +1 -1
  19. package/dist/cjs/components/pie-semi-circle-chart/style.css +94 -4
  20. package/dist/cjs/components/tooltip/index.js +2 -2
  21. package/dist/cjs/components/tooltip/index.js.map +1 -1
  22. package/dist/cjs/components/tooltip/style.css +94 -2
  23. package/dist/cjs/index.js +2 -2
  24. package/dist/cjs/index.js.map +1 -1
  25. package/dist/cjs/providers/theme/index.js +2 -2
  26. package/dist/cjs/providers/theme/index.js.map +1 -1
  27. package/dist/cjs/providers/theme/style.css +95 -0
  28. package/dist/cjs/style.css +95 -9
  29. package/dist/index.d.ts +301 -0
  30. package/dist/mjs/components/bar-chart/index.js +2 -2
  31. package/dist/mjs/components/bar-chart/index.js.map +1 -1
  32. package/dist/mjs/components/bar-chart/style.css +94 -5
  33. package/dist/mjs/components/grid-control/index.js +2 -2
  34. package/dist/mjs/components/grid-control/index.js.map +1 -1
  35. package/dist/mjs/components/grid-control/style.css +94 -2
  36. package/dist/mjs/components/legend/index.js +2 -2
  37. package/dist/mjs/components/legend/index.js.map +1 -1
  38. package/dist/mjs/components/legend/style.css +94 -2
  39. package/dist/mjs/components/line-chart/index.js +2 -2
  40. package/dist/mjs/components/line-chart/index.js.map +1 -1
  41. package/dist/mjs/components/line-chart/style.css +94 -3
  42. package/dist/mjs/components/pie-chart/index.js +2 -2
  43. package/dist/mjs/components/pie-chart/index.js.map +1 -1
  44. package/dist/mjs/components/pie-chart/style.css +94 -4
  45. package/dist/mjs/components/pie-semi-circle-chart/index.js +2 -2
  46. package/dist/mjs/components/pie-semi-circle-chart/index.js.map +1 -1
  47. package/dist/mjs/components/pie-semi-circle-chart/style.css +94 -4
  48. package/dist/mjs/components/tooltip/index.js +2 -2
  49. package/dist/mjs/components/tooltip/index.js.map +1 -1
  50. package/dist/mjs/components/tooltip/style.css +94 -2
  51. package/dist/mjs/index.js +2 -2
  52. package/dist/mjs/index.js.map +1 -1
  53. package/dist/mjs/providers/theme/index.js +2 -2
  54. package/dist/mjs/providers/theme/index.js.map +1 -1
  55. package/dist/mjs/providers/theme/style.css +95 -0
  56. package/dist/mjs/style.css +95 -9
  57. package/global.d.ts +14 -0
  58. package/package.json +29 -8
  59. package/rollup.config.mjs +142 -0
  60. package/src/components/bar-chart/bar-chart.tsx +11 -5
  61. package/src/components/line-chart/line-chart.tsx +55 -17
  62. package/src/components/pie-chart/__tests__/pie-chart.test.tsx +59 -0
  63. package/src/components/pie-chart/pie-chart.tsx +94 -7
  64. package/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx +20 -13
  65. package/src/components/shared/with-responsive.tsx +54 -0
  66. package/src/types.ts +26 -1
  67. package/tests/jest.config.cjs +12 -0
  68. package/tests/jest.setup.js +13 -0
  69. package/webpack.config.cjs +10 -1
  70. package/dist/cjs/components/bar-chart/style.css.map +0 -1
  71. package/dist/cjs/components/grid-control/style.css.map +0 -1
  72. package/dist/cjs/components/legend/style.css.map +0 -1
  73. package/dist/cjs/components/line-chart/style.css.map +0 -1
  74. package/dist/cjs/components/pie-chart/style.css.map +0 -1
  75. package/dist/cjs/components/pie-semi-circle-chart/style.css.map +0 -1
  76. package/dist/cjs/components/tooltip/style.css.map +0 -1
  77. package/dist/cjs/style.css.map +0 -1
  78. package/dist/mjs/components/bar-chart/style.css.map +0 -1
  79. package/dist/mjs/components/grid-control/style.css.map +0 -1
  80. package/dist/mjs/components/legend/style.css.map +0 -1
  81. package/dist/mjs/components/line-chart/style.css.map +0 -1
  82. package/dist/mjs/components/pie-chart/style.css.map +0 -1
  83. package/dist/mjs/components/pie-semi-circle-chart/style.css.map +0 -1
  84. package/dist/mjs/components/tooltip/style.css.map +0 -1
  85. package/dist/mjs/style.css.map +0 -1
  86. package/dist/types/components/bar-chart/bar-chart.d.ts +0 -6
  87. package/dist/types/components/bar-chart/index.d.ts +0 -1
  88. package/dist/types/components/grid-control/grid-control.d.ts +0 -4
  89. package/dist/types/components/grid-control/index.d.ts +0 -1
  90. package/dist/types/components/legend/base-legend.d.ts +0 -3
  91. package/dist/types/components/legend/index.d.ts +0 -2
  92. package/dist/types/components/legend/types.d.ts +0 -12
  93. package/dist/types/components/line-chart/index.d.ts +0 -1
  94. package/dist/types/components/line-chart/line-chart.d.ts +0 -6
  95. package/dist/types/components/pie-chart/index.d.ts +0 -1
  96. package/dist/types/components/pie-chart/pie-chart.d.ts +0 -15
  97. package/dist/types/components/pie-semi-circle-chart/index.d.ts +0 -1
  98. package/dist/types/components/pie-semi-circle-chart/pie-semi-circle-chart.d.ts +0 -23
  99. package/dist/types/components/tooltip/base-tooltip.d.ts +0 -29
  100. package/dist/types/components/tooltip/index.d.ts +0 -2
  101. package/dist/types/hooks/use-chart-mouse-handler.d.ts +0 -41
  102. package/dist/types/index.d.ts +0 -8
  103. package/dist/types/providers/theme/index.d.ts +0 -2
  104. package/dist/types/providers/theme/theme-provider.d.ts +0 -18
  105. package/dist/types/providers/theme/themes.d.ts +0 -14
  106. package/dist/types/types.d.ts +0 -137
package/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ 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.4.0] - 2025-01-22
9
+ ### Added
10
+ - Added passing through options for X, Y axis [#41109]
11
+ - Add gradient fill for line chart [#41143]
12
+ - Charts: add responsive chart stories [#41018]
13
+ - Charts: adds dependencies and config for jest testing. Adds some initial tests to pie chart component [#41148]
14
+ - Charts: adds more pie chart tests [#41175]
15
+
16
+ ### Changed
17
+ - Changed back to build with Rollup [#41234]
18
+ - Introduce gapScale and cornerScale properties [#41033]
19
+ - PieChart: iterate a bit over component API [#40993]
20
+
21
+ ## [0.3.0] - 2025-01-12
22
+ ### Changed
23
+ - make charts responsive [#40922]
24
+
25
+ ### Fixed
26
+ - Fixed React reference [#40978]
27
+
8
28
  ## [0.2.3] - 2025-01-12
9
29
  ### Changed
10
30
  - Replace Rollup with Webpack for charts [#40912]
@@ -47,6 +67,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
47
67
  - Fixed lints following ESLint rule changes for TS [#40584]
48
68
  - Fixing a bug in Chart storybook data. [#40640]
49
69
 
70
+ [0.4.0]: https://github.com/Automattic/charts/compare/v0.3.0...v0.4.0
71
+ [0.3.0]: https://github.com/Automattic/charts/compare/v0.2.3...v0.3.0
50
72
  [0.2.3]: https://github.com/Automattic/charts/compare/v0.2.2...v0.2.3
51
73
  [0.2.2]: https://github.com/Automattic/charts/compare/v0.2.1...v0.2.2
52
74
  [0.2.1]: https://github.com/Automattic/charts/compare/v0.2.0...v0.2.1
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=Array(t);a<t;a++)r[a]=e[a];return r}function r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.r(t),e.d(t,{BarChart:()=>S});const l=require("@visx/axis"),n=require("@visx/event"),o=require("@visx/group"),i=require("@visx/scale"),c=require("@visx/shape"),d=require("@visx/tooltip"),u=require("clsx");var s=e.n(u);const m=require("react");var v=e.n(m),p={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},h=(0,m.createContext)(p);const g=require("@visx/grid"),f=function(e){var t=e.width,a=e.height,r=e.xScale,l=e.yScale,n=e.gridVisibility,o=void 0===n?"x":n,i=e.top,c=void 0===i?0:i;return v().createElement("g",{transform:"translate(0, ".concat(c,")"),className:"jfpeES0fbFrqCPR8dRN7"},o.includes("x")&&v().createElement(g.GridRows,{scale:r,width:t}),o.includes("y")&&v().createElement(g.GridColumns,{scale:l,height:a}))},b=require("@visx/legend"),y={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var E={horizontal:"row",vertical:"column"},x=function(e){var t=e.items,a=e.className,r=e.orientation,l=void 0===r?"horizontal":r,n=(0,i.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:s()(y.legend,y["legend--".concat(l)],a),role:"list"},React.createElement(b.LegendOrdinal,{scale:n,direction:E[l],shape:"rect",shapeWidth:16,shapeHeight:16,className:y["legend-items"]},(function(e){return React.createElement("div",{className:y["legend--".concat(l)]},e.map((function(e){var a,r;return React.createElement("div",{key:e.text,className:y["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:y["legend-item-swatch"]})),React.createElement("span",{className:y["legend-item-label"]},e.text,(null===(a=t.find((function(t){return t.label===e.text})))||void 0===a?void 0:a.value)&&React.createElement("span",{className:y["legend-item-value"]},null===(r=t.find((function(t){return t.label===e.text})))||void 0===r?void 0:r.value)))})))})))};var R=function(e){var t=e.data;return React.createElement(React.Fragment,null,null==t?void 0:t.label,": ",(null==t?void 0:t.valueDisplay)||(null==t?void 0:t.value))},F=function(e){var t=e.data,a=e.top,r=e.left,l=e.component,n=void 0===l?R:l,o=e.children,i=e.className;return React.createElement("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:a,left:r},role:"tooltip"},o||t&&React.createElement(n,{data:t,className:i}))};const w={"bar-chart":"Vm_cn8YnIXBavFt6eHSp","bar-chart-legend":"e4dhKgBP7e6FBRAX2SrP"};var N=function(e){var t,a=e.data,u=e.width,v=void 0===u?500:u,p=e.height,g=void 0===p?500:p,b=e.margin,y=void 0===b?{top:20,right:20,bottom:40,left:40}:b,E=e.withTooltips,R=void 0!==E&&E,N=e.showLegend,S=void 0!==N&&N,C=e.legendOrientation,A=void 0===C?"horizontal":C,L=e.className,q=e.gridVisibility,B=void 0===q?"x":q,M=(0,m.useContext)(h),O=(0,d.useTooltip)(),k=O.tooltipOpen,P=O.tooltipLeft,D=O.tooltipTop,T=O.tooltipData,j=O.hideTooltip,K=O.showTooltip,I=(0,m.useCallback)((function(e,t,a,r,l){var o=(0,n.localPoint)(e);o&&K({tooltipData:{value:t,xLabel:a,yLabel:r,seriesIndex:l},tooltipLeft:o.x,tooltipTop:o.y-10})}),[K]),_=(0,m.useCallback)((function(){j()}),[j]);if(null==a||!a.length)return React.createElement("div",{className:s()("bar-chart-empty",w["bat-chart-empty"])},"Empty...");var z=y,X=v-z.left-z.right,G=g-z.top-z.bottom,H=null===(t=a[0].data)||void 0===t?void 0:t.map((function(e){return(null==e?void 0:e.label)||""})),V=(0,i.scaleBand)({range:[0,X],domain:H,padding:.2}),J=(0,i.scaleBand)({range:[0,V.bandwidth()],domain:a.map((function(e,t){return t.toString()})),padding:.1}),U=(0,i.scaleLinear)({range:[G,0],domain:[0,Math.max.apply(Math,r(a.map((function(e){return Math.max.apply(Math,r(e.data.map((function(e){return(null==e?void 0:e.value)||0}))))}))))]}),W=a.map((function(e,t){return{label:e.label,value:"",color:M.colors[t%M.colors.length]}}));return React.createElement("div",{className:s()("bar-chart",L,w["bar-chart"])},React.createElement("svg",{width:v,height:g},React.createElement(o.Group,{left:z.left,top:z.top},React.createElement(f,{width:X,height:G,xScale:V,yScale:U,gridVisibility:B}),a.map((function(e,t){return React.createElement(o.Group,{key:t},e.data.map((function(a){var r,l,n=V((null==a?void 0:a.label)||"");if(void 0===n)return null;var o=J.bandwidth(),i=n+(null!==(r=J(t.toString()))&&void 0!==r?r:0);return React.createElement(c.Bar,{key:"bar-".concat(t,"-").concat(a.label),x:i,y:U(a.value),width:o,height:G-(null!==(l=U(a.value))&&void 0!==l?l:0),fill:M.colors[t%M.colors.length],onMouseMove:R?function(r){return I(r,a.value,(null==a?void 0:a.label)||"",e.label,t)}:void 0,onMouseLeave:R?_:void 0})})))})),React.createElement(l.AxisLeft,{scale:U}),React.createElement(l.AxisBottom,{scale:V,top:G}))),R&&k&&T&&React.createElement(F,{top:D||0,left:P||0},React.createElement("div",null,React.createElement("div",null,T.yLabel),React.createElement("div",null,T.xLabel,": ",T.value))),S&&React.createElement(x,{items:W,orientation:A,className:w["bar-chart-legend"]}))};N.displayName="BarChart";const S=N;module.exports=t})();
2
- //# sourceMappingURL=index.js.map
1
+ "use strict";var e=require("react/jsx-runtime"),l=require("@visx/axis"),t=require("@visx/event"),a=require("@visx/group"),i=require("@visx/scale"),r=require("@visx/shape"),s=require("@visx/tooltip"),o=require("clsx"),n=require("react"),d=require("@visx/grid"),c=require("@visx/legend"),h=require("@visx/responsive");const g=n.createContext({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});var m="grid-control-module__grid-control__KOnZN";const u=({width:l,height:t,xScale:a,yScale:i,gridVisibility:r="x",top:s=0})=>e.jsxs("g",{transform:`translate(0, ${s})`,className:m,children:[r.includes("x")&&e.jsx(d.GridRows,{scale:a,width:l}),r.includes("y")&&e.jsx(d.GridColumns,{scale:i,height:t})]});var x={"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 p={horizontal:"row",vertical:"column"},v=({items:l,className:t,orientation:a="horizontal"})=>{const r=i.scaleOrdinal({domain:l.map((e=>e.label)),range:l.map((e=>e.color))});return e.jsx("div",{className:o(x.legend,x[`legend--${a}`],t),role:"list",children:e.jsx(c.LegendOrdinal,{scale:r,direction:p[a],shape:"rect",shapeWidth:16,shapeHeight:16,className:x["legend-items"],children:t=>e.jsx("div",{className:x[`legend--${a}`],children:t.map((t=>e.jsxs("div",{className:x["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:t.value,className:x["legend-item-swatch"]})}),e.jsxs("span",{className:x["legend-item-label"],children:[t.text,l.find((e=>e.label===t.text))?.value&&e.jsx("span",{className:x["legend-item-value"],children:l.find((e=>e.label===t.text))?.value})]})]},t.text)))})})})};var b="base-tooltip-module__tooltip__OfX6n";const _=({data:l})=>e.jsxs(e.Fragment,{children:[l?.label,": ",l?.valueDisplay||l?.value]}),j=({data:l,top:t,left:a,component:i=_,children:r,className:s})=>e.jsx("div",{className:b,style:{top:t,left:a},role:"tooltip",children:r||l&&e.jsx(i,{data:l,className:s})});var f={"bar-chart":"bar-chart-module__bar-chart__lmYNi","bar-chart-legend":"bar-chart-module__bar-chart-legend__vgKKq"};const w=({data:d,margin:c={top:20,right:20,bottom:40,left:40},withTooltips:h=!1,showLegend:m=!1,legendOrientation:x="horizontal",className:p,gridVisibility:b="x",width:_,height:w=400})=>{const N=n.useContext(g),{tooltipOpen:y,tooltipLeft:F,tooltipTop:C,tooltipData:q,hideTooltip:L,showTooltip:S}=s.useTooltip(),k=n.useCallback(((e,l,a,i,r)=>{const s=t.localPoint(e);s&&S({tooltipData:{value:l,xLabel:a,yLabel:i,seriesIndex:r},tooltipLeft:s.x,tooltipTop:s.y-10})}),[S]),z=n.useCallback((()=>{L()}),[L]);if(!d?.length)return e.jsx("div",{className:o("bar-chart-empty",f["bat-chart-empty"]),children:"Empty..."});const B=c,D=_-B.left-B.right,T=w-B.top-B.bottom,M=d[0].data?.map((e=>e?.label||"")),O=i.scaleBand({range:[0,D],domain:M,padding:.2}),$=i.scaleBand({range:[0,O.bandwidth()],domain:d.map(((e,l)=>l.toString())),padding:.1}),A=i.scaleLinear({range:[T,0],domain:[0,Math.max(...d.map((e=>Math.max(...e.data.map((e=>e?.value||0))))))]}),G=d.map(((e,l)=>({label:e.label,value:"",color:N.colors[l%N.colors.length]})));return e.jsxs("div",{className:o("bar-chart",p,f["bar-chart"]),children:[e.jsx("svg",{width:_,height:w,children:e.jsxs(a.Group,{left:B.left,top:B.top,children:[e.jsx(u,{width:D,height:T,xScale:O,yScale:A,gridVisibility:b}),d.map(((l,t)=>e.jsx(a.Group,{children:l.data.map((a=>{const i=O(a?.label||"");if(void 0===i)return null;const s=$.bandwidth(),o=i+($(t.toString())??0);return e.jsx(r.Bar,{x:o,y:A(a.value),width:s,height:T-(A(a.value)??0),fill:N.colors[t%N.colors.length],onMouseMove:h?e=>k(e,a.value,a?.label||"",l.label,t):void 0,onMouseLeave:h?z:void 0},`bar-${t}-${a.label}`)}))},t))),e.jsx(l.AxisLeft,{scale:A}),e.jsx(l.AxisBottom,{scale:O,top:T})]})}),h&&y&&q&&e.jsx(j,{top:C||0,left:F||0,children:e.jsxs("div",{children:[e.jsx("div",{children:q.yLabel}),e.jsxs("div",{children:[q.xLabel,": ",q.value]})]})}),m&&e.jsx(v,{items:G,orientation:x,className:f["bar-chart-legend"]})]})};w.displayName="BarChart";var N=function(l,t){const{maxWidth:a=1200,aspectRatio:i=.5,debounceTime:r=50}=t||{};return function(t){const{parentRef:s,width:o}=h.useParentSize({debounceTime:r,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),n=o?Math.min(o,a):600,d=n*i;return e.jsx("div",{ref:s,style:{width:"100%",minHeight:`${d}px`},children:e.jsx(l,{width:n,height:d,size:n,...t})})}}(w);exports.BarChart=N;
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/bar-chart/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,E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vCrE,KAAO4B,EAAMnF,OAAQkG,EAAcf,EAAMnF,OAAOnB,QAChDqJ,YAAcpD,EAXW,SAAEiB,GAAmC,OAC/DF,EAAiBE,EAAOtI,EAAEiB,OAAOjB,aAAC,EAADA,EAAG6E,QAAS,GAAI+E,EAAO/E,MAAO4D,EAAa,OAUzB4B,EAClDK,aAAerD,EAAeyB,OAAmBuB,GAGpD,IACO,IAET5G,MAAAuB,cAAC2F,EAAAA,SAAQ,CAAC5G,MAAQX,IAClBK,MAAAuB,cAAC4F,EAAAA,WAAU,CAAC7G,MAAQZ,EAASK,IAAMyF,MAInC5B,GAAgBS,GAAeG,GAChCxE,MAAAuB,cAACoB,EAAW,CAAC5C,IAAMwE,GAAc,EAAI1B,KAAOyB,GAAe,GAC1DtE,MAAAuB,cAAA,WACCvB,MAAAuB,cAAA,WAAOiD,EAAYO,QACnB/E,MAAAuB,cAAA,WACGiD,EAAYM,OAAQ,KAAIN,EAAYhH,SAMxCsG,GACD9D,MAAAuB,cAAC6F,EAAM,CACNxG,MAAQwF,EACRtF,YAAckD,EACd7D,UAAYsB,EAAQ,sBAKzB,EAEA0B,EAASkE,YAAc,WACvB,U","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://@automattic/charts/external commonjs2 \"@visx/axis\"","webpack://@automattic/charts/external commonjs2 \"@visx/event\"","webpack://@automattic/charts/external commonjs2 \"@visx/group\"","webpack://@automattic/charts/external commonjs2 \"@visx/scale\"","webpack://@automattic/charts/external commonjs2 \"@visx/shape\"","webpack://@automattic/charts/external commonjs2 \"@visx/tooltip\"","webpack://@automattic/charts/external commonjs2 \"clsx\"","webpack://@automattic/charts/external commonjs2 \"react\"","webpack://@automattic/charts/./src/providers/theme/themes.ts","webpack://@automattic/charts/./src/providers/theme/theme-provider.tsx","webpack://@automattic/charts/external commonjs2 \"@visx/grid\"","webpack://@automattic/charts/./src/components/grid-control/grid-control.tsx","webpack://@automattic/charts/./src/components/grid-control/grid-control.module.scss?a210","webpack://@automattic/charts/external commonjs2 \"@visx/legend\"","webpack://@automattic/charts/./src/components/legend/legend.module.scss?843e","webpack://@automattic/charts/./src/components/legend/base-legend.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss?1d14","webpack://@automattic/charts/./src/components/bar-chart/bar-chart.module.scss?9954","webpack://@automattic/charts/./src/components/bar-chart/bar-chart.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nexport { _toConsumableArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nexport { _arrayWithoutHoles as default };","function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableSpread as default };","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/axis\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/event\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/group\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/scale\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/shape\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/tooltip\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clsx\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","import type { ChartTheme } from '../../types';\n\n/**\n * Default theme configuration\n */\nconst defaultTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Jetpack theme configuration\n */\nconst jetpackTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Woo theme configuration\n */\nconst wooTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#80C8FF', '#B999FF', '#3858E9' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\nexport { defaultTheme, jetpackTheme, wooTheme };\n","import { createContext, useContext, FC, type ReactNode } from 'react';\nimport { defaultTheme } from './themes';\nimport type { ChartTheme } from '../../types';\n\n/**\n * Context for sharing theme configuration across components\n */\nconst ThemeContext = createContext< ChartTheme >( defaultTheme );\n\n/**\n * Hook to access chart theme\n * @return {object} A built theme configuration compatible with visx charts\n */\nconst useChartTheme = () => {\n\tconst theme = useContext( ThemeContext );\n\treturn theme;\n};\n\n/**\n * Props for the ThemeProvider component\n */\ntype ThemeProviderProps = {\n\t/** Optional partial theme override */\n\ttheme?: Partial< ChartTheme >;\n\t/** Child components that will have access to the theme */\n\tchildren: ReactNode;\n};\n\n// Provider component for chart theming\n// Allows theme customization through props while maintaining default values\nconst ThemeProvider: FC< ThemeProviderProps > = ( { theme = {}, children } ) => {\n\tconst mergedTheme = { ...defaultTheme, ...theme };\n\treturn <ThemeContext.Provider value={ mergedTheme }>{ children }</ThemeContext.Provider>;\n};\n\nexport { ThemeProvider, useChartTheme };\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/grid\");","import { GridRows, GridColumns } from '@visx/grid';\nimport React from 'react';\nimport styles from './grid-control.module.scss';\nimport type { GridProps } from '../../types';\n\nconst GridControl: React.FC< GridProps > = ( {\n\twidth,\n\theight,\n\txScale,\n\tyScale,\n\tgridVisibility = 'x',\n\ttop = 0,\n} ) => {\n\treturn (\n\t\t<g transform={ `translate(0, ${ top })` } className={ styles[ 'grid-control' ] }>\n\t\t\t{ gridVisibility.includes( 'x' ) && <GridRows scale={ xScale } width={ width } /> }\n\t\t\t{ gridVisibility.includes( 'y' ) && <GridColumns scale={ yScale } height={ height } /> }\n\t\t</g>\n\t);\n};\n\nexport default GridControl;\n","// extracted by mini-css-extract-plugin\nexport default {\"grid-control\":\"jfpeES0fbFrqCPR8dRN7\"};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/legend\");","// extracted by mini-css-extract-plugin\nexport default {\"legend--horizontal\":\"b1_5FxxoK4aEFLoe67IA\",\"legend--vertical\":\"vpmQkJAPhp3XJ9Wb6vOw\",\"legend-item\":\"IKM8KG1lF9e5NzDqMLOJ\",\"legend-item-swatch\":\"_eccyBq0v2puKsHw8XND\",\"legend-item-label\":\"UeZrUEpEK0tLzXHmeUco\",\"legend-item-value\":\"R5msPOYKm79jYV13H0v7\"};","import { LegendOrdinal } from '@visx/legend';\nimport { scaleOrdinal } from '@visx/scale';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport styles from './legend.module.scss';\nimport type { LegendProps } from './types';\n\n/**\n * Base legend component that displays color-coded items with labels using visx\n * @param {object} props - Component properties\n * @param {Array} props.items - Array of legend items to display\n * @param {string} props.className - Additional CSS class names\n * @param {string} props.orientation - Layout orientation (horizontal/vertical)\n * @return {JSX.Element} Rendered legend component\n */\nconst orientationToFlexDirection = {\n\thorizontal: 'row' as const,\n\tvertical: 'column' as const,\n};\n\nexport const BaseLegend: FC< LegendProps > = ( {\n\titems,\n\tclassName,\n\torientation = 'horizontal',\n} ) => {\n\tconst legendScale = scaleOrdinal( {\n\t\tdomain: items.map( item => item.label ),\n\t\trange: items.map( item => item.color ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( styles.legend, styles[ `legend--${ orientation }` ], className ) }\n\t\t\trole=\"list\"\n\t\t>\n\t\t\t<LegendOrdinal\n\t\t\t\tscale={ legendScale }\n\t\t\t\tdirection={ orientationToFlexDirection[ orientation ] }\n\t\t\t\tshape=\"rect\"\n\t\t\t\tshapeWidth={ 16 }\n\t\t\t\tshapeHeight={ 16 }\n\t\t\t\tclassName={ styles[ 'legend-items' ] }\n\t\t\t>\n\t\t\t\t{ labels => (\n\t\t\t\t\t<div className={ styles[ `legend--${ orientation }` ] }>\n\t\t\t\t\t\t{ labels.map( label => (\n\t\t\t\t\t\t\t<div key={ label.text } className={ styles[ 'legend-item' ] }>\n\t\t\t\t\t\t\t\t<svg width={ 16 } height={ 16 }>\n\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\twidth={ 16 }\n\t\t\t\t\t\t\t\t\t\theight={ 16 }\n\t\t\t\t\t\t\t\t\t\tfill={ label.value }\n\t\t\t\t\t\t\t\t\t\tclassName={ styles[ 'legend-item-swatch' ] }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-label' ] }>\n\t\t\t\t\t\t\t\t\t{ label.text }\n\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value && (\n\t\t\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-value' ] }>\n\t\t\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</LegendOrdinal>\n\t\t</div>\n\t);\n};\n","import styles from './base-tooltip.module.scss';\nimport type { CSSProperties, ComponentType, ReactNode } from 'react';\n\ntype TooltipData = {\n\tlabel: string;\n\tvalue: number;\n\tvalueDisplay?: string;\n};\n\ntype TooltipComponentProps = {\n\tdata: TooltipData;\n\tclassName?: string;\n};\n\ntype TooltipCommonProps = {\n\ttop: number;\n\tleft: number;\n\tstyle?: CSSProperties;\n\tclassName?: string;\n};\n\ntype DefaultDataTooltip = {\n\tdata: TooltipData;\n\tcomponent?: ComponentType< TooltipComponentProps >;\n\tchildren?: never;\n};\n\ntype CustomTooltip = {\n\tchildren: ReactNode;\n\tdata?: never;\n\tcomponent?: never;\n};\n\ntype BaseTooltipProps = TooltipCommonProps & ( DefaultDataTooltip | CustomTooltip );\n\nconst DefaultTooltipContent = ( { data }: TooltipComponentProps ) => (\n\t<>\n\t\t{ data?.label }: { data?.valueDisplay || data?.value }\n\t</>\n);\n\nexport const BaseTooltip = ( {\n\tdata,\n\ttop,\n\tleft,\n\tcomponent: Component = DefaultTooltipContent,\n\tchildren,\n\tclassName,\n}: BaseTooltipProps ) => {\n\treturn (\n\t\t<div className={ styles.tooltip } style={ { top, left } } role=\"tooltip\">\n\t\t\t{ children || ( data && <Component data={ data } className={ className } /> ) }\n\t\t</div>\n\t);\n};\n\nexport type { BaseTooltipProps, TooltipData };\n","// extracted by mini-css-extract-plugin\nexport default {\"tooltip\":\"Jmgc7XAf2uAyK5059rBe\"};","// extracted by mini-css-extract-plugin\nexport default {\"bar-chart\":\"Vm_cn8YnIXBavFt6eHSp\",\"bar-chart-legend\":\"e4dhKgBP7e6FBRAX2SrP\"};","import { AxisLeft, AxisBottom } from '@visx/axis';\nimport { localPoint } from '@visx/event';\nimport { Group } from '@visx/group';\nimport { scaleBand, scaleLinear } from '@visx/scale';\nimport { Bar } from '@visx/shape';\nimport { useTooltip } from '@visx/tooltip';\nimport clsx from 'clsx';\nimport { FC, useCallback, type MouseEvent } from 'react';\nimport { useChartTheme } from '../../providers/theme';\nimport { GridControl } from '../grid-control';\nimport { Legend } from '../legend';\nimport { BaseTooltip } from '../tooltip';\nimport styles from './bar-chart.module.scss';\nimport type { BaseChartProps, SeriesData } from '../../types';\n\ninterface BarChartProps extends BaseChartProps< SeriesData[] > {}\n\ntype BarChartTooltipData = { value: number; xLabel: string; yLabel: string; seriesIndex: number };\n\nconst BarChart: FC< BarChartProps > = ( {\n\tdata,\n\twidth = 500, //TODO: replace when making the components responsive\n\theight = 500, //TODO: replace when making the components responsive\n\tmargin = { top: 20, right: 20, bottom: 40, left: 40 },\n\twithTooltips = false,\n\tshowLegend = false,\n\tlegendOrientation = 'horizontal',\n\tclassName,\n\tgridVisibility = 'x',\n} ) => {\n\tconst theme = useChartTheme();\n\tconst { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =\n\t\tuseTooltip< BarChartTooltipData >();\n\n\tconst handleMouseMove = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent< SVGRectElement >,\n\t\t\tvalue: number,\n\t\t\txLabel: string,\n\t\t\tyLabel: string,\n\t\t\tseriesIndex: number\n\t\t) => {\n\t\t\tconst coords = localPoint( event );\n\t\t\tif ( ! coords ) return;\n\n\t\t\tshowTooltip( {\n\t\t\t\ttooltipData: { value, xLabel, yLabel, seriesIndex },\n\t\t\t\ttooltipLeft: coords.x,\n\t\t\t\ttooltipTop: coords.y - 10,\n\t\t\t} );\n\t\t},\n\t\t[ showTooltip ]\n\t);\n\n\tconst handleMouseLeave = useCallback( () => {\n\t\thideTooltip();\n\t}, [ hideTooltip ] );\n\n\tif ( ! data?.length ) {\n\t\treturn <div className={ clsx( 'bar-chart-empty', styles[ 'bat-chart-empty' ] ) }>Empty...</div>;\n\t}\n\n\tconst margins = margin;\n\tconst xMax = width - margins.left - margins.right;\n\tconst yMax = height - margins.top - margins.bottom;\n\n\t// Get labels for x-axis from the first series (assuming all series have same labels)\n\tconst labels = data[ 0 ].data?.map( d => d?.label || '' );\n\n\t// Create scales\n\tconst xScale = scaleBand< string >( {\n\t\trange: [ 0, xMax ],\n\t\tdomain: labels,\n\t\tpadding: 0.2,\n\t} );\n\n\tconst innerScale = scaleBand( {\n\t\trange: [ 0, xScale.bandwidth() ],\n\t\tdomain: data.map( ( _, i ) => i.toString() ),\n\t\tpadding: 0.1,\n\t} );\n\n\tconst yScale = scaleLinear< number >( {\n\t\trange: [ yMax, 0 ],\n\t\tdomain: [\n\t\t\t0,\n\t\t\tMath.max( ...data.map( series => Math.max( ...series.data.map( d => d?.value || 0 ) ) ) ),\n\t\t],\n\t} );\n\n\t// Create legend items from group labels, this iterates over groups rather than data points\n\tconst legendItems = data.map( ( group, index ) => ( {\n\t\tlabel: group.label, // Label for each unique group\n\t\tvalue: '', // Empty string since we don't want to show a specific value\n\t\tcolor: theme.colors[ index % theme.colors.length ],\n\t} ) );\n\n\treturn (\n\t\t<div className={ clsx( 'bar-chart', className, styles[ 'bar-chart' ] ) }>\n\t\t\t<svg width={ width } height={ height }>\n\t\t\t\t<Group left={ margins.left } top={ margins.top }>\n\t\t\t\t\t<GridControl\n\t\t\t\t\t\twidth={ xMax }\n\t\t\t\t\t\theight={ yMax }\n\t\t\t\t\t\txScale={ xScale }\n\t\t\t\t\t\tyScale={ yScale }\n\t\t\t\t\t\tgridVisibility={ gridVisibility }\n\t\t\t\t\t/>\n\t\t\t\t\t{ data.map( ( series, seriesIndex ) => (\n\t\t\t\t\t\t<Group key={ seriesIndex }>\n\t\t\t\t\t\t\t{ series.data.map( d => {\n\t\t\t\t\t\t\t\tconst xPos = xScale( d?.label || '' );\n\t\t\t\t\t\t\t\tif ( xPos === undefined ) return null;\n\n\t\t\t\t\t\t\t\tconst barWidth = innerScale.bandwidth();\n\t\t\t\t\t\t\t\tconst barX = xPos + ( innerScale( seriesIndex.toString() ) ?? 0 );\n\n\t\t\t\t\t\t\t\tconst handleBarMouseMove = ( event: MouseEvent< SVGRectElement > ) =>\n\t\t\t\t\t\t\t\t\thandleMouseMove( event, d.value, d?.label || '', series.label, seriesIndex );\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Bar\n\t\t\t\t\t\t\t\t\t\tkey={ `bar-${ seriesIndex }-${ d.label }` }\n\t\t\t\t\t\t\t\t\t\tx={ barX }\n\t\t\t\t\t\t\t\t\t\ty={ yScale( d.value ) }\n\t\t\t\t\t\t\t\t\t\twidth={ barWidth }\n\t\t\t\t\t\t\t\t\t\theight={ yMax - ( yScale( d.value ) ?? 0 ) }\n\t\t\t\t\t\t\t\t\t\tfill={ theme.colors[ seriesIndex % theme.colors.length ] }\n\t\t\t\t\t\t\t\t\t\tonMouseMove={ withTooltips ? handleBarMouseMove : undefined }\n\t\t\t\t\t\t\t\t\t\tonMouseLeave={ withTooltips ? handleMouseLeave : undefined }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</Group>\n\t\t\t\t\t) ) }\n\t\t\t\t\t<AxisLeft scale={ yScale } />\n\t\t\t\t\t<AxisBottom scale={ xScale } top={ yMax } />\n\t\t\t\t</Group>\n\t\t\t</svg>\n\n\t\t\t{ withTooltips && tooltipOpen && tooltipData && (\n\t\t\t\t<BaseTooltip top={ tooltipTop || 0 } left={ tooltipLeft || 0 }>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div>{ tooltipData.yLabel }</div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t{ tooltipData.xLabel }: { tooltipData.value }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</BaseTooltip>\n\t\t\t) }\n\n\t\t\t{ showLegend && (\n\t\t\t\t<Legend\n\t\t\t\t\titems={ legendItems }\n\t\t\t\t\torientation={ legendOrientation }\n\t\t\t\t\tclassName={ styles[ 'bar-chart-legend' ] }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nBarChart.displayName = 'BarChart';\nexport default BarChart;\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","_arrayLikeToArray","r","length","e","n","Array","_toConsumableArray","isArray","iterator","from","t","toString","slice","constructor","name","test","TypeError","require","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","_ref","width","height","xScale","yScale","_ref$gridVisibility","gridVisibility","_ref$top","top","React","transform","concat","className","includes","GridRows","scale","GridColumns","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","createElement","clsx","styles","legend","role","LegendOrdinal","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","text","fill","find","DefaultTooltipContent","data","Fragment","valueDisplay","BaseTooltip","_ref2","left","_ref2$component","component","Component","children","style","BarChart","_data$0$data","_ref$width","_ref$height","_ref$margin","margin","right","bottom","_ref$withTooltips","withTooltips","_ref$showLegend","showLegend","_ref$legendOrientatio","legendOrientation","theme","useContext","_useTooltip","useTooltip","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","handleMouseMove","useCallback","event","xLabel","yLabel","seriesIndex","coords","localPoint","x","y","handleMouseLeave","margins","xMax","yMax","scaleBand","padding","innerScale","bandwidth","_","i","scaleLinear","Math","max","apply","series","legendItems","group","index","Group","GridControl","_innerScale","_yScale","xPos","undefined","barWidth","barX","Bar","onMouseMove","onMouseLeave","AxisLeft","AxisBottom","Legend","displayName"],"sourceRoot":""}
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","../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[null,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","jsx","fill","value","text","find","DefaultTooltipContent","data","jsxs","_Fragment","Fragment","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","barChart","WrappedComponent","config","maxWidth","aspectRatio","debounceTime","props","parentRef","parentWidth","useParentSize","enableDebounceLeadingCall","initialSize","containerWidth","min","containerHeight","ref","minHeight","size","withResponsive"],"mappings":"4TAKA,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,aACCJ,UAAYsB,EAAMrB,EAAOsB,OAAQtB,EAAQ,WAAYY,KAAkBb,GACvEwB,KAAK,OAELtB,SAAAE,EAAAA,IAACqB,EAAAA,cACA,CAAAnB,MAAQQ,EACRY,UAAYlB,EAA4BK,GACxCc,MAAM,OACNC,WAAa,GACbC,YAAc,GACd7B,UAAYC,EAAQ,yBAElB6B,GACD1B,EAAAA,WAAKJ,UAAYC,EAAQ,WAAYY,KAAgBX,S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GACDhD,EAAA2B,IAACwE,EACA,CAAA3F,MAAQ8E,EACR7E,YAAcwC,EACdrD,UAAYC,EAAQ,wBAItB,EAGH8C,EAASyD,YAAc,WACvB,IAAeC,ECtJC,SACfC,EACAC,GAEA,MAAMC,SAAEA,EAAW,KAAIC,YAAEA,EAAc,GAAGC,aAAEA,EAAe,IAAOH,GAAU,GAE5E,OAAO,SAA0BI,GAChC,MAAMC,UAAEA,EAAWxH,MAAOyH,GAAgBC,EAAAA,cAAe,CACxDJ,eACAK,2BAA2B,EAC3BC,YAAa,CAAE5H,MAAO,IAAKC,OAAQ,OAI9B4H,EAAiBJ,EAAc1B,KAAK+B,IAAKL,EAAaL,GAAa,IACnEW,EAAkBF,EAAiBR,EAEzC,OACCzG,EACC2B,IAAA,MAAA,CAAAyF,IAAMR,EACNlE,MAAQ,CACPtD,MAAO,OACPiI,UAAW,GAAIF,OACfrH,SAEDE,MAACsG,EAAgB,CAChBlH,MAAQ6H,EACR5H,OAAS8H,EACTG,KAAOL,KACAN,KAIX,CACD,CDoHeY,CAAiC5E"}
@@ -1,6 +1,95 @@
1
- .Vm_cn8YnIXBavFt6eHSp{position:relative}.e4dhKgBP7e6FBRAX2SrP{margin-top:1rem}
2
- .jfpeES0fbFrqCPR8dRN7 .visx-line{stroke:#d7d6d6;stroke-width:1px;shape-rendering:crispEdges}
3
- .Jmgc7XAf2uAyK5059rBe{padding:.5rem;background-color:rgba(0,0,0,.85);color:#fff;border-radius:4px;font-size:14px;box-shadow:0 1px 2px rgba(0,0,0,.1);position:absolute;pointer-events:none;transform:translate(-50%, -100%)}
4
- .b1_5FxxoK4aEFLoe67IA{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px}.vpmQkJAPhp3XJ9Wb6vOw{display:flex;flex-direction:column;gap:8px}.IKM8KG1lF9e5NzDqMLOJ{display:flex;align-items:center;gap:8px;font-size:.875rem}._eccyBq0v2puKsHw8XND{border-radius:2px}.UeZrUEpEK0tLzXHmeUco{color:var(--jp-gray-80, #2c3338);display:flex;align-items:center;gap:.5rem}.R5msPOYKm79jYV13H0v7{font-weight:500}
1
+ .pie-chart-module__pie-chart__R12Vh {
2
+ position: relative;
3
+ }
4
+ .line-chart-module__line-chart__ITM3d {
5
+ position: relative;
6
+ }
7
+ .line-chart-module__line-chart__tooltip__aqcme {
8
+ background: #fff;
9
+ padding: 0.5rem;
10
+ }
11
+ .line-chart-module__line-chart__tooltip-date__4Dzab {
12
+ font-weight: bold;
13
+ padding-bottom: 10px;
14
+ }
15
+ .line-chart-module__line-chart__tooltip-row__6A37G {
16
+ display: flex;
17
+ align-items: center;
18
+ padding: 4px 0;
19
+ justify-content: space-between;
20
+ }
21
+ .line-chart-module__line-chart__tooltip-label__IvnFF {
22
+ font-weight: 500;
23
+ padding-right: 1rem;
24
+ }
25
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
26
+ position: relative;
27
+ text-align: center;
28
+ }
29
+ .pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
30
+ margin-top: 1rem;
31
+ }
32
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
33
+ margin-bottom: 0px;
34
+ font-weight: 600;
35
+ font-size: 16px;
36
+ }
37
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
38
+ margin-top: 0px;
39
+ font-size: 14px;
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
+ }
5
57
 
6
- /*# sourceMappingURL=style.css.map*/
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
+ }
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{GridControl:()=>a});const t=require("@visx/grid"),o=require("react");var i=e.n(o);const a=function(e){var r=e.width,o=e.height,a=e.xScale,n=e.yScale,l=e.gridVisibility,d=void 0===l?"x":l,c=e.top,s=void 0===c?0:c;return i().createElement("g",{transform:"translate(0, ".concat(s,")"),className:"jfpeES0fbFrqCPR8dRN7"},d.includes("x")&&i().createElement(t.GridRows,{scale:a,width:r}),d.includes("y")&&i().createElement(t.GridColumns,{scale:n,height:o}))};module.exports=r})();
2
- //# sourceMappingURL=index.js.map
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.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/grid-control/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,uCCL9D,MAAM,EAA+BC,QAAQ,cCAvC,EAA+BA,QAAQ,S,aCC7C,MCoBA,EAhB2C,SAAHC,GAOjC,IANNC,EAAKD,EAALC,MACAC,EAAMF,EAANE,OACAC,EAAMH,EAANG,OACAC,EAAMJ,EAANI,OAAMC,EAAAL,EACNM,eAAAA,OAAc,IAAAD,EAAG,IAAGA,EAAAE,EAAAP,EACpBQ,IAAAA,OAAG,IAAAD,EAAG,EAACA,EAEP,OACCE,IAAAA,cAAA,KAAGC,UAAS,gBAAAC,OAAoBH,EAAG,KAAOI,UDbb,wBCc1BN,EAAeO,SAAU,MAASJ,IAAAA,cAACK,EAAAA,SAAQ,CAACC,MAAQZ,EAASF,MAAQA,IACrEK,EAAeO,SAAU,MAASJ,IAAAA,cAACO,EAAAA,YAAW,CAACD,MAAQX,EAASF,OAASA,IAG9E,E","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/external commonjs2 \"@visx/grid\"","webpack://@automattic/charts/external commonjs2 \"react\"","webpack://@automattic/charts/./src/components/grid-control/grid-control.module.scss?a210","webpack://@automattic/charts/./src/components/grid-control/grid-control.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/grid\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","// extracted by mini-css-extract-plugin\nexport default {\"grid-control\":\"jfpeES0fbFrqCPR8dRN7\"};","import { GridRows, GridColumns } from '@visx/grid';\nimport React from 'react';\nimport styles from './grid-control.module.scss';\nimport type { GridProps } from '../../types';\n\nconst GridControl: React.FC< GridProps > = ( {\n\twidth,\n\theight,\n\txScale,\n\tyScale,\n\tgridVisibility = 'x',\n\ttop = 0,\n} ) => {\n\treturn (\n\t\t<g transform={ `translate(0, ${ top })` } className={ styles[ 'grid-control' ] }>\n\t\t\t{ gridVisibility.includes( 'x' ) && <GridRows scale={ xScale } width={ width } /> }\n\t\t\t{ gridVisibility.includes( 'y' ) && <GridColumns scale={ yScale } height={ height } /> }\n\t\t</g>\n\t);\n};\n\nexport default GridControl;\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","_ref","width","height","xScale","yScale","_ref$gridVisibility","gridVisibility","_ref$top","top","React","transform","concat","className","includes","GridRows","scale","GridColumns"],"sourceRoot":""}
1
+ {"version":3,"file":"index.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"}
@@ -1,3 +1,95 @@
1
- .jfpeES0fbFrqCPR8dRN7 .visx-line{stroke:#d7d6d6;stroke-width:1px;shape-rendering:crispEdges}
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
+ .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
+ .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
+ }
2
53
 
3
- /*# sourceMappingURL=style.css.map*/
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
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
76
+ position: relative;
77
+ text-align: center;
78
+ }
79
+ .pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
80
+ margin-top: 1rem;
81
+ }
82
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
83
+ margin-bottom: 0px;
84
+ font-weight: 600;
85
+ font-size: 16px;
86
+ }
87
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
88
+ margin-top: 0px;
89
+ font-size: 14px;
90
+ }
91
+ .grid-control-module__grid-control__KOnZN .visx-line {
92
+ stroke: #d7d6d6;
93
+ stroke-width: 1px;
94
+ shape-rendering: crispEdges;
95
+ }
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var l in a)e.o(a,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:a[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Legend:()=>o});const a=require("@visx/legend"),l=require("@visx/scale"),n=require("clsx");var r=e.n(n);const i={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var c={horizontal:"row",vertical:"column"},o=function(e){var t=e.items,n=e.className,o=e.orientation,d=void 0===o?"horizontal":o,s=(0,l.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:r()(i.legend,i["legend--".concat(d)],n),role:"list"},React.createElement(a.LegendOrdinal,{scale:s,direction:c[d],shape:"rect",shapeWidth:16,shapeHeight:16,className:i["legend-items"]},(function(e){return React.createElement("div",{className:i["legend--".concat(d)]},e.map((function(e){var a,l;return React.createElement("div",{key:e.text,className:i["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:i["legend-item-swatch"]})),React.createElement("span",{className:i["legend-item-label"]},e.text,(null===(a=t.find((function(t){return t.label===e.text})))||void 0===a?void 0:a.value)&&React.createElement("span",{className:i["legend-item-value"]},null===(l=t.find((function(t){return t.label===e.text})))||void 0===l?void 0:l.value)))})))})))};module.exports=t})();
2
- //# sourceMappingURL=index.js.map
1
+ "use strict";var e=require("react/jsx-runtime"),l=require("@visx/legend"),a=require("@visx/scale"),n=require("clsx");require("react");var i={"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=a.scaleOrdinal({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e.jsx("div",{className:n(i.legend,i[`legend--${r}`],s),role:"list",children:e.jsx(l.LegendOrdinal,{scale:c,direction:d[r],shape:"rect",shapeWidth:16,shapeHeight:16,className:i["legend-items"],children:l=>e.jsx("div",{className:i[`legend--${r}`],children:l.map((l=>e.jsxs("div",{className:i["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:l.value,className:i["legend-item-swatch"]})}),e.jsxs("span",{className:i["legend-item-label"],children:[l.text,t.find((e=>e.label===l.text))?.value&&e.jsx("span",{className:i["legend-item-value"],children:t.find((e=>e.label===l.text))?.value})]})]},l.text)))})})})};
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/legend/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,kCCL9D,MAAM,EAA+BC,QAAQ,gBCAvC,EAA+BA,QAAQ,eCAvC,EAA+BA,QAAQ,Q,aCC7C,SAAgB,qBAAqB,uBAAuB,mBAAmB,uBAAuB,cAAc,uBAAuB,qBAAqB,uBAAuB,oBAAoB,uBAAuB,oBAAoB,wBCctP,IAAMC,EAA6B,CAClCC,WAAY,MACZC,SAAU,UAGEC,EAAgC,SAAHC,GAInC,IAHNC,EAAKD,EAALC,MACAC,EAASF,EAATE,UAASC,EAAAH,EACTI,YAAAA,OAAW,IAAAD,EAAG,aAAYA,EAEpBE,GAAcC,EAAAA,EAAAA,cAAc,CACjCC,OAAQN,EAAMO,KAAK,SAAAC,GAAI,OAAIA,EAAKC,KAAK,IACrCC,MAAOV,EAAMO,KAAK,SAAAC,GAAI,OAAIA,EAAKG,KAAK,MAGrC,OACCC,MAAAC,cAAA,OACCZ,UAAYa,IAAMC,EAAOC,OAAQD,EAAO,WAADE,OAAcd,IAAkBF,GACvEiB,KAAK,QAELN,MAAAC,cAACM,EAAAA,cAAa,CACbC,MAAQhB,EACRiB,UAAY1B,EAA4BQ,GACxCmB,MAAM,OACNC,WAAa,GACbC,YAAc,GACdvB,UAAYc,EAAQ,kBAElB,SAAAU,GAAM,OACPb,MAAAC,cAAA,OAAKZ,UAAYc,EAAO,WAADE,OAAcd,KAClCsB,EAAOlB,KAAK,SAAAE,GAAK,IAAAiB,EAAAC,EAAA,OAClBf,MAAAC,cAAA,OAAKjC,IAAM6B,EAAMmB,KAAO3B,UAAYc,EAAQ,gBAC3CH,MAAAC,cAAA,OAAKgB,MAAQ,GAAKC,OAAS,IAC1BlB,MAAAC,cAAA,QACCgB,MAAQ,GACRC,OAAS,GACTC,KAAOtB,EAAMhB,MACbQ,UAAYc,EAAQ,yBAGtBH,MAAAC,cAAA,QAAMZ,UAAYc,EAAQ,sBACvBN,EAAMmB,MACyC,QAA/CF,EAAA1B,EAAMgC,MAAM,SAAAxB,GAAI,OAAIA,EAAKC,QAAUA,EAAMmB,IAAI,WAAE,IAAAF,OAAA,EAA/CA,EAAiDjC,QAClDmB,MAAAC,cAAA,QAAMZ,UAAYc,EAAQ,sBACwB,QADDY,EAC9C3B,EAAMgC,MAAM,SAAAxB,GAAI,OAAIA,EAAKC,QAAUA,EAAMmB,IAAI,WAAE,IAAAD,OAAA,EAA/CA,EAAiDlC,QAIjD,IAEF,IAKX,E","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/external commonjs2 \"@visx/legend\"","webpack://@automattic/charts/external commonjs2 \"@visx/scale\"","webpack://@automattic/charts/external commonjs2 \"clsx\"","webpack://@automattic/charts/./src/components/legend/legend.module.scss?843e","webpack://@automattic/charts/./src/components/legend/base-legend.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/legend\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/scale\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clsx\");","// extracted by mini-css-extract-plugin\nexport default {\"legend--horizontal\":\"b1_5FxxoK4aEFLoe67IA\",\"legend--vertical\":\"vpmQkJAPhp3XJ9Wb6vOw\",\"legend-item\":\"IKM8KG1lF9e5NzDqMLOJ\",\"legend-item-swatch\":\"_eccyBq0v2puKsHw8XND\",\"legend-item-label\":\"UeZrUEpEK0tLzXHmeUco\",\"legend-item-value\":\"R5msPOYKm79jYV13H0v7\"};","import { LegendOrdinal } from '@visx/legend';\nimport { scaleOrdinal } from '@visx/scale';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport styles from './legend.module.scss';\nimport type { LegendProps } from './types';\n\n/**\n * Base legend component that displays color-coded items with labels using visx\n * @param {object} props - Component properties\n * @param {Array} props.items - Array of legend items to display\n * @param {string} props.className - Additional CSS class names\n * @param {string} props.orientation - Layout orientation (horizontal/vertical)\n * @return {JSX.Element} Rendered legend component\n */\nconst orientationToFlexDirection = {\n\thorizontal: 'row' as const,\n\tvertical: 'column' as const,\n};\n\nexport const BaseLegend: FC< LegendProps > = ( {\n\titems,\n\tclassName,\n\torientation = 'horizontal',\n} ) => {\n\tconst legendScale = scaleOrdinal( {\n\t\tdomain: items.map( item => item.label ),\n\t\trange: items.map( item => item.color ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( styles.legend, styles[ `legend--${ orientation }` ], className ) }\n\t\t\trole=\"list\"\n\t\t>\n\t\t\t<LegendOrdinal\n\t\t\t\tscale={ legendScale }\n\t\t\t\tdirection={ orientationToFlexDirection[ orientation ] }\n\t\t\t\tshape=\"rect\"\n\t\t\t\tshapeWidth={ 16 }\n\t\t\t\tshapeHeight={ 16 }\n\t\t\t\tclassName={ styles[ 'legend-items' ] }\n\t\t\t>\n\t\t\t\t{ labels => (\n\t\t\t\t\t<div className={ styles[ `legend--${ orientation }` ] }>\n\t\t\t\t\t\t{ labels.map( label => (\n\t\t\t\t\t\t\t<div key={ label.text } className={ styles[ 'legend-item' ] }>\n\t\t\t\t\t\t\t\t<svg width={ 16 } height={ 16 }>\n\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\twidth={ 16 }\n\t\t\t\t\t\t\t\t\t\theight={ 16 }\n\t\t\t\t\t\t\t\t\t\tfill={ label.value }\n\t\t\t\t\t\t\t\t\t\tclassName={ styles[ 'legend-item-swatch' ] }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-label' ] }>\n\t\t\t\t\t\t\t\t\t{ label.text }\n\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value && (\n\t\t\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-value' ] }>\n\t\t\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</LegendOrdinal>\n\t\t</div>\n\t);\n};\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","orientationToFlexDirection","horizontal","vertical","BaseLegend","_ref","items","className","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","React","createElement","clsx","styles","legend","concat","role","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","text","width","height","fill","find"],"sourceRoot":""}
1
+ {"version":3,"file":"index.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","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","jsx","width","height","fill","value","text","find"],"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,aACCV,UAAYW,EAAMC,EAAOC,OAAQD,EAAQ,WAAYX,KAAkBD,GACvEc,KAAK,OAELC,SAAAL,EAAAA,IAACM,EAAAA,cACA,CAAAC,MAAQf,EACRgB,UAAYtB,EAA4BK,GACxCkB,MAAM,OACNC,WAAa,GACbC,YAAc,GACdrB,UAAYY,EAAQ,yBAElBU,GACDZ,EAAAA,WAAKV,UAAYY,EAAQ,WAAYX,KAAgBc,SAClDO,EAAOjB,KAAKE,GACbgB,EAAAA,YAAwBvB,UAAYY,EAAQ,eAC3CG,SAAA,CAAAL,EAAAc,IAAA,MAAA,CAAKC,MAAQ,GAAKC,OAAS,YAC1BhB,EACCc,IAAA,OAAA,CAAAC,MAAQ,GACRC,OAAS,GACTC,KAAOpB,EAAMqB,MACb5B,UAAYY,EAAQ,0BAGtBW,EAAAA,aAAMvB,UAAYY,EAAQ,qBACvBG,SAAA,CAAAR,EAAMsB,KACN9B,EAAM+B,MAAMxB,GAAQA,EAAKC,QAAUA,EAAMsB,QAAQD,OAClDlB,EAAMc,IAAA,OAAA,CAAAxB,UAAYY,EAAQ,qBAAqBG,SAC5ChB,EAAM+B,MAAMxB,GAAQA,EAAKC,QAAUA,EAAMsB,QAAQD,aAb5CrB,EAAMsB,aAuBrB"}
@@ -1,3 +1,95 @@
1
- .b1_5FxxoK4aEFLoe67IA{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px}.vpmQkJAPhp3XJ9Wb6vOw{display:flex;flex-direction:column;gap:8px}.IKM8KG1lF9e5NzDqMLOJ{display:flex;align-items:center;gap:8px;font-size:.875rem}._eccyBq0v2puKsHw8XND{border-radius:2px}.UeZrUEpEK0tLzXHmeUco{color:var(--jp-gray-80, #2c3338);display:flex;align-items:center;gap:.5rem}.R5msPOYKm79jYV13H0v7{font-weight:500}
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
+ .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
+ .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
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
43
+ position: relative;
44
+ text-align: center;
45
+ }
46
+ .pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
47
+ margin-top: 1rem;
48
+ }
49
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
50
+ margin-bottom: 0px;
51
+ font-weight: 600;
52
+ font-size: 16px;
53
+ }
54
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
55
+ margin-top: 0px;
56
+ font-size: 14px;
57
+ }
58
+ .grid-control-module__grid-control__KOnZN .visx-line {
59
+ stroke: #d7d6d6;
60
+ stroke-width: 1px;
61
+ shape-rendering: crispEdges;
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
+ }
2
74
 
3
- /*# sourceMappingURL=style.css.map*/
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
+ }
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},r.apply(null,arguments)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}e.r(t),e.d(t,{LineChart:()=>y});const n=require("@visx/xychart"),l=require("clsx");var o=e.n(l);const i=require("react");var c={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},u=(0,i.createContext)(c);const s=require("@visx/legend"),d=require("@visx/scale"),m={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var v={horizontal:"row",vertical:"column"},h=function(e){var t=e.items,r=e.className,a=e.orientation,n=void 0===a?"horizontal":a,l=(0,d.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:o()(m.legend,m["legend--".concat(n)],r),role:"list"},React.createElement(s.LegendOrdinal,{scale:l,direction:v[n],shape:"rect",shapeWidth:16,shapeHeight:16,className:m["legend-items"]},(function(e){return React.createElement("div",{className:m["legend--".concat(n)]},e.map((function(e){var r,a;return React.createElement("div",{key:e.text,className:m["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:m["legend-item-swatch"]})),React.createElement("span",{className:m["legend-item-label"]},e.text,(null===(r=t.find((function(t){return t.label===e.text})))||void 0===r?void 0:r.value)&&React.createElement("span",{className:m["legend-item-value"]},null===(a=t.find((function(t){return t.label===e.text})))||void 0===a?void 0:a.value)))})))})))};const g={"line-chart":"vbyo4J2HC_KvyGgsWui7","line-chart__tooltip":"nLSohGgB7OyUmLRN_dLD","line-chart__tooltip-date":"MGw7UT3IImVKXXuBYmwf","line-chart__tooltip-row":"KwvDxit9dbF2E6ZzF29e","line-chart__tooltip-label":"WmFS4ekGu9e3G6URbkhd"};var p=function(e){var t,r=e.tooltipData,n=null==r||null===(t=r.nearestDatum)||void 0===t?void 0:t.datum;if(!n)return null;var l=Object.entries((null==r?void 0:r.datumByKey)||{}).map((function(e){var t,r,n=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,l,o,i=[],c=!0,u=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(a=l.call(r)).done)&&(i.push(a.value),i.length!==t);c=!0);}catch(e){u=!0,n=e}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw n}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return{key:n[0],value:n[1].datum.value}})).sort((function(e,t){return t.value-e.value}));return React.createElement("div",{className:g["line-chart__tooltip"]},React.createElement("div",{className:g["line-chart__tooltip-date"]},n.date.toLocaleDateString()),l.map((function(e){return React.createElement("div",{key:e.key,className:g["line-chart__tooltip-row"]},React.createElement("span",{className:g["line-chart__tooltip-label"]},e.key,":"),React.createElement("span",{className:g["line-chart__tooltip-value"]},e.value))})))},f=function(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})};const y=function(e){var t=e.data,a=e.width,l=e.height,c=e.margin,s=void 0===c?{top:20,right:20,bottom:40,left:40}:c,d=e.className,m=e.withTooltips,v=void 0===m||m,y=e.showLegend,b=void 0!==y&&y,E=e.legendOrientation,k=void 0===E?"horizontal":E,_=(0,i.useContext)(u);if(null==t||!t.length)return React.createElement("div",{className:o()("line-chart-empty",g["line-chart-empty"])},"Empty...");var R=t.map((function(e,t){return{label:e.label,value:"",color:_.colors[t%_.colors.length]}})),F={xAccessor:function(e){return e.date},yAccessor:function(e){return e.value}},w=(0,n.buildChartTheme)({backgroundColor:_.backgroundColor,colors:_.colors,gridStyles:_.gridStyles,tickLength:(null==_?void 0:_.tickLength)||0,gridColor:(null==_?void 0:_.gridColor)||"",gridColorDark:(null==_?void 0:_.gridColorDark)||""});return React.createElement("div",{className:o()("line-chart",g["line-chart"],d)},React.createElement(n.XYChart,{theme:w,width:a,height:l,margin:s,xScale:{type:"time"},yScale:{type:"linear",nice:!0}},React.createElement(n.AnimatedGrid,{columns:!1,numTicks:4}),React.createElement(n.AnimatedAxis,{orientation:"bottom",numTicks:5,tickFormat:f}),React.createElement(n.AnimatedAxis,{orientation:"left",numTicks:4}),t.map((function(e,t){return React.createElement(n.AnimatedLineSeries,r({key:null==e?void 0:e.label,dataKey:null==e?void 0:e.label,data:e.data},F,{stroke:w.colors[t%w.colors.length],strokeWidth:2}))})),v&&React.createElement(n.Tooltip,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:p})),b&&React.createElement(h,{items:R,orientation:k,className:g["line-chart-legend"]}))};module.exports=t})();
2
- //# sourceMappingURL=index.js.map
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@visx/gradient"),l=require("@visx/xychart"),i=require("clsx"),a=require("react"),r=require("@visx/legend"),n=require("@visx/scale"),o=require("@visx/responsive");const s=a.createContext({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});var d={"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 c={horizontal:"row",vertical:"column"},h=({items:t,className:l,orientation:a="horizontal"})=>{const o=n.scaleOrdinal({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e.jsx("div",{className:i(d.legend,d[`legend--${a}`],l),role:"list",children:e.jsx(r.LegendOrdinal,{scale:o,direction:c[a],shape:"rect",shapeWidth:16,shapeHeight:16,className:d["legend-items"],children:l=>e.jsx("div",{className:d[`legend--${a}`],children:l.map((l=>e.jsxs("div",{className:d["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:l.value,className:d["legend-item-swatch"]})}),e.jsxs("span",{className:d["legend-item-label"],children:[l.text,t.find((e=>e.label===l.text))?.value&&e.jsx("span",{className:d["legend-item-value"],children:t.find((e=>e.label===l.text))?.value})]})]},l.text)))})})})};var m={"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 g=({tooltipData:t})=>{const l=t?.nearestDatum?.datum;if(!l)return null;const i=Object.entries(t?.datumByKey||{}).map((([e,{datum:t}])=>({key:e,value:t.value}))).sort(((e,t)=>t.value-e.value));return e.jsxs("div",{className:m["line-chart__tooltip"],children:[e.jsx("div",{className:m["line-chart__tooltip-date"],children:l.date.toLocaleDateString()}),i.map((t=>e.jsxs("div",{className:m["line-chart__tooltip-row"],children:[e.jsxs("span",{className:m["line-chart__tooltip-label"],children:[t.key,":"]}),e.jsx("span",{className:m["line-chart__tooltip-value"],children:t.value})]},t.key)))]})},_=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"});var u=function(t,l){const{maxWidth:i=1200,aspectRatio:a=.5,debounceTime:r=50}=l||{};return function(l){const{parentRef:n,width:s}=o.useParentSize({debounceTime:r,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),d=s?Math.min(s,i):600,c=d*a;return e.jsx("div",{ref:n,style:{width:"100%",minHeight:`${c}px`},children:e.jsx(t,{width:d,height:c,size:d,...l})})}}((({data:r,width:n,height:o,margin:d={top:20,right:20,bottom:40,left:40},className:c,withTooltips:u=!0,showLegend:x=!1,legendOrientation:p="horizontal",withGradientFill:v=!1,options:j={}})=>{const b=a.useContext(s);if(!r?.length)return e.jsx("div",{className:i("line-chart-empty",m["line-chart-empty"]),children:"Empty..."});const k=r.map(((e,t)=>({label:e.label,value:"",color:b.colors[t%b.colors.length]}))),y={xAccessor:e=>e.date,yAccessor:e=>e.value},F=l.buildChartTheme({backgroundColor:b.backgroundColor,colors:b.colors,gridStyles:b.gridStyles,tickLength:b?.tickLength||0,gridColor:b?.gridColor||"",gridColorDark:b?.gridColorDark||""});return e.jsxs("div",{className:i("line-chart",m["line-chart"],c),children:[e.jsxs(l.XYChart,{theme:F,width:n,height:o,margin:d,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:_,...j?.axis?.x}),e.jsx(l.AnimatedAxis,{orientation:"left",numTicks:4,...j?.axis?.y}),r.map(((i,a)=>{const r=i.options?.stroke??F.colors[a%F.colors.length];return e.jsxs(e.Fragment,{children:[e.jsx(t.LinearGradient,{id:`area-gradient-${a+1}`,from:r,to:"white",toOpacity:.1,...i.options?.gradient}),e.jsx(l.AnimatedLineSeries,{dataKey:i?.label,data:i.data,...y,stroke:r,strokeWidth:2},i?.label),v&&e.jsx(l.AnimatedAreaSeries,{dataKey:i?.label,data:i.data,...y,stroke:r,strokeWidth:0,fill:`url(#area-gradient-${a+1})`,renderLine:!1},i?.label)]})})),u&&e.jsx(l.Tooltip,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:g})]}),x&&e.jsx(h,{items:k,orientation:p,className:m["line-chart-legend"]})]})}));exports.LineChart=u;
2
+ //# sourceMappingURL=index.js.map