@automattic/charts 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/components/bar-chart/index.js +2 -0
- package/dist/cjs/components/bar-chart/index.js.map +1 -0
- package/dist/cjs/components/bar-chart/style.css +6 -0
- package/dist/cjs/components/bar-chart/style.css.map +1 -0
- package/dist/cjs/components/grid-control/index.js +2 -0
- package/dist/cjs/components/grid-control/index.js.map +1 -0
- package/dist/cjs/components/grid-control/style.css +3 -0
- package/dist/cjs/components/grid-control/style.css.map +1 -0
- package/dist/cjs/components/legend/index.js +2 -0
- package/dist/cjs/components/legend/index.js.map +1 -0
- package/dist/cjs/components/legend/style.css +3 -0
- package/dist/cjs/components/legend/style.css.map +1 -0
- package/dist/cjs/components/line-chart/index.js +2 -0
- package/dist/cjs/components/line-chart/index.js.map +1 -0
- package/dist/cjs/components/line-chart/style.css +4 -0
- package/dist/cjs/components/line-chart/style.css.map +1 -0
- package/dist/cjs/components/pie-chart/index.js +2 -0
- package/dist/cjs/components/pie-chart/index.js.map +1 -0
- package/dist/cjs/components/pie-chart/style.css +5 -0
- package/dist/cjs/components/pie-chart/style.css.map +1 -0
- package/dist/cjs/components/pie-semi-circle-chart/index.js +2 -0
- package/dist/cjs/components/pie-semi-circle-chart/index.js.map +1 -0
- package/dist/cjs/components/pie-semi-circle-chart/style.css +5 -0
- package/dist/cjs/components/pie-semi-circle-chart/style.css.map +1 -0
- package/dist/cjs/components/tooltip/index.js +2 -0
- package/dist/cjs/components/tooltip/index.js.map +1 -0
- package/dist/cjs/components/tooltip/style.css +3 -0
- package/dist/cjs/components/tooltip/style.css.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/providers/theme/index.js +2 -0
- package/dist/cjs/providers/theme/index.js.map +1 -0
- package/dist/cjs/style.css +9 -0
- package/dist/cjs/style.css.map +1 -0
- package/dist/mjs/components/bar-chart/index.js +2 -0
- package/dist/mjs/components/bar-chart/index.js.map +1 -0
- package/dist/mjs/components/bar-chart/style.css +6 -0
- package/dist/mjs/components/bar-chart/style.css.map +1 -0
- package/dist/mjs/components/grid-control/index.js +2 -0
- package/dist/mjs/components/grid-control/index.js.map +1 -0
- package/dist/mjs/components/grid-control/style.css +3 -0
- package/dist/mjs/components/grid-control/style.css.map +1 -0
- package/dist/mjs/components/legend/index.js +2 -0
- package/dist/mjs/components/legend/index.js.map +1 -0
- package/dist/mjs/components/legend/style.css +3 -0
- package/dist/mjs/components/legend/style.css.map +1 -0
- package/dist/mjs/components/line-chart/index.js +2 -0
- package/dist/mjs/components/line-chart/index.js.map +1 -0
- package/dist/mjs/components/line-chart/style.css +4 -0
- package/dist/mjs/components/line-chart/style.css.map +1 -0
- package/dist/mjs/components/pie-chart/index.js +2 -0
- package/dist/mjs/components/pie-chart/index.js.map +1 -0
- package/dist/mjs/components/pie-chart/style.css +5 -0
- package/dist/mjs/components/pie-chart/style.css.map +1 -0
- package/dist/mjs/components/pie-semi-circle-chart/index.js +2 -0
- package/dist/mjs/components/pie-semi-circle-chart/index.js.map +1 -0
- package/dist/mjs/components/pie-semi-circle-chart/style.css +5 -0
- package/dist/mjs/components/pie-semi-circle-chart/style.css.map +1 -0
- package/dist/mjs/components/tooltip/index.js +2 -0
- package/dist/mjs/components/tooltip/index.js.map +1 -0
- package/dist/mjs/components/tooltip/style.css +3 -0
- package/dist/mjs/components/tooltip/style.css.map +1 -0
- package/dist/mjs/index.js +2 -0
- package/dist/mjs/index.js.map +1 -0
- package/dist/mjs/package.json +3 -0
- package/dist/mjs/providers/theme/index.js +2 -0
- package/dist/mjs/providers/theme/index.js.map +1 -0
- package/dist/mjs/style.css +9 -0
- package/dist/mjs/style.css.map +1 -0
- package/dist/types/components/bar-chart/bar-chart.d.ts +6 -0
- package/dist/types/components/bar-chart/index.d.ts +1 -0
- package/dist/types/components/grid-control/grid-control.d.ts +4 -0
- package/dist/types/components/grid-control/index.d.ts +1 -0
- package/dist/types/components/legend/base-legend.d.ts +3 -0
- package/dist/types/components/legend/index.d.ts +2 -0
- package/dist/types/components/legend/types.d.ts +12 -0
- package/dist/types/components/line-chart/index.d.ts +1 -0
- package/dist/types/components/line-chart/line-chart.d.ts +6 -0
- package/dist/types/components/pie-chart/index.d.ts +1 -0
- package/dist/types/components/pie-chart/pie-chart.d.ts +15 -0
- package/dist/types/components/pie-semi-circle-chart/index.d.ts +1 -0
- package/dist/types/components/pie-semi-circle-chart/pie-semi-circle-chart.d.ts +23 -0
- package/dist/types/components/tooltip/base-tooltip.d.ts +29 -0
- package/dist/types/components/tooltip/index.d.ts +2 -0
- package/dist/types/hooks/use-chart-mouse-handler.d.ts +41 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/providers/theme/index.d.ts +2 -0
- package/dist/types/providers/theme/theme-provider.d.ts +18 -0
- package/dist/types/providers/theme/themes.d.ts +14 -0
- package/dist/types/types.d.ts +137 -0
- package/index.ts +1 -1
- package/package.json +51 -23
- package/src/components/bar-chart/bar-chart.tsx +8 -8
- package/src/components/grid-control/grid-control.tsx +1 -1
- package/src/components/line-chart/line-chart.tsx +1 -1
- package/src/components/pie-chart/pie-chart.tsx +21 -13
- package/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx +5 -5
- package/src/components/tooltip/base-tooltip.tsx +1 -1
- package/src/hooks/use-chart-mouse-handler.ts +2 -2
- package/src/index.ts +0 -4
- package/src/providers/theme/theme-provider.tsx +2 -2
- package/src/providers/theme/themes.ts +1 -1
- package/tools/fixup.sh +11 -0
- package/webpack.config.cjs +132 -0
- package/dist/index.css +0 -2
- package/dist/index.css.map +0 -1
- package/dist/index.d.mts +0 -287
- package/dist/index.d.ts +0 -287
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
- package/tsup.config.js +0 -26
- /package/src/{components/shared/types.d.ts → types.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.3] - 2025-01-12
|
|
9
|
+
### Changed
|
|
10
|
+
- Replace Rollup with Webpack for charts [#40912]
|
|
11
|
+
- Updated package dependencies. [#40841]
|
|
12
|
+
|
|
13
|
+
## [0.2.2] - 2025-01-03
|
|
14
|
+
### Changed
|
|
15
|
+
- Switching esbuild to rollup for better treeshaking. [#40817]
|
|
16
|
+
- Updated package dependencies. [#40798]
|
|
17
|
+
|
|
8
18
|
## [0.2.1] - 2024-12-31
|
|
9
19
|
### Added
|
|
10
20
|
- Added dist to mirror repo [#40776]
|
|
@@ -37,5 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
37
47
|
- Fixed lints following ESLint rule changes for TS [#40584]
|
|
38
48
|
- Fixing a bug in Chart storybook data. [#40640]
|
|
39
49
|
|
|
50
|
+
[0.2.3]: https://github.com/Automattic/charts/compare/v0.2.2...v0.2.3
|
|
51
|
+
[0.2.2]: https://github.com/Automattic/charts/compare/v0.2.1...v0.2.2
|
|
40
52
|
[0.2.1]: https://github.com/Automattic/charts/compare/v0.2.0...v0.2.1
|
|
41
53
|
[0.2.0]: https://github.com/Automattic/charts/compare/v0.1.0...v0.2.0
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=Array(t);a<t;a++)r[a]=e[a];return r}function r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.r(t),e.d(t,{BarChart:()=>S});const l=require("@visx/axis"),n=require("@visx/event"),o=require("@visx/group"),i=require("@visx/scale"),c=require("@visx/shape"),d=require("@visx/tooltip"),u=require("clsx");var s=e.n(u);const m=require("react");var v=e.n(m),p={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},h=(0,m.createContext)(p);const g=require("@visx/grid"),f=function(e){var t=e.width,a=e.height,r=e.xScale,l=e.yScale,n=e.gridVisibility,o=void 0===n?"x":n,i=e.top,c=void 0===i?0:i;return v().createElement("g",{transform:"translate(0, ".concat(c,")"),className:"jfpeES0fbFrqCPR8dRN7"},o.includes("x")&&v().createElement(g.GridRows,{scale:r,width:t}),o.includes("y")&&v().createElement(g.GridColumns,{scale:l,height:a}))},b=require("@visx/legend"),y={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var E={horizontal:"row",vertical:"column"},x=function(e){var t=e.items,a=e.className,r=e.orientation,l=void 0===r?"horizontal":r,n=(0,i.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:s()(y.legend,y["legend--".concat(l)],a),role:"list"},React.createElement(b.LegendOrdinal,{scale:n,direction:E[l],shape:"rect",shapeWidth:16,shapeHeight:16,className:y["legend-items"]},(function(e){return React.createElement("div",{className:y["legend--".concat(l)]},e.map((function(e){var a,r;return React.createElement("div",{key:e.text,className:y["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:y["legend-item-swatch"]})),React.createElement("span",{className:y["legend-item-label"]},e.text,(null===(a=t.find((function(t){return t.label===e.text})))||void 0===a?void 0:a.value)&&React.createElement("span",{className:y["legend-item-value"]},null===(r=t.find((function(t){return t.label===e.text})))||void 0===r?void 0:r.value)))})))})))};var R=function(e){var t=e.data;return React.createElement(React.Fragment,null,null==t?void 0:t.label,": ",(null==t?void 0:t.valueDisplay)||(null==t?void 0:t.value))},F=function(e){var t=e.data,a=e.top,r=e.left,l=e.component,n=void 0===l?R:l,o=e.children,i=e.className;return React.createElement("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:a,left:r},role:"tooltip"},o||t&&React.createElement(n,{data:t,className:i}))};const w={"bar-chart":"Vm_cn8YnIXBavFt6eHSp","bar-chart-legend":"e4dhKgBP7e6FBRAX2SrP"};var N=function(e){var t,a=e.data,u=e.width,v=void 0===u?500:u,p=e.height,g=void 0===p?500:p,b=e.margin,y=void 0===b?{top:20,right:20,bottom:40,left:40}:b,E=e.withTooltips,R=void 0!==E&&E,N=e.showLegend,S=void 0!==N&&N,C=e.legendOrientation,A=void 0===C?"horizontal":C,L=e.className,q=e.gridVisibility,B=void 0===q?"x":q,M=(0,m.useContext)(h),O=(0,d.useTooltip)(),k=O.tooltipOpen,P=O.tooltipLeft,D=O.tooltipTop,T=O.tooltipData,j=O.hideTooltip,K=O.showTooltip,I=(0,m.useCallback)((function(e,t,a,r,l){var o=(0,n.localPoint)(e);o&&K({tooltipData:{value:t,xLabel:a,yLabel:r,seriesIndex:l},tooltipLeft:o.x,tooltipTop:o.y-10})}),[K]),_=(0,m.useCallback)((function(){j()}),[j]);if(null==a||!a.length)return React.createElement("div",{className:s()("bar-chart-empty",w["bat-chart-empty"])},"Empty...");var z=y,X=v-z.left-z.right,G=g-z.top-z.bottom,H=null===(t=a[0].data)||void 0===t?void 0:t.map((function(e){return(null==e?void 0:e.label)||""})),V=(0,i.scaleBand)({range:[0,X],domain:H,padding:.2}),J=(0,i.scaleBand)({range:[0,V.bandwidth()],domain:a.map((function(e,t){return t.toString()})),padding:.1}),U=(0,i.scaleLinear)({range:[G,0],domain:[0,Math.max.apply(Math,r(a.map((function(e){return Math.max.apply(Math,r(e.data.map((function(e){return(null==e?void 0:e.value)||0}))))}))))]}),W=a.map((function(e,t){return{label:e.label,value:"",color:M.colors[t%M.colors.length]}}));return React.createElement("div",{className:s()("bar-chart",L,w["bar-chart"])},React.createElement("svg",{width:v,height:g},React.createElement(o.Group,{left:z.left,top:z.top},React.createElement(f,{width:X,height:G,xScale:V,yScale:U,gridVisibility:B}),a.map((function(e,t){return React.createElement(o.Group,{key:t},e.data.map((function(a){var r,l,n=V((null==a?void 0:a.label)||"");if(void 0===n)return null;var o=J.bandwidth(),i=n+(null!==(r=J(t.toString()))&&void 0!==r?r:0);return React.createElement(c.Bar,{key:"bar-".concat(t,"-").concat(a.label),x:i,y:U(a.value),width:o,height:G-(null!==(l=U(a.value))&&void 0!==l?l:0),fill:M.colors[t%M.colors.length],onMouseMove:R?function(r){return I(r,a.value,(null==a?void 0:a.label)||"",e.label,t)}:void 0,onMouseLeave:R?_:void 0})})))})),React.createElement(l.AxisLeft,{scale:U}),React.createElement(l.AxisBottom,{scale:V,top:G}))),R&&k&&T&&React.createElement(F,{top:D||0,left:P||0},React.createElement("div",null,React.createElement("div",null,T.yLabel),React.createElement("div",null,T.xLabel,": ",T.value))),S&&React.createElement(x,{items:W,orientation:A,className:w["bar-chart-legend"]}))};N.displayName="BarChart";const S=N;module.exports=t})();
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/bar-chart/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,KCL9D,SAASC,EAAkBC,EAAGlB,IAC3B,MAAQA,GAAKA,EAAIkB,EAAEC,UAAYnB,EAAIkB,EAAEC,QACtC,IAAK,IAAIC,EAAI,EAAGC,EAAIC,MAAMtB,GAAIoB,EAAIpB,EAAGoB,IAAKC,EAAED,GAAKF,EAAEE,GACnD,OAAOC,CACT,CCAA,SAASE,EAAmBL,GAC1B,OCJF,SAA4BA,GAC1B,GAAII,MAAME,QAAQN,GAAI,OAAO,EAAiBA,EAChD,CDES,CAAkBA,IEL3B,SAA0BA,GACxB,GAAI,oBAAsBJ,Q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AADA,EAAG6E,QAAS,IACjC,QAAcwF,IAATD,EAAqB,OAAO,KAEjC,IAAME,EAAWlB,EAAWC,YACtBkB,EAAOH,GAA6C,QAAzCF,EAAKd,EAAYX,EAAY5G,mBAAY,IAAAqI,EAAAA,EAAI,GAK9D,OACCzG,MAAAuB,cAACwF,EAAAA,IAAG,CACHpK,IAAG,OAAAuD,OAAW8E,EAAW,KAAA9E,OAAM3D,EAAE6E,OACjC+D,EAAI2B,EACJ1B,EAAIzF,EAAQpD,EAAEiB,OACdgC,MAAQqH,EACRpH,OAAS+F,GAA0B,QAAtBkB,EAAK/G,EAAQpD,EAAEiB,cAAO,IAAAkJ,EAAAA,EAAI,GACvCrE,KAAO4B,EAAMnF,OAAQkG,EAAcf,EAAMnF,OAAOnB,QAChDqJ,YAAcpD,EAXW,SAAEiB,GAAmC,OAC/DF,EAAiBE,EAAOtI,EAAEiB,OAAOjB,aAAC,EAADA,EAAG6E,QAAS,GAAI+E,EAAO/E,MAAO4D,EAAa,OAUzB4B,EAClDK,aAAerD,EAAeyB,OAAmBuB,GAGpD,IACO,IAET5G,MAAAuB,cAAC2F,EAAAA,SAAQ,CAAC5G,MAAQX,IAClBK,MAAAuB,cAAC4F,EAAAA,WAAU,CAAC7G,MAAQZ,EAASK,IAAMyF,MAInC5B,GAAgBS,GAAeG,GAChCxE,MAAAuB,cAACoB,EAAW,CAAC5C,IAAMwE,GAAc,EAAI1B,KAAOyB,GAAe,GAC1DtE,MAAAuB,cAAA,WACCvB,MAAAuB,cAAA,WAAOiD,EAAYO,QACnB/E,MAAAuB,cAAA,WACGiD,EAAYM,OAAQ,KAAIN,EAAYhH,SAMxCsG,GACD9D,MAAAuB,cAAC6F,EAAM,CACNxG,MAAQwF,EACRtF,YAAckD,EACd7D,UAAYsB,EAAQ,sBAKzB,EAEA0B,EAASkE,YAAc,WACvB,U","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://@automattic/charts/external commonjs2 \"@visx/axis\"","webpack://@automattic/charts/external commonjs2 \"@visx/event\"","webpack://@automattic/charts/external commonjs2 \"@visx/group\"","webpack://@automattic/charts/external commonjs2 \"@visx/scale\"","webpack://@automattic/charts/external commonjs2 \"@visx/shape\"","webpack://@automattic/charts/external commonjs2 \"@visx/tooltip\"","webpack://@automattic/charts/external commonjs2 \"clsx\"","webpack://@automattic/charts/external commonjs2 \"react\"","webpack://@automattic/charts/./src/providers/theme/themes.ts","webpack://@automattic/charts/./src/providers/theme/theme-provider.tsx","webpack://@automattic/charts/external commonjs2 \"@visx/grid\"","webpack://@automattic/charts/./src/components/grid-control/grid-control.tsx","webpack://@automattic/charts/./src/components/grid-control/grid-control.module.scss?a210","webpack://@automattic/charts/external commonjs2 \"@visx/legend\"","webpack://@automattic/charts/./src/components/legend/legend.module.scss?843e","webpack://@automattic/charts/./src/components/legend/base-legend.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss?1d14","webpack://@automattic/charts/./src/components/bar-chart/bar-chart.module.scss?9954","webpack://@automattic/charts/./src/components/bar-chart/bar-chart.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nexport { _toConsumableArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nexport { _arrayWithoutHoles as default };","function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableSpread as default };","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/axis\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/event\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/group\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/scale\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/shape\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/tooltip\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clsx\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","import type { ChartTheme } from '../../types';\n\n/**\n * Default theme configuration\n */\nconst defaultTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Jetpack theme configuration\n */\nconst jetpackTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Woo theme configuration\n */\nconst wooTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#80C8FF', '#B999FF', '#3858E9' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\nexport { defaultTheme, jetpackTheme, wooTheme };\n","import { createContext, useContext, FC, type ReactNode } from 'react';\nimport { defaultTheme } from './themes';\nimport type { ChartTheme } from '../../types';\n\n/**\n * Context for sharing theme configuration across components\n */\nconst ThemeContext = createContext< ChartTheme >( defaultTheme );\n\n/**\n * Hook to access chart theme\n * @return {object} A built theme configuration compatible with visx charts\n */\nconst useChartTheme = () => {\n\tconst theme = useContext( ThemeContext );\n\treturn theme;\n};\n\n/**\n * Props for the ThemeProvider component\n */\ntype ThemeProviderProps = {\n\t/** Optional partial theme override */\n\ttheme?: Partial< ChartTheme >;\n\t/** Child components that will have access to the theme */\n\tchildren: ReactNode;\n};\n\n// Provider component for chart theming\n// Allows theme customization through props while maintaining default values\nconst ThemeProvider: FC< ThemeProviderProps > = ( { theme = {}, children } ) => {\n\tconst mergedTheme = { ...defaultTheme, ...theme };\n\treturn <ThemeContext.Provider value={ mergedTheme }>{ children }</ThemeContext.Provider>;\n};\n\nexport { ThemeProvider, useChartTheme };\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/grid\");","import { GridRows, GridColumns } from '@visx/grid';\nimport React from 'react';\nimport styles from './grid-control.module.scss';\nimport type { GridProps } from '../../types';\n\nconst GridControl: React.FC< GridProps > = ( {\n\twidth,\n\theight,\n\txScale,\n\tyScale,\n\tgridVisibility = 'x',\n\ttop = 0,\n} ) => {\n\treturn (\n\t\t<g transform={ `translate(0, ${ top })` } className={ styles[ 'grid-control' ] }>\n\t\t\t{ gridVisibility.includes( 'x' ) && <GridRows scale={ xScale } width={ width } /> }\n\t\t\t{ gridVisibility.includes( 'y' ) && <GridColumns scale={ yScale } height={ height } /> }\n\t\t</g>\n\t);\n};\n\nexport default GridControl;\n","// extracted by mini-css-extract-plugin\nexport default {\"grid-control\":\"jfpeES0fbFrqCPR8dRN7\"};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/legend\");","// extracted by mini-css-extract-plugin\nexport default {\"legend--horizontal\":\"b1_5FxxoK4aEFLoe67IA\",\"legend--vertical\":\"vpmQkJAPhp3XJ9Wb6vOw\",\"legend-item\":\"IKM8KG1lF9e5NzDqMLOJ\",\"legend-item-swatch\":\"_eccyBq0v2puKsHw8XND\",\"legend-item-label\":\"UeZrUEpEK0tLzXHmeUco\",\"legend-item-value\":\"R5msPOYKm79jYV13H0v7\"};","import { LegendOrdinal } from '@visx/legend';\nimport { scaleOrdinal } from '@visx/scale';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport styles from './legend.module.scss';\nimport type { LegendProps } from './types';\n\n/**\n * Base legend component that displays color-coded items with labels using visx\n * @param {object} props - Component properties\n * @param {Array} props.items - Array of legend items to display\n * @param {string} props.className - Additional CSS class names\n * @param {string} props.orientation - Layout orientation (horizontal/vertical)\n * @return {JSX.Element} Rendered legend component\n */\nconst orientationToFlexDirection = {\n\thorizontal: 'row' as const,\n\tvertical: 'column' as const,\n};\n\nexport const BaseLegend: FC< LegendProps > = ( {\n\titems,\n\tclassName,\n\torientation = 'horizontal',\n} ) => {\n\tconst legendScale = scaleOrdinal( {\n\t\tdomain: items.map( item => item.label ),\n\t\trange: items.map( item => item.color ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( styles.legend, styles[ `legend--${ orientation }` ], className ) }\n\t\t\trole=\"list\"\n\t\t>\n\t\t\t<LegendOrdinal\n\t\t\t\tscale={ legendScale }\n\t\t\t\tdirection={ orientationToFlexDirection[ orientation ] }\n\t\t\t\tshape=\"rect\"\n\t\t\t\tshapeWidth={ 16 }\n\t\t\t\tshapeHeight={ 16 }\n\t\t\t\tclassName={ styles[ 'legend-items' ] }\n\t\t\t>\n\t\t\t\t{ labels => (\n\t\t\t\t\t<div className={ styles[ `legend--${ orientation }` ] }>\n\t\t\t\t\t\t{ labels.map( label => (\n\t\t\t\t\t\t\t<div key={ label.text } className={ styles[ 'legend-item' ] }>\n\t\t\t\t\t\t\t\t<svg width={ 16 } height={ 16 }>\n\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\twidth={ 16 }\n\t\t\t\t\t\t\t\t\t\theight={ 16 }\n\t\t\t\t\t\t\t\t\t\tfill={ label.value }\n\t\t\t\t\t\t\t\t\t\tclassName={ styles[ 'legend-item-swatch' ] }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-label' ] }>\n\t\t\t\t\t\t\t\t\t{ label.text }\n\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value && (\n\t\t\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-value' ] }>\n\t\t\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</LegendOrdinal>\n\t\t</div>\n\t);\n};\n","import styles from './base-tooltip.module.scss';\nimport type { CSSProperties, ComponentType, ReactNode } from 'react';\n\ntype TooltipData = {\n\tlabel: string;\n\tvalue: number;\n\tvalueDisplay?: string;\n};\n\ntype TooltipComponentProps = {\n\tdata: TooltipData;\n\tclassName?: string;\n};\n\ntype TooltipCommonProps = {\n\ttop: number;\n\tleft: number;\n\tstyle?: CSSProperties;\n\tclassName?: string;\n};\n\ntype DefaultDataTooltip = {\n\tdata: TooltipData;\n\tcomponent?: ComponentType< TooltipComponentProps >;\n\tchildren?: never;\n};\n\ntype CustomTooltip = {\n\tchildren: ReactNode;\n\tdata?: never;\n\tcomponent?: never;\n};\n\ntype BaseTooltipProps = TooltipCommonProps & ( DefaultDataTooltip | CustomTooltip );\n\nconst DefaultTooltipContent = ( { data }: TooltipComponentProps ) => (\n\t<>\n\t\t{ data?.label }: { data?.valueDisplay || data?.value }\n\t</>\n);\n\nexport const BaseTooltip = ( {\n\tdata,\n\ttop,\n\tleft,\n\tcomponent: Component = DefaultTooltipContent,\n\tchildren,\n\tclassName,\n}: BaseTooltipProps ) => {\n\treturn (\n\t\t<div className={ styles.tooltip } style={ { top, left } } role=\"tooltip\">\n\t\t\t{ children || ( data && <Component data={ data } className={ className } /> ) }\n\t\t</div>\n\t);\n};\n\nexport type { BaseTooltipProps, TooltipData };\n","// extracted by mini-css-extract-plugin\nexport default {\"tooltip\":\"Jmgc7XAf2uAyK5059rBe\"};","// extracted by mini-css-extract-plugin\nexport default {\"bar-chart\":\"Vm_cn8YnIXBavFt6eHSp\",\"bar-chart-legend\":\"e4dhKgBP7e6FBRAX2SrP\"};","import { AxisLeft, AxisBottom } from '@visx/axis';\nimport { localPoint } from '@visx/event';\nimport { Group } from '@visx/group';\nimport { scaleBand, scaleLinear } from '@visx/scale';\nimport { Bar } from '@visx/shape';\nimport { useTooltip } from '@visx/tooltip';\nimport clsx from 'clsx';\nimport { FC, useCallback, type MouseEvent } from 'react';\nimport { useChartTheme } from '../../providers/theme';\nimport { GridControl } from '../grid-control';\nimport { Legend } from '../legend';\nimport { BaseTooltip } from '../tooltip';\nimport styles from './bar-chart.module.scss';\nimport type { BaseChartProps, SeriesData } from '../../types';\n\ninterface BarChartProps extends BaseChartProps< SeriesData[] > {}\n\ntype BarChartTooltipData = { value: number; xLabel: string; yLabel: string; seriesIndex: number };\n\nconst BarChart: FC< BarChartProps > = ( {\n\tdata,\n\twidth = 500, //TODO: replace when making the components responsive\n\theight = 500, //TODO: replace when making the components responsive\n\tmargin = { top: 20, right: 20, bottom: 40, left: 40 },\n\twithTooltips = false,\n\tshowLegend = false,\n\tlegendOrientation = 'horizontal',\n\tclassName,\n\tgridVisibility = 'x',\n} ) => {\n\tconst theme = useChartTheme();\n\tconst { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =\n\t\tuseTooltip< BarChartTooltipData >();\n\n\tconst handleMouseMove = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent< SVGRectElement >,\n\t\t\tvalue: number,\n\t\t\txLabel: string,\n\t\t\tyLabel: string,\n\t\t\tseriesIndex: number\n\t\t) => {\n\t\t\tconst coords = localPoint( event );\n\t\t\tif ( ! coords ) return;\n\n\t\t\tshowTooltip( {\n\t\t\t\ttooltipData: { value, xLabel, yLabel, seriesIndex },\n\t\t\t\ttooltipLeft: coords.x,\n\t\t\t\ttooltipTop: coords.y - 10,\n\t\t\t} );\n\t\t},\n\t\t[ showTooltip ]\n\t);\n\n\tconst handleMouseLeave = useCallback( () => {\n\t\thideTooltip();\n\t}, [ hideTooltip ] );\n\n\tif ( ! data?.length ) {\n\t\treturn <div className={ clsx( 'bar-chart-empty', styles[ 'bat-chart-empty' ] ) }>Empty...</div>;\n\t}\n\n\tconst margins = margin;\n\tconst xMax = width - margins.left - margins.right;\n\tconst yMax = height - margins.top - margins.bottom;\n\n\t// Get labels for x-axis from the first series (assuming all series have same labels)\n\tconst labels = data[ 0 ].data?.map( d => d?.label || '' );\n\n\t// Create scales\n\tconst xScale = scaleBand< string >( {\n\t\trange: [ 0, xMax ],\n\t\tdomain: labels,\n\t\tpadding: 0.2,\n\t} );\n\n\tconst innerScale = scaleBand( {\n\t\trange: [ 0, xScale.bandwidth() ],\n\t\tdomain: data.map( ( _, i ) => i.toString() ),\n\t\tpadding: 0.1,\n\t} );\n\n\tconst yScale = scaleLinear< number >( {\n\t\trange: [ yMax, 0 ],\n\t\tdomain: [\n\t\t\t0,\n\t\t\tMath.max( ...data.map( series => Math.max( ...series.data.map( d => d?.value || 0 ) ) ) ),\n\t\t],\n\t} );\n\n\t// Create legend items from group labels, this iterates over groups rather than data points\n\tconst legendItems = data.map( ( group, index ) => ( {\n\t\tlabel: group.label, // Label for each unique group\n\t\tvalue: '', // Empty string since we don't want to show a specific value\n\t\tcolor: theme.colors[ index % theme.colors.length ],\n\t} ) );\n\n\treturn (\n\t\t<div className={ clsx( 'bar-chart', className, styles[ 'bar-chart' ] ) }>\n\t\t\t<svg width={ width } height={ height }>\n\t\t\t\t<Group left={ margins.left } top={ margins.top }>\n\t\t\t\t\t<GridControl\n\t\t\t\t\t\twidth={ xMax }\n\t\t\t\t\t\theight={ yMax }\n\t\t\t\t\t\txScale={ xScale }\n\t\t\t\t\t\tyScale={ yScale }\n\t\t\t\t\t\tgridVisibility={ gridVisibility }\n\t\t\t\t\t/>\n\t\t\t\t\t{ data.map( ( series, seriesIndex ) => (\n\t\t\t\t\t\t<Group key={ seriesIndex }>\n\t\t\t\t\t\t\t{ series.data.map( d => {\n\t\t\t\t\t\t\t\tconst xPos = xScale( d?.label || '' );\n\t\t\t\t\t\t\t\tif ( xPos === undefined ) return null;\n\n\t\t\t\t\t\t\t\tconst barWidth = innerScale.bandwidth();\n\t\t\t\t\t\t\t\tconst barX = xPos + ( innerScale( seriesIndex.toString() ) ?? 0 );\n\n\t\t\t\t\t\t\t\tconst handleBarMouseMove = ( event: MouseEvent< SVGRectElement > ) =>\n\t\t\t\t\t\t\t\t\thandleMouseMove( event, d.value, d?.label || '', series.label, seriesIndex );\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Bar\n\t\t\t\t\t\t\t\t\t\tkey={ `bar-${ seriesIndex }-${ d.label }` }\n\t\t\t\t\t\t\t\t\t\tx={ barX }\n\t\t\t\t\t\t\t\t\t\ty={ yScale( d.value ) }\n\t\t\t\t\t\t\t\t\t\twidth={ barWidth }\n\t\t\t\t\t\t\t\t\t\theight={ yMax - ( yScale( d.value ) ?? 0 ) }\n\t\t\t\t\t\t\t\t\t\tfill={ theme.colors[ seriesIndex % theme.colors.length ] }\n\t\t\t\t\t\t\t\t\t\tonMouseMove={ withTooltips ? handleBarMouseMove : undefined }\n\t\t\t\t\t\t\t\t\t\tonMouseLeave={ withTooltips ? handleMouseLeave : undefined }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</Group>\n\t\t\t\t\t) ) }\n\t\t\t\t\t<AxisLeft scale={ yScale } />\n\t\t\t\t\t<AxisBottom scale={ xScale } top={ yMax } />\n\t\t\t\t</Group>\n\t\t\t</svg>\n\n\t\t\t{ withTooltips && tooltipOpen && tooltipData && (\n\t\t\t\t<BaseTooltip top={ tooltipTop || 0 } left={ tooltipLeft || 0 }>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div>{ tooltipData.yLabel }</div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t{ tooltipData.xLabel }: { tooltipData.value }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</BaseTooltip>\n\t\t\t) }\n\n\t\t\t{ showLegend && (\n\t\t\t\t<Legend\n\t\t\t\t\titems={ legendItems }\n\t\t\t\t\torientation={ legendOrientation }\n\t\t\t\t\tclassName={ styles[ 'bar-chart-legend' ] }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nBarChart.displayName = 'BarChart';\nexport default BarChart;\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","_arrayLikeToArray","r","length","e","n","Array","_toConsumableArray","isArray","iterator","from","t","toString","slice","constructor","name","test","TypeError","require","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","_ref","width","height","xScale","yScale","_ref$gridVisibility","gridVisibility","_ref$top","top","React","transform","concat","className","includes","GridRows","scale","GridColumns","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","createElement","clsx","styles","legend","role","LegendOrdinal","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","text","fill","find","DefaultTooltipContent","data","Fragment","valueDisplay","BaseTooltip","_ref2","left","_ref2$component","component","Component","children","style","BarChart","_data$0$data","_ref$width","_ref$height","_ref$margin","margin","right","bottom","_ref$withTooltips","withTooltips","_ref$showLegend","showLegend","_ref$legendOrientatio","legendOrientation","theme","useContext","_useTooltip","useTooltip","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","handleMouseMove","useCallback","event","xLabel","yLabel","seriesIndex","coords","localPoint","x","y","handleMouseLeave","margins","xMax","yMax","scaleBand","padding","innerScale","bandwidth","_","i","scaleLinear","Math","max","apply","series","legendItems","group","index","Group","GridControl","_innerScale","_yScale","xPos","undefined","barWidth","barX","Bar","onMouseMove","onMouseLeave","AxisLeft","AxisBottom","Legend","displayName"],"sourceRoot":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
.Vm_cn8YnIXBavFt6eHSp{position:relative}.e4dhKgBP7e6FBRAX2SrP{margin-top:1rem}
|
|
2
|
+
.jfpeES0fbFrqCPR8dRN7 .visx-line{stroke:#d7d6d6;stroke-width:1px;shape-rendering:crispEdges}
|
|
3
|
+
.Jmgc7XAf2uAyK5059rBe{padding:.5rem;background-color:rgba(0,0,0,.85);color:#fff;border-radius:4px;font-size:14px;box-shadow:0 1px 2px rgba(0,0,0,.1);position:absolute;pointer-events:none;transform:translate(-50%, -100%)}
|
|
4
|
+
.b1_5FxxoK4aEFLoe67IA{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px}.vpmQkJAPhp3XJ9Wb6vOw{display:flex;flex-direction:column;gap:8px}.IKM8KG1lF9e5NzDqMLOJ{display:flex;align-items:center;gap:8px;font-size:.875rem}._eccyBq0v2puKsHw8XND{border-radius:2px}.UeZrUEpEK0tLzXHmeUco{color:var(--jp-gray-80, #2c3338);display:flex;align-items:center;gap:.5rem}.R5msPOYKm79jYV13H0v7{font-weight:500}
|
|
5
|
+
|
|
6
|
+
/*# sourceMappingURL=style.css.map*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/bar-chart/style.css","mappings":"AAAA,sBACC,kBAEA,sBACC,gB;ACAA,iCACE,cAJc,CAKd,iBACA,2B;ACPJ,sBACE,cACA,iCACA,WACA,kBACA,eACA,oCACA,kBACA,oBACA,iC;ACRD,sBACC,aACA,mBACA,eACA,SAGD,sBACC,aACA,sBACA,QAIF,sBACC,aACA,mBACA,QACA,kBAGD,sBACC,kBAGD,sBACC,iCACA,aACA,mBACA,UAGD,sBACC,gB","sources":["webpack://@automattic/charts/./src/components/bar-chart/bar-chart.module.scss","webpack://@automattic/charts/./src/components/grid-control/grid-control.module.scss","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss","webpack://@automattic/charts/./src/components/legend/legend.module.scss"],"sourcesContent":[".bar-chart {\n\tposition: relative;\n\t\n\t&-legend {\n\t\tmargin-top: 1rem;\n\t}\n}\n","// Variables\n$grid-line-color: #d7d6d6;\n\n.grid-control {\n :global(.visx-line) {\n stroke: $grid-line-color;\n stroke-width: 1px;\n shape-rendering: crispEdges;\n }\n} ",".tooltip {\n padding: 0.5rem;\n background-color: rgba(0, 0, 0, 0.85);\n color: white;\n border-radius: 4px;\n font-size: 14px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n position: absolute;\n pointer-events: none;\n transform: translate(-50%, -100%);\n}\n",".legend {\n\t&--horizontal {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\tgap: 16px;\n\t}\n\n\t&--vertical {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t}\n}\n\n.legend-item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tfont-size: 0.875rem;\n}\n\n.legend-item-swatch {\n\tborder-radius: 2px;\n}\n\n.legend-item-label {\n\tcolor: var(--jp-gray-80, #2c3338);\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.5rem;\n}\n\n.legend-item-value {\n\tfont-weight: 500;\n}\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{GridControl:()=>a});const t=require("@visx/grid"),o=require("react");var i=e.n(o);const a=function(e){var r=e.width,o=e.height,a=e.xScale,n=e.yScale,l=e.gridVisibility,d=void 0===l?"x":l,c=e.top,s=void 0===c?0:c;return i().createElement("g",{transform:"translate(0, ".concat(s,")"),className:"jfpeES0fbFrqCPR8dRN7"},d.includes("x")&&i().createElement(t.GridRows,{scale:a,width:r}),d.includes("y")&&i().createElement(t.GridColumns,{scale:n,height:o}))};module.exports=r})();
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/grid-control/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,uCCL9D,MAAM,EAA+BC,QAAQ,cCAvC,EAA+BA,QAAQ,S,aCC7C,MCoBA,EAhB2C,SAAHC,GAOjC,IANNC,EAAKD,EAALC,MACAC,EAAMF,EAANE,OACAC,EAAMH,EAANG,OACAC,EAAMJ,EAANI,OAAMC,EAAAL,EACNM,eAAAA,OAAc,IAAAD,EAAG,IAAGA,EAAAE,EAAAP,EACpBQ,IAAAA,OAAG,IAAAD,EAAG,EAACA,EAEP,OACCE,IAAAA,cAAA,KAAGC,UAAS,gBAAAC,OAAoBH,EAAG,KAAOI,UDbb,wBCc1BN,EAAeO,SAAU,MAASJ,IAAAA,cAACK,EAAAA,SAAQ,CAACC,MAAQZ,EAASF,MAAQA,IACrEK,EAAeO,SAAU,MAASJ,IAAAA,cAACO,EAAAA,YAAW,CAACD,MAAQX,EAASF,OAASA,IAG9E,E","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/external commonjs2 \"@visx/grid\"","webpack://@automattic/charts/external commonjs2 \"react\"","webpack://@automattic/charts/./src/components/grid-control/grid-control.module.scss?a210","webpack://@automattic/charts/./src/components/grid-control/grid-control.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/grid\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","// extracted by mini-css-extract-plugin\nexport default {\"grid-control\":\"jfpeES0fbFrqCPR8dRN7\"};","import { GridRows, GridColumns } from '@visx/grid';\nimport React from 'react';\nimport styles from './grid-control.module.scss';\nimport type { GridProps } from '../../types';\n\nconst GridControl: React.FC< GridProps > = ( {\n\twidth,\n\theight,\n\txScale,\n\tyScale,\n\tgridVisibility = 'x',\n\ttop = 0,\n} ) => {\n\treturn (\n\t\t<g transform={ `translate(0, ${ top })` } className={ styles[ 'grid-control' ] }>\n\t\t\t{ gridVisibility.includes( 'x' ) && <GridRows scale={ xScale } width={ width } /> }\n\t\t\t{ gridVisibility.includes( 'y' ) && <GridColumns scale={ yScale } height={ height } /> }\n\t\t</g>\n\t);\n};\n\nexport default GridControl;\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","_ref","width","height","xScale","yScale","_ref$gridVisibility","gridVisibility","_ref$top","top","React","transform","concat","className","includes","GridRows","scale","GridColumns"],"sourceRoot":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/grid-control/style.css","mappings":"AAIE,iCACE,cAJc,CAKd,iBACA,2B","sources":["webpack://@automattic/charts/./src/components/grid-control/grid-control.module.scss"],"sourcesContent":["// Variables\n$grid-line-color: #d7d6d6;\n\n.grid-control {\n :global(.visx-line) {\n stroke: $grid-line-color;\n stroke-width: 1px;\n shape-rendering: crispEdges;\n }\n} "],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var l in a)e.o(a,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:a[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Legend:()=>o});const a=require("@visx/legend"),l=require("@visx/scale"),n=require("clsx");var r=e.n(n);const i={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var c={horizontal:"row",vertical:"column"},o=function(e){var t=e.items,n=e.className,o=e.orientation,d=void 0===o?"horizontal":o,s=(0,l.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:r()(i.legend,i["legend--".concat(d)],n),role:"list"},React.createElement(a.LegendOrdinal,{scale:s,direction:c[d],shape:"rect",shapeWidth:16,shapeHeight:16,className:i["legend-items"]},(function(e){return React.createElement("div",{className:i["legend--".concat(d)]},e.map((function(e){var a,l;return React.createElement("div",{key:e.text,className:i["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:i["legend-item-swatch"]})),React.createElement("span",{className:i["legend-item-label"]},e.text,(null===(a=t.find((function(t){return t.label===e.text})))||void 0===a?void 0:a.value)&&React.createElement("span",{className:i["legend-item-value"]},null===(l=t.find((function(t){return t.label===e.text})))||void 0===l?void 0:l.value)))})))})))};module.exports=t})();
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/legend/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,kCCL9D,MAAM,EAA+BC,QAAQ,gBCAvC,EAA+BA,QAAQ,eCAvC,EAA+BA,QAAQ,Q,aCC7C,SAAgB,qB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wB,QADDY,EAC9C3B,EAAMgC,MAAM,SAAAxB,GAAI,OAAIA,EAAKC,QAAUA,EAAMmB,IAAI,WAAE,IAAAD,OAAA,EAA/CA,EAAiDlC,QAIjD,IAEF,IAKX,E","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/external commonjs2 \"@visx/legend\"","webpack://@automattic/charts/external commonjs2 \"@visx/scale\"","webpack://@automattic/charts/external commonjs2 \"clsx\"","webpack://@automattic/charts/./src/components/legend/legend.module.scss?843e","webpack://@automattic/charts/./src/components/legend/base-legend.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/legend\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/scale\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clsx\");","// extracted by mini-css-extract-plugin\nexport default {\"legend--horizontal\":\"b1_5FxxoK4aEFLoe67IA\",\"legend--vertical\":\"vpmQkJAPhp3XJ9Wb6vOw\",\"legend-item\":\"IKM8KG1lF9e5NzDqMLOJ\",\"legend-item-swatch\":\"_eccyBq0v2puKsHw8XND\",\"legend-item-label\":\"UeZrUEpEK0tLzXHmeUco\",\"legend-item-value\":\"R5msPOYKm79jYV13H0v7\"};","import { LegendOrdinal } from '@visx/legend';\nimport { scaleOrdinal } from '@visx/scale';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport styles from './legend.module.scss';\nimport type { LegendProps } from './types';\n\n/**\n * Base legend component that displays color-coded items with labels using visx\n * @param {object} props - Component properties\n * @param {Array} props.items - Array of legend items to display\n * @param {string} props.className - Additional CSS class names\n * @param {string} props.orientation - Layout orientation (horizontal/vertical)\n * @return {JSX.Element} Rendered legend component\n */\nconst orientationToFlexDirection = {\n\thorizontal: 'row' as const,\n\tvertical: 'column' as const,\n};\n\nexport const BaseLegend: FC< LegendProps > = ( {\n\titems,\n\tclassName,\n\torientation = 'horizontal',\n} ) => {\n\tconst legendScale = scaleOrdinal( {\n\t\tdomain: items.map( item => item.label ),\n\t\trange: items.map( item => item.color ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( styles.legend, styles[ `legend--${ orientation }` ], className ) }\n\t\t\trole=\"list\"\n\t\t>\n\t\t\t<LegendOrdinal\n\t\t\t\tscale={ legendScale }\n\t\t\t\tdirection={ orientationToFlexDirection[ orientation ] }\n\t\t\t\tshape=\"rect\"\n\t\t\t\tshapeWidth={ 16 }\n\t\t\t\tshapeHeight={ 16 }\n\t\t\t\tclassName={ styles[ 'legend-items' ] }\n\t\t\t>\n\t\t\t\t{ labels => (\n\t\t\t\t\t<div className={ styles[ `legend--${ orientation }` ] }>\n\t\t\t\t\t\t{ labels.map( label => (\n\t\t\t\t\t\t\t<div key={ label.text } className={ styles[ 'legend-item' ] }>\n\t\t\t\t\t\t\t\t<svg width={ 16 } height={ 16 }>\n\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\twidth={ 16 }\n\t\t\t\t\t\t\t\t\t\theight={ 16 }\n\t\t\t\t\t\t\t\t\t\tfill={ label.value }\n\t\t\t\t\t\t\t\t\t\tclassName={ styles[ 'legend-item-swatch' ] }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-label' ] }>\n\t\t\t\t\t\t\t\t\t{ label.text }\n\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value && (\n\t\t\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-value' ] }>\n\t\t\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</LegendOrdinal>\n\t\t</div>\n\t);\n};\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","orientationToFlexDirection","horizontal","vertical","BaseLegend","_ref","items","className","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","React","createElement","clsx","styles","legend","concat","role","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","text","width","height","fill","find"],"sourceRoot":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
.b1_5FxxoK4aEFLoe67IA{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px}.vpmQkJAPhp3XJ9Wb6vOw{display:flex;flex-direction:column;gap:8px}.IKM8KG1lF9e5NzDqMLOJ{display:flex;align-items:center;gap:8px;font-size:.875rem}._eccyBq0v2puKsHw8XND{border-radius:2px}.UeZrUEpEK0tLzXHmeUco{color:var(--jp-gray-80, #2c3338);display:flex;align-items:center;gap:.5rem}.R5msPOYKm79jYV13H0v7{font-weight:500}
|
|
2
|
+
|
|
3
|
+
/*# sourceMappingURL=style.css.map*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/legend/style.css","mappings":"AACC,sBACC,aACA,mBACA,eACA,SAGD,sBACC,aACA,sBACA,QAIF,sBACC,aACA,mBACA,QACA,kBAGD,sBACC,kBAGD,sBACC,iCACA,aACA,mBACA,UAGD,sBACC,gB","sources":["webpack://@automattic/charts/./src/components/legend/legend.module.scss"],"sourcesContent":[".legend {\n\t&--horizontal {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\tgap: 16px;\n\t}\n\n\t&--vertical {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t}\n}\n\n.legend-item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tfont-size: 0.875rem;\n}\n\n.legend-item-swatch {\n\tborder-radius: 2px;\n}\n\n.legend-item-label {\n\tcolor: var(--jp-gray-80, #2c3338);\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.5rem;\n}\n\n.legend-item-value {\n\tfont-weight: 500;\n}\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},r.apply(null,arguments)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}e.r(t),e.d(t,{LineChart:()=>y});const n=require("@visx/xychart"),l=require("clsx");var o=e.n(l);const i=require("react");var c={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},u=(0,i.createContext)(c);const s=require("@visx/legend"),d=require("@visx/scale"),m={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var v={horizontal:"row",vertical:"column"},h=function(e){var t=e.items,r=e.className,a=e.orientation,n=void 0===a?"horizontal":a,l=(0,d.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:o()(m.legend,m["legend--".concat(n)],r),role:"list"},React.createElement(s.LegendOrdinal,{scale:l,direction:v[n],shape:"rect",shapeWidth:16,shapeHeight:16,className:m["legend-items"]},(function(e){return React.createElement("div",{className:m["legend--".concat(n)]},e.map((function(e){var r,a;return React.createElement("div",{key:e.text,className:m["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:m["legend-item-swatch"]})),React.createElement("span",{className:m["legend-item-label"]},e.text,(null===(r=t.find((function(t){return t.label===e.text})))||void 0===r?void 0:r.value)&&React.createElement("span",{className:m["legend-item-value"]},null===(a=t.find((function(t){return t.label===e.text})))||void 0===a?void 0:a.value)))})))})))};const g={"line-chart":"vbyo4J2HC_KvyGgsWui7","line-chart__tooltip":"nLSohGgB7OyUmLRN_dLD","line-chart__tooltip-date":"MGw7UT3IImVKXXuBYmwf","line-chart__tooltip-row":"KwvDxit9dbF2E6ZzF29e","line-chart__tooltip-label":"WmFS4ekGu9e3G6URbkhd"};var p=function(e){var t,r=e.tooltipData,n=null==r||null===(t=r.nearestDatum)||void 0===t?void 0:t.datum;if(!n)return null;var l=Object.entries((null==r?void 0:r.datumByKey)||{}).map((function(e){var t,r,n=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,l,o,i=[],c=!0,u=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(a=l.call(r)).done)&&(i.push(a.value),i.length!==t);c=!0);}catch(e){u=!0,n=e}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw n}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return{key:n[0],value:n[1].datum.value}})).sort((function(e,t){return t.value-e.value}));return React.createElement("div",{className:g["line-chart__tooltip"]},React.createElement("div",{className:g["line-chart__tooltip-date"]},n.date.toLocaleDateString()),l.map((function(e){return React.createElement("div",{key:e.key,className:g["line-chart__tooltip-row"]},React.createElement("span",{className:g["line-chart__tooltip-label"]},e.key,":"),React.createElement("span",{className:g["line-chart__tooltip-value"]},e.value))})))},f=function(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})};const y=function(e){var t=e.data,a=e.width,l=e.height,c=e.margin,s=void 0===c?{top:20,right:20,bottom:40,left:40}:c,d=e.className,m=e.withTooltips,v=void 0===m||m,y=e.showLegend,b=void 0!==y&&y,E=e.legendOrientation,k=void 0===E?"horizontal":E,_=(0,i.useContext)(u);if(null==t||!t.length)return React.createElement("div",{className:o()("line-chart-empty",g["line-chart-empty"])},"Empty...");var R=t.map((function(e,t){return{label:e.label,value:"",color:_.colors[t%_.colors.length]}})),F={xAccessor:function(e){return e.date},yAccessor:function(e){return e.value}},w=(0,n.buildChartTheme)({backgroundColor:_.backgroundColor,colors:_.colors,gridStyles:_.gridStyles,tickLength:(null==_?void 0:_.tickLength)||0,gridColor:(null==_?void 0:_.gridColor)||"",gridColorDark:(null==_?void 0:_.gridColorDark)||""});return React.createElement("div",{className:o()("line-chart",g["line-chart"],d)},React.createElement(n.XYChart,{theme:w,width:a,height:l,margin:s,xScale:{type:"time"},yScale:{type:"linear",nice:!0}},React.createElement(n.AnimatedGrid,{columns:!1,numTicks:4}),React.createElement(n.AnimatedAxis,{orientation:"bottom",numTicks:5,tickFormat:f}),React.createElement(n.AnimatedAxis,{orientation:"left",numTicks:4}),t.map((function(e,t){return React.createElement(n.AnimatedLineSeries,r({key:null==e?void 0:e.label,dataKey:null==e?void 0:e.label,data:e.data},F,{stroke:w.colors[t%w.colors.length],strokeWidth:2}))})),v&&React.createElement(n.Tooltip,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:p})),b&&React.createElement(h,{items:R,orientation:k,className:g["line-chart-legend"]}))};module.exports=t})();
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/line-chart/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,C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A,EACT0C,OAASA,EACTsB,OAAS,CAAEC,KAAM,QACjBC,OAAS,CAAED,KAAM,SAAUE,MAAM,IAEjCrF,MAAAC,cAACqF,EAAAA,aAAY,CAACC,SAAU,EAAQC,SAAW,IAC3CxF,MAAAC,cAACwF,EAAAA,aAAY,CAAClG,YAAY,SAASiG,SAAW,EAAIE,WAAatC,IAC/DpD,MAAAC,cAACwF,EAAAA,aAAY,CAAClG,YAAY,OAAOiG,SAAW,IAE1C9B,EAAK/D,KAAK,SAAEgG,EAAYhB,GAAK,OAC9B3E,MAAAC,cAAC2F,EAAAA,mBAAkBtI,EAAA,CAClBd,IAAMmJ,aAAU,EAAVA,EAAY9F,MAClBgG,QAAUF,aAAU,EAAVA,EAAY9F,MACtB6D,KAAOiC,EAAWjC,MACbkB,EAAS,CACdpG,OAASuG,EAAMzG,OAAQqG,EAAQI,EAAMzG,OAAOV,QAC5Ca,YAAc,IACb,IAGDyF,GACDlE,MAAAC,cAAC6F,EAAAA,QAAO,CACPC,qBAAmB,EACnBC,qBAAmB,EACnBC,kBAAgB,EAChB5E,cAAgBA,KAKjB+C,GACDpE,MAAAC,cAACiG,EAAM,CACN9G,MAAQqF,EACRlF,YAAc+E,EACdjF,UAAYc,EAAQ,uBAKzB,E","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://@automattic/charts/external commonjs2 \"@visx/xychart\"","webpack://@automattic/charts/external commonjs2 \"clsx\"","webpack://@automattic/charts/external commonjs2 \"react\"","webpack://@automattic/charts/./src/providers/theme/themes.ts","webpack://@automattic/charts/./src/providers/theme/theme-provider.tsx","webpack://@automattic/charts/external commonjs2 \"@visx/legend\"","webpack://@automattic/charts/external commonjs2 \"@visx/scale\"","webpack://@automattic/charts/./src/components/legend/legend.module.scss?843e","webpack://@automattic/charts/./src/components/legend/base-legend.tsx","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/../../../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/unsupportedIterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","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 };","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/xychart\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clsx\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","import type { ChartTheme } from '../../types';\n\n/**\n * Default theme configuration\n */\nconst defaultTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Jetpack theme configuration\n */\nconst jetpackTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Woo theme configuration\n */\nconst wooTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#80C8FF', '#B999FF', '#3858E9' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\nexport { defaultTheme, jetpackTheme, wooTheme };\n","import { createContext, useContext, FC, type ReactNode } from 'react';\nimport { defaultTheme } from './themes';\nimport type { ChartTheme } from '../../types';\n\n/**\n * Context for sharing theme configuration across components\n */\nconst ThemeContext = createContext< ChartTheme >( defaultTheme );\n\n/**\n * Hook to access chart theme\n * @return {object} A built theme configuration compatible with visx charts\n */\nconst useChartTheme = () => {\n\tconst theme = useContext( ThemeContext );\n\treturn theme;\n};\n\n/**\n * Props for the ThemeProvider component\n */\ntype ThemeProviderProps = {\n\t/** Optional partial theme override */\n\ttheme?: Partial< ChartTheme >;\n\t/** Child components that will have access to the theme */\n\tchildren: ReactNode;\n};\n\n// Provider component for chart theming\n// Allows theme customization through props while maintaining default values\nconst ThemeProvider: FC< ThemeProviderProps > = ( { theme = {}, children } ) => {\n\tconst mergedTheme = { ...defaultTheme, ...theme };\n\treturn <ThemeContext.Provider value={ mergedTheme }>{ children }</ThemeContext.Provider>;\n};\n\nexport { ThemeProvider, useChartTheme };\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/legend\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/scale\");","// 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","// 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 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\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 LineChart;\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 };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _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 };"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","_extends","assign","bind","n","e","arguments","length","t","r","apply","_arrayLikeToArray","Array","require","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","orientationToFlexDirection","horizontal","vertical","BaseLegend","_ref","items","className","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","React","createElement","clsx","styles","legend","concat","role","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","text","width","height","fill","find","renderTooltip","_tooltipData$nearestD","tooltipData","nearestDatum","datum","tooltipPoints","entries","datumByKey","_ref2","_ref3","isArray","l","iterator","i","u","f","next","done","push","toString","slice","constructor","name","from","test","TypeError","sort","b","date","toLocaleDateString","point","formatDateTick","Date","undefined","month","day","_ref4","data","_ref4$margin","margin","top","right","bottom","left","_ref4$withTooltips","withTooltips","_ref4$showLegend","showLegend","_ref4$legendOrientati","legendOrientation","providerTheme","useContext","legendItems","group","index","accessors","xAccessor","yAccessor","theme","buildChartTheme","XYChart","xScale","type","yScale","nice","AnimatedGrid","columns","numTicks","AnimatedAxis","tickFormat","seriesData","AnimatedLineSeries","dataKey","Tooltip","snapTooltipToDatumX","snapTooltipToDatumY","showSeriesGlyphs","Legend"],"sourceRoot":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
.vbyo4J2HC_KvyGgsWui7{position:relative}.nLSohGgB7OyUmLRN_dLD{background:#fff;padding:.5rem}.MGw7UT3IImVKXXuBYmwf{font-weight:bold;padding-bottom:10px}.KwvDxit9dbF2E6ZzF29e{display:flex;align-items:center;padding:4px 0;justify-content:space-between}.WmFS4ekGu9e3G6URbkhd{font-weight:500;padding-right:1rem}
|
|
2
|
+
.b1_5FxxoK4aEFLoe67IA{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px}.vpmQkJAPhp3XJ9Wb6vOw{display:flex;flex-direction:column;gap:8px}.IKM8KG1lF9e5NzDqMLOJ{display:flex;align-items:center;gap:8px;font-size:.875rem}._eccyBq0v2puKsHw8XND{border-radius:2px}.UeZrUEpEK0tLzXHmeUco{color:var(--jp-gray-80, #2c3338);display:flex;align-items:center;gap:.5rem}.R5msPOYKm79jYV13H0v7{font-weight:500}
|
|
3
|
+
|
|
4
|
+
/*# sourceMappingURL=style.css.map*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/line-chart/style.css","mappings":"AAAA,sBACC,kBAEA,sBACC,gBACA,cAGD,sBACC,iBACA,oBAGD,sBACC,aACA,mBACA,cACA,8BAGD,sBACC,gBACA,mB;ACrBD,sBACC,aACA,mBACA,eACA,SAGD,sBACC,aACA,sBACA,QAIF,sBACC,aACA,mBACA,QACA,kBAGD,sBACC,kBAGD,sBACC,iCACA,aACA,mBACA,UAGD,sBACC,gB","sources":["webpack://@automattic/charts/./src/components/line-chart/line-chart.module.scss","webpack://@automattic/charts/./src/components/legend/legend.module.scss"],"sourcesContent":[".line-chart {\n\tposition: relative;\n\n\t&__tooltip {\n\t\tbackground: #fff;\n\t\tpadding: 0.5rem;\n\t}\n\n\t&__tooltip-date {\n\t\tfont-weight: bold;\n\t\tpadding-bottom: 10px;\n\t}\n\n\t&__tooltip-row {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 4px 0;\n\t\tjustify-content: space-between;\n\t}\n\n\t&__tooltip-label {\n\t\tfont-weight: 500;\n\t\tpadding-right: 1rem;\n\t}\n}\n",".legend {\n\t&--horizontal {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\tgap: 16px;\n\t}\n\n\t&--vertical {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t}\n}\n\n.legend-item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tfont-size: 0.875rem;\n}\n\n.legend-item-swatch {\n\tborder-radius: 2px;\n}\n\n.legend-item-label {\n\tcolor: var(--jp-gray-80, #2c3338);\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.5rem;\n}\n\n.legend-item-value {\n\tfont-weight: 500;\n}\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function n(e){return n="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},n(e)}function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.r(t),e.d(t,{PieChart:()=>j});const a=require("@visx/group"),l=require("@visx/shape"),i=require("clsx");var c=e.n(i);const u=require("@visx/event"),s=require("@visx/tooltip"),d=require("react");var p={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},f=(0,d.createContext)(p);const m=require("@visx/legend"),v=require("@visx/scale"),g={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var y={horizontal:"row",vertical:"column"},b=function(e){var t=e.items,r=e.className,n=e.orientation,o=void 0===n?"horizontal":n,a=(0,v.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:c()(g.legend,g["legend--".concat(o)],r),role:"list"},React.createElement(m.LegendOrdinal,{scale:a,direction:y[o],shape:"rect",shapeWidth:16,shapeHeight:16,className:g["legend-items"]},(function(e){return React.createElement("div",{className:g["legend--".concat(o)]},e.map((function(e){var r,n;return React.createElement("div",{key:e.text,className:g["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:g["legend-item-swatch"]})),React.createElement("span",{className:g["legend-item-label"]},e.text,(null===(r=t.find((function(t){return t.label===e.text})))||void 0===r?void 0:r.value)&&React.createElement("span",{className:g["legend-item-value"]},null===(n=t.find((function(t){return t.label===e.text})))||void 0===n?void 0:n.value)))})))})))};var h=function(e){var t=e.data;return React.createElement(React.Fragment,null,null==t?void 0:t.label,": ",(null==t?void 0:t.valueDisplay)||(null==t?void 0:t.value))},O=function(e){var t=e.data,r=e.top,n=e.left,o=e.component,a=void 0===o?h:o,l=e.children,i=e.className;return React.createElement("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:r,left:n},role:"tooltip"},l||t&&React.createElement(a,{data:t,className:i}))};const E={"pie-chart":"R2Ly_tkJtgL0HA8P3fpm"};function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const j=function(e){var t=e.data,n=e.width,o=void 0===n?500:n,i=e.height,m=void 0===i?500:i,v=e.withTooltips,g=void 0!==v&&v,y=e.innerRadius,h=void 0===y?0:y,w=e.className,j=e.showLegend,x=e.legendOrientation,S=(0,d.useContext)(f),F=function(e){var t=e.withTooltips,r=(0,s.useTooltip)(),n=r.tooltipOpen,o=r.tooltipLeft,a=r.tooltipTop,l=r.tooltipData,i=r.hideTooltip,c=r.showTooltip;return{onMouseMove:(0,d.useCallback)((function(e,r){if(t){var n=(0,u.localPoint)(e);n&&c({tooltipData:r,tooltipLeft:n.x,tooltipTop:n.y-10})}}),[t,c]),onMouseLeave:(0,d.useCallback)((function(){t&&i()}),[t,i]),tooltipOpen:n,tooltipData:l||null,tooltipLeft:o,tooltipTop:a}}({withTooltips:g}),P=F.onMouseMove,A=F.onMouseLeave,C=F.tooltipOpen,M=F.tooltipData,N=F.tooltipLeft,k=F.tooltipTop,D=Math.min(o,m)/2,L=o/2,T=m/2,q=t.map((function(e,t){return R(R({},e),{},{index:t})})),K={value:function(e){return e.value},fill:function(e){return(null==e?void 0:e.color)||S.colors[e.index]}},_=t.map((function(e,t){return{label:e.label,value:e.value.toString(),color:S.colors[t%S.colors.length]}}));return React.createElement("div",{className:c()("pie-chart",E["pie-chart"],w)},React.createElement("svg",{width:o,height:m},React.createElement(a.Group,{top:T,left:L},React.createElement(l.Pie,{data:q,pieValue:K.value,outerRadius:D-20,innerRadius:h},(function(e){return e.arcs.map((function(t,n){var o,a,l=(o=e.path.centroid(t),a=2,function(e){if(Array.isArray(e))return e}(o)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,l,i=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(u)throw o}}return i}}(o,a)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(o,a)||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.")}()),i=l[0],c=l[1],u=t.endAngle-t.startAngle>=.25,s={d:e.path(t)||"",fill:K.fill(t.data)};return g&&(s.onMouseMove=function(e){return P(e,t.data)},s.onMouseLeave=A),React.createElement("g",{key:"arc-".concat(n)},React.createElement("path",s),u&&React.createElement("text",{x:i,y:c,dy:".33em",fill:S.labelBackgroundColor||p.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none"},t.data.label))}))})))),j&&React.createElement(b,{items:_,orientation:x,className:E["pie-chart-legend"]}),g&&C&&M&&React.createElement(O,{data:M,top:k||0,left:N||0,style:{transform:"translate(-50%, -100%)"}}))};module.exports=t})();
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/pie-chart/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CA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AAMF,IAAS,GACtB5D,KAAMmD,EAAUnD,KAAM4D,EAAIzD,OAQ3B,OALKe,IACJ8D,EAAU9C,YATa,SAAEE,GAA+B,OACxDF,EAAaE,EAAOwB,EAAIzD,KAAM,EAS9B6E,EAAUvC,aAAeA,GAIzB5D,MAAAC,cAAA,KAAG9D,IAAG,OAAAkE,OAAW+D,IAChBpE,MAAAC,cAAA,OAAWkG,GACTH,GACDhG,MAAAC,cAAA,QACCyD,EAAIoC,EACJnC,EAAIoC,EACJK,GAAG,QACHjF,KACCuB,EAAcrE,sBAAwBF,EAAaE,qBAEpDgI,SAAW,GACXC,WAAW,SACXC,cAAc,QAEZxB,EAAIzD,KAAKzB,OAKhB,GACD,MAKD2C,GACDxC,MAAAC,cAACuG,EAAM,CACNpH,MAAQmF,EACRhF,YAAckD,EACdpD,UAAYc,EAAQ,sBAIpBkC,GAAgBU,GAAeG,GAChClD,MAAAC,cAACwB,EAAW,CACXH,KAAO4B,EACPvB,IAAMsB,GAAc,EACpBrB,KAAOoB,GAAe,EACtBf,MAAQ,CACPwE,UAAW,4BAMjB,E","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/../../../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/typeof.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@automattic/charts/external commonjs2 \"@visx/group\"","webpack://@automattic/charts/external commonjs2 \"@visx/shape\"","webpack://@automattic/charts/external commonjs2 \"clsx\"","webpack://@automattic/charts/external commonjs2 \"@visx/event\"","webpack://@automattic/charts/external commonjs2 \"@visx/tooltip\"","webpack://@automattic/charts/external commonjs2 \"react\"","webpack://@automattic/charts/./src/providers/theme/themes.ts","webpack://@automattic/charts/./src/providers/theme/theme-provider.tsx","webpack://@automattic/charts/external commonjs2 \"@visx/legend\"","webpack://@automattic/charts/external commonjs2 \"@visx/scale\"","webpack://@automattic/charts/./src/components/legend/legend.module.scss?843e","webpack://@automattic/charts/./src/components/legend/base-legend.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss?1d14","webpack://@automattic/charts/./src/components/pie-chart/pie-chart.module.scss?1ca3","webpack://@automattic/charts/./src/components/pie-chart/pie-chart.tsx","webpack://@automattic/charts/./src/hooks/use-chart-mouse-handler.ts","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/unsupportedIterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/group\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/shape\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clsx\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/event\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/tooltip\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","import type { ChartTheme } from '../../types';\n\n/**\n * Default theme configuration\n */\nconst defaultTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Jetpack theme configuration\n */\nconst jetpackTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Woo theme configuration\n */\nconst wooTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#80C8FF', '#B999FF', '#3858E9' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\nexport { defaultTheme, jetpackTheme, wooTheme };\n","import { createContext, useContext, FC, type ReactNode } from 'react';\nimport { defaultTheme } from './themes';\nimport type { ChartTheme } from '../../types';\n\n/**\n * Context for sharing theme configuration across components\n */\nconst ThemeContext = createContext< ChartTheme >( defaultTheme );\n\n/**\n * Hook to access chart theme\n * @return {object} A built theme configuration compatible with visx charts\n */\nconst useChartTheme = () => {\n\tconst theme = useContext( ThemeContext );\n\treturn theme;\n};\n\n/**\n * Props for the ThemeProvider component\n */\ntype ThemeProviderProps = {\n\t/** Optional partial theme override */\n\ttheme?: Partial< ChartTheme >;\n\t/** Child components that will have access to the theme */\n\tchildren: ReactNode;\n};\n\n// Provider component for chart theming\n// Allows theme customization through props while maintaining default values\nconst ThemeProvider: FC< ThemeProviderProps > = ( { theme = {}, children } ) => {\n\tconst mergedTheme = { ...defaultTheme, ...theme };\n\treturn <ThemeContext.Provider value={ mergedTheme }>{ children }</ThemeContext.Provider>;\n};\n\nexport { ThemeProvider, useChartTheme };\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/legend\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/scale\");","// extracted by mini-css-extract-plugin\nexport default {\"legend--horizontal\":\"b1_5FxxoK4aEFLoe67IA\",\"legend--vertical\":\"vpmQkJAPhp3XJ9Wb6vOw\",\"legend-item\":\"IKM8KG1lF9e5NzDqMLOJ\",\"legend-item-swatch\":\"_eccyBq0v2puKsHw8XND\",\"legend-item-label\":\"UeZrUEpEK0tLzXHmeUco\",\"legend-item-value\":\"R5msPOYKm79jYV13H0v7\"};","import { LegendOrdinal } from '@visx/legend';\nimport { scaleOrdinal } from '@visx/scale';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport styles from './legend.module.scss';\nimport type { LegendProps } from './types';\n\n/**\n * Base legend component that displays color-coded items with labels using visx\n * @param {object} props - Component properties\n * @param {Array} props.items - Array of legend items to display\n * @param {string} props.className - Additional CSS class names\n * @param {string} props.orientation - Layout orientation (horizontal/vertical)\n * @return {JSX.Element} Rendered legend component\n */\nconst orientationToFlexDirection = {\n\thorizontal: 'row' as const,\n\tvertical: 'column' as const,\n};\n\nexport const BaseLegend: FC< LegendProps > = ( {\n\titems,\n\tclassName,\n\torientation = 'horizontal',\n} ) => {\n\tconst legendScale = scaleOrdinal( {\n\t\tdomain: items.map( item => item.label ),\n\t\trange: items.map( item => item.color ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( styles.legend, styles[ `legend--${ orientation }` ], className ) }\n\t\t\trole=\"list\"\n\t\t>\n\t\t\t<LegendOrdinal\n\t\t\t\tscale={ legendScale }\n\t\t\t\tdirection={ orientationToFlexDirection[ orientation ] }\n\t\t\t\tshape=\"rect\"\n\t\t\t\tshapeWidth={ 16 }\n\t\t\t\tshapeHeight={ 16 }\n\t\t\t\tclassName={ styles[ 'legend-items' ] }\n\t\t\t>\n\t\t\t\t{ labels => (\n\t\t\t\t\t<div className={ styles[ `legend--${ orientation }` ] }>\n\t\t\t\t\t\t{ labels.map( label => (\n\t\t\t\t\t\t\t<div key={ label.text } className={ styles[ 'legend-item' ] }>\n\t\t\t\t\t\t\t\t<svg width={ 16 } height={ 16 }>\n\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\twidth={ 16 }\n\t\t\t\t\t\t\t\t\t\theight={ 16 }\n\t\t\t\t\t\t\t\t\t\tfill={ label.value }\n\t\t\t\t\t\t\t\t\t\tclassName={ styles[ 'legend-item-swatch' ] }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-label' ] }>\n\t\t\t\t\t\t\t\t\t{ label.text }\n\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value && (\n\t\t\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-value' ] }>\n\t\t\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</LegendOrdinal>\n\t\t</div>\n\t);\n};\n","import styles from './base-tooltip.module.scss';\nimport type { CSSProperties, ComponentType, ReactNode } from 'react';\n\ntype TooltipData = {\n\tlabel: string;\n\tvalue: number;\n\tvalueDisplay?: string;\n};\n\ntype TooltipComponentProps = {\n\tdata: TooltipData;\n\tclassName?: string;\n};\n\ntype TooltipCommonProps = {\n\ttop: number;\n\tleft: number;\n\tstyle?: CSSProperties;\n\tclassName?: string;\n};\n\ntype DefaultDataTooltip = {\n\tdata: TooltipData;\n\tcomponent?: ComponentType< TooltipComponentProps >;\n\tchildren?: never;\n};\n\ntype CustomTooltip = {\n\tchildren: ReactNode;\n\tdata?: never;\n\tcomponent?: never;\n};\n\ntype BaseTooltipProps = TooltipCommonProps & ( DefaultDataTooltip | CustomTooltip );\n\nconst DefaultTooltipContent = ( { data }: TooltipComponentProps ) => (\n\t<>\n\t\t{ data?.label }: { data?.valueDisplay || data?.value }\n\t</>\n);\n\nexport const BaseTooltip = ( {\n\tdata,\n\ttop,\n\tleft,\n\tcomponent: Component = DefaultTooltipContent,\n\tchildren,\n\tclassName,\n}: BaseTooltipProps ) => {\n\treturn (\n\t\t<div className={ styles.tooltip } style={ { top, left } } role=\"tooltip\">\n\t\t\t{ children || ( data && <Component data={ data } className={ className } /> ) }\n\t\t</div>\n\t);\n};\n\nexport type { BaseTooltipProps, TooltipData };\n","// extracted by mini-css-extract-plugin\nexport default {\"tooltip\":\"Jmgc7XAf2uAyK5059rBe\"};","// extracted by mini-css-extract-plugin\nexport default {\"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 { 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\nexport default PieChart;\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","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 };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _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 };"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","_arrayLikeToArray","r","length","e","n","Array","_typeof","iterator","constructor","t","i","toPrimitive","TypeError","String","toPropertyKey","configurable","writable","require","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","orientationToFlexDirection","horizontal","vertical","BaseLegend","_ref","items","className","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","React","createElement","clsx","styles","legend","concat","role","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","text","width","height","fill","find","DefaultTooltipContent","data","Fragment","valueDisplay","BaseTooltip","_ref2","top","left","_ref2$component","component","Component","children","style","_ref$width","_ref$height","_ref$withTooltips","withTooltips","_ref$innerRadius","innerRadius","showLegend","legendOrientation","providerTheme","useContext","_useChartMouseHandler","_useTooltip","useTooltip","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","onMouseMove","useCallback","event","coords","localPoint","x","y","onMouseLeave","useChartMouseHandler","radius","Math","min","centerX","centerY","dataWithIndex","index","_objectSpread","accessors","legendItems","toString","Group","Pie","pieValue","outerRadius","pie","arcs","arc","_pie$path$centroid2","path","centroid","isArray","l","u","f","next","done","push","slice","name","from","test","centroidX","centroidY","hasSpaceForLabel","endAngle","startAngle","pathProps","dy","fontSize","textAnchor","pointerEvents","Legend","transform"],"sourceRoot":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
.R2Ly_tkJtgL0HA8P3fpm{position:relative}
|
|
2
|
+
.b1_5FxxoK4aEFLoe67IA{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px}.vpmQkJAPhp3XJ9Wb6vOw{display:flex;flex-direction:column;gap:8px}.IKM8KG1lF9e5NzDqMLOJ{display:flex;align-items:center;gap:8px;font-size:.875rem}._eccyBq0v2puKsHw8XND{border-radius:2px}.UeZrUEpEK0tLzXHmeUco{color:var(--jp-gray-80, #2c3338);display:flex;align-items:center;gap:.5rem}.R5msPOYKm79jYV13H0v7{font-weight:500}
|
|
3
|
+
.Jmgc7XAf2uAyK5059rBe{padding:.5rem;background-color:rgba(0,0,0,.85);color:#fff;border-radius:4px;font-size:14px;box-shadow:0 1px 2px rgba(0,0,0,.1);position:absolute;pointer-events:none;transform:translate(-50%, -100%)}
|
|
4
|
+
|
|
5
|
+
/*# sourceMappingURL=style.css.map*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/pie-chart/style.css","mappings":"AAAA,sBACC,kB;ACAA,sBACC,aACA,mBACA,eACA,SAGD,sBACC,aACA,sBACA,QAIF,sBACC,aACA,mBACA,QACA,kBAGD,sBACC,kBAGD,sBACC,iCACA,aACA,mBACA,UAGD,sBACC,gB;AClCD,sBACE,cACA,iCACA,WACA,kBACA,eACA,oCACA,kBACA,oBACA,iC","sources":["webpack://@automattic/charts/./src/components/pie-chart/pie-chart.module.scss","webpack://@automattic/charts/./src/components/legend/legend.module.scss","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss"],"sourcesContent":[".pie-chart {\n\tposition: relative;\n}\n",".legend {\n\t&--horizontal {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\tgap: 16px;\n\t}\n\n\t&--vertical {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t}\n}\n\n.legend-item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tfont-size: 0.875rem;\n}\n\n.legend-item-swatch {\n\tborder-radius: 2px;\n}\n\n.legend-item-label {\n\tcolor: var(--jp-gray-80, #2c3338);\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.5rem;\n}\n\n.legend-item-value {\n\tfont-weight: 500;\n}\n",".tooltip {\n padding: 0.5rem;\n background-color: rgba(0, 0, 0, 0.85);\n color: white;\n border-radius: 4px;\n font-size: 14px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n position: absolute;\n pointer-events: none;\n transform: translate(-50%, -100%);\n}\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e){return r="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},r(e)}function a(e,t,a){return(t=function(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}e.r(t),e.d(t,{PieSemiCircleChart:()=>w});const n=require("@visx/event"),l=require("@visx/group"),o=require("@visx/shape/lib/shapes/Pie");var i=e.n(o);const c=require("@visx/text"),u=require("@visx/tooltip"),s=require("clsx");var d=e.n(s);const m=require("react");var p={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},v=(0,m.createContext)(p);const f=require("@visx/legend"),b=require("@visx/scale"),g={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var y={horizontal:"row",vertical:"column"},h=function(e){var t=e.items,r=e.className,a=e.orientation,n=void 0===a?"horizontal":a,l=(0,b.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:d()(g.legend,g["legend--".concat(n)],r),role:"list"},React.createElement(f.LegendOrdinal,{scale:l,direction:y[n],shape:"rect",shapeWidth:16,shapeHeight:16,className:g["legend-items"]},(function(e){return React.createElement("div",{className:g["legend--".concat(n)]},e.map((function(e){var r,a;return React.createElement("div",{key:e.text,className:g["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:g["legend-item-swatch"]})),React.createElement("span",{className:g["legend-item-label"]},e.text,(null===(r=t.find((function(t){return t.label===e.text})))||void 0===r?void 0:r.value)&&React.createElement("span",{className:g["legend-item-value"]},null===(a=t.find((function(t){return t.label===e.text})))||void 0===a?void 0:a.value)))})))})))};var E=function(e){var t=e.data;return React.createElement(React.Fragment,null,null==t?void 0:t.label,": ",(null==t?void 0:t.valueDisplay)||(null==t?void 0:t.value))},O=function(e){var t=e.data,r=e.top,a=e.left,n=e.component,l=void 0===n?E:n,o=e.children,i=e.className;return React.createElement("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:r,left:a},role:"tooltip"},o||t&&React.createElement(l,{data:t,className:i}))};function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const w=function(e){var t=e.data,r=e.width,a=void 0===r?500:r,o=e.label,s=e.note,p=e.className,f=e.withTooltips,b=void 0!==f&&f,g=e.clockwise,y=void 0===g||g,E=e.thickness,R=void 0===E?.4:E,w=e.showLegend,P=e.legendOrientation,F=(0,m.useContext)(v),j=(0,u.useTooltip)(),N=j.tooltipOpen,S=j.tooltipLeft,D=j.tooltipTop,k=j.tooltipData,C=j.hideTooltip,q=j.showTooltip,A=a/2,M=a/2,L=a/2,T=L*(1-R+.03),K=t.map((function(e,t){return x(x({},e),{},{index:t})})),B=y?-Math.PI/2:Math.PI/2,H=y?Math.PI/2:-Math.PI/2,I={value:function(e){return e.value},sort:function(e,t){return t.value-e.value},fill:function(e){return e.color||F.colors[e.index%F.colors.length]}},J=(0,m.useCallback)((function(e,t){var r=(0,n.localPoint)(e);r&&q({tooltipData:t.data,tooltipLeft:r.x,tooltipTop:r.y-10})}),[q]),W=(0,m.useCallback)((function(){C()}),[C]),_=(0,m.useCallback)((function(e){return function(t){J(t,e)}}),[J]),z=t.map((function(e,t){return{label:e.label,value:e.valueDisplay||e.value.toString(),color:I.fill(x(x({},e),{},{index:t}))}}));return React.createElement("div",{className:d()("pie-semi-circle-chart","oJsjYo330oeLpWqpqf4w",p)},React.createElement("svg",{width:a,height:M},React.createElement(l.Group,{top:A,left:A},React.createElement(i(),{data:K,pieValue:I.value,outerRadius:L,innerRadius:T,cornerRadius:3,padAngle:.03,startAngle:B,endAngle:H,pieSort:I.sort},(function(e){return e.arcs.map((function(t){return React.createElement("g",{key:t.data.label,onMouseMove:_(t),onMouseLeave:W},React.createElement("path",{d:e.path(t)||"",fill:I.fill(t.data)}))}))})),React.createElement(l.Group,null,React.createElement(c.Text,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:"bxF3iRlHVJNqwEjRY9QD"},o),React.createElement(c.Text,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:"tA3u0r3RunHmbWFBLrqW"},s)))),b&&N&&k&&React.createElement(O,{data:{label:k.label,value:k.value,valueDisplay:k.valueDisplay},top:D||0,left:S||0}),w&&React.createElement(h,{items:z,orientation:P,className:"aV40KcaCeoEycQ2crVkB"}))};module.exports=t})();
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/pie-semi-circle-chart/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,KCL9D,SAASC,EAAQb,GAGf,OAAOa,EAAU,mBAAqBH,QAAU,iBAAmBA,OAAOI,SAAW,SAAUd,GAC7F,cAAcA,CAChB,EAAI,SAAUA,GACZ,OAAOA,GAAK,mBAAqBU,QAAUV,EAAEe,cAAgBL,QAAUV,IAAMU,OAAOH,UAAY,gBAAkBP,CACpH,EAAGa,EAAQb,EACb,CCPA,SAAS,EAAgBgB,EAAGC,EAAGC,GAC7B,OAAQD,ECAV,SAAuBC,GACrB,IAAIC,ECFN,SAAqBD,GACnB,GAAI,UAAYL,EAAQK,KAAOA,EAAG,OAAOA,EACzC,IAAIF,EAAIE,EAAER,OAAOU,aACjB,QAAI,IAAWJ,EAAG,CAChB,IAAIG,EAAIH,EAAE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K7F,KAAK,SAAA4E,GAAG,OACvBvE,MAAAC,cAAA,KACC1D,IAAMgI,EAAIjD,KAAKzB,MACf4F,YAAcZ,EAAoBN,GAClCmB,aAAed,GAEf5E,MAAAC,cAAA,QAAM9D,EAAIoJ,EAAII,KAAMpB,IAAS,GAAKpD,KAAO6C,EAAU7C,KAAMoD,EAAIjD,QAC1D,GAEN,IAGDtB,MAAAC,cAAC+E,EAAAA,MAAK,KACLhF,MAAAC,cAAC2F,EAAAA,KAAI,CACJC,WAAW,SACXC,eAAe,QACfnB,GAAK,GACLtF,UClJsH,wBDoJpHQ,GAEHG,MAAAC,cAAC2F,EAAAA,KAAI,CACJC,WAAW,SACXC,eAAe,QACfnB,GAAK,GACLtF,UC1JoJ,wBD4JlJ8C,MAMJE,GAAgBW,GAAeG,GAChCnD,MAAAC,cAACwB,EAAW,CACXH,KAAO,CACNzB,MAAOsD,EAAYtD,MACnBzC,MAAO+F,EAAY/F,MACnBoE,aAAc2B,EAAY3B,cAE3BG,IAAMuB,GAAc,EACpBtB,KAAOqB,GAAe,IAItBP,GACD1C,MAAAC,cAAC8F,EAAM,CACN3G,MAAQ0F,EACRvF,YAAcoD,EACdtD,UClLyF,yBDuL9F,E","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@automattic/charts/external commonjs2 \"@visx/event\"","webpack://@automattic/charts/external commonjs2 \"@visx/group\"","webpack://@automattic/charts/external commonjs2 \"@visx/shape/lib/shapes/Pie\"","webpack://@automattic/charts/external commonjs2 \"@visx/text\"","webpack://@automattic/charts/external commonjs2 \"@visx/tooltip\"","webpack://@automattic/charts/external commonjs2 \"clsx\"","webpack://@automattic/charts/external commonjs2 \"react\"","webpack://@automattic/charts/./src/providers/theme/themes.ts","webpack://@automattic/charts/./src/providers/theme/theme-provider.tsx","webpack://@automattic/charts/external commonjs2 \"@visx/legend\"","webpack://@automattic/charts/external commonjs2 \"@visx/scale\"","webpack://@automattic/charts/./src/components/legend/legend.module.scss?843e","webpack://@automattic/charts/./src/components/legend/base-legend.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss?1d14","webpack://@automattic/charts/./src/components/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":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/event\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/group\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/shape/lib/shapes/Pie\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/text\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/tooltip\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clsx\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","import type { ChartTheme } from '../../types';\n\n/**\n * Default theme configuration\n */\nconst defaultTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Jetpack theme configuration\n */\nconst jetpackTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Woo theme configuration\n */\nconst wooTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#80C8FF', '#B999FF', '#3858E9' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\nexport { defaultTheme, jetpackTheme, wooTheme };\n","import { createContext, useContext, FC, type ReactNode } from 'react';\nimport { defaultTheme } from './themes';\nimport type { ChartTheme } from '../../types';\n\n/**\n * Context for sharing theme configuration across components\n */\nconst ThemeContext = createContext< ChartTheme >( defaultTheme );\n\n/**\n * Hook to access chart theme\n * @return {object} A built theme configuration compatible with visx charts\n */\nconst useChartTheme = () => {\n\tconst theme = useContext( ThemeContext );\n\treturn theme;\n};\n\n/**\n * Props for the ThemeProvider component\n */\ntype ThemeProviderProps = {\n\t/** Optional partial theme override */\n\ttheme?: Partial< ChartTheme >;\n\t/** Child components that will have access to the theme */\n\tchildren: ReactNode;\n};\n\n// Provider component for chart theming\n// Allows theme customization through props while maintaining default values\nconst ThemeProvider: FC< ThemeProviderProps > = ( { theme = {}, children } ) => {\n\tconst mergedTheme = { ...defaultTheme, ...theme };\n\treturn <ThemeContext.Provider value={ mergedTheme }>{ children }</ThemeContext.Provider>;\n};\n\nexport { ThemeProvider, useChartTheme };\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/legend\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/scale\");","// extracted by mini-css-extract-plugin\nexport default {\"legend--horizontal\":\"b1_5FxxoK4aEFLoe67IA\",\"legend--vertical\":\"vpmQkJAPhp3XJ9Wb6vOw\",\"legend-item\":\"IKM8KG1lF9e5NzDqMLOJ\",\"legend-item-swatch\":\"_eccyBq0v2puKsHw8XND\",\"legend-item-label\":\"UeZrUEpEK0tLzXHmeUco\",\"legend-item-value\":\"R5msPOYKm79jYV13H0v7\"};","import { LegendOrdinal } from '@visx/legend';\nimport { scaleOrdinal } from '@visx/scale';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport styles from './legend.module.scss';\nimport type { LegendProps } from './types';\n\n/**\n * Base legend component that displays color-coded items with labels using visx\n * @param {object} props - Component properties\n * @param {Array} props.items - Array of legend items to display\n * @param {string} props.className - Additional CSS class names\n * @param {string} props.orientation - Layout orientation (horizontal/vertical)\n * @return {JSX.Element} Rendered legend component\n */\nconst orientationToFlexDirection = {\n\thorizontal: 'row' as const,\n\tvertical: 'column' as const,\n};\n\nexport const BaseLegend: FC< LegendProps > = ( {\n\titems,\n\tclassName,\n\torientation = 'horizontal',\n} ) => {\n\tconst legendScale = scaleOrdinal( {\n\t\tdomain: items.map( item => item.label ),\n\t\trange: items.map( item => item.color ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( styles.legend, styles[ `legend--${ orientation }` ], className ) }\n\t\t\trole=\"list\"\n\t\t>\n\t\t\t<LegendOrdinal\n\t\t\t\tscale={ legendScale }\n\t\t\t\tdirection={ orientationToFlexDirection[ orientation ] }\n\t\t\t\tshape=\"rect\"\n\t\t\t\tshapeWidth={ 16 }\n\t\t\t\tshapeHeight={ 16 }\n\t\t\t\tclassName={ styles[ 'legend-items' ] }\n\t\t\t>\n\t\t\t\t{ labels => (\n\t\t\t\t\t<div className={ styles[ `legend--${ orientation }` ] }>\n\t\t\t\t\t\t{ labels.map( label => (\n\t\t\t\t\t\t\t<div key={ label.text } className={ styles[ 'legend-item' ] }>\n\t\t\t\t\t\t\t\t<svg width={ 16 } height={ 16 }>\n\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\twidth={ 16 }\n\t\t\t\t\t\t\t\t\t\theight={ 16 }\n\t\t\t\t\t\t\t\t\t\tfill={ label.value }\n\t\t\t\t\t\t\t\t\t\tclassName={ styles[ 'legend-item-swatch' ] }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-label' ] }>\n\t\t\t\t\t\t\t\t\t{ label.text }\n\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value && (\n\t\t\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-value' ] }>\n\t\t\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</LegendOrdinal>\n\t\t</div>\n\t);\n};\n","import styles from './base-tooltip.module.scss';\nimport type { CSSProperties, ComponentType, ReactNode } from 'react';\n\ntype TooltipData = {\n\tlabel: string;\n\tvalue: number;\n\tvalueDisplay?: string;\n};\n\ntype TooltipComponentProps = {\n\tdata: TooltipData;\n\tclassName?: string;\n};\n\ntype TooltipCommonProps = {\n\ttop: number;\n\tleft: number;\n\tstyle?: CSSProperties;\n\tclassName?: string;\n};\n\ntype DefaultDataTooltip = {\n\tdata: TooltipData;\n\tcomponent?: ComponentType< TooltipComponentProps >;\n\tchildren?: never;\n};\n\ntype CustomTooltip = {\n\tchildren: ReactNode;\n\tdata?: never;\n\tcomponent?: never;\n};\n\ntype BaseTooltipProps = TooltipCommonProps & ( DefaultDataTooltip | CustomTooltip );\n\nconst DefaultTooltipContent = ( { data }: TooltipComponentProps ) => (\n\t<>\n\t\t{ data?.label }: { data?.valueDisplay || data?.value }\n\t</>\n);\n\nexport const BaseTooltip = ( {\n\tdata,\n\ttop,\n\tleft,\n\tcomponent: Component = DefaultTooltipContent,\n\tchildren,\n\tclassName,\n}: BaseTooltipProps ) => {\n\treturn (\n\t\t<div className={ styles.tooltip } style={ { top, left } } role=\"tooltip\">\n\t\t\t{ children || ( data && <Component data={ data } className={ className } /> ) }\n\t\t</div>\n\t);\n};\n\nexport type { BaseTooltipProps, TooltipData };\n","// extracted by mini-css-extract-plugin\nexport default {\"tooltip\":\"Jmgc7XAf2uAyK5059rBe\"};","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 { 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\nexport default 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":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","_typeof","iterator","constructor","e","r","t","i","toPrimitive","TypeError","String","toPropertyKey","configurable","writable","require","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","orientationToFlexDirection","horizontal","vertical","BaseLegend","_ref","items","className","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","React","createElement","clsx","styles","legend","concat","role","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","text","width","height","fill","find","DefaultTooltipContent","data","Fragment","valueDisplay","BaseTooltip","_ref2","top","left","_ref2$component","component","Component","children","style","_ref$width","note","_ref$withTooltips","withTooltips","_ref$clockwise","clockwise","_ref$thickness","thickness","showLegend","legendOrientation","providerTheme","useContext","_useTooltip","useTooltip","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","centerX","radius","innerRadius","dataWithIndex","index","_objectSpread","startAngle","Math","PI","endAngle","accessors","sort","b","length","handleMouseMove","useCallback","event","arc","coords","localPoint","x","y","handleMouseLeave","handleArcMouseMove","legendItems","toString","Group","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","path","Text","textAnchor","verticalAnchor","Legend"],"sourceRoot":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
.oJsjYo330oeLpWqpqf4w{position:relative;text-align:center}.aV40KcaCeoEycQ2crVkB{margin-top:1rem}.oJsjYo330oeLpWqpqf4w .bxF3iRlHVJNqwEjRY9QD{margin-bottom:0px;font-weight:600;font-size:16px}.oJsjYo330oeLpWqpqf4w .tA3u0r3RunHmbWFBLrqW{margin-top:0px;font-size:14px}
|
|
2
|
+
.Jmgc7XAf2uAyK5059rBe{padding:.5rem;background-color:rgba(0,0,0,.85);color:#fff;border-radius:4px;font-size:14px;box-shadow:0 1px 2px rgba(0,0,0,.1);position:absolute;pointer-events:none;transform:translate(-50%, -100%)}
|
|
3
|
+
.b1_5FxxoK4aEFLoe67IA{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px}.vpmQkJAPhp3XJ9Wb6vOw{display:flex;flex-direction:column;gap:8px}.IKM8KG1lF9e5NzDqMLOJ{display:flex;align-items:center;gap:8px;font-size:.875rem}._eccyBq0v2puKsHw8XND{border-radius:2px}.UeZrUEpEK0tLzXHmeUco{color:var(--jp-gray-80, #2c3338);display:flex;align-items:center;gap:.5rem}.R5msPOYKm79jYV13H0v7{font-weight:500}
|
|
4
|
+
|
|
5
|
+
/*# sourceMappingURL=style.css.map*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/pie-semi-circle-chart/style.css","mappings":"AAAA,sBACC,kBACA,kBAEA,sBACC,gBAGD,4CACC,kBACA,gBACA,eAGD,4CACC,eACA,e;AChBF,sBACE,cACA,iCACA,WACA,kBACA,eACA,oCACA,kBACA,oBACA,iC;ACRD,sBACC,aACA,mBACA,eACA,SAGD,sBACC,aACA,sBACA,QAIF,sBACC,aACA,mBACA,QACA,kBAGD,sBACC,kBAGD,sBACC,iCACA,aACA,mBACA,UAGD,sBACC,gB","sources":["webpack://@automattic/charts/./src/components/pie-semi-circle-chart/pie-semi-circle-chart.module.scss","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss","webpack://@automattic/charts/./src/components/legend/legend.module.scss"],"sourcesContent":[".pie-semi-circle-chart {\n\tposition: relative;\n\ttext-align: center;\n\n\t&-legend {\n\t\tmargin-top: 1rem;\n\t}\n\n\t.label {\n\t\tmargin-bottom: 0px; // Add space between label and pie chart\n\t\tfont-weight: 600; // Make label more prominent than note\n\t\tfont-size: 16px; // Set explicit font size\n\t}\n\n\t.note {\n\t\tmargin-top: 0px; // Add space between pie chart and note\n\t\tfont-size: 14px; // Slightly smaller text for hierarchy\n\t}\n}\n",".tooltip {\n padding: 0.5rem;\n background-color: rgba(0, 0, 0, 0.85);\n color: white;\n border-radius: 4px;\n font-size: 14px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n position: absolute;\n pointer-events: none;\n transform: translate(-50%, -100%);\n}\n",".legend {\n\t&--horizontal {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\tgap: 16px;\n\t}\n\n\t&--vertical {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t}\n}\n\n.legend-item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tfont-size: 0.875rem;\n}\n\n.legend-item-swatch {\n\tborder-radius: 2px;\n}\n\n.legend-item-label {\n\tcolor: var(--jp-gray-80, #2c3338);\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 0.5rem;\n}\n\n.legend-item-value {\n\tfont-weight: 500;\n}\n"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,a)=>{for(var l in a)e.o(a,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:a[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{BaseTooltip:()=>l});var a=function(e){var t=e.data;return React.createElement(React.Fragment,null,null==t?void 0:t.label,": ",(null==t?void 0:t.valueDisplay)||(null==t?void 0:t.value))},l=function(e){var t=e.data,l=e.top,o=e.left,r=e.component,n=void 0===r?a:r,c=e.children,d=e.className;return React.createElement("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:l,left:o},role:"tooltip"},c||t&&React.createElement(n,{data:t,className:d}))};module.exports=t})();
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/tooltip/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFV,EAAyBC,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,uCC8B9D,IAAMC,EAAwB,SAAHC,GAAA,IAAOC,EAAID,EAAJC,KAAI,OACrCC,MAAAC,cAAAD,MAAAE,SAAA,KACGH,aAAI,EAAJA,EAAMI,MAAO,MAAIJ,aAAI,EAAJA,EAAMK,gBAAgBL,aAAI,EAAJA,EAAMH,OAC7C,EAGSS,EAAc,SAAHC,GAOC,IANxBP,EAAIO,EAAJP,KACAQ,EAAGD,EAAHC,IACAC,EAAIF,EAAJE,KAAIC,EAAAH,EACJI,UAAWC,OAAS,IAAAF,EAAGZ,EAAqBY,EAC5CG,EAAQN,EAARM,SACAC,EAASP,EAATO,UAEA,OACCb,MAAAC,cAAA,OAAKY,UCjDmB,uBDiDUC,MAAQ,CAAEP,IAAAA,EAAKC,KAAAA,GAASO,KAAK,WAC5DH,GAAcb,GAAQC,MAAAC,cAACU,EAAS,CAACZ,KAAOA,EAAOc,UAAYA,IAGhE,E","sources":["webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss?1d14"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","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\"};"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","DefaultTooltipContent","_ref","data","React","createElement","Fragment","label","valueDisplay","BaseTooltip","_ref2","top","left","_ref2$component","component","Component","children","className","style","role"],"sourceRoot":""}
|