@automattic/charts 0.3.0 → 0.5.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 (198) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/components/bar-chart/bar-chart.js +2 -0
  3. package/dist/cjs/components/bar-chart/bar-chart.js.map +1 -0
  4. package/dist/cjs/components/bar-chart/bar-chart.module.scss.js +2 -0
  5. package/dist/cjs/components/bar-chart/bar-chart.module.scss.js.map +1 -0
  6. package/dist/cjs/components/grid-control/grid-control.js +2 -0
  7. package/dist/cjs/components/grid-control/grid-control.js.map +1 -0
  8. package/dist/cjs/components/grid-control/grid-control.module.scss.js +2 -0
  9. package/dist/cjs/components/grid-control/grid-control.module.scss.js.map +1 -0
  10. package/dist/cjs/components/legend/base-legend.js +2 -0
  11. package/dist/cjs/components/legend/base-legend.js.map +1 -0
  12. package/dist/cjs/components/legend/legend.module.scss.js +2 -0
  13. package/dist/cjs/components/legend/legend.module.scss.js.map +1 -0
  14. package/dist/cjs/components/line-chart/line-chart.js +2 -0
  15. package/dist/cjs/components/line-chart/line-chart.js.map +1 -0
  16. package/dist/cjs/components/line-chart/line-chart.module.scss.js +2 -0
  17. package/dist/cjs/components/line-chart/line-chart.module.scss.js.map +1 -0
  18. package/dist/cjs/components/pie-chart/pie-chart.js +2 -0
  19. package/dist/cjs/components/pie-chart/pie-chart.js.map +1 -0
  20. package/dist/cjs/components/pie-chart/pie-chart.module.scss.js +2 -0
  21. package/dist/cjs/components/pie-chart/pie-chart.module.scss.js.map +1 -0
  22. package/dist/cjs/components/pie-semi-circle-chart/pie-semi-circle-chart.js +2 -0
  23. package/dist/cjs/components/pie-semi-circle-chart/pie-semi-circle-chart.js.map +1 -0
  24. package/dist/cjs/components/pie-semi-circle-chart/pie-semi-circle-chart.module.scss.js +2 -0
  25. package/dist/cjs/components/pie-semi-circle-chart/pie-semi-circle-chart.module.scss.js.map +1 -0
  26. package/dist/cjs/components/shared/with-responsive.js +2 -0
  27. package/dist/cjs/components/shared/with-responsive.js.map +1 -0
  28. package/dist/cjs/components/tooltip/base-tooltip.js +2 -0
  29. package/dist/cjs/components/tooltip/base-tooltip.js.map +1 -0
  30. package/dist/cjs/components/tooltip/base-tooltip.module.scss.js +2 -0
  31. package/dist/cjs/components/tooltip/base-tooltip.module.scss.js.map +1 -0
  32. package/dist/cjs/hooks/use-chart-mouse-handler.js +2 -0
  33. package/dist/cjs/hooks/use-chart-mouse-handler.js.map +1 -0
  34. package/dist/cjs/index.css +1 -0
  35. package/dist/cjs/index.js +2 -3
  36. package/dist/cjs/index.js.map +1 -1
  37. package/dist/cjs/providers/theme/theme-provider.js +2 -0
  38. package/dist/cjs/providers/theme/theme-provider.js.map +1 -0
  39. package/dist/cjs/providers/theme/themes.js +2 -0
  40. package/dist/cjs/providers/theme/themes.js.map +1 -0
  41. package/dist/index.d.ts +301 -0
  42. package/dist/mjs/components/bar-chart/bar-chart.js +2 -0
  43. package/dist/mjs/components/bar-chart/bar-chart.js.map +1 -0
  44. package/dist/mjs/components/bar-chart/bar-chart.module.scss.js +2 -0
  45. package/dist/mjs/components/bar-chart/bar-chart.module.scss.js.map +1 -0
  46. package/dist/mjs/components/grid-control/grid-control.js +2 -0
  47. package/dist/mjs/components/grid-control/grid-control.js.map +1 -0
  48. package/dist/mjs/components/grid-control/grid-control.module.scss.js +2 -0
  49. package/dist/mjs/components/grid-control/grid-control.module.scss.js.map +1 -0
  50. package/dist/mjs/components/legend/base-legend.js +2 -0
  51. package/dist/mjs/components/legend/base-legend.js.map +1 -0
  52. package/dist/mjs/components/legend/legend.module.scss.js +2 -0
  53. package/dist/mjs/components/legend/legend.module.scss.js.map +1 -0
  54. package/dist/mjs/components/line-chart/line-chart.js +2 -0
  55. package/dist/mjs/components/line-chart/line-chart.js.map +1 -0
  56. package/dist/mjs/components/line-chart/line-chart.module.scss.js +2 -0
  57. package/dist/mjs/components/line-chart/line-chart.module.scss.js.map +1 -0
  58. package/dist/mjs/components/pie-chart/pie-chart.js +2 -0
  59. package/dist/mjs/components/pie-chart/pie-chart.js.map +1 -0
  60. package/dist/mjs/components/pie-chart/pie-chart.module.scss.js +2 -0
  61. package/dist/mjs/components/pie-chart/pie-chart.module.scss.js.map +1 -0
  62. package/dist/mjs/components/pie-semi-circle-chart/pie-semi-circle-chart.js +2 -0
  63. package/dist/mjs/components/pie-semi-circle-chart/pie-semi-circle-chart.js.map +1 -0
  64. package/dist/mjs/components/pie-semi-circle-chart/pie-semi-circle-chart.module.scss.js +2 -0
  65. package/dist/mjs/components/pie-semi-circle-chart/pie-semi-circle-chart.module.scss.js.map +1 -0
  66. package/dist/mjs/components/shared/with-responsive.js +2 -0
  67. package/dist/mjs/components/shared/with-responsive.js.map +1 -0
  68. package/dist/mjs/components/tooltip/base-tooltip.js +2 -0
  69. package/dist/mjs/components/tooltip/base-tooltip.js.map +1 -0
  70. package/dist/mjs/components/tooltip/base-tooltip.module.scss.js +2 -0
  71. package/dist/mjs/components/tooltip/base-tooltip.module.scss.js.map +1 -0
  72. package/dist/mjs/hooks/use-chart-mouse-handler.js +2 -0
  73. package/dist/mjs/hooks/use-chart-mouse-handler.js.map +1 -0
  74. package/dist/mjs/index.css +1 -0
  75. package/dist/mjs/index.js +2 -3
  76. package/dist/mjs/index.js.map +1 -1
  77. package/dist/mjs/providers/theme/theme-provider.js +2 -0
  78. package/dist/mjs/providers/theme/theme-provider.js.map +1 -0
  79. package/dist/mjs/providers/theme/themes.js +2 -0
  80. package/dist/mjs/providers/theme/themes.js.map +1 -0
  81. package/global.d.ts +14 -0
  82. package/package.json +29 -8
  83. package/rollup.config.mjs +77 -0
  84. package/src/components/line-chart/line-chart.tsx +50 -15
  85. package/src/components/pie-chart/__tests__/pie-chart.test.tsx +59 -0
  86. package/src/components/pie-chart/pie-chart.tsx +91 -6
  87. package/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx +19 -12
  88. package/src/components/shared/with-responsive.tsx +4 -3
  89. package/src/types.ts +25 -0
  90. package/tests/jest.config.cjs +12 -0
  91. package/tests/jest.setup.js +13 -0
  92. package/dist/cjs/components/bar-chart/index.js +0 -3
  93. package/dist/cjs/components/bar-chart/index.js.LICENSE.txt +0 -9
  94. package/dist/cjs/components/bar-chart/index.js.map +0 -1
  95. package/dist/cjs/components/bar-chart/style.css +0 -6
  96. package/dist/cjs/components/bar-chart/style.css.map +0 -1
  97. package/dist/cjs/components/grid-control/index.js +0 -3
  98. package/dist/cjs/components/grid-control/index.js.LICENSE.txt +0 -9
  99. package/dist/cjs/components/grid-control/index.js.map +0 -1
  100. package/dist/cjs/components/grid-control/style.css +0 -3
  101. package/dist/cjs/components/grid-control/style.css.map +0 -1
  102. package/dist/cjs/components/legend/index.js +0 -3
  103. package/dist/cjs/components/legend/index.js.LICENSE.txt +0 -9
  104. package/dist/cjs/components/legend/index.js.map +0 -1
  105. package/dist/cjs/components/legend/style.css +0 -3
  106. package/dist/cjs/components/legend/style.css.map +0 -1
  107. package/dist/cjs/components/line-chart/index.js +0 -3
  108. package/dist/cjs/components/line-chart/index.js.LICENSE.txt +0 -9
  109. package/dist/cjs/components/line-chart/index.js.map +0 -1
  110. package/dist/cjs/components/line-chart/style.css +0 -4
  111. package/dist/cjs/components/line-chart/style.css.map +0 -1
  112. package/dist/cjs/components/pie-chart/index.js +0 -3
  113. package/dist/cjs/components/pie-chart/index.js.LICENSE.txt +0 -9
  114. package/dist/cjs/components/pie-chart/index.js.map +0 -1
  115. package/dist/cjs/components/pie-chart/style.css +0 -5
  116. package/dist/cjs/components/pie-chart/style.css.map +0 -1
  117. package/dist/cjs/components/pie-semi-circle-chart/index.js +0 -3
  118. package/dist/cjs/components/pie-semi-circle-chart/index.js.LICENSE.txt +0 -9
  119. package/dist/cjs/components/pie-semi-circle-chart/index.js.map +0 -1
  120. package/dist/cjs/components/pie-semi-circle-chart/style.css +0 -5
  121. package/dist/cjs/components/pie-semi-circle-chart/style.css.map +0 -1
  122. package/dist/cjs/components/tooltip/index.js +0 -3
  123. package/dist/cjs/components/tooltip/index.js.LICENSE.txt +0 -9
  124. package/dist/cjs/components/tooltip/index.js.map +0 -1
  125. package/dist/cjs/components/tooltip/style.css +0 -3
  126. package/dist/cjs/components/tooltip/style.css.map +0 -1
  127. package/dist/cjs/index.js.LICENSE.txt +0 -9
  128. package/dist/cjs/package.json +0 -3
  129. package/dist/cjs/providers/theme/index.js +0 -3
  130. package/dist/cjs/providers/theme/index.js.LICENSE.txt +0 -9
  131. package/dist/cjs/providers/theme/index.js.map +0 -1
  132. package/dist/cjs/style.css +0 -9
  133. package/dist/cjs/style.css.map +0 -1
  134. package/dist/mjs/components/bar-chart/index.js +0 -3
  135. package/dist/mjs/components/bar-chart/index.js.LICENSE.txt +0 -9
  136. package/dist/mjs/components/bar-chart/index.js.map +0 -1
  137. package/dist/mjs/components/bar-chart/style.css +0 -6
  138. package/dist/mjs/components/bar-chart/style.css.map +0 -1
  139. package/dist/mjs/components/grid-control/index.js +0 -3
  140. package/dist/mjs/components/grid-control/index.js.LICENSE.txt +0 -9
  141. package/dist/mjs/components/grid-control/index.js.map +0 -1
  142. package/dist/mjs/components/grid-control/style.css +0 -3
  143. package/dist/mjs/components/grid-control/style.css.map +0 -1
  144. package/dist/mjs/components/legend/index.js +0 -3
  145. package/dist/mjs/components/legend/index.js.LICENSE.txt +0 -9
  146. package/dist/mjs/components/legend/index.js.map +0 -1
  147. package/dist/mjs/components/legend/style.css +0 -3
  148. package/dist/mjs/components/legend/style.css.map +0 -1
  149. package/dist/mjs/components/line-chart/index.js +0 -3
  150. package/dist/mjs/components/line-chart/index.js.LICENSE.txt +0 -9
  151. package/dist/mjs/components/line-chart/index.js.map +0 -1
  152. package/dist/mjs/components/line-chart/style.css +0 -4
  153. package/dist/mjs/components/line-chart/style.css.map +0 -1
  154. package/dist/mjs/components/pie-chart/index.js +0 -3
  155. package/dist/mjs/components/pie-chart/index.js.LICENSE.txt +0 -9
  156. package/dist/mjs/components/pie-chart/index.js.map +0 -1
  157. package/dist/mjs/components/pie-chart/style.css +0 -5
  158. package/dist/mjs/components/pie-chart/style.css.map +0 -1
  159. package/dist/mjs/components/pie-semi-circle-chart/index.js +0 -3
  160. package/dist/mjs/components/pie-semi-circle-chart/index.js.LICENSE.txt +0 -9
  161. package/dist/mjs/components/pie-semi-circle-chart/index.js.map +0 -1
  162. package/dist/mjs/components/pie-semi-circle-chart/style.css +0 -5
  163. package/dist/mjs/components/pie-semi-circle-chart/style.css.map +0 -1
  164. package/dist/mjs/components/tooltip/index.js +0 -3
  165. package/dist/mjs/components/tooltip/index.js.LICENSE.txt +0 -9
  166. package/dist/mjs/components/tooltip/index.js.map +0 -1
  167. package/dist/mjs/components/tooltip/style.css +0 -3
  168. package/dist/mjs/components/tooltip/style.css.map +0 -1
  169. package/dist/mjs/index.js.LICENSE.txt +0 -9
  170. package/dist/mjs/package.json +0 -3
  171. package/dist/mjs/providers/theme/index.js +0 -3
  172. package/dist/mjs/providers/theme/index.js.LICENSE.txt +0 -9
  173. package/dist/mjs/providers/theme/index.js.map +0 -1
  174. package/dist/mjs/style.css +0 -9
  175. package/dist/mjs/style.css.map +0 -1
  176. package/dist/types/components/bar-chart/bar-chart.d.ts +0 -5
  177. package/dist/types/components/bar-chart/index.d.ts +0 -1
  178. package/dist/types/components/grid-control/grid-control.d.ts +0 -4
  179. package/dist/types/components/grid-control/index.d.ts +0 -1
  180. package/dist/types/components/legend/base-legend.d.ts +0 -3
  181. package/dist/types/components/legend/index.d.ts +0 -2
  182. package/dist/types/components/legend/types.d.ts +0 -12
  183. package/dist/types/components/line-chart/index.d.ts +0 -1
  184. package/dist/types/components/line-chart/line-chart.d.ts +0 -11
  185. package/dist/types/components/pie-chart/index.d.ts +0 -1
  186. package/dist/types/components/pie-chart/pie-chart.d.ts +0 -9
  187. package/dist/types/components/pie-semi-circle-chart/index.d.ts +0 -1
  188. package/dist/types/components/pie-semi-circle-chart/pie-semi-circle-chart.d.ts +0 -22
  189. package/dist/types/components/shared/with-responsive.d.ts +0 -17
  190. package/dist/types/components/tooltip/base-tooltip.d.ts +0 -29
  191. package/dist/types/components/tooltip/index.d.ts +0 -2
  192. package/dist/types/hooks/use-chart-mouse-handler.d.ts +0 -41
  193. package/dist/types/index.d.ts +0 -8
  194. package/dist/types/providers/theme/index.d.ts +0 -2
  195. package/dist/types/providers/theme/theme-provider.d.ts +0 -18
  196. package/dist/types/providers/theme/themes.d.ts +0 -14
  197. package/dist/types/types.d.ts +0 -137
  198. package/tools/fixup.sh +0 -11
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ 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.5.0] - 2025-01-22
9
+ ### Changed
10
+ - Simplify rollup config and remove a cjs import [#41266]
11
+
12
+ ## [0.4.0] - 2025-01-22
13
+ ### Added
14
+ - Added passing through options for X, Y axis [#41109]
15
+ - Add gradient fill for line chart [#41143]
16
+ - Charts: add responsive chart stories [#41018]
17
+ - Charts: adds dependencies and config for jest testing. Adds some initial tests to pie chart component [#41148]
18
+ - Charts: adds more pie chart tests [#41175]
19
+
20
+ ### Changed
21
+ - Changed back to build with Rollup [#41234]
22
+ - Introduce gapScale and cornerScale properties [#41033]
23
+ - PieChart: iterate a bit over component API [#40993]
24
+
8
25
  ## [0.3.0] - 2025-01-12
9
26
  ### Changed
10
27
  - make charts responsive [#40922]
@@ -54,6 +71,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
54
71
  - Fixed lints following ESLint rule changes for TS [#40584]
55
72
  - Fixing a bug in Chart storybook data. [#40640]
56
73
 
74
+ [0.5.0]: https://github.com/Automattic/charts/compare/v0.4.0...v0.5.0
75
+ [0.4.0]: https://github.com/Automattic/charts/compare/v0.3.0...v0.4.0
57
76
  [0.3.0]: https://github.com/Automattic/charts/compare/v0.2.3...v0.3.0
58
77
  [0.2.3]: https://github.com/Automattic/charts/compare/v0.2.2...v0.2.3
59
78
  [0.2.2]: https://github.com/Automattic/charts/compare/v0.2.1...v0.2.2
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@visx/axis"),i=require("@visx/event"),a=require("@visx/group"),r=require("@visx/scale"),l=require("@visx/shape"),o=require("@visx/tooltip"),s=require("clsx"),n=require("react"),d=require("../../providers/theme/theme-provider.js"),h=require("../grid-control/grid-control.js"),c=require("../legend/base-legend.js"),p=require("../shared/with-responsive.js"),u=require("../tooltip/base-tooltip.js"),x=require("./bar-chart.module.scss.js");const m=({data:p,margin:m={top:20,right:20,bottom:40,left:40},withTooltips:v=!1,showLegend:g=!1,legendOrientation:b="horizontal",className:j,gridVisibility:q="x",width:f,height:w=400})=>{const y=d.useChartTheme(),{tooltipOpen:L,tooltipLeft:T,tooltipTop:B,tooltipData:M,hideTooltip:N,showTooltip:C}=o.useTooltip(),S=n.useCallback(((e,t,a,r,l)=>{const o=i.localPoint(e);o&&C({tooltipData:{value:t,xLabel:a,yLabel:r,seriesIndex:l},tooltipLeft:o.x,tooltipTop:o.y-10})}),[C]),k=n.useCallback((()=>{N()}),[N]);if(!p?.length)return e.jsx("div",{className:s("bar-chart-empty",x["bat-chart-empty"]),children:"Empty..."});const A=m,D=f-A.left-A.right,G=w-A.top-A.bottom,O=p[0].data?.map((e=>e?.label||"")),V=r.scaleBand({range:[0,D],domain:O,padding:.2}),$=r.scaleBand({range:[0,V.bandwidth()],domain:p.map(((e,t)=>t.toString())),padding:.1}),z=r.scaleLinear({range:[G,0],domain:[0,Math.max(...p.map((e=>Math.max(...e.data.map((e=>e?.value||0))))))]}),E=p.map(((e,t)=>({label:e.label,value:"",color:y.colors[t%y.colors.length]})));return e.jsxs("div",{className:s("bar-chart",j,x["bar-chart"]),children:[e.jsx("svg",{width:f,height:w,children:e.jsxs(a.Group,{left:A.left,top:A.top,children:[e.jsx(h,{width:D,height:G,xScale:V,yScale:z,gridVisibility:q}),p.map(((t,i)=>e.jsx(a.Group,{children:t.data.map((a=>{const r=V(a?.label||"");if(void 0===r)return null;const o=$.bandwidth(),s=r+($(i.toString())??0);return e.jsx(l.Bar,{x:s,y:z(a.value),width:o,height:G-(z(a.value)??0),fill:y.colors[i%y.colors.length],onMouseMove:v?e=>S(e,a.value,a?.label||"",t.label,i):void 0,onMouseLeave:v?k:void 0},`bar-${i}-${a.label}`)}))},i))),e.jsx(t.AxisLeft,{scale:z}),e.jsx(t.AxisBottom,{scale:V,top:G})]})}),v&&L&&M&&e.jsx(u.BaseTooltip,{top:B||0,left:T||0,children:e.jsxs("div",{children:[e.jsx("div",{children:M.yLabel}),e.jsxs("div",{children:[M.xLabel,": ",M.value]})]})}),g&&e.jsx(c.BaseLegend,{items:E,orientation:b,className:x["bar-chart-legend"]})]})};m.displayName="BarChart";var v=p.withResponsive(m);module.exports=v;
2
+ //# sourceMappingURL=bar-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bar-chart.js","sources":["/@automattic/charts/../../../../src/components/bar-chart/bar-chart.tsx"],"sourcesContent":[null],"names":["BarChart","data","margin","top","right","bottom","left","withTooltips","showLegend","legendOrientation","className","gridVisibility","width","height","theme","useChartTheme","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","handleMouseMove","useCallback","event","value","xLabel","yLabel","seriesIndex","coords","localPoint","x","y","handleMouseLeave","length","_jsx","clsx","styles","margins","xMax","yMax","labels","map","d","label","xScale","scaleBand","range","domain","padding","innerScale","bandwidth","_","i","toString","yScale","scaleLinear","Math","max","series","legendItems","group","index","color","colors","_jsxs","jsxs","children","Group","GridControl","jsx","xPos","undefined","barWidth","barX","Bar","fill","onMouseMove","onMouseLeave","AxisLeft","scale","AxisBottom","BaseTooltip","Legend","BaseLegend","items","orientation","displayName","withResponsive"],"mappings":"8eAyBA,MAAMA,EAAgC,EACrCC,OACAC,SAAS,CAAEC,IAAK,GAAIC,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AeG,GAChCiB,EAAAA,IAAC+C,EAAAA,YAAY,CAAAhF,IAAMe,GAAc,EAAIZ,KAAOW,GAAe,WAC1DiD,EACCC,KAAA,MAAA,CAAAC,SAAA,CAAAhC,EAAAA,IAAA,MAAA,CAAAgC,SAAOjD,EAAYS,SACnBsC,EAAAC,KAAA,MAAA,CAAAC,SAAA,CACGjD,EAAYQ,YAAYR,EAAYO,cAMxClB,GACD4B,EAAAmC,IAACa,EAAMC,WACN,CAAAC,MAAQzB,EACR0B,YAAc9E,EACdC,UAAY4B,EAAQ,wBAItB,EAGHtC,EAASwF,YAAc,WACvB,IAAeC,EAAAA,EAAAA,eAAiCzF"}
@@ -0,0 +1,2 @@
1
+ "use strict";module.exports={"bar-chart":"bar-chart-module_bar-chart__lmYNi","bar-chart-legend":"bar-chart-module_bar-chart-legend__vgKKq"};
2
+ //# sourceMappingURL=bar-chart.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bar-chart.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var r=require("react/jsx-runtime"),e=require("@visx/grid");require("react");var i=require("./grid-control.module.scss.js");module.exports=({width:s,height:t,xScale:l,yScale:c,gridVisibility:a="x",top:d=0})=>r.jsxs("g",{transform:`translate(0, ${d})`,className:i["grid-control"],children:[a.includes("x")&&r.jsx(e.GridRows,{scale:l,width:s}),a.includes("y")&&r.jsx(e.GridColumns,{scale:c,height:t})]});
2
+ //# sourceMappingURL=grid-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-control.js","sources":["/@automattic/charts/../../../../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":"uJAK2C,EAC1CA,QACAC,SACAC,SACAC,SACAC,iBAAiB,IACjBC,MAAM,KAGLC,EAAAA,KAAG,IAAA,CAAAC,UAAY,gBAAiBF,KAAUG,UAAYC,EAAQ,gBAAgBC,SAAA,CAC3EN,EAAeO,SAAU,MAASC,MAACC,EAAAA,SAAQ,CAACC,MAAQZ,EAASF,MAAQA,IACrEI,EAAeO,SAAU,MAASC,MAACG,EAAWA,YAAA,CAACD,MAAQX,EAASF,OAASA"}
@@ -0,0 +1,2 @@
1
+ "use strict";module.exports={"grid-control":"grid-control-module_grid-control__KOnZN"};
2
+ //# sourceMappingURL=grid-control.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-control.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),l=require("@visx/legend"),s=require("@visx/scale"),a=require("clsx");require("react");var i=require("./legend.module.scss.js");const r={horizontal:"row",vertical:"column"};exports.BaseLegend=({items:t,className:n,orientation:c="horizontal"})=>{const d=s.scaleOrdinal({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e.jsx("div",{className:a(i.legend,i[`legend--${c}`],n),role:"list",children:e.jsx(l.LegendOrdinal,{scale:d,direction:r[c],shape:"rect",shapeWidth:16,shapeHeight:16,className:i["legend-items"],children:l=>e.jsx("div",{className:i[`legend--${c}`],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=base-legend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-legend.js","sources":["/@automattic/charts/../../../../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":"+KAeA,MAAMA,EAA6B,CAClCC,WAAY,MACZC,SAAU,6BAGkC,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"}
@@ -0,0 +1,2 @@
1
+ "use strict";module.exports={"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"};
2
+ //# sourceMappingURL=legend.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legend.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@visx/gradient"),r=require("@visx/xychart"),a=require("clsx");require("react");var i=require("../../providers/theme/theme-provider.js"),s=require("../legend/base-legend.js"),o=require("../shared/with-responsive.js"),l=require("./line-chart.module.scss.js");const n=({tooltipData:t})=>{const r=t?.nearestDatum?.datum;if(!r)return null;const a=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:l["line-chart__tooltip"],children:[e.jsx("div",{className:l["line-chart__tooltip-date"],children:r.date.toLocaleDateString()}),a.map((t=>e.jsxs("div",{className:l["line-chart__tooltip-row"],children:[e.jsxs("span",{className:l["line-chart__tooltip-label"],children:[t.key,":"]}),e.jsx("span",{className:l["line-chart__tooltip-value"],children:t.value})]},t.key)))]})},c=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"});var d=o.withResponsive((({data:o,width:d,height:h,margin:m={top:20,right:20,bottom:40,left:40},className:u,withTooltips:p=!0,showLegend:g=!1,legendOrientation:x="horizontal",withGradientFill:j=!1,options:v={}})=>{const y=i.useChartTheme();if(!o?.length)return e.jsx("div",{className:a("line-chart-empty",l["line-chart-empty"]),children:"Empty..."});const k=o.map(((e,t)=>({label:e.label,value:"",color:y.colors[t%y.colors.length]}))),b={xAccessor:e=>e.date,yAccessor:e=>e.value},T=r.buildChartTheme({backgroundColor:y.backgroundColor,colors:y.colors,gridStyles:y.gridStyles,tickLength:y?.tickLength||0,gridColor:y?.gridColor||"",gridColorDark:y?.gridColorDark||""});return e.jsxs("div",{className:a("line-chart",l["line-chart"],u),children:[e.jsxs(r.XYChart,{theme:T,width:d,height:h,margin:m,xScale:{type:"time"},yScale:{type:"linear",nice:!0},children:[e.jsx(r.AnimatedGrid,{columns:!1,numTicks:4}),e.jsx(r.AnimatedAxis,{orientation:"bottom",numTicks:5,tickFormat:c,...v?.axis?.x}),e.jsx(r.AnimatedAxis,{orientation:"left",numTicks:4,...v?.axis?.y}),o.map(((a,i)=>{const s=a.options?.stroke??T.colors[i%T.colors.length];return e.jsxs(e.Fragment,{children:[e.jsx(t.LinearGradient,{id:`area-gradient-${i+1}`,from:s,to:"white",toOpacity:.1,...a.options?.gradient}),e.jsx(r.AnimatedLineSeries,{dataKey:a?.label,data:a.data,...b,stroke:s,strokeWidth:2},a?.label),j&&e.jsx(r.AnimatedAreaSeries,{dataKey:a?.label,data:a.data,...b,stroke:s,strokeWidth:0,fill:`url(#area-gradient-${i+1})`,renderLine:!1},a?.label)]})})),p&&e.jsx(r.Tooltip,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:n})]}),g&&e.jsx(s.BaseLegend,{items:k,orientation:x,className:l["line-chart-legend"]})]})}));module.exports=d;
2
+ //# sourceMappingURL=line-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-chart.js","sources":["/@automattic/charts/../../../../src/components/line-chart/line-chart.tsx"],"sourcesContent":[null],"names":["renderTooltip","tooltipData","nearestDatum","datum","tooltipPoints","Object","entries","datumByKey","map","key","value","sort","a","b","_jsxs","jsxs","className","styles","children","_jsx","date","toLocaleDateString","point","formatDateTick","Date","undefined","month","day","withResponsive","data","width","height","margin","top","right","bottom","left","withTooltips","showLegend","legendOrientation","withGradientFill","options","providerTheme","useChartTheme","length","clsx","legendItems","group","index","label","color","colors","accessors","xAccessor","d","yAccessor","theme","buildChartTheme","backgroundColor","gridStyles","tickLength","gridColor","gridColorDark","XYChart","xScale","type","yScale","nice","jsx","AnimatedGrid","columns","numTicks","AnimatedAxis","orientation","tickFormat","axis","x","y","seriesData","stroke","_Fragment","LinearGradient","id","from","to","toOpacity","gradient","AnimatedLineSeries","dataKey","strokeWidth","AnimatedAreaSeries","fill","renderLine","Tooltip","snapTooltipToDatumX","snapTooltipToDatumY","showSeriesGlyphs","Legend","items"],"mappings":"4TAiCA,MAAMA,EAAgB,EACrBC,kBAUA,MAAMC,EAAeD,GAAaC,cAAcC,MAChD,IAAOD,EAAe,OAAO,KAE7B,MAAME,EAAgCC,OAAOC,QAASL,GAAaM,YAAc,CAAA,GAC/EC,KAAK,EAAIC,GAAON,aAAiB,CACjCM,MACAC,MAAOP,EAAMO,UAEbC,MAAM,CAAEC,EAAGC,IAAOA,EAAEH,MAAQE,EAAEF,QAEhC,OACCI,EAAKC,KAAA,MAAA,CAAAC,UAAYC,EAAQ,uBACxBC,SAAA,CAAAC,EAAAA,IAAA,MAAA,CAAKH,UAAYC,EAAQ,4BACtBC,SAAAhB,EAAakB,KAAKC,uBAEnBjB,EAAcI,KAAKc,GACpBR,EAAAC,KAAA,MAAA,CAAuBC,UAAYC,EAAQ,2BAC1CC,SAAA,CAAAJ,EAAAC,KAAA,OAAA,CAAMC,UAAYC,EAAQ,6BAA6BC,SAAA,CAAKI,EAAMb,IAAa,OAC/EU,EAAAA,YAAMH,UAAYC,EAAQ,6BAA6BC,SAAKI,EAAMZ,UAFxDY,EAAMb,SAMlB,EAGGc,EAAmBb,GACX,IAAIc,KAAMd,GACXW,wBAAoBI,EAAW,CAC1CC,MAAO,QACPC,IAAK,YA2HP,IAAeC,EAAAA,EAAAA,gBAvHyB,EACvCC,OACAC,QACAC,SACAC,SAAS,CAAEC,IAAK,GAAIC,MAAO,GAAIC,OAAQ,GAAIC,KAAM,IACjDpB,YACAqB,gBAAe,EACfC,cAAa,EACbC,oBAAoB,aACpBC,oBAAmB,EACnBC,UAAU,CAAE,MAEZ,MAAMC,EAAgBC,EAAAA,gBAEtB,IAAOd,GAAMe,OACZ,OACCzB,MAAA,MAAA,CAAKH,UAAY6B,EAAM,mBAAoB5B,EAAQ,qBAAsBC,SAA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,MAACoE,EAAAA,mBAEA,CAAAC,QAAUV,GAAY7B,MACtBpB,KAAOiD,EAAWjD,QACbuB,EACL2B,OAASA,EACTU,YAAc,GALRX,GAAY7B,OASjBT,GACDrB,EAAAiD,IAACsB,EAAkBA,mBAAA,CAElBF,QAAUV,GAAY7B,MACtBpB,KAAOiD,EAAWjD,QACbuB,EACL2B,OAASA,EACTU,YAAc,EACdE,KAAO,sBAAuB3C,EAAQ,KACtC4C,YAAa,GAPPd,GAAY7B,SAWpB,IAGDZ,GACDlB,EAAAA,IAAC0E,EAAAA,SACAC,qBAAmB,EACnBC,qBACA,EAAAC,oBACAhG,cAAgBA,OAKjBsC,GACDnB,EAAAA,IAAC8E,EAAAA,WACA,CAAAC,MAAQpD,EACR2B,YAAclC,EACdvB,UAAYC,EAAQ,yBAItB"}
@@ -0,0 +1,2 @@
1
+ "use strict";module.exports={"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"};
2
+ //# sourceMappingURL=line-chart.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-chart.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),a=require("@visx/group"),s=require("@visx/shape"),r=require("clsx");require("react");var t=require("../../hooks/use-chart-mouse-handler.js"),i=require("../../providers/theme/theme-provider.js"),l=require("../../providers/theme/themes.js"),o=require("../legend/base-legend.js"),n=require("../shared/with-responsive.js"),d=require("../tooltip/base-tooltip.js"),c=require("./pie-chart.module.scss.js");const u=({data:n,withTooltips:u=!1,className:p,showLegend:h,legendOrientation:m,size:v,thickness:g=1,padding:x=20,gapScale:j=0,cornerScale:f=0})=>{const q=i.useChartTheme(),{onMouseMove:M,onMouseLeave:b,tooltipOpen:N,tooltipData:w,tooltipLeft:T,tooltipTop:V}=t({withTooltips:u}),{isValid:A,message:B}=(e=>{if(!e.length)return{isValid:!1,message:"No data available"};if(e.some((e=>e.percentage<0||e.value<0)))return{isValid:!1,message:"Invalid data: Negative values are not allowed"};const a=e.reduce(((e,a)=>e+a.percentage),0);return Math.abs(a-100)>.01?{isValid:!1,message:"Invalid percentage total: Must equal 100"}:{isValid:!0,message:""}})(n);if(!A)return e.jsx("div",{className:r("pie-chart",c["pie-chart"],p),children:e.jsx("div",{className:c["error-message"],children:B})});const L=v,R=v,k=Math.min(L,R)/2,y=L/2,C=R/2,S=j*(2*Math.PI/n.length),I=k-x,P=I*(1-g),$=(I-P)/2,z=f?Math.min(f*I,$):0,O=n.map(((e,a)=>({...e,index:a}))),D={value:e=>e.value,fill:e=>e?.color||q.colors[e.index]},E=n.map(((e,a)=>({label:e.label,value:e.value.toString(),color:q.colors[a%q.colors.length]})));return e.jsxs("div",{className:r("pie-chart",c["pie-chart"],p),children:[e.jsx("svg",{viewBox:`0 0 ${v} ${v}`,preserveAspectRatio:"xMidYMid meet",children:e.jsx(a.Group,{top:C,left:y,children:e.jsx(s.Pie,{data:O,pieValue:D.value,outerRadius:I,innerRadius:P,padAngle:S,cornerRadius:z,children:a=>a.arcs.map(((s,r)=>{const[t,i]=a.path.centroid(s),o=s.endAngle-s.startAngle>=.25,n=e=>M(e,s.data),d={d:a.path(s)||"",fill:D.fill(s.data)};return u&&(d.onMouseMove=n,d.onMouseLeave=b),e.jsxs("g",{children:[e.jsx("path",{...d}),o&&e.jsx("text",{x:t,y:i,dy:".33em",fill:q.labelBackgroundColor||l.defaultTheme.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none",children:s.data.label})]},`arc-${r}`)}))})})}),h&&e.jsx(o.BaseLegend,{items:E,orientation:m,className:c["pie-chart-legend"]}),u&&N&&w&&e.jsx(d.BaseTooltip,{data:w,top:V||0,left:T||0,style:{transform:"translate(-50%, -100%)"}})]})};u.displayName="PieChart";var p=n.withResponsive(u);module.exports=p;
2
+ //# sourceMappingURL=pie-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pie-chart.js","sources":["/@automattic/charts/../../../../src/components/pie-chart/pie-chart.tsx"],"sourcesContent":[null],"names":["PieChart","data","withTooltips","className","showLegend","legendOrientation","size","thickness","padding","gapScale","cornerScale","providerTheme","useChartTheme","onMouseMove","onMouseLeave","tooltipOpen","tooltipData","tooltipLeft","tooltipTop","useChartMouseHandler","isValid","message","length","some","item","percentage","value","totalPercentage","reduce","sum","Math","abs","validateData","_jsx","jsx","clsx","styles","children","width","height","radius","min","centerX","centerY","padAngle","PI","outerRadius","innerRadius","maxCornerRadius","cornerRadius","dataWithIndex","map","d","index","accessors","fill","color","colors","legendItems","label","toString","_jsxs","viewBox","preserveAspectRatio","Group","top","left","Pie","pieValue","pie","arcs","arc","centroidX","centroidY","path","centroid","hasSpaceForLabel","endAngle","startAngle","handleMouseMove","event","pathProps","jsxs","x","y","dy","labelBackgroundColor","defaultTheme","fontSize","textAnchor","pointerEvents","Legend","items","orientation","BaseTooltip","style","transform","displayName","withResponsive"],"mappings":"+bAyDA,MA2BMA,EAAW,EAChBC,OACAC,gBAAe,EACfC,YACAC,aACAC,oBACAC,OACAC,YAAY,EACZC,UAAU,GACVC,WAAW,EACXC,cAAc,MAEd,MAAMC,EAAgBC,EAAAA,iBAChBC,YAAEA,EAAWC,aAAEA,EAAYC,YAAEA,EAAWC,YAAEA,EAAWC,YAAEA,EAAWC,WAAEA,GACzEC,EAAsB,CACrBjB,kBAGIkB,QAAEA,EAAOC,QAAEA,GA7CG,CAAEpB,IACtB,IAAOA,EAAKqB,OACX,MAAO,CAAEF,SAAS,EAAOC,QAAS,qBAKnC,GAD0BpB,EAAKsB,MAAMC,GAAQA,EAAKC,WAAa,GAAKD,EAAKE,MAAQ,IAEhF,MAAO,CAAEN,SAAS,EAAOC,QAAS,iDAIn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.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pie-chart.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),l=require("@visx/event"),i=require("@visx/group"),t=require("@visx/shape"),a=require("@visx/text"),s=require("@visx/tooltip"),r=require("clsx"),o=require("react"),c=require("../../providers/theme/theme-provider.js"),n=require("../legend/base-legend.js"),p=require("../shared/with-responsive.js"),u=require("../tooltip/base-tooltip.js"),d=require("./pie-semi-circle-chart.module.scss.js");const h=({data:p,size:h=500,label:v,note:x,className:m,withTooltips:j=!1,clockwise:g=!0,thickness:q=.4,showLegend:b,legendOrientation:T})=>{const f=c.useChartTheme(),{tooltipOpen:w,tooltipLeft:y,tooltipTop:A,tooltipData:M,hideTooltip:P,showTooltip:C}=s.useTooltip(),N=h/2,k=h/2,D=h/2,L=D*(1-q+.03),I=p.map(((e,l)=>({...e,index:l}))),R=g?-Math.PI/2:Math.PI/2,B=g?Math.PI/2:-Math.PI/2,S={value:e=>e.value,sort:(e,l)=>l.value-e.value,fill:e=>e.color||f.colors[e.index%f.colors.length]},G=o.useCallback(((e,i)=>{const t=l.localPoint(e);t&&C({tooltipData:i.data,tooltipLeft:t.x,tooltipTop:t.y-10})}),[C]),O=o.useCallback((()=>{P()}),[P]),$=o.useCallback((e=>l=>{G(l,e)}),[G]),z=p.map(((e,l)=>({label:e.label,value:e.valueDisplay||e.value.toString(),color:S.fill({...e,index:l})})));return e.jsxs("div",{className:r("pie-semi-circle-chart",d["pie-semi-circle-chart"],m),children:[e.jsx("svg",{viewBox:`0 0 ${h} ${k}`,children:e.jsxs(i.Group,{top:N,left:N,children:[e.jsx(t.Pie,{data:I,pieValue:S.value,outerRadius:D,innerRadius:L,cornerRadius:3,padAngle:.03,startAngle:R,endAngle:B,pieSort:S.sort,children:l=>l.arcs.map((i=>e.jsx("g",{onMouseMove:$(i),onMouseLeave:O,children:e.jsx("path",{d:l.path(i)||"",fill:S.fill(i.data)})},i.data.label)))}),e.jsxs(i.Group,{children:[e.jsx(a.Text,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:d.label,children:v}),e.jsx(a.Text,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:d.note,children:x})]})]})}),j&&w&&M&&e.jsx(u.BaseTooltip,{data:{label:M.label,value:M.value,valueDisplay:M.valueDisplay},top:A||0,left:y||0}),b&&e.jsx(n.BaseLegend,{items:z,orientation:T,className:d["pie-semi-circle-chart-legend"]})]})};h.displayName="PieSemiCircleChart";var v=p.withResponsive(h);module.exports=v;
2
+ //# sourceMappingURL=pie-semi-circle-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pie-semi-circle-chart.js","sources":["/@automattic/charts/../../../../src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx"],"sourcesContent":[null],"names":["PieSemiCircleChart","data","size","label","note","className","withTooltips","clockwise","thickness","showLegend","legendOrientation","providerTheme","useChartTheme","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","centerX","height","radius","innerRadius","dataWithIndex","map","d","index","startAngle","Math","PI","endAngle","accessors","value","sort","a","b","fill","color","colors","length","handleMouseMove","useCallback","event","arc","coords","localPoint","x","y","handleMouseLeave","handleArcMouseMove","legendItems","item","valueDisplay","toString","_jsxs","clsx","styles","children","_jsx","viewBox","Group","top","left","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","jsx","path","Text","textAnchor","verticalAnchor","BaseTooltip","Legend","items","orientation","displayName","withResponsive"],"mappings":"obA2CA,MAAMA,EAAoD,EACzDC,OACAC,OAAO,IACPC,QACAC,OACAC,YACAC,gBAAe,EACfC,aAAY,EACZC,YAAY,GACZC,aACAC,wBAEA,MAAMC,EAAgBC,EAAAA,iBAChBC,YAAEA,EAAWC,YAAEA,EAAWC,WAAEA,EAAUC,YAAEA,EAAWC,YAAEA,EAAWC,YAAEA,GAC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,KAAOuB,EACPyC,SAAWjC,EAAUC,MACrBiC,YAAc5C,EACdC,YAAcA,EACd4C,aAAe,EACfC,SAtEO,IAuEPxC,WAAaA,EACbG,SAAWA,EACXsC,QAAUrC,EAAUE,KAElBwB,SAAAY,GACMA,EAAIC,KAAK9C,KAAKmB,GACpBe,EAAAA,IAAA,IAAA,CAECa,YAActB,EAAoBN,GAClC6B,aAAexB,EAAgBS,SAE/BC,EAAMe,IAAA,OAAA,CAAAhD,EAAI4C,EAAIK,KAAM/B,IAAS,GAAKP,KAAOL,EAAUK,KAAMO,EAAI3C,SAJvD2C,EAAI3C,KAAKE,WAUnBoD,OAACM,EAAAA,iBACAF,EAAAA,IAACiB,EAAIA,KACJ,CAAAC,WAAW,SACXC,eAAe,QACf9B,GAAK,GACL3C,UAAYoD,EAAOtD,MAAKuD,SAEtBvD,IAEHwD,EAAAA,IAACiB,EAAIA,KACJ,CAAAC,WAAW,SACXC,eAAe,QACf9B,GAAK,GACL3C,UAAYoD,EAAOrD,KAAIsD,SAErBtD,YAMJE,GAAgBO,GAAeG,GAChC2C,EAAAe,IAACK,cAAW,CACX9E,KAAO,CACNE,MAAOa,EAAYb,MACnB8B,MAAOjB,EAAYiB,MACnBoB,aAAcrC,EAAYqC,cAE3BS,IAAM/C,GAAc,EACpBgD,KAAOjD,GAAe,IAItBL,GACDkD,MAACqB,EAAAA,WACA,CAAAC,MAAQ9B,EACR+B,YAAcxE,EACdL,UAAYoD,EAAQ,oCAItB,EAGHzD,EAAmBmF,YAAc,qBACjC,IAAeC,EAAAA,EAAAA,eAA2CpF"}
@@ -0,0 +1,2 @@
1
+ "use strict";module.exports={"pie-semi-circle-chart":"pie-semi-circle-chart-module_pie-semi-circle-chart__r5jk9","pie-semi-circle-chart-legend":"pie-semi-circle-chart-module_pie-semi-circle-chart-legend__c8W1Y",label:"pie-semi-circle-chart-module_label__nPqOg",note:"pie-semi-circle-chart-module_note__LpBZQ"};
2
+ //# sourceMappingURL=pie-semi-circle-chart.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pie-semi-circle-chart.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),i=require("@visx/responsive");require("react"),exports.withResponsive=function(t,n){const{maxWidth:r=1200,aspectRatio:s=.5,debounceTime:a=50}=n||{};return function(n){const{parentRef:h,width:u}=i.useParentSize({debounceTime:a,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),c=u?Math.min(u,r):600,o=c*s;return e.jsx("div",{ref:h,style:{width:"100%",minHeight:`${o}px`},children:e.jsx(t,{width:c,height:o,size:c,...n})})}};
2
+ //# sourceMappingURL=with-responsive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-responsive.js","sources":["/@automattic/charts/../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[null],"names":["WrappedComponent","config","maxWidth","aspectRatio","debounceTime","props","parentRef","width","parentWidth","useParentSize","enableDebounceLeadingCall","initialSize","height","containerWidth","Math","min","containerHeight","_jsx","jsx","ref","style","minHeight","children","size"],"mappings":"sHAmBgB,SACfA,EACAC,GAEA,MAAMC,SAAEA,EAAW,KAAIC,YAAEA,EAAc,GAAGC,aAAEA,EAAe,IAAOH,GAAU,GAE5E,OAAO,SAA0BI,GAChC,MAAMC,UAAEA,EAAWC,MAAOC,GAAgBC,EAAAA,cAAe,CACxDL,eACAM,2BAA2B,EAC3BC,YAAa,CAAEJ,MAAO,IAAKK,OAAQ,OAI9BC,EAAiBL,EAAcM,KAAKC,IAAKP,EAAaN,GAAa,IACnEc,EAAkBH,EAAiBV,EAEzC,OACCc,EACCC,IAAA,MAAA,CAAAC,IAAMb,EACNc,MAAQ,CACPb,MAAO,OACPc,UAAW,GAAIL,OACfM,SAEDL,MAACjB,EAAgB,CAChBO,MAAQM,EACRD,OAASI,EACTO,KAAOV,KACAR,KAIX,CACD"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),s=require("./base-tooltip.module.scss.js");const t=({data:s})=>e.jsxs(e.Fragment,{children:[s?.label,": ",s?.valueDisplay||s?.value]});exports.BaseTooltip=({data:a,top:l,left:o,component:r=t,children:i,className:c})=>e.jsx("div",{className:s.tooltip,style:{top:l,left:o},role:"tooltip",children:i||a&&e.jsx(r,{data:a,className:c})});
2
+ //# sourceMappingURL=base-tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-tooltip.js","sources":["/@automattic/charts/../../../../src/components/tooltip/base-tooltip.tsx"],"sourcesContent":[null],"names":["DefaultTooltipContent","data","_jsxs","jsxs","_Fragment","Fragment","children","label","valueDisplay","value","top","left","component","Component","className","_jsx","styles","tooltip","style","role","jsx"],"mappings":"2FAmCA,MAAMA,EAAwB,EAAIC,UACjCC,EACGC,KAAAC,EAAAC,SAAA,CAAAC,SAAA,CAAAL,GAAMM,MAAK,KAAMN,GAAMO,cAAgBP,GAAMQ,6BAItB,EAC1BR,OACAS,MACAC,OACAC,UAAWC,EAAYb,EACvBM,WACAQ,eAGCC,MAAK,MAAA,CAAAD,UAAYE,EAAOC,QAAUC,MAAQ,CAAER,MAAKC,QAASQ,KAAK,UAC5Db,SAAAA,GAAcL,GAAQc,EAACK,IAAAP,GAAUZ,KAAOA,EAAOa,UAAYA"}
@@ -0,0 +1,2 @@
1
+ "use strict";module.exports={tooltip:"base-tooltip-module_tooltip__OfX6n"};
2
+ //# sourceMappingURL=base-tooltip.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-tooltip.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var o=require("@visx/event"),t=require("@visx/tooltip"),e=require("react");module.exports=({withTooltips:i})=>{const{tooltipOpen:l,tooltipLeft:p,tooltipTop:a,tooltipData:r,hideTooltip:s,showTooltip:u}=t.useTooltip();return{onMouseMove:e.useCallback(((t,e)=>{if(!i)return;const l=o.localPoint(t);l&&u({tooltipData:e,tooltipLeft:l.x,tooltipTop:l.y-10})}),[i,u]),onMouseLeave:e.useCallback((()=>{i&&s()}),[i,s]),tooltipOpen:l,tooltipData:r||null,tooltipLeft:p,tooltipTop:a}};
2
+ //# sourceMappingURL=use-chart-mouse-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chart-mouse-handler.js","sources":["/@automattic/charts/../../../src/hooks/use-chart-mouse-handler.ts"],"sourcesContent":[null],"names":["withTooltips","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","onMouseMove","useCallback","event","data","coords","localPoint","x","y","onMouseLeave"],"mappings":"uGA6C6B,EAC5BA,mBAEA,MAAMC,YAAEA,EAAWC,YAAEA,EAAWC,WAAEA,EAAUC,YAAEA,EAAWC,YAAEA,EAAWC,YAAEA,GACvEC,EAAAA,aA8BD,MAAO,CACNC,YA5BmBC,EAAAA,aACnB,CAAEC,EAAiCC,KAClC,IAAOX,EACN,OAGD,MAAMY,EAASC,aAAYH,GACpBE,GAIPN,EAAa,CACZF,YAAaO,EACbT,YAAaU,EAAOE,EACpBX,WAAYS,EAAOG,EAAI,IACrB,GAEJ,CAAEf,EAAcM,IAYhBU,aAToBP,EAAAA,aAAa,KAC1BT,GAGPK,GAAa,GACX,CAAEL,EAAcK,IAKlBJ,cACAG,YAAaA,GAAe,KAC5BF,cACAC,aACA"}
@@ -0,0 +1 @@
1
+ .grid-control-module_grid-control__KOnZN .visx-line{stroke:#d7d6d6;stroke-width:1px;shape-rendering:crispEdges}.legend-module_legend--horizontal__IUN13{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px}.legend-module_legend--vertical__Scfzo{display:flex;flex-direction:column;gap:8px}.legend-module_legend-item__feemn{align-items:center;display:flex;font-size:.875rem;gap:8px}.legend-module_legend-item-swatch__nRyXf{border-radius:2px}.legend-module_legend-item-label__ksx6I{align-items:center;color:var(--jp-gray-80,#2c3338);display:flex;gap:.5rem}.legend-module_legend-item-value__d9x1j{font-weight:500}.base-tooltip-module_tooltip__OfX6n{background-color:rgba(0,0,0,.85);border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.1);color:#fff;font-size:14px;padding:.5rem;pointer-events:none;position:absolute;transform:translate(-50%,-100%)}.bar-chart-module_bar-chart__lmYNi{position:relative}.bar-chart-module_bar-chart-legend__vgKKq{margin-top:1rem}.line-chart-module_line-chart__ITM3d{position:relative}.line-chart-module_line-chart__tooltip__aqcme{background:#fff;padding:.5rem}.line-chart-module_line-chart__tooltip-date__4Dzab{font-weight:700;padding-bottom:10px}.line-chart-module_line-chart__tooltip-row__6A37G{align-items:center;display:flex;justify-content:space-between;padding:4px 0}.line-chart-module_line-chart__tooltip-label__IvnFF{font-weight:500;padding-right:1rem}.pie-chart-module_pie-chart__R12Vh{position:relative}.pie-semi-circle-chart-module_pie-semi-circle-chart__r5jk9{position:relative;text-align:center}.pie-semi-circle-chart-module_pie-semi-circle-chart-legend__c8W1Y{margin-top:1rem}.pie-semi-circle-chart-module_pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module_label__nPqOg{font-size:16px;font-weight:600;margin-bottom:0}.pie-semi-circle-chart-module_pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module_note__LpBZQ{font-size:14px;margin-top:0}
package/dist/cjs/index.js CHANGED
@@ -1,3 +1,2 @@
1
- /*! For license information please see index.js.LICENSE.txt */
2
- (()=>{"use strict";var e={572:(e,t,r)=>{var o=r(953),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,a=o.__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 o,i={},s=null,u=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,o)&&!c.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:s,ref:u,props:i,_owner:a.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(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](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 o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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 o={};function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function i(e,t){if(e){if("string"==typeof e)return n(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)?n(e,t):void 0}}function l(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(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(o),r.d(o,{BarChart:()=>q,BaseTooltip:()=>E,Legend:()=>C,LineChart:()=>X,PieChart:()=>Z,PieSemiCircleChart:()=>le,ThemeProvider:()=>P,useChartMouseHandler:()=>U});const a=require("@visx/axis"),c=require("@visx/event"),s=require("@visx/group"),u=require("@visx/scale"),d=require("@visx/shape"),p=require("@visx/tooltip"),h=require("clsx");var v=r.n(h),f=r(953);function m(e){return m="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},m(e)}function b(e,t,r){return(t=function(e){var t=function(e){if("object"!=m(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==m(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var y={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},g=r(48);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function x(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){b(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}var O=(0,f.createContext)(y),w=function(){return(0,f.useContext)(O)},P=function(e){var t=e.theme,r=void 0===t?{}:t,o=e.children,n=x(x({},y),r);return(0,g.jsx)(O.Provider,{value:n,children:o})};const S=require("@visx/grid"),D=function(e){var t=e.width,r=e.height,o=e.xScale,n=e.yScale,i=e.gridVisibility,l=void 0===i?"x":i,a=e.top,c=void 0===a?0:a;return(0,g.jsxs)("g",{transform:"translate(0, ".concat(c,")"),className:"jfpeES0fbFrqCPR8dRN7",children:[l.includes("x")&&(0,g.jsx)(S.GridRows,{scale:o,width:t}),l.includes("y")&&(0,g.jsx)(S.GridColumns,{scale:n,height:r})]})},T=require("@visx/legend"),k={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var L={horizontal:"row",vertical:"column"},C=function(e){var t=e.items,r=e.className,o=e.orientation,n=void 0===o?"horizontal":o,i=(0,u.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return(0,g.jsx)("div",{className:v()(k.legend,k["legend--".concat(n)],r),role:"list",children:(0,g.jsx)(T.LegendOrdinal,{scale:i,direction:L[n],shape:"rect",shapeWidth:16,shapeHeight:16,className:k["legend-items"],children:function(e){return(0,g.jsx)("div",{className:k["legend--".concat(n)],children:e.map((function(e){var r,o;return(0,g.jsxs)("div",{className:k["legend-item"],children:[(0,g.jsx)("svg",{width:16,height:16,children:(0,g.jsx)("rect",{width:16,height:16,fill:e.value,className:k["legend-item-swatch"]})}),(0,g.jsxs)("span",{className:k["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,g.jsx)("span",{className:k["legend-item-value"],children:null===(o=t.find((function(t){return t.label===e.text})))||void 0===o?void 0:o.value})]})]},e.text)}))})}})})};const N=require("@visx/responsive");function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function M(e,t){var r=t||{},o=r.maxWidth,n=void 0===o?1200:o,i=r.aspectRatio,l=void 0===i?.5:i,a=r.debounceTime,c=void 0===a?50:a;return function(t){var r=(0,N.useParentSize)({debounceTime:c,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),o=r.parentRef,i=r.width,a=i?Math.min(i,n):600,s=a*l;return(0,g.jsx)("div",{ref:o,style:{width:"100%",minHeight:"".concat(s,"px")},children:(0,g.jsx)(e,A({width:a,height:s},t))})}}var F=function(e){var t=e.data;return(0,g.jsxs)(g.Fragment,{children:[null==t?void 0:t.label,": ",(null==t?void 0:t.valueDisplay)||(null==t?void 0:t.value)]})},E=function(e){var t=e.data,r=e.top,o=e.left,n=e.component,i=void 0===n?F:n,l=e.children,a=e.className;return(0,g.jsx)("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:r,left:o},role:"tooltip",children:l||t&&(0,g.jsx)(i,{data:t,className:a})})};const R={"bar-chart":"Vm_cn8YnIXBavFt6eHSp","bar-chart-legend":"e4dhKgBP7e6FBRAX2SrP"};var B=function(e){var t,r=e.data,o=e.margin,n=void 0===o?{top:20,right:20,bottom:40,left:40}:o,i=e.withTooltips,h=void 0!==i&&i,m=e.showLegend,b=void 0!==m&&m,y=e.legendOrientation,j=void 0===y?"horizontal":y,x=e.className,O=e.gridVisibility,P=void 0===O?"x":O,S=e.width,T=e.height,k=void 0===T?400:T,L=w(),N=(0,p.useTooltip)(),_=N.tooltipOpen,A=N.tooltipLeft,M=N.tooltipTop,F=N.tooltipData,B=N.hideTooltip,q=N.showTooltip,I=(0,f.useCallback)((function(e,t,r,o,n){var i=(0,c.localPoint)(e);i&&q({tooltipData:{value:t,xLabel:r,yLabel:o,seriesIndex:n},tooltipLeft:i.x,tooltipTop:i.y-10})}),[q]),G=(0,f.useCallback)((function(){B()}),[B]);if(null==r||!r.length)return(0,g.jsx)("div",{className:v()("bar-chart-empty",R["bat-chart-empty"]),children:"Empty..."});var K=n,z=S-K.left-K.right,H=k-K.top-K.bottom,V=null===(t=r[0].data)||void 0===t?void 0:t.map((function(e){return(null==e?void 0:e.label)||""})),W=(0,u.scaleBand)({range:[0,z],domain:V,padding:.2}),X=(0,u.scaleBand)({range:[0,W.bandwidth()],domain:r.map((function(e,t){return t.toString()})),padding:.1}),U=(0,u.scaleLinear)({range:[H,0],domain:[0,Math.max.apply(Math,l(r.map((function(e){return Math.max.apply(Math,l(e.data.map((function(e){return(null==e?void 0:e.value)||0}))))}))))]}),Y=r.map((function(e,t){return{label:e.label,value:"",color:L.colors[t%L.colors.length]}}));return(0,g.jsxs)("div",{className:v()("bar-chart",x,R["bar-chart"]),children:[(0,g.jsx)("svg",{width:S,height:k,children:(0,g.jsxs)(s.Group,{left:K.left,top:K.top,children:[(0,g.jsx)(D,{width:z,height:H,xScale:W,yScale:U,gridVisibility:P}),r.map((function(e,t){return(0,g.jsx)(s.Group,{children:e.data.map((function(r){var o,n,i=W((null==r?void 0:r.label)||"");if(void 0===i)return null;var l=X.bandwidth(),a=i+(null!==(o=X(t.toString()))&&void 0!==o?o:0);return(0,g.jsx)(d.Bar,{x:a,y:U(r.value),width:l,height:H-(null!==(n=U(r.value))&&void 0!==n?n:0),fill:L.colors[t%L.colors.length],onMouseMove:h?function(o){return I(o,r.value,(null==r?void 0:r.label)||"",e.label,t)}:void 0,onMouseLeave:h?G:void 0},"bar-".concat(t,"-").concat(r.label))}))},t)})),(0,g.jsx)(a.AxisLeft,{scale:U}),(0,g.jsx)(a.AxisBottom,{scale:W,top:H})]})}),h&&_&&F&&(0,g.jsx)(E,{top:M||0,left:A||0,children:(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{children:F.yLabel}),(0,g.jsxs)("div",{children:[F.xLabel,": ",F.value]})]})}),b&&(0,g.jsx)(C,{items:Y,orientation:j,className:R["bar-chart-legend"]})]})};B.displayName="BarChart";const q=M(B);function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,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=(o=i.call(r)).done)&&(a.push(o.value),a.length!==t);c=!0);}catch(e){s=!0,n=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw n}}return a}}(e,t)||i(e,t)||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.")}()}const G=require("@visx/xychart"),K={"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 z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V=function(e){var t,r=e.tooltipData,o=null==r||null===(t=r.nearestDatum)||void 0===t?void 0:t.datum;if(!o)return null;var n=Object.entries((null==r?void 0:r.datumByKey)||{}).map((function(e){var t=I(e,2);return{key:t[0],value:t[1].datum.value}})).sort((function(e,t){return t.value-e.value}));return(0,g.jsxs)("div",{className:K["line-chart__tooltip"],children:[(0,g.jsx)("div",{className:K["line-chart__tooltip-date"],children:o.date.toLocaleDateString()}),n.map((function(e){return(0,g.jsxs)("div",{className:K["line-chart__tooltip-row"],children:[(0,g.jsxs)("span",{className:K["line-chart__tooltip-label"],children:[e.key,":"]}),(0,g.jsx)("span",{className:K["line-chart__tooltip-value"],children:e.value})]},e.key)}))]})},W=function(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})};const X=M((function(e){var t=e.data,r=e.width,o=e.height,n=e.margin,i=void 0===n?{top:20,right:20,bottom:40,left:40}:n,l=e.className,a=e.withTooltips,c=void 0===a||a,s=e.showLegend,u=void 0!==s&&s,d=e.legendOrientation,p=void 0===d?"horizontal":d,h=w();if(null==t||!t.length)return(0,g.jsx)("div",{className:v()("line-chart-empty",K["line-chart-empty"]),children:"Empty..."});var f=t.map((function(e,t){return{label:e.label,value:"",color:h.colors[t%h.colors.length]}})),m={xAccessor:function(e){return e.date},yAccessor:function(e){return e.value}},b=(0,G.buildChartTheme)({backgroundColor:h.backgroundColor,colors:h.colors,gridStyles:h.gridStyles,tickLength:(null==h?void 0:h.tickLength)||0,gridColor:(null==h?void 0:h.gridColor)||"",gridColorDark:(null==h?void 0:h.gridColorDark)||""});return(0,g.jsxs)("div",{className:v()("line-chart",K["line-chart"],l),children:[(0,g.jsxs)(G.XYChart,{theme:b,width:r,height:o,margin:i,xScale:{type:"time"},yScale:{type:"linear",nice:!0},children:[(0,g.jsx)(G.AnimatedGrid,{columns:!1,numTicks:4}),(0,g.jsx)(G.AnimatedAxis,{orientation:"bottom",numTicks:5,tickFormat:W}),(0,g.jsx)(G.AnimatedAxis,{orientation:"left",numTicks:4}),t.map((function(e,t){return(0,g.jsx)(G.AnimatedLineSeries,H(H({dataKey:null==e?void 0:e.label,data:e.data},m),{},{stroke:b.colors[t%b.colors.length],strokeWidth:2}),null==e?void 0:e.label)})),c&&(0,g.jsx)(G.Tooltip,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:V})]}),u&&(0,g.jsx)(C,{items:f,orientation:p,className:K["line-chart-legend"]})]})})),U=function(e){var t=e.withTooltips,r=(0,p.useTooltip)(),o=r.tooltipOpen,n=r.tooltipLeft,i=r.tooltipTop,l=r.tooltipData,a=r.hideTooltip,s=r.showTooltip;return{onMouseMove:(0,f.useCallback)((function(e,r){if(t){var o=(0,c.localPoint)(e);o&&s({tooltipData:r,tooltipLeft:o.x,tooltipTop:o.y-10})}}),[t,s]),onMouseLeave:(0,f.useCallback)((function(){t&&a()}),[t,a]),tooltipOpen:o,tooltipData:l||null,tooltipLeft:n,tooltipTop:i}},Y={"pie-chart":"R2Ly_tkJtgL0HA8P3fpm"};function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function Q(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){b(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}var $=function(e){var t=e.data,r=e.width,o=void 0===r?500:r,n=e.height,i=void 0===n?500:n,l=e.withTooltips,a=void 0!==l&&l,c=e.innerRadius,u=void 0===c?0:c,p=e.className,h=e.showLegend,f=e.legendOrientation,m=w(),b=U({withTooltips:a}),j=b.onMouseMove,x=b.onMouseLeave,O=b.tooltipOpen,P=b.tooltipData,S=b.tooltipLeft,D=b.tooltipTop,T=Math.min(o,i)/2,k=o/2,L=i/2,N=t.map((function(e,t){return Q(Q({},e),{},{index:t})})),_={value:function(e){return e.value},fill:function(e){return(null==e?void 0:e.color)||m.colors[e.index]}},A=t.map((function(e,t){return{label:e.label,value:e.value.toString(),color:m.colors[t%m.colors.length]}}));return(0,g.jsxs)("div",{className:v()("pie-chart",Y["pie-chart"],p),children:[(0,g.jsx)("svg",{width:o,height:i,children:(0,g.jsx)(s.Group,{top:L,left:k,children:(0,g.jsx)(d.Pie,{data:N,pieValue:_.value,outerRadius:T-20,innerRadius:u,children:function(e){return e.arcs.map((function(t,r){var o=I(e.path.centroid(t),2),n=o[0],i=o[1],l=t.endAngle-t.startAngle>=.25,c={d:e.path(t)||"",fill:_.fill(t.data)};return a&&(c.onMouseMove=function(e){return j(e,t.data)},c.onMouseLeave=x),(0,g.jsxs)("g",{children:[(0,g.jsx)("path",Q({},c)),l&&(0,g.jsx)("text",{x:n,y:i,dy:".33em",fill:m.labelBackgroundColor||y.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none",children:t.data.label})]},"arc-".concat(r))}))}})})}),h&&(0,g.jsx)(C,{items:A,orientation:f,className:Y["pie-chart-legend"]}),a&&O&&P&&(0,g.jsx)(E,{data:P,top:D||0,left:S||0,style:{transform:"translate(-50%, -100%)"}})]})};$.displayName="PieChart";const Z=M($),ee=require("@visx/shape/lib/shapes/Pie");var te=r.n(ee);const re=require("@visx/text");function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ie=function(e){var t=e.data,r=e.width,o=void 0===r?500:r,n=e.label,i=e.note,l=e.className,a=e.withTooltips,u=void 0!==a&&a,d=e.clockwise,h=void 0===d||d,m=e.thickness,b=void 0===m?.4:m,y=e.showLegend,j=e.legendOrientation,x=w(),O=(0,p.useTooltip)(),P=O.tooltipOpen,S=O.tooltipLeft,D=O.tooltipTop,T=O.tooltipData,k=O.hideTooltip,L=O.showTooltip,N=o/2,_=o/2,A=o/2,M=A*(1-b+.03),F=t.map((function(e,t){return ne(ne({},e),{},{index:t})})),R=h?-Math.PI/2:Math.PI/2,B=h?Math.PI/2:-Math.PI/2,q={value:function(e){return e.value},sort:function(e,t){return t.value-e.value},fill:function(e){return e.color||x.colors[e.index%x.colors.length]}},I=(0,f.useCallback)((function(e,t){var r=(0,c.localPoint)(e);r&&L({tooltipData:t.data,tooltipLeft:r.x,tooltipTop:r.y-10})}),[L]),G=(0,f.useCallback)((function(){k()}),[k]),K=(0,f.useCallback)((function(e){return function(t){I(t,e)}}),[I]),z=t.map((function(e,t){return{label:e.label,value:e.valueDisplay||e.value.toString(),color:q.fill(ne(ne({},e),{},{index:t}))}}));return(0,g.jsxs)("div",{className:v()("pie-semi-circle-chart","oJsjYo330oeLpWqpqf4w",l),children:[(0,g.jsx)("svg",{width:o,height:_,children:(0,g.jsxs)(s.Group,{top:N,left:N,children:[(0,g.jsx)(te(),{data:F,pieValue:q.value,outerRadius:A,innerRadius:M,cornerRadius:3,padAngle:.03,startAngle:R,endAngle:B,pieSort:q.sort,children:function(e){return e.arcs.map((function(t){return(0,g.jsx)("g",{onMouseMove:K(t),onMouseLeave:G,children:(0,g.jsx)("path",{d:e.path(t)||"",fill:q.fill(t.data)})},t.data.label)}))}}),(0,g.jsxs)(s.Group,{children:[(0,g.jsx)(re.Text,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:"bxF3iRlHVJNqwEjRY9QD",children:n}),(0,g.jsx)(re.Text,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:"tA3u0r3RunHmbWFBLrqW",children:i})]})]})}),u&&P&&T&&(0,g.jsx)(E,{data:{label:T.label,value:T.value,valueDisplay:T.valueDisplay},top:D||0,left:S||0}),y&&(0,g.jsx)(C,{items:z,orientation:j,className:"aV40KcaCeoEycQ2crVkB"})]})};ie.displayName="PieSemiCircleChart";const le=M(ie);module.exports=o})();
3
- //# sourceMappingURL=index.js.map
1
+ "use strict";var e=require("./components/bar-chart/bar-chart.js"),r=require("./components/line-chart/line-chart.js"),t=require("./components/pie-chart/pie-chart.js"),s=require("./components/pie-semi-circle-chart/pie-semi-circle-chart.js"),o=require("./components/tooltip/base-tooltip.js"),i=require("./components/legend/base-legend.js"),a=require("./providers/theme/theme-provider.js"),p=require("./hooks/use-chart-mouse-handler.js");exports.BarChart=e,exports.LineChart=r,exports.PieChart=t,exports.PieSemiCircleChart=s,exports.BaseTooltip=o.BaseTooltip,exports.Legend=i.BaseLegend,exports.ThemeProvider=a.ThemeProvider,exports.useChartMouseHandler=p;
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","mappings":";wCASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,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,SAAS1B,EAAE2B,KAAKV,EAAEL,IAAIU,EAAET,IAAIU,EAAEK,MAAMP,EAAEQ,OAAOrB,EAAEsB,QAAQ,CAACC,EAAQC,SAAS7B,EAAE4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B,SAExBiC,KAEH9B,EAAAA,EAAAA,KAACiO,GAAAA,KAAI,CACJb,WAAW,SACXc,eAAe,QACfrH,GAAK,GACLhG,UC3JoJ,uBD2J3HhB,SAEvB0N,YAMJjI,GAAgBQ,GAAeG,IAChCjG,EAAAA,EAAAA,KAACyE,EAAW,CACXH,KAAO,CACNxC,MAAOmE,EAAYnE,MACnB3E,MAAO8I,EAAY9I,MACnBqH,aAAcyB,EAAYzB,cAE3B/D,IAAMuF,GAAc,EACpBrB,KAAOoB,GAAe,IAItBP,IACDxF,EAAAA,EAAAA,KAAC0I,EAAM,CACNpH,MAAQqG,EACRnG,YAAckE,EACd7E,UCnLyF,2BDwL9F,EAEAyM,GAAmB3E,YAAc,qBACjC,SAAe3F,EAA2CsK","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/unsupportedIterableToArray.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/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/../../../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/./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/external commonjs2 \"@visx/responsive\"","webpack://@automattic/charts/./src/components/shared/with-responsive.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss?1d14","webpack://@automattic/charts/./src/components/bar-chart/bar-chart.module.scss?9954","webpack://@automattic/charts/./src/components/bar-chart/bar-chart.tsx","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","webpack://@automattic/charts/external commonjs2 \"@visx/xychart\"","webpack://@automattic/charts/./src/components/line-chart/line-chart.module.scss?db8b","webpack://@automattic/charts/./src/components/line-chart/line-chart.tsx","webpack://@automattic/charts/./src/hooks/use-chart-mouse-handler.ts","webpack://@automattic/charts/./src/components/pie-chart/pie-chart.module.scss?1ca3","webpack://@automattic/charts/./src/components/pie-chart/pie-chart.tsx","webpack://@automattic/charts/external commonjs2 \"@visx/shape/lib/shapes/Pie\"","webpack://@automattic/charts/external commonjs2 \"@visx/text\"","webpack://@automattic/charts/./src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx","webpack://@automattic/charts/./src/components/pie-semi-circle-chart/pie-semi-circle-chart.module.scss?31c2"],"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 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 };","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 };","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\");","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 };","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","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/responsive\");","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","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 arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nexport { _slicedToArray as default };","function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nexport { _arrayWithHoles as default };","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableRest as default };","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/xychart\");","// extracted by mini-css-extract-plugin\nexport default {\"line-chart\":\"vbyo4J2HC_KvyGgsWui7\",\"line-chart__tooltip\":\"nLSohGgB7OyUmLRN_dLD\",\"line-chart__tooltip-date\":\"MGw7UT3IImVKXXuBYmwf\",\"line-chart__tooltip-row\":\"KwvDxit9dbF2E6ZzF29e\",\"line-chart__tooltip-label\":\"WmFS4ekGu9e3G6URbkhd\"};","import {\n\tXYChart,\n\tAnimatedLineSeries,\n\tAnimatedAxis,\n\tAnimatedGrid,\n\tTooltip,\n\tbuildChartTheme,\n} from '@visx/xychart';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport { useChartTheme } from '../../providers/theme/theme-provider';\nimport { Legend } from '../legend';\nimport { withResponsive } from '../shared/with-responsive';\nimport styles from './line-chart.module.scss';\nimport type { BaseChartProps, DataPointDate, SeriesData } from '../../types';\n\n// TODO: revisit grid and axis options - accept as props for frid lines, axis, values: x, y, all, none\n\ninterface LineChartProps extends BaseChartProps< SeriesData[] > {\n\tmargin?: { top: number; right: number; bottom: number; left: number };\n}\n\ntype TooltipData = {\n\tdate: Date;\n\t[ key: string ]: number | Date;\n};\n\ntype TooltipDatum = {\n\tkey: string;\n\tvalue: number;\n};\n\nconst renderTooltip = ( {\n\ttooltipData,\n}: {\n\ttooltipData?: {\n\t\tnearestDatum?: {\n\t\t\tdatum: TooltipData;\n\t\t\tkey: string;\n\t\t};\n\t\tdatumByKey?: { [ key: string ]: { datum: TooltipData } };\n\t};\n} ) => {\n\tconst nearestDatum = tooltipData?.nearestDatum?.datum;\n\tif ( ! nearestDatum ) return null;\n\n\tconst tooltipPoints: TooltipDatum[] = Object.entries( tooltipData?.datumByKey || {} )\n\t\t.map( ( [ key, { datum } ] ) => ( {\n\t\t\tkey,\n\t\t\tvalue: datum.value as number,\n\t\t} ) )\n\t\t.sort( ( a, b ) => b.value - a.value );\n\n\treturn (\n\t\t<div className={ styles[ 'line-chart__tooltip' ] }>\n\t\t\t<div className={ styles[ 'line-chart__tooltip-date' ] }>\n\t\t\t\t{ nearestDatum.date.toLocaleDateString() }\n\t\t\t</div>\n\t\t\t{ tooltipPoints.map( point => (\n\t\t\t\t<div key={ point.key } className={ styles[ 'line-chart__tooltip-row' ] }>\n\t\t\t\t\t<span className={ styles[ 'line-chart__tooltip-label' ] }>{ point.key }:</span>\n\t\t\t\t\t<span className={ styles[ 'line-chart__tooltip-value' ] }>{ point.value }</span>\n\t\t\t\t</div>\n\t\t\t) ) }\n\t\t</div>\n\t);\n};\n\nconst formatDateTick = ( value: number ) => {\n\tconst date = new Date( value );\n\treturn date.toLocaleDateString( undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t} );\n};\n\nconst LineChart: FC< LineChartProps > = ( {\n\tdata,\n\twidth,\n\theight,\n\tmargin = { top: 20, right: 20, bottom: 40, left: 40 },\n\tclassName,\n\twithTooltips = true,\n\tshowLegend = false,\n\tlegendOrientation = 'horizontal',\n} ) => {\n\tconst providerTheme = useChartTheme();\n\n\tif ( ! data?.length ) {\n\t\treturn (\n\t\t\t<div className={ clsx( 'line-chart-empty', styles[ 'line-chart-empty' ] ) }>Empty...</div>\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: providerTheme.colors[ index % providerTheme.colors.length ],\n\t} ) );\n\n\tconst accessors = {\n\t\txAccessor: ( d: DataPointDate ) => d.date,\n\t\tyAccessor: ( d: DataPointDate ) => d.value,\n\t};\n\n\tconst theme = buildChartTheme( {\n\t\tbackgroundColor: providerTheme.backgroundColor,\n\t\tcolors: providerTheme.colors,\n\t\tgridStyles: providerTheme.gridStyles,\n\t\ttickLength: providerTheme?.tickLength || 0,\n\t\tgridColor: providerTheme?.gridColor || '',\n\t\tgridColorDark: providerTheme?.gridColorDark || '',\n\t} );\n\n\treturn (\n\t\t<div className={ clsx( 'line-chart', styles[ 'line-chart' ], className ) }>\n\t\t\t<XYChart\n\t\t\t\ttheme={ theme }\n\t\t\t\twidth={ width }\n\t\t\t\theight={ height }\n\t\t\t\tmargin={ margin }\n\t\t\t\txScale={ { type: 'time' } }\n\t\t\t\tyScale={ { type: 'linear', nice: true } }\n\t\t\t>\n\t\t\t\t<AnimatedGrid columns={ false } numTicks={ 4 } />\n\t\t\t\t<AnimatedAxis orientation=\"bottom\" numTicks={ 5 } tickFormat={ formatDateTick } />\n\t\t\t\t<AnimatedAxis orientation=\"left\" numTicks={ 4 } />\n\n\t\t\t\t{ data.map( ( seriesData, index ) => (\n\t\t\t\t\t<AnimatedLineSeries\n\t\t\t\t\t\tkey={ seriesData?.label }\n\t\t\t\t\t\tdataKey={ seriesData?.label }\n\t\t\t\t\t\tdata={ seriesData.data as DataPointDate[] } // TODO: this needs fixing or a more specific type for each chart\n\t\t\t\t\t\t{ ...accessors }\n\t\t\t\t\t\tstroke={ theme.colors[ index % theme.colors.length ] }\n\t\t\t\t\t\tstrokeWidth={ 2 }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\n\t\t\t\t{ withTooltips && (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tsnapTooltipToDatumX\n\t\t\t\t\t\tsnapTooltipToDatumY\n\t\t\t\t\t\tshowSeriesGlyphs\n\t\t\t\t\t\trenderTooltip={ renderTooltip }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</XYChart>\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[ 'line-chart-legend' ] }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nexport default withResponsive< LineChartProps >( LineChart );\n","import { localPoint } from '@visx/event';\nimport { useTooltip } from '@visx/tooltip';\nimport { useCallback, type MouseEvent } from 'react';\nimport type { DataPoint } from '../types';\n\ntype UseChartMouseHandlerProps = {\n\t/**\n\t * Whether tooltips are enabled\n\t */\n\twithTooltips: boolean;\n};\n\ntype UseChartMouseHandlerReturn = {\n\t/**\n\t * Handler for mouse move events\n\t */\n\tonMouseMove: ( event: React.MouseEvent< SVGElement >, data: DataPoint ) => void;\n\t/**\n\t * Handler for mouse leave events\n\t */\n\tonMouseLeave: () => void;\n\t/**\n\t * Whether the tooltip is currently open\n\t */\n\ttooltipOpen: boolean;\n\t/**\n\t * The current tooltip data\n\t */\n\ttooltipData: DataPoint | null;\n\t/**\n\t * The current tooltip left position\n\t */\n\ttooltipLeft: number | undefined;\n\t/**\n\t * The current tooltip top position\n\t */\n\ttooltipTop: number | undefined;\n};\n\n/**\n * Hook to handle mouse interactions for chart components\n *\n * @param {UseChartMouseHandlerProps} props - Hook configuration\n * @return {UseChartMouseHandlerReturn} Object containing handlers and tooltip state\n */\nconst useChartMouseHandler = ( {\n\twithTooltips,\n}: UseChartMouseHandlerProps ): UseChartMouseHandlerReturn => {\n\tconst { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =\n\t\tuseTooltip< DataPoint >();\n\n\t// TODO: either debounce/throttle or use useTooltipInPortal with built-in debounce\n\tconst onMouseMove = useCallback(\n\t\t( event: MouseEvent< SVGElement >, data: DataPoint ) => {\n\t\t\tif ( ! withTooltips ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst coords = localPoint( event );\n\t\t\tif ( ! coords ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tshowTooltip( {\n\t\t\t\ttooltipData: data,\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[ withTooltips, showTooltip ]\n\t);\n\n\tconst onMouseLeave = useCallback( () => {\n\t\tif ( ! withTooltips ) {\n\t\t\treturn;\n\t\t}\n\t\thideTooltip();\n\t}, [ withTooltips, hideTooltip ] );\n\n\treturn {\n\t\tonMouseMove,\n\t\tonMouseLeave,\n\t\ttooltipOpen,\n\t\ttooltipData: tooltipData || null,\n\t\ttooltipLeft,\n\t\ttooltipTop,\n\t};\n};\n\nexport default useChartMouseHandler;\n","// extracted by mini-css-extract-plugin\nexport default {\"pie-chart\":\"R2Ly_tkJtgL0HA8P3fpm\"};","import { Group } from '@visx/group';\nimport { Pie } from '@visx/shape';\nimport clsx from 'clsx';\nimport { SVGProps, type MouseEvent } from 'react';\nimport useChartMouseHandler from '../../hooks/use-chart-mouse-handler';\nimport { useChartTheme, defaultTheme } from '../../providers/theme';\nimport { Legend } from '../legend';\nimport { withResponsive } from '../shared/with-responsive';\nimport { BaseTooltip } from '../tooltip';\nimport styles from './pie-chart.module.scss';\nimport type { BaseChartProps, DataPointPercentage } from '../../types';\n\n// TODO: add animation\n\ninterface PieChartProps extends BaseChartProps< DataPointPercentage[] > {\n\t/**\n\t * Inner radius in pixels. If > 0, creates a donut chart. Defaults to 0.\n\t */\n\tinnerRadius?: number;\n}\n\n/**\n * Renders a pie or donut chart using the provided data.\n *\n * @param {PieChartProps} props - Component props\n * @return {JSX.Element} The rendered chart component\n */\nconst PieChart = ( {\n\tdata,\n\twidth = 500, //TODO: replace when making the components responsive\n\theight = 500, //TODO: replace when making the components responsive\n\twithTooltips = false,\n\tinnerRadius = 0,\n\tclassName,\n\tshowLegend,\n\tlegendOrientation,\n}: PieChartProps ) => {\n\tconst providerTheme = useChartTheme();\n\tconst { onMouseMove, onMouseLeave, tooltipOpen, tooltipData, tooltipLeft, tooltipTop } =\n\t\tuseChartMouseHandler( {\n\t\t\twithTooltips,\n\t\t} );\n\n\t// Calculate radius based on width/height\n\tconst radius = Math.min( width, height ) / 2;\n\tconst centerX = width / 2;\n\tconst centerY = height / 2;\n\n\t// Map the data to include index for color assignment\n\tconst dataWithIndex = data.map( ( d, index ) => ( {\n\t\t...d,\n\t\tindex,\n\t} ) );\n\n\tconst accessors = {\n\t\tvalue: ( d: DataPointPercentage ) => d.value,\n\t\t// Use the color property from the data object as a last resort. The theme provides colours by default.\n\t\tfill: ( d: DataPointPercentage & { index: number } ) =>\n\t\t\td?.color || providerTheme.colors[ d.index ],\n\t};\n\n\t// Create legend items from data\n\tconst legendItems = data.map( ( item, index ) => ( {\n\t\tlabel: item.label,\n\t\tvalue: item.value.toString(),\n\t\tcolor: providerTheme.colors[ index % providerTheme.colors.length ],\n\t} ) );\n\n\treturn (\n\t\t<div className={ clsx( 'pie-chart', styles[ 'pie-chart' ], className ) }>\n\t\t\t<svg width={ width } height={ height }>\n\t\t\t\t<Group top={ centerY } left={ centerX }>\n\t\t\t\t\t<Pie< DataPointPercentage & { index: number } >\n\t\t\t\t\t\tdata={ dataWithIndex }\n\t\t\t\t\t\tpieValue={ accessors.value }\n\t\t\t\t\t\touterRadius={ radius - 20 } // Leave space for labels/tooltips\n\t\t\t\t\t\tinnerRadius={ innerRadius }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ pie => {\n\t\t\t\t\t\t\treturn pie.arcs.map( ( arc, index ) => {\n\t\t\t\t\t\t\t\tconst [ centroidX, centroidY ] = pie.path.centroid( arc );\n\t\t\t\t\t\t\t\tconst hasSpaceForLabel = arc.endAngle - arc.startAngle >= 0.25;\n\t\t\t\t\t\t\t\tconst handleMouseMove = ( event: MouseEvent< SVGElement > ) =>\n\t\t\t\t\t\t\t\t\tonMouseMove( event, arc.data );\n\n\t\t\t\t\t\t\t\tconst pathProps: SVGProps< SVGPathElement > = {\n\t\t\t\t\t\t\t\t\td: pie.path( arc ) || '',\n\t\t\t\t\t\t\t\t\tfill: accessors.fill( arc.data ),\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif ( withTooltips ) {\n\t\t\t\t\t\t\t\t\tpathProps.onMouseMove = handleMouseMove;\n\t\t\t\t\t\t\t\t\tpathProps.onMouseLeave = onMouseLeave;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<g key={ `arc-${ index }` }>\n\t\t\t\t\t\t\t\t\t\t<path { ...pathProps } />\n\t\t\t\t\t\t\t\t\t\t{ hasSpaceForLabel && (\n\t\t\t\t\t\t\t\t\t\t\t<text\n\t\t\t\t\t\t\t\t\t\t\t\tx={ centroidX }\n\t\t\t\t\t\t\t\t\t\t\t\ty={ centroidY }\n\t\t\t\t\t\t\t\t\t\t\t\tdy=\".33em\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\t\t\t\t\t\tproviderTheme.labelBackgroundColor || defaultTheme.labelBackgroundColor\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize={ 12 }\n\t\t\t\t\t\t\t\t\t\t\t\ttextAnchor=\"middle\"\n\t\t\t\t\t\t\t\t\t\t\t\tpointerEvents=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ arc.data.label }\n\t\t\t\t\t\t\t\t\t\t\t</text>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t</Pie>\n\t\t\t\t</Group>\n\t\t\t</svg>\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[ 'pie-chart-legend' ] }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ withTooltips && tooltipOpen && tooltipData && (\n\t\t\t\t<BaseTooltip\n\t\t\t\t\tdata={ tooltipData }\n\t\t\t\t\ttop={ tooltipTop || 0 }\n\t\t\t\t\tleft={ tooltipLeft || 0 }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\ttransform: 'translate(-50%, -100%)',\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nPieChart.displayName = 'PieChart';\nexport default withResponsive< PieChartProps >( PieChart );\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/shape/lib/shapes/Pie\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/text\");","import { localPoint } from '@visx/event';\nimport { Group } from '@visx/group';\nimport Pie, { type PieArcDatum } from '@visx/shape/lib/shapes/Pie';\nimport { Text } from '@visx/text';\nimport { useTooltip } from '@visx/tooltip';\nimport clsx from 'clsx';\nimport { FC, useCallback } from 'react';\nimport { useChartTheme } from '../../providers/theme/theme-provider';\nimport { Legend } from '../legend';\nimport { withResponsive } from '../shared/with-responsive';\nimport { BaseTooltip } from '../tooltip';\nimport styles from './pie-semi-circle-chart.module.scss';\nimport type { BaseChartProps, DataPointPercentage } from '../../types';\n\ninterface PieSemiCircleChartProps extends BaseChartProps< DataPointPercentage[] > {\n\t/**\n\t * Label text to display above the chart\n\t */\n\tlabel: string;\n\t/**\n\t * Note text to display below the label\n\t */\n\tnote: string;\n\t/**\n\t * Direction of chart rendering\n\t * true for clockwise, false for counter-clockwise\n\t */\n\tclockwise?: boolean;\n\t/**\n\t * Thickness of the pie chart. A value between 0 and 1\n\t */\n\tthickness?: number;\n}\n\ntype ArcData = PieArcDatum< DataPointPercentage >;\n\nconst PieSemiCircleChart: FC< PieSemiCircleChartProps > = ( {\n\tdata,\n\twidth = 500, //TODO: replace when making the components responsive\n\tlabel,\n\tnote,\n\tclassName,\n\twithTooltips = false,\n\tclockwise = true,\n\tthickness = 0.4,\n\tshowLegend,\n\tlegendOrientation,\n} ) => {\n\tconst providerTheme = useChartTheme();\n\tconst { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =\n\t\tuseTooltip< DataPointPercentage >();\n\n\tconst centerX = width / 2;\n\tconst height = width / 2;\n\tconst radius = width / 2;\n\tconst pad = 0.03;\n\tconst innerRadius = radius * ( 1 - thickness + pad );\n\n\t// Map the data to include index for color assignment\n\tconst dataWithIndex = data.map( ( d, index ) => ( {\n\t\t...d,\n\t\tindex,\n\t} ) );\n\n\t// Set the clockwise direction based on the prop\n\tconst startAngle = clockwise ? -Math.PI / 2 : Math.PI / 2;\n\tconst endAngle = clockwise ? Math.PI / 2 : -Math.PI / 2;\n\n\tconst accessors = {\n\t\tvalue: ( d: DataPointPercentage & { index: number } ) => d.value,\n\t\tsort: (\n\t\t\ta: DataPointPercentage & { index: number },\n\t\t\tb: DataPointPercentage & { index: number }\n\t\t) => b.value - a.value,\n\t\t// Use the color property from the data object as a last resort. The theme provides colours by default.\n\t\tfill: ( d: DataPointPercentage & { index: number } ) =>\n\t\t\td.color || providerTheme.colors[ d.index % providerTheme.colors.length ],\n\t};\n\n\tconst handleMouseMove = useCallback(\n\t\t( event: React.MouseEvent, arc: ArcData ) => {\n\t\t\tconst coords = localPoint( event );\n\t\t\tif ( ! coords ) return;\n\n\t\t\tshowTooltip( {\n\t\t\t\ttooltipData: arc.data,\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\tconst handleArcMouseMove = useCallback(\n\t\t( arc: ArcData ) => ( event: React.MouseEvent ) => {\n\t\t\thandleMouseMove( event, arc );\n\t\t},\n\t\t[ handleMouseMove ]\n\t);\n\n\t// Create legend items\n\tconst legendItems = data.map( ( item, index ) => ( {\n\t\tlabel: item.label,\n\t\tvalue: item.valueDisplay || item.value.toString(),\n\t\tcolor: accessors.fill( { ...item, index } ),\n\t} ) );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'pie-semi-circle-chart', styles[ 'pie-semi-circle-chart' ], className ) }\n\t\t>\n\t\t\t<svg width={ width } height={ height }>\n\t\t\t\t{ /* Main chart group that contains both the pie and text elements */ }\n\t\t\t\t<Group top={ centerX } left={ centerX }>\n\t\t\t\t\t{ /* Pie chart */ }\n\t\t\t\t\t<Pie< DataPointPercentage & { index: number } >\n\t\t\t\t\t\tdata={ dataWithIndex }\n\t\t\t\t\t\tpieValue={ accessors.value }\n\t\t\t\t\t\touterRadius={ radius }\n\t\t\t\t\t\tinnerRadius={ innerRadius }\n\t\t\t\t\t\tcornerRadius={ 3 }\n\t\t\t\t\t\tpadAngle={ pad }\n\t\t\t\t\t\tstartAngle={ startAngle }\n\t\t\t\t\t\tendAngle={ endAngle }\n\t\t\t\t\t\tpieSort={ accessors.sort }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ pie => {\n\t\t\t\t\t\t\treturn pie.arcs.map( arc => (\n\t\t\t\t\t\t\t\t<g\n\t\t\t\t\t\t\t\t\tkey={ arc.data.label }\n\t\t\t\t\t\t\t\t\tonMouseMove={ handleArcMouseMove( arc ) }\n\t\t\t\t\t\t\t\t\tonMouseLeave={ handleMouseLeave }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<path d={ pie.path( arc ) || '' } fill={ accessors.fill( arc.data ) } />\n\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t} }\n\t\t\t\t\t</Pie>\n\n\t\t\t\t\t<Group>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttextAnchor=\"middle\"\n\t\t\t\t\t\t\tverticalAnchor=\"start\"\n\t\t\t\t\t\t\ty={ -40 } // double font size to make room for a note\n\t\t\t\t\t\t\tclassName={ styles.label }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttextAnchor=\"middle\"\n\t\t\t\t\t\t\tverticalAnchor=\"start\"\n\t\t\t\t\t\t\ty={ -20 } // font size with padding\n\t\t\t\t\t\t\tclassName={ styles.note }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ note }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Group>\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\n\t\t\t\t\tdata={ {\n\t\t\t\t\t\tlabel: tooltipData.label,\n\t\t\t\t\t\tvalue: tooltipData.value,\n\t\t\t\t\t\tvalueDisplay: tooltipData.valueDisplay,\n\t\t\t\t\t} }\n\t\t\t\t\ttop={ tooltipTop || 0 }\n\t\t\t\t\tleft={ tooltipLeft || 0 }\n\t\t\t\t/>\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[ 'pie-semi-circle-chart-legend' ] }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nPieSemiCircleChart.displayName = 'PieSemiCircleChart';\nexport default withResponsive< PieSemiCircleChartProps >( PieSemiCircleChart );\n","// extracted by mini-css-extract-plugin\nexport default {\"pie-semi-circle-chart\":\"oJsjYo330oeLpWqpqf4w\",\"pie-semi-circle-chart-legend\":\"aV40KcaCeoEycQ2crVkB\",\"label\":\"bxF3iRlHVJNqwEjRY9QD\",\"note\":\"tA3u0r3RunHmbWFBLrqW\"};"],"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","_unsupportedIterableToArray","t","toString","slice","constructor","name","from","test","_toConsumableArray","isArray","iterator","TypeError","_typeof","_defineProperty","i","toPrimitive","String","toPropertyKey","configurable","writable","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","useChartTheme","useContext","ThemeProvider","_ref","_ref$theme","theme","children","mergedTheme","_objectSpread","_jsx","Provider","width","height","xScale","yScale","_ref$gridVisibility","gridVisibility","_ref$top","top","_jsxs","transform","concat","className","includes","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","withResponsive","WrappedComponent","config","_ref$maxWidth","maxWidth","_ref$aspectRatio","aspectRatio","_ref$debounceTime","debounceTime","_useParentSize","useParentSize","enableDebounceLeadingCall","initialSize","parentRef","parentWidth","containerWidth","Math","min","containerHeight","style","minHeight","DefaultTooltipContent","data","_Fragment","valueDisplay","BaseTooltip","_ref2","left","_ref2$component","component","Component","BarChart","_data$0$data","_ref$margin","margin","right","bottom","_ref$withTooltips","withTooltips","_ref$showLegend","showLegend","_ref$legendOrientatio","legendOrientation","_ref$height","_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","max","apply","series","legendItems","group","index","Group","GridControl","_innerScale","_yScale","xPos","barWidth","barX","Bar","onMouseMove","onMouseLeave","AxisLeft","AxisBottom","Legend","displayName","_slicedToArray","u","next","done","push","renderTooltip","_tooltipData$nearestD","nearestDatum","datum","tooltipPoints","entries","datumByKey","_ref3","sort","date","toLocaleDateString","point","formatDateTick","Date","month","day","_ref4","_ref4$margin","_ref4$withTooltips","_ref4$showLegend","_ref4$legendOrientati","providerTheme","accessors","xAccessor","yAccessor","buildChartTheme","XYChart","nice","AnimatedGrid","columns","numTicks","AnimatedAxis","tickFormat","seriesData","AnimatedLineSeries","dataKey","Tooltip","snapTooltipToDatumX","snapTooltipToDatumY","showSeriesGlyphs","PieChart","_ref$width","_ref$innerRadius","innerRadius","_useChartMouseHandler","useChartMouseHandler","radius","centerX","centerY","dataWithIndex","Pie","pieValue","outerRadius","pie","arcs","arc","_pie$path$centroid2","path","centroid","centroidX","centroidY","hasSpaceForLabel","endAngle","startAngle","pathProps","dy","fontSize","textAnchor","pointerEvents","PieSemiCircleChart","note","_ref$clockwise","clockwise","_ref$thickness","thickness","PI","handleArcMouseMove","cornerRadius","padAngle","pieSort","Text","verticalAnchor"],"sourceRoot":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./themes.js");const s=r.createContext(t.defaultTheme);exports.ThemeProvider=({theme:r={},children:u})=>{const h={...t.defaultTheme,...r};return e.jsx(s.Provider,{value:h,children:u})},exports.useChartTheme=()=>r.useContext(s);
2
+ //# sourceMappingURL=theme-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-provider.js","sources":["/@automattic/charts/../../../../src/providers/theme/theme-provider.tsx"],"sourcesContent":[null],"names":["ThemeContext","createContext","defaultTheme","theme","children","mergedTheme","_jsx","jsx","Provider","value","useContext"],"mappings":"4FAOA,MAAMA,EAAeC,EAAAA,cAA6BC,EAAAA,oCAuBF,EAAIC,QAAQ,CAAE,EAAEC,eAC/D,MAAMC,EAAc,IAAKH,kBAAiBC,GAC1C,OAAOG,EAAAC,IAACP,EAAaQ,SAAQ,CAACC,MAAQJ,EAAWD,SAAKA,GAAkC,wBAnBnE,IACPM,aAAYV"}
@@ -0,0 +1,2 @@
1
+ "use strict";exports.defaultTheme={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""};
2
+ //# sourceMappingURL=themes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.js","sources":["/@automattic/charts/../../../../src/providers/theme/themes.ts"],"sourcesContent":[null],"names":["backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark"],"mappings":"kCAKiC,CAChCA,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe"}