@automattic/charts 0.3.0 → 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 (123) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/components/bar-chart/index.js +2 -3
  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 -3
  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 -3
  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 -3
  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 -3
  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 -3
  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 -3
  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 -3
  24. package/dist/cjs/index.js.map +1 -1
  25. package/dist/cjs/providers/theme/index.js +2 -3
  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 -3
  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 -3
  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 -3
  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 -3
  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 -3
  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 -3
  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 -3
  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 -3
  52. package/dist/mjs/index.js.map +1 -1
  53. package/dist/mjs/providers/theme/index.js +2 -3
  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/line-chart/line-chart.tsx +50 -15
  61. package/src/components/pie-chart/__tests__/pie-chart.test.tsx +59 -0
  62. package/src/components/pie-chart/pie-chart.tsx +91 -6
  63. package/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx +17 -12
  64. package/src/components/shared/with-responsive.tsx +4 -3
  65. package/src/types.ts +25 -0
  66. package/tests/jest.config.cjs +12 -0
  67. package/tests/jest.setup.js +13 -0
  68. package/dist/cjs/components/bar-chart/index.js.LICENSE.txt +0 -9
  69. package/dist/cjs/components/bar-chart/style.css.map +0 -1
  70. package/dist/cjs/components/grid-control/index.js.LICENSE.txt +0 -9
  71. package/dist/cjs/components/grid-control/style.css.map +0 -1
  72. package/dist/cjs/components/legend/index.js.LICENSE.txt +0 -9
  73. package/dist/cjs/components/legend/style.css.map +0 -1
  74. package/dist/cjs/components/line-chart/index.js.LICENSE.txt +0 -9
  75. package/dist/cjs/components/line-chart/style.css.map +0 -1
  76. package/dist/cjs/components/pie-chart/index.js.LICENSE.txt +0 -9
  77. package/dist/cjs/components/pie-chart/style.css.map +0 -1
  78. package/dist/cjs/components/pie-semi-circle-chart/index.js.LICENSE.txt +0 -9
  79. package/dist/cjs/components/pie-semi-circle-chart/style.css.map +0 -1
  80. package/dist/cjs/components/tooltip/index.js.LICENSE.txt +0 -9
  81. package/dist/cjs/components/tooltip/style.css.map +0 -1
  82. package/dist/cjs/index.js.LICENSE.txt +0 -9
  83. package/dist/cjs/providers/theme/index.js.LICENSE.txt +0 -9
  84. package/dist/cjs/style.css.map +0 -1
  85. package/dist/mjs/components/bar-chart/index.js.LICENSE.txt +0 -9
  86. package/dist/mjs/components/bar-chart/style.css.map +0 -1
  87. package/dist/mjs/components/grid-control/index.js.LICENSE.txt +0 -9
  88. package/dist/mjs/components/grid-control/style.css.map +0 -1
  89. package/dist/mjs/components/legend/index.js.LICENSE.txt +0 -9
  90. package/dist/mjs/components/legend/style.css.map +0 -1
  91. package/dist/mjs/components/line-chart/index.js.LICENSE.txt +0 -9
  92. package/dist/mjs/components/line-chart/style.css.map +0 -1
  93. package/dist/mjs/components/pie-chart/index.js.LICENSE.txt +0 -9
  94. package/dist/mjs/components/pie-chart/style.css.map +0 -1
  95. package/dist/mjs/components/pie-semi-circle-chart/index.js.LICENSE.txt +0 -9
  96. package/dist/mjs/components/pie-semi-circle-chart/style.css.map +0 -1
  97. package/dist/mjs/components/tooltip/index.js.LICENSE.txt +0 -9
  98. package/dist/mjs/components/tooltip/style.css.map +0 -1
  99. package/dist/mjs/index.js.LICENSE.txt +0 -9
  100. package/dist/mjs/providers/theme/index.js.LICENSE.txt +0 -9
  101. package/dist/mjs/style.css.map +0 -1
  102. package/dist/types/components/bar-chart/bar-chart.d.ts +0 -5
  103. package/dist/types/components/bar-chart/index.d.ts +0 -1
  104. package/dist/types/components/grid-control/grid-control.d.ts +0 -4
  105. package/dist/types/components/grid-control/index.d.ts +0 -1
  106. package/dist/types/components/legend/base-legend.d.ts +0 -3
  107. package/dist/types/components/legend/index.d.ts +0 -2
  108. package/dist/types/components/legend/types.d.ts +0 -12
  109. package/dist/types/components/line-chart/index.d.ts +0 -1
  110. package/dist/types/components/line-chart/line-chart.d.ts +0 -11
  111. package/dist/types/components/pie-chart/index.d.ts +0 -1
  112. package/dist/types/components/pie-chart/pie-chart.d.ts +0 -9
  113. package/dist/types/components/pie-semi-circle-chart/index.d.ts +0 -1
  114. package/dist/types/components/pie-semi-circle-chart/pie-semi-circle-chart.d.ts +0 -22
  115. package/dist/types/components/shared/with-responsive.d.ts +0 -17
  116. package/dist/types/components/tooltip/base-tooltip.d.ts +0 -29
  117. package/dist/types/components/tooltip/index.d.ts +0 -2
  118. package/dist/types/hooks/use-chart-mouse-handler.d.ts +0 -41
  119. package/dist/types/index.d.ts +0 -8
  120. package/dist/types/providers/theme/index.d.ts +0 -2
  121. package/dist/types/providers/theme/theme-provider.d.ts +0 -18
  122. package/dist/types/providers/theme/themes.d.ts +0 -14
  123. package/dist/types/types.d.ts +0 -137
package/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ 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
+
8
21
  ## [0.3.0] - 2025-01-12
9
22
  ### Changed
10
23
  - make charts responsive [#40922]
@@ -54,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
54
67
  - Fixed lints following ESLint rule changes for TS [#40584]
55
68
  - Fixing a bug in Chart storybook data. [#40640]
56
69
 
70
+ [0.4.0]: https://github.com/Automattic/charts/compare/v0.3.0...v0.4.0
57
71
  [0.3.0]: https://github.com/Automattic/charts/compare/v0.2.3...v0.3.0
58
72
  [0.2.3]: https://github.com/Automattic/charts/compare/v0.2.2...v0.2.3
59
73
  [0.2.2]: https://github.com/Automattic/charts/compare/v0.2.1...v0.2.2
@@ -1,3 +1,2 @@
1
- /*! For license information please see index.js.LICENSE.txt */
2
- (()=>{"use strict";var e={572:(e,t,r)=>{var n=r(953),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var n,i={},s=null,u=null;for(n in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,n)&&!c.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:o,type:e,key:s,ref:u,props:i,_owner:l.current}}t.Fragment=i,t.jsx=s,t.jsxs=s},48:(e,t,r)=>{e.exports=r(572)},953:e=>{e.exports=require("react")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return function(e){if(Array.isArray(e))return o(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 o(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)?o(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.")}()}r.r(n),r.d(n,{BarChart:()=>E});const a=require("@visx/axis"),l=require("@visx/event"),c=require("@visx/group"),s=require("@visx/scale"),u=require("@visx/shape"),d=require("@visx/tooltip"),v=require("clsx");var p=r.n(v),f=r(953),h={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},m=r(48),b=(0,f.createContext)(h);const g=require("@visx/grid"),y=function(e){var t=e.width,r=e.height,n=e.xScale,o=e.yScale,i=e.gridVisibility,a=void 0===i?"x":i,l=e.top,c=void 0===l?0:l;return(0,m.jsxs)("g",{transform:"translate(0, ".concat(c,")"),className:"jfpeES0fbFrqCPR8dRN7",children:[a.includes("x")&&(0,m.jsx)(g.GridRows,{scale:n,width:t}),a.includes("y")&&(0,m.jsx)(g.GridColumns,{scale:o,height:r})]})},x=require("@visx/legend"),j={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var w={horizontal:"row",vertical:"column"},O=function(e){var t=e.items,r=e.className,n=e.orientation,o=void 0===n?"horizontal":n,i=(0,s.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return(0,m.jsx)("div",{className:p()(j.legend,j["legend--".concat(o)],r),role:"list",children:(0,m.jsx)(x.LegendOrdinal,{scale:i,direction:w[o],shape:"rect",shapeWidth:16,shapeHeight:16,className:j["legend-items"],children:function(e){return(0,m.jsx)("div",{className:j["legend--".concat(o)],children:e.map((function(e){var r,n;return(0,m.jsxs)("div",{className:j["legend-item"],children:[(0,m.jsx)("svg",{width:16,height:16,children:(0,m.jsx)("rect",{width:16,height:16,fill:e.value,className:j["legend-item-swatch"]})}),(0,m.jsxs)("span",{className:j["legend-item-label"],children:[e.text,(null===(r=t.find((function(t){return t.label===e.text})))||void 0===r?void 0:r.value)&&(0,m.jsx)("span",{className:j["legend-item-value"],children:null===(n=t.find((function(t){return t.label===e.text})))||void 0===n?void 0:n.value})]})]},e.text)}))})}})})};function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function F(e,t,r){return(t=function(e){var t=function(e){if("object"!=S(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==S(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const P=require("@visx/responsive");function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){F(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var C=function(e){var t=e.data;return(0,m.jsxs)(m.Fragment,{children:[null==t?void 0:t.label,": ",(null==t?void 0:t.valueDisplay)||(null==t?void 0:t.value)]})},L=function(e){var t=e.data,r=e.top,n=e.left,o=e.component,i=void 0===o?C:o,a=e.children,l=e.className;return(0,m.jsx)("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:r,left:n},role:"tooltip",children:a||t&&(0,m.jsx)(i,{data:t,className:l})})};const A={"bar-chart":"Vm_cn8YnIXBavFt6eHSp","bar-chart-legend":"e4dhKgBP7e6FBRAX2SrP"};var D=function(e){var t,r=e.data,n=e.margin,o=void 0===n?{top:20,right:20,bottom:40,left:40}:n,v=e.withTooltips,h=void 0!==v&&v,g=e.showLegend,x=void 0!==g&&g,j=e.legendOrientation,w=void 0===j?"horizontal":j,S=e.className,F=e.gridVisibility,P=void 0===F?"x":F,N=e.width,_=e.height,C=void 0===_?400:_,D=(0,f.useContext)(b),E=(0,d.useTooltip)(),T=E.tooltipOpen,k=E.tooltipLeft,q=E.tooltipTop,B=E.tooltipData,M=E.hideTooltip,R=E.showTooltip,I=(0,f.useCallback)((function(e,t,r,n,o){var i=(0,l.localPoint)(e);i&&R({tooltipData:{value:t,xLabel:r,yLabel:n,seriesIndex:o},tooltipLeft:i.x,tooltipTop:i.y-10})}),[R]),z=(0,f.useCallback)((function(){M()}),[M]);if(null==r||!r.length)return(0,m.jsx)("div",{className:p()("bar-chart-empty",A["bat-chart-empty"]),children:"Empty..."});var K=o,H=N-K.left-K.right,U=C-K.top-K.bottom,X=null===(t=r[0].data)||void 0===t?void 0:t.map((function(e){return(null==e?void 0:e.label)||""})),G=(0,s.scaleBand)({range:[0,H],domain:X,padding:.2}),V=(0,s.scaleBand)({range:[0,G.bandwidth()],domain:r.map((function(e,t){return t.toString()})),padding:.1}),W=(0,s.scaleLinear)({range:[U,0],domain:[0,Math.max.apply(Math,i(r.map((function(e){return Math.max.apply(Math,i(e.data.map((function(e){return(null==e?void 0:e.value)||0}))))}))))]}),J=r.map((function(e,t){return{label:e.label,value:"",color:D.colors[t%D.colors.length]}}));return(0,m.jsxs)("div",{className:p()("bar-chart",S,A["bar-chart"]),children:[(0,m.jsx)("svg",{width:N,height:C,children:(0,m.jsxs)(c.Group,{left:K.left,top:K.top,children:[(0,m.jsx)(y,{width:H,height:U,xScale:G,yScale:W,gridVisibility:P}),r.map((function(e,t){return(0,m.jsx)(c.Group,{children:e.data.map((function(r){var n,o,i=G((null==r?void 0:r.label)||"");if(void 0===i)return null;var a=V.bandwidth(),l=i+(null!==(n=V(t.toString()))&&void 0!==n?n:0);return(0,m.jsx)(u.Bar,{x:l,y:W(r.value),width:a,height:U-(null!==(o=W(r.value))&&void 0!==o?o:0),fill:D.colors[t%D.colors.length],onMouseMove:h?function(n){return I(n,r.value,(null==r?void 0:r.label)||"",e.label,t)}:void 0,onMouseLeave:h?z:void 0},"bar-".concat(t,"-").concat(r.label))}))},t)})),(0,m.jsx)(a.AxisLeft,{scale:W}),(0,m.jsx)(a.AxisBottom,{scale:G,top:U})]})}),h&&T&&B&&(0,m.jsx)(L,{top:q||0,left:k||0,children:(0,m.jsxs)("div",{children:[(0,m.jsx)("div",{children:B.yLabel}),(0,m.jsxs)("div",{children:[B.xLabel,": ",B.value]})]})}),x&&(0,m.jsx)(O,{items:J,orientation:w,className:A["bar-chart-legend"]})]})};D.displayName="BarChart";const E=(T=D,q=(k={}).maxWidth,B=void 0===q?1200:q,R=void 0===(M=k.aspectRatio)?.5:M,z=void 0===(I=k.debounceTime)?50:I,function(e){var t=(0,P.useParentSize)({debounceTime:z,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),r=t.parentRef,n=t.width,o=n?Math.min(n,B):600,i=o*R;return(0,m.jsx)("div",{ref:r,style:{width:"100%",minHeight:"".concat(i,"px")},children:(0,m.jsx)(T,_({width:o,height:i},e))})});var T,k,q,B,M,R,I,z;module.exports=n})();
3
- //# 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":";wCASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EA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BnJ,MAAQ+I,EACR9I,OAASgJ,GAEFvM,KAIX,GAjCM,IACNwL,EAGAnI,EAA8EoI,EAAtEC,EAAeE,EAAED,EAAiBG,EAAED","sources":["webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js","webpack://@automattic/charts/external commonjs2 \"react\"","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/./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/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@automattic/charts/external commonjs2 \"@visx/responsive\"","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","webpack://@automattic/charts/./src/components/shared/with-responsive.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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\");","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","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/responsive\");","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 { withResponsive } from '../shared/with-responsive';\nimport { BaseTooltip } from '../tooltip';\nimport styles from './bar-chart.module.scss';\nimport type { BaseChartProps, SeriesData } from '../../types';\n\ntype BarChartTooltipData = {\n\tvalue: number;\n\txLabel: string;\n\tyLabel: string;\n\tseriesIndex: number;\n};\n\ninterface BarChartProps extends BaseChartProps< SeriesData[] > {}\n\nconst BarChart: FC< BarChartProps > = ( {\n\tdata,\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\twidth,\n\theight = 400,\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 withResponsive< BarChartProps >( BarChart );\n","import { useParentSize } from '@visx/responsive';\nimport { ComponentType } from 'react';\nimport type { BaseChartProps } from '../../types';\n\ntype ResponsiveConfig = {\n\tmaxWidth?: number;\n\taspectRatio?: number;\n\tdebounceTime?: number;\n};\n\n/**\n * A higher-order component that provides responsive width and height\n * to the wrapped chart component using useParentSize from @visx/responsive.\n *\n * @param WrappedComponent - The chart component to be wrapped.\n * @param config - Optional configuration for responsive behavior\n * @return A functional component that renders the wrapped component with responsive dimensions.\n */\nexport function withResponsive< T extends BaseChartProps< unknown > >(\n\tWrappedComponent: ComponentType< T >,\n\tconfig?: ResponsiveConfig\n) {\n\tconst { maxWidth = 1200, aspectRatio = 0.5, debounceTime = 50 } = config || {};\n\n\treturn function ResponsiveChart( props: Omit< T, 'width' | 'height' > ) {\n\t\tconst { parentRef, width: parentWidth } = useParentSize( {\n\t\t\tdebounceTime,\n\t\t\tenableDebounceLeadingCall: true,\n\t\t\tinitialSize: { width: 600, height: 400 },\n\t\t} );\n\n\t\t// Calculate dimensions\n\t\tconst containerWidth = parentWidth ? Math.min( parentWidth, maxWidth ) : 600;\n\t\tconst containerHeight = containerWidth * aspectRatio;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ parentRef }\n\t\t\t\tstyle={ {\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\tminHeight: `${ containerHeight }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<WrappedComponent\n\t\t\t\t\twidth={ containerWidth }\n\t\t\t\t\theight={ containerHeight }\n\t\t\t\t\t// When width and height are passed as props, they will override the responsive values, and the chart will become fixed size.\n\t\t\t\t\t{ ...( props as T ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n}\n"],"names":["f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","Fragment","jsx","jsxs","module","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","get","obj","prop","r","toStringTag","value","_arrayLikeToArray","length","Array","_toConsumableArray","isArray","iterator","from","t","toString","slice","constructor","name","test","TypeError","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","_ref","width","height","xScale","yScale","_ref$gridVisibility","gridVisibility","_ref$top","top","_jsxs","transform","concat","className","children","includes","_jsx","GridRows","scale","GridColumns","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","clsx","styles","legend","role","LegendOrdinal","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","fill","text","find","_typeof","i","toPrimitive","String","toPropertyKey","configurable","writable","DefaultTooltipContent","data","_Fragment","valueDisplay","BaseTooltip","_ref2","left","_ref2$component","component","Component","style","BarChart","_data$0$data","_ref$margin","margin","right","bottom","_ref$withTooltips","withTooltips","_ref$showLegend","showLegend","_ref$legendOrientatio","legendOrientation","_ref$height","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","_","scaleLinear","Math","max","apply","series","legendItems","group","index","Group","GridControl","_innerScale","_yScale","xPos","barWidth","barX","Bar","onMouseMove","onMouseLeave","AxisLeft","AxisBottom","Legend","displayName","WrappedComponent","_ref$maxWidth","maxWidth","aspectRatio","_ref$aspectRatio","debounceTime","_ref$debounceTime","_useParentSize","useParentSize","enableDebounceLeadingCall","initialSize","parentRef","parentWidth","containerWidth","min","containerHeight","minHeight","_objectSpread"],"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,SAC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,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,3 +1,2 @@
1
- /*! For license information please see index.js.LICENSE.txt */
2
- (()=>{"use strict";var e={572:(e,r,t)=>{var o=t(953),n=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(e,r,t){var o,l={},d=null,c=null;for(o in void 0!==t&&(d=""+t),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(c=r.ref),r)i.call(r,o)&&!a.hasOwnProperty(o)&&(l[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===l[o]&&(l[o]=r[o]);return{$$typeof:n,type:e,key:d,ref:c,props:l,_owner:s.current}}r.jsx=l,r.jsxs=l},48:(e,r,t)=>{e.exports=t(572)},953:e=>{e.exports=require("react")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return e[o](i,i.exports,t),i.exports}t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};t.r(o),t.d(o,{GridControl:()=>s});const n=require("@visx/grid");t(953);var i=t(48);const s=function(e){var r=e.width,t=e.height,o=e.xScale,s=e.yScale,a=e.gridVisibility,l=void 0===a?"x":a,d=e.top,c=void 0===d?0:d;return(0,i.jsxs)("g",{transform:"translate(0, ".concat(c,")"),className:"jfpeES0fbFrqCPR8dRN7",children:[l.includes("x")&&(0,i.jsx)(n.GridRows,{scale:o,width:r}),l.includes("y")&&(0,i.jsx)(n.GridColumns,{scale:s,height:t})]})};module.exports=o})();
3
- //# 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":";4CASiBA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAgDC,GAA7BF,OAAOC,IAAI,kBAAoBE,OAAOC,UAAUC,gBAAeC,EAAER,EAAES,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAAGJ,EAAEN,UAAK,IAASM,EAAEL,MAAMU,EAAEL,EAAEL,KAAcK,EAAEd,EAAEoB,KAAKN,EAAEE,KAAKT,EAAEJ,eAAea,KAAKC,EAAED,GAAGF,EAAEE,IAAI,GAAGH,GAAGA,EAAEQ,aAAa,IAAIL,KAAKF,EAAED,EAAEQ,kBAAe,IAASJ,EAAED,KAAKC,EAAED,GAAGF,EAAEE,IAAI,MAAM,CAACM,SAASzB,EAAE0B,KAAKV,EAAEL,IAAIU,EAAET,IAAIU,EAAEK,MAAMP,EAAEQ,OAAOrB,EAAEsB,QAAQ,CAAoBC,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,EAASF,MAAQA,IACrEK,EAAeQ,SAAU,OAASC,EAAAA,EAAAA,KAACG,EAAAA,YAAW,CAACD,MAAQb,EAASF,OAASA,MAG9E","sources":["webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js","webpack://@automattic/charts/external commonjs2 \"react\"","webpack://@automattic/charts/webpack/bootstrap","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/./src/components/grid-control/grid-control.tsx","webpack://@automattic/charts/./src/components/grid-control/grid-control.module.scss?a210"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\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\");","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\"};"],"names":["f","k","Symbol","for","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","jsx","jsxs","module","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","definition","o","defineProperty","enumerable","get","obj","prop","r","toStringTag","value","_ref","width","height","xScale","yScale","_ref$gridVisibility","gridVisibility","_ref$top","top","_jsxs","transform","concat","className","children","includes","_jsx","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,3 +1,2 @@
1
- /*! For license information please see index.js.LICENSE.txt */
2
- (()=>{"use strict";var e={572:(e,r,t)=>{var n=t(953),l=Symbol.for("react.element"),o=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(e,r,t){var n,s={},d=null,c=null;for(n in void 0!==t&&(d=""+t),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(c=r.ref),r)o.call(r,n)&&!i.hasOwnProperty(n)&&(s[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===s[n]&&(s[n]=r[n]);return{$$typeof:l,type:e,key:d,ref:c,props:s,_owner:a.current}}r.jsx=s,r.jsxs=s},48:(e,r,t)=>{e.exports=t(572)},953:e=>{e.exports=require("react")}},r={};function t(n){var l=r[n];if(void 0!==l)return l.exports;var o=r[n]={exports:{}};return e[n](o,o.exports,t),o.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};t.r(n),t.d(n,{Legend:()=>u});const l=require("@visx/legend"),o=require("@visx/scale"),a=require("clsx");var i=t.n(a);const s={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var d=t(48),c={horizontal:"row",vertical:"column"},u=function(e){var r=e.items,t=e.className,n=e.orientation,a=void 0===n?"horizontal":n,u=(0,o.scaleOrdinal)({domain:r.map((function(e){return e.label})),range:r.map((function(e){return e.color}))});return(0,d.jsx)("div",{className:i()(s.legend,s["legend--".concat(a)],t),role:"list",children:(0,d.jsx)(l.LegendOrdinal,{scale:u,direction:c[a],shape:"rect",shapeWidth:16,shapeHeight:16,className:s["legend-items"],children:function(e){return(0,d.jsx)("div",{className:s["legend--".concat(a)],children:e.map((function(e){var t,n;return(0,d.jsxs)("div",{className:s["legend-item"],children:[(0,d.jsx)("svg",{width:16,height:16,children:(0,d.jsx)("rect",{width:16,height:16,fill:e.value,className:s["legend-item-swatch"]})}),(0,d.jsxs)("span",{className:s["legend-item-label"],children:[e.text,(null===(t=r.find((function(r){return r.label===e.text})))||void 0===t?void 0:t.value)&&(0,d.jsx)("span",{className:s["legend-item-value"],children:null===(n=r.find((function(r){return r.label===e.text})))||void 0===n?void 0:n.value})]})]},e.text)}))})}})})};module.exports=n})();
3
- //# 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":";4CASiBA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAgDC,GAA7BF,OAAOC,IAAI,kBAAoBE,OAAOC,UAAUC,gBAAeC,EAAER,EAAES,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAAGJ,EAAEN,UAAK,IAASM,EAAEL,MAAMU,EAAEL,EAAEL,KAAcK,EAAEd,EAAEoB,KAAKN,EAAEE,KAAKT,EAAEJ,eAAea,KAAKC,EAAED,GAAGF,EAAEE,IAAI,GAAGH,GAAGA,EAAEQ,aAAa,IAAIL,KAAKF,EAAED,EAAEQ,kBAAe,IAASJ,EAAED,KAAKC,EAAED,GAAGF,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,EAAAA,EAAAA,KAAA,QAAMX,UAAYa,EAAQ,qBAAuBI,SACC,QADDS,EAC9C3B,EAAMiC,MAAM,SAAAzB,GAAI,OAAIA,EAAKC,QAAUA,EAAMuB,IAAI,WAAE,IAAAL,OAAA,EAA/CA,EAAiDjC,aAb5Ce,EAAMuB,KAiBX,KAEF,KAKX","sources":["webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js","webpack://@automattic/charts/external commonjs2 \"react\"","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":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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":["f","k","Symbol","for","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","jsx","jsxs","module","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","get","obj","prop","r","toStringTag","value","orientationToFlexDirection","horizontal","vertical","BaseLegend","_ref","items","className","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","concat","role","children","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","_jsxs","width","height","fill","text","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,3 +1,2 @@
1
- /*! For license information please see index.js.LICENSE.txt */
2
- (()=>{"use strict";var e={572:(e,t,r)=>{var n=r(953),o=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,c={},s=null,u=null;for(n in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!a.hasOwnProperty(n)&&(c[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===c[n]&&(c[n]=t[n]);return{$$typeof:o,type:e,key:s,ref:u,props:c,_owner:l.current}}t.jsx=c,t.jsxs=c},48:(e,t,r)=>{e.exports=r(572)},953:e=>{e.exports=require("react")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t,r){return(t=function(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}r.r(n),r.d(n,{LineChart:()=>P});const a=require("@visx/xychart"),c=require("clsx");var s=r.n(c),u=r(953),d={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},p=r(48),m=(0,u.createContext)(d);const f=require("@visx/legend"),h=require("@visx/scale"),v={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var y={horizontal:"row",vertical:"column"},b=function(e){var t=e.items,r=e.className,n=e.orientation,o=void 0===n?"horizontal":n,i=(0,h.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return(0,p.jsx)("div",{className:s()(v.legend,v["legend--".concat(o)],r),role:"list",children:(0,p.jsx)(f.LegendOrdinal,{scale:i,direction:y[o],shape:"rect",shapeWidth:16,shapeHeight:16,className:v["legend-items"],children:function(e){return(0,p.jsx)("div",{className:v["legend--".concat(o)],children:e.map((function(e){var r,n;return(0,p.jsxs)("div",{className:v["legend-item"],children:[(0,p.jsx)("svg",{width:16,height:16,children:(0,p.jsx)("rect",{width:16,height:16,fill:e.value,className:v["legend-item-swatch"]})}),(0,p.jsxs)("span",{className:v["legend-item-label"],children:[e.text,(null===(r=t.find((function(t){return t.label===e.text})))||void 0===r?void 0:r.value)&&(0,p.jsx)("span",{className:v["legend-item-value"],children:null===(n=t.find((function(t){return t.label===e.text})))||void 0===n?void 0:n.value})]})]},e.text)}))})}})})};const g=require("@visx/responsive");function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const x={"line-chart":"vbyo4J2HC_KvyGgsWui7","line-chart__tooltip":"nLSohGgB7OyUmLRN_dLD","line-chart__tooltip-date":"MGw7UT3IImVKXXuBYmwf","line-chart__tooltip-row":"KwvDxit9dbF2E6ZzF29e","line-chart__tooltip-label":"WmFS4ekGu9e3G6URbkhd"};function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var S=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 o=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 n,o,i,l,a=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw o}}return a}}(t,r)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(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(0,p.jsxs)("div",{className:x["line-chart__tooltip"],children:[(0,p.jsx)("div",{className:x["line-chart__tooltip-date"],children:n.date.toLocaleDateString()}),o.map((function(e){return(0,p.jsxs)("div",{className:x["line-chart__tooltip-row"],children:[(0,p.jsxs)("span",{className:x["line-chart__tooltip-label"],children:[e.key,":"]}),(0,p.jsx)("span",{className:x["line-chart__tooltip-value"],children:e.value})]},e.key)}))]})},k=function(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})};const P=(D=function(e){var t=e.data,r=e.width,n=e.height,o=e.margin,i=void 0===o?{top:20,right:20,bottom:40,left:40}:o,l=e.className,c=e.withTooltips,d=void 0===c||c,f=e.showLegend,h=void 0!==f&&f,v=e.legendOrientation,y=void 0===v?"horizontal":v,g=(0,u.useContext)(m);if(null==t||!t.length)return(0,p.jsx)("div",{className:s()("line-chart-empty",x["line-chart-empty"]),children:"Empty..."});var j=t.map((function(e,t){return{label:e.label,value:"",color:g.colors[t%g.colors.length]}})),O={xAccessor:function(e){return e.date},yAccessor:function(e){return e.value}},w=(0,a.buildChartTheme)({backgroundColor:g.backgroundColor,colors:g.colors,gridStyles:g.gridStyles,tickLength:(null==g?void 0:g.tickLength)||0,gridColor:(null==g?void 0:g.gridColor)||"",gridColorDark:(null==g?void 0:g.gridColorDark)||""});return(0,p.jsxs)("div",{className:s()("line-chart",x["line-chart"],l),children:[(0,p.jsxs)(a.XYChart,{theme:w,width:r,height:n,margin:i,xScale:{type:"time"},yScale:{type:"linear",nice:!0},children:[(0,p.jsx)(a.AnimatedGrid,{columns:!1,numTicks:4}),(0,p.jsx)(a.AnimatedAxis,{orientation:"bottom",numTicks:5,tickFormat:k}),(0,p.jsx)(a.AnimatedAxis,{orientation:"left",numTicks:4}),t.map((function(e,t){return(0,p.jsx)(a.AnimatedLineSeries,_(_({dataKey:null==e?void 0:e.label,data:e.data},O),{},{stroke:w.colors[t%w.colors.length],strokeWidth:2}),null==e?void 0:e.label)})),d&&(0,p.jsx)(a.Tooltip,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:S})]}),h&&(0,p.jsx)(b,{items:j,orientation:y,className:x["line-chart-legend"]})]})},C=(F={}).maxWidth,N=void 0===C?1200:C,A=void 0===(T=F.aspectRatio)?.5:T,E=void 0===(L=F.debounceTime)?50:L,function(e){var t=(0,g.useParentSize)({debounceTime:E,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),r=t.parentRef,n=t.width,o=n?Math.min(n,N):600,i=o*A;return(0,p.jsx)("div",{ref:r,style:{width:"100%",minHeight:"".concat(i,"px")},children:(0,p.jsx)(D,O({width:o,height:i},e))})});var D,F,C,N,T,A,L,E;module.exports=n})();
3
- //# 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