@automattic/charts 0.2.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/components/bar-chart/index.js +2 -2
  3. package/dist/cjs/components/bar-chart/index.js.map +1 -1
  4. package/dist/cjs/components/bar-chart/style.css +94 -5
  5. package/dist/cjs/components/grid-control/index.js +2 -2
  6. package/dist/cjs/components/grid-control/index.js.map +1 -1
  7. package/dist/cjs/components/grid-control/style.css +94 -2
  8. package/dist/cjs/components/legend/index.js +2 -2
  9. package/dist/cjs/components/legend/index.js.map +1 -1
  10. package/dist/cjs/components/legend/style.css +94 -2
  11. package/dist/cjs/components/line-chart/index.js +2 -2
  12. package/dist/cjs/components/line-chart/index.js.map +1 -1
  13. package/dist/cjs/components/line-chart/style.css +94 -3
  14. package/dist/cjs/components/pie-chart/index.js +2 -2
  15. package/dist/cjs/components/pie-chart/index.js.map +1 -1
  16. package/dist/cjs/components/pie-chart/style.css +94 -4
  17. package/dist/cjs/components/pie-semi-circle-chart/index.js +2 -2
  18. package/dist/cjs/components/pie-semi-circle-chart/index.js.map +1 -1
  19. package/dist/cjs/components/pie-semi-circle-chart/style.css +94 -4
  20. package/dist/cjs/components/tooltip/index.js +2 -2
  21. package/dist/cjs/components/tooltip/index.js.map +1 -1
  22. package/dist/cjs/components/tooltip/style.css +94 -2
  23. package/dist/cjs/index.js +2 -2
  24. package/dist/cjs/index.js.map +1 -1
  25. package/dist/cjs/providers/theme/index.js +2 -2
  26. package/dist/cjs/providers/theme/index.js.map +1 -1
  27. package/dist/cjs/providers/theme/style.css +95 -0
  28. package/dist/cjs/style.css +95 -9
  29. package/dist/index.d.ts +301 -0
  30. package/dist/mjs/components/bar-chart/index.js +2 -2
  31. package/dist/mjs/components/bar-chart/index.js.map +1 -1
  32. package/dist/mjs/components/bar-chart/style.css +94 -5
  33. package/dist/mjs/components/grid-control/index.js +2 -2
  34. package/dist/mjs/components/grid-control/index.js.map +1 -1
  35. package/dist/mjs/components/grid-control/style.css +94 -2
  36. package/dist/mjs/components/legend/index.js +2 -2
  37. package/dist/mjs/components/legend/index.js.map +1 -1
  38. package/dist/mjs/components/legend/style.css +94 -2
  39. package/dist/mjs/components/line-chart/index.js +2 -2
  40. package/dist/mjs/components/line-chart/index.js.map +1 -1
  41. package/dist/mjs/components/line-chart/style.css +94 -3
  42. package/dist/mjs/components/pie-chart/index.js +2 -2
  43. package/dist/mjs/components/pie-chart/index.js.map +1 -1
  44. package/dist/mjs/components/pie-chart/style.css +94 -4
  45. package/dist/mjs/components/pie-semi-circle-chart/index.js +2 -2
  46. package/dist/mjs/components/pie-semi-circle-chart/index.js.map +1 -1
  47. package/dist/mjs/components/pie-semi-circle-chart/style.css +94 -4
  48. package/dist/mjs/components/tooltip/index.js +2 -2
  49. package/dist/mjs/components/tooltip/index.js.map +1 -1
  50. package/dist/mjs/components/tooltip/style.css +94 -2
  51. package/dist/mjs/index.js +2 -2
  52. package/dist/mjs/index.js.map +1 -1
  53. package/dist/mjs/providers/theme/index.js +2 -2
  54. package/dist/mjs/providers/theme/index.js.map +1 -1
  55. package/dist/mjs/providers/theme/style.css +95 -0
  56. package/dist/mjs/style.css +95 -9
  57. package/global.d.ts +14 -0
  58. package/package.json +29 -8
  59. package/rollup.config.mjs +142 -0
  60. package/src/components/bar-chart/bar-chart.tsx +11 -5
  61. package/src/components/line-chart/line-chart.tsx +55 -17
  62. package/src/components/pie-chart/__tests__/pie-chart.test.tsx +59 -0
  63. package/src/components/pie-chart/pie-chart.tsx +94 -7
  64. package/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx +20 -13
  65. package/src/components/shared/with-responsive.tsx +54 -0
  66. package/src/types.ts +26 -1
  67. package/tests/jest.config.cjs +12 -0
  68. package/tests/jest.setup.js +13 -0
  69. package/webpack.config.cjs +10 -1
  70. package/dist/cjs/components/bar-chart/style.css.map +0 -1
  71. package/dist/cjs/components/grid-control/style.css.map +0 -1
  72. package/dist/cjs/components/legend/style.css.map +0 -1
  73. package/dist/cjs/components/line-chart/style.css.map +0 -1
  74. package/dist/cjs/components/pie-chart/style.css.map +0 -1
  75. package/dist/cjs/components/pie-semi-circle-chart/style.css.map +0 -1
  76. package/dist/cjs/components/tooltip/style.css.map +0 -1
  77. package/dist/cjs/style.css.map +0 -1
  78. package/dist/mjs/components/bar-chart/style.css.map +0 -1
  79. package/dist/mjs/components/grid-control/style.css.map +0 -1
  80. package/dist/mjs/components/legend/style.css.map +0 -1
  81. package/dist/mjs/components/line-chart/style.css.map +0 -1
  82. package/dist/mjs/components/pie-chart/style.css.map +0 -1
  83. package/dist/mjs/components/pie-semi-circle-chart/style.css.map +0 -1
  84. package/dist/mjs/components/tooltip/style.css.map +0 -1
  85. package/dist/mjs/style.css.map +0 -1
  86. package/dist/types/components/bar-chart/bar-chart.d.ts +0 -6
  87. package/dist/types/components/bar-chart/index.d.ts +0 -1
  88. package/dist/types/components/grid-control/grid-control.d.ts +0 -4
  89. package/dist/types/components/grid-control/index.d.ts +0 -1
  90. package/dist/types/components/legend/base-legend.d.ts +0 -3
  91. package/dist/types/components/legend/index.d.ts +0 -2
  92. package/dist/types/components/legend/types.d.ts +0 -12
  93. package/dist/types/components/line-chart/index.d.ts +0 -1
  94. package/dist/types/components/line-chart/line-chart.d.ts +0 -6
  95. package/dist/types/components/pie-chart/index.d.ts +0 -1
  96. package/dist/types/components/pie-chart/pie-chart.d.ts +0 -15
  97. package/dist/types/components/pie-semi-circle-chart/index.d.ts +0 -1
  98. package/dist/types/components/pie-semi-circle-chart/pie-semi-circle-chart.d.ts +0 -23
  99. package/dist/types/components/tooltip/base-tooltip.d.ts +0 -29
  100. package/dist/types/components/tooltip/index.d.ts +0 -2
  101. package/dist/types/hooks/use-chart-mouse-handler.d.ts +0 -41
  102. package/dist/types/index.d.ts +0 -8
  103. package/dist/types/providers/theme/index.d.ts +0 -2
  104. package/dist/types/providers/theme/theme-provider.d.ts +0 -18
  105. package/dist/types/providers/theme/themes.d.ts +0 -14
  106. package/dist/types/types.d.ts +0 -137
@@ -1,2 +1,2 @@
1
- import*as e from"@visx/group";import*as t from"@visx/shape";import*as r from"clsx";import*as o from"@visx/event";import*as n from"@visx/tooltip";import*as a from"react";import*as l from"@visx/legend";import*as i from"@visx/scale";var c={d:(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},u={};function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function d(e){return d="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},d(e)}function p(e,t,r){return(t=function(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}c.d(u,{r:()=>N});const m=(f={Group:()=>e.Group},v={},c.d(v,f),v);var f,v;const g=(e=>{var t={};return c.d(t,e),t})({Pie:()=>t.Pie}),b=(e=>{var t={};return c.d(t,e),t})({default:()=>r.default}),h=(e=>{var t={};return c.d(t,e),t})({localPoint:()=>o.localPoint}),y=(e=>{var t={};return c.d(t,e),t})({useTooltip:()=>n.useTooltip}),O=(e=>{var t={};return c.d(t,e),t})({createContext:()=>a.createContext,useCallback:()=>a.useCallback,useContext:()=>a.useContext});var E={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},w=(0,O.createContext)(E);const x=(e=>{var t={};return c.d(t,e),t})({LegendOrdinal:()=>l.LegendOrdinal}),R=(e=>{var t={};return c.d(t,e),t})({scaleOrdinal:()=>i.scaleOrdinal}),P={"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"},j=function(e){var t=e.items,r=e.className,o=e.orientation,n=void 0===o?"horizontal":o,a=(0,R.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:(0,b.default)(P.legend,P["legend--".concat(n)],r),role:"list"},React.createElement(x.LegendOrdinal,{scale:a,direction:C[n],shape:"rect",shapeWidth:16,shapeHeight:16,className:P["legend-items"]},(function(e){return React.createElement("div",{className:P["legend--".concat(n)]},e.map((function(e){var r,o;return React.createElement("div",{key:e.text,className:P["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:P["legend-item-swatch"]})),React.createElement("span",{className:P["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:P["legend-item-value"]},null===(o=t.find((function(t){return t.label===e.text})))||void 0===o?void 0:o.value)))})))})))};var F=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))},k=function(e){var t=e.data,r=e.top,o=e.left,n=e.component,a=void 0===n?F:n,l=e.children,i=e.className;return React.createElement("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:r,left:o},role:"tooltip"},l||t&&React.createElement(a,{data:t,className:i}))};const L={"pie-chart":"R2Ly_tkJtgL0HA8P3fpm"};function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){p(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const N=function(e){var t=e.data,r=e.width,o=void 0===r?500:r,n=e.height,a=void 0===n?500:n,l=e.withTooltips,i=void 0!==l&&l,c=e.innerRadius,u=void 0===c?0:c,d=e.className,p=e.showLegend,f=e.legendOrientation,v=(0,O.useContext)(w),x=function(e){var t=e.withTooltips,r=(0,y.useTooltip)(),o=r.tooltipOpen,n=r.tooltipLeft,a=r.tooltipTop,l=r.tooltipData,i=r.hideTooltip,c=r.showTooltip;return{onMouseMove:(0,O.useCallback)((function(e,r){if(t){var o=(0,h.localPoint)(e);o&&c({tooltipData:r,tooltipLeft:o.x,tooltipTop:o.y-10})}}),[t,c]),onMouseLeave:(0,O.useCallback)((function(){t&&i()}),[t,i]),tooltipOpen:o,tooltipData:l||null,tooltipLeft:n,tooltipTop:a}}({withTooltips:i}),R=x.onMouseMove,P=x.onMouseLeave,C=x.tooltipOpen,F=x.tooltipData,S=x.tooltipLeft,N=x.tooltipTop,D=Math.min(o,a)/2,T=o/2,M=a/2,K=t.map((function(e,t){return A(A({},e),{},{index:t})})),z={value:function(e){return e.value},fill:function(e){return(null==e?void 0:e.color)||v.colors[e.index]}},B=t.map((function(e,t){return{label:e.label,value:e.value.toString(),color:v.colors[t%v.colors.length]}}));return React.createElement("div",{className:(0,b.default)("pie-chart",L["pie-chart"],d)},React.createElement("svg",{width:o,height:a},React.createElement(m.Group,{top:M,left:T},React.createElement(g.Pie,{data:K,pieValue:z.value,outerRadius:D-20,innerRadius:u},(function(e){return e.arcs.map((function(t,r){var o,n,a=(o=e.path.centroid(t),n=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 o,n,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=(o=a.call(r)).done)&&(i.push(o.value),i.length!==t);c=!0);}catch(e){u=!0,n=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(u)throw n}}return i}}(o,n)||function(e,t){if(e){if("string"==typeof e)return s(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)?s(e,t):void 0}}(o,n)||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.")}()),l=a[0],c=a[1],u=t.endAngle-t.startAngle>=.25,d={d:e.path(t)||"",fill:z.fill(t.data)};return i&&(d.onMouseMove=function(e){return R(e,t.data)},d.onMouseLeave=P),React.createElement("g",{key:"arc-".concat(r)},React.createElement("path",d),u&&React.createElement("text",{x:l,y:c,dy:".33em",fill:v.labelBackgroundColor||E.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none"},t.data.label))}))})))),p&&React.createElement(j,{items:B,orientation:f,className:L["pie-chart-legend"]}),i&&C&&F&&React.createElement(k,{data:F,top:N||0,left:S||0,style:{transform:"translate(-50%, -100%)"}}))};var D=u.r;export{D as PieChart};
2
- //# sourceMappingURL=index.js.map
1
+ import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import{Group as a}from"@visx/group";import{Pie as i}from"@visx/shape";import o from"clsx";import{useCallback as n,createContext as r,useContext as s}from"react";import{localPoint as d}from"@visx/event";import{useTooltip as c}from"@visx/tooltip";import{LegendOrdinal as m}from"@visx/legend";import{scaleOrdinal as p}from"@visx/scale";import{useParentSize as h}from"@visx/responsive";const g={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},u=r(g);var v={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const f={horizontal:"row",vertical:"column"},_=({items:l,className:a,orientation:i="horizontal"})=>{const n=p({domain:l.map((e=>e.label)),range:l.map((e=>e.color))});return e("div",{className:o(v.legend,v[`legend--${i}`],a),role:"list",children:e(m,{scale:n,direction:f[i],shape:"rect",shapeWidth:16,shapeHeight:16,className:v["legend-items"],children:a=>e("div",{className:v[`legend--${i}`],children:a.map((a=>t("div",{className:v["legend-item"],children:[e("svg",{width:16,height:16,children:e("rect",{width:16,height:16,fill:a.value,className:v["legend-item-swatch"]})}),t("span",{className:v["legend-item-label"],children:[a.text,l.find((e=>e.label===a.text))?.value&&e("span",{className:v["legend-item-value"],children:l.find((e=>e.label===a.text))?.value})]})]},a.text)))})})})};var x="base-tooltip-module__tooltip__OfX6n";const b=({data:e})=>t(l,{children:[e?.label,": ",e?.valueDisplay||e?.value]}),N=({data:t,top:l,left:a,component:i=b,children:o,className:n})=>e("div",{className:x,style:{top:l,left:a},role:"tooltip",children:o||t&&e(i,{data:t,className:n})});var w={"pie-chart":"pie-chart-module__pie-chart__R12Vh"};const F=({data:l,withTooltips:r=!1,className:m,showLegend:p,legendOrientation:h,size:v,thickness:f=1,padding:x=20,gapScale:b=0,cornerScale:F=0})=>{const M=s(u),{onMouseMove:C,onMouseLeave:T,tooltipOpen:k,tooltipData:y,tooltipLeft:D,tooltipTop:L}=(({withTooltips:e})=>{const{tooltipOpen:t,tooltipLeft:l,tooltipTop:a,tooltipData:i,hideTooltip:o,showTooltip:r}=c();return{onMouseMove:n(((t,l)=>{if(!e)return;const a=d(t);a&&r({tooltipData:l,tooltipLeft:a.x,tooltipTop:a.y-10})}),[e,r]),onMouseLeave:n((()=>{e&&o()}),[e,o]),tooltipOpen:t,tooltipData:i||null,tooltipLeft:l,tooltipTop:a}})({withTooltips:r}),{isValid:z,message:R}=(e=>{if(!e.length)return{isValid:!1,message:"No data available"};if(e.some((e=>e.percentage<0||e.value<0)))return{isValid:!1,message:"Invalid data: Negative values are not allowed"};const t=e.reduce(((e,t)=>e+t.percentage),0);return Math.abs(t-100)>.01?{isValid:!1,message:"Invalid percentage total: Must equal 100"}:{isValid:!0,message:""}})(l);if(!z)return e("div",{className:o("pie-chart",w["pie-chart"],m),children:e("div",{className:w["error-message"],children:R})});const A=v,S=v,V=Math.min(A,S)/2,$=A/2,B=S/2,I=b*(2*Math.PI/l.length),O=V-x,P=O*(1-f),W=(O-P)/2,j=F?Math.min(F*O,W):0,H=l.map(((e,t)=>({...e,index:t}))),X={value:e=>e.value,fill:e=>e?.color||M.colors[e.index]},q=l.map(((e,t)=>({label:e.label,value:e.value.toString(),color:M.colors[t%M.colors.length]})));return t("div",{className:o("pie-chart",w["pie-chart"],m),children:[e("svg",{viewBox:`0 0 ${v} ${v}`,preserveAspectRatio:"xMidYMid meet",children:e(a,{top:B,left:$,children:e(i,{data:H,pieValue:X.value,outerRadius:O,innerRadius:P,padAngle:I,cornerRadius:j,children:l=>l.arcs.map(((a,i)=>{const[o,n]=l.path.centroid(a),s=a.endAngle-a.startAngle>=.25,d=e=>C(e,a.data),c={d:l.path(a)||"",fill:X.fill(a.data)};return r&&(c.onMouseMove=d,c.onMouseLeave=T),t("g",{children:[e("path",{...c}),s&&e("text",{x:o,y:n,dy:".33em",fill:M.labelBackgroundColor||g.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none",children:a.data.label})]},`arc-${i}`)}))})})}),p&&e(_,{items:q,orientation:h,className:w["pie-chart-legend"]}),r&&k&&y&&e(N,{data:y,top:L||0,left:D||0,style:{transform:"translate(-50%, -100%)"}})]})};F.displayName="PieChart";var M=function(t,l){const{maxWidth:a=1200,aspectRatio:i=.5,debounceTime:o=50}=l||{};return function(l){const{parentRef:n,width:r}=h({debounceTime:o,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),s=r?Math.min(r,a):600,d=s*i;return e("div",{ref:n,style:{width:"100%",minHeight:`${d}px`},children:e(t,{width:s,height:d,size:s,...l})})}}(F);export{M as PieChart};
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/pie-chart/index.js","mappings":"sOACA,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,I,KCAlF,SAASI,EAAkBC,EAAGC,IAC3B,MAAQA,GAAKA,EAAID,EAAEE,UAAYD,EAAID,EAAEE,QACtC,IAAK,IAAIC,EAAI,EAAGC,EAAIC,MAAMJ,GAAIE,EAAIF,EAAGE,IAAKC,EAAED,GAAKH,EAAEG,GACnD,OAAOC,CACT,CCJA,SAASE,EAAQjB,GAGf,OAAOiB,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAUnB,GAC7F,cAAcA,CAChB,EAAI,SAAUA,GACZ,OAAOA,GAAK,mBAAqBkB,QAAUlB,EAAEoB,cAAgBF,QAAUlB,IAAMkB,OAAOX,UAAY,gBAAkBP,CAC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B,SAAWlB,EAAImB,YAAc,IAIpDC,EAAwC,CAC7CtI,EAAGgH,EAAII,KAAMF,IAAS,GACtB1D,KAAMiD,EAAUjD,KAAM0D,EAAIvD,OAQ3B,OALKe,IACJ4D,EAAU5C,YATa,SAAEE,GAA+B,OACxDF,EAAaE,EAAOsB,EAAIvD,KAAM,EAS9B2E,EAAUvC,aAAeA,GAIzB1D,MAAAC,cAAA,KAAGxE,IAAG,OAAA4E,OAAW6D,IAChBlE,MAAAC,cAAA,OAAWgG,GACTH,GACD9F,MAAAC,cAAA,QACCvC,EAAIkI,EACJpI,EAAIqI,EACJK,GAAG,QACH/E,KACCuB,EAAcvE,sBAAwBF,EAAaE,qBAEpDgI,SAAW,GACXC,WAAW,SACXC,cAAc,QAEZxB,EAAIvD,KAAKzB,OAKhB,GACD,MAKD2C,GACDxC,MAAAC,cAACqG,EAAM,CACNlH,MAAQiF,EACR9E,YAAckD,EACdpD,UAAYc,EAAQ,sBAIpBkC,GAAgBU,GAAeG,GAChClD,MAAAC,cAACwB,EAAW,CACXH,KAAO4B,EACPvB,IAAMsB,GAAc,EACpBrB,KAAOoB,GAAe,EACtBf,MAAQ,CACPsE,UAAW,4BAMjB,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/../../../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 module \"@visx/group\"","webpack://@automattic/charts/external module \"@visx/shape\"","webpack://@automattic/charts/external module \"clsx\"","webpack://@automattic/charts/external module \"@visx/event\"","webpack://@automattic/charts/external module \"@visx/tooltip\"","webpack://@automattic/charts/external module \"react\"","webpack://@automattic/charts/./src/providers/theme/themes.ts","webpack://@automattic/charts/./src/providers/theme/theme-provider.tsx","webpack://@automattic/charts/external module \"@visx/legend\"","webpack://@automattic/charts/external module \"@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","// 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))","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 };","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"Group\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_group_7523624b__.Group) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"Pie\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_shape_3711bad4__.Pie) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"default\"]: () => (__WEBPACK_EXTERNAL_MODULE_clsx__[\"default\"]) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"localPoint\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_event_19f6f977__.localPoint) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"useTooltip\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_tooltip_83ba89e9__.useTooltip) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"createContext\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.createContext), [\"useCallback\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useCallback), [\"useContext\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useContext) });","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","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"LegendOrdinal\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_legend_118b7922__.LegendOrdinal) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"scaleOrdinal\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_scale_2ec4ad68__.scaleOrdinal) });","// 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__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","_arrayLikeToArray","r","a","length","e","n","Array","_typeof","Symbol","iterator","constructor","t","i","toPrimitive","TypeError","String","toPropertyKey","value","configurable","writable","y","__WEBPACK_EXTERNAL_MODULE__visx_group_7523624b__","x","d","__WEBPACK_EXTERNAL_MODULE__visx_shape_3711bad4__","__WEBPACK_EXTERNAL_MODULE_clsx__","__WEBPACK_EXTERNAL_MODULE__visx_event_19f6f977__","__WEBPACK_EXTERNAL_MODULE__visx_tooltip_83ba89e9__","__WEBPACK_EXTERNAL_MODULE_react__","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","__WEBPACK_EXTERNAL_MODULE__visx_legend_118b7922__","__WEBPACK_EXTERNAL_MODULE__visx_scale_2ec4ad68__","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","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":""}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/hooks/use-chart-mouse-handler.ts","../../../../src/providers/theme/themes.ts","../../../../src/providers/theme/theme-provider.tsx","../../../../src/components/legend/base-legend.tsx","../../../../src/components/tooltip/base-tooltip.tsx","../../../../src/components/pie-chart/pie-chart.tsx","../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[null,null,null,null,null,null,null],"names":["defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","className","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","role","children","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","width","height","fill","value","text","find","DefaultTooltipContent","data","_Fragment","valueDisplay","BaseTooltip","top","left","component","Component","style","PieChart","withTooltips","showLegend","legendOrientation","size","thickness","padding","gapScale","cornerScale","providerTheme","useContext","onMouseMove","onMouseLeave","tooltipOpen","tooltipData","tooltipLeft","tooltipTop","hideTooltip","showTooltip","useTooltip","useCallback","event","coords","localPoint","x","y","useChartMouseHandler","isValid","message","length","some","percentage","totalPercentage","reduce","sum","Math","abs","validateData","radius","min","centerX","centerY","padAngle","PI","outerRadius","innerRadius","maxCornerRadius","cornerRadius","dataWithIndex","d","index","accessors","legendItems","toString","viewBox","preserveAspectRatio","Group","Pie","pieValue","pie","arcs","arc","centroidX","centroidY","path","centroid","hasSpaceForLabel","endAngle","startAngle","handleMouseMove","pathProps","dy","fontSize","textAnchor","pointerEvents","Legend","transform","displayName","pieChart","WrappedComponent","config","maxWidth","aspectRatio","debounceTime","props","parentRef","parentWidth","useParentSize","enableDebounceLeadingCall","initialSize","containerWidth","containerHeight","ref","minHeight","withResponsive"],"mappings":"8bA6CA,MCxCMA,EAA2B,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,ICRVC,EAAeC,EAA6BX,qXCQlD,MAAMY,EAA6B,CAClCC,WAAY,MACZC,SAAU,UAGEC,EAAgC,EAC5CC,QACAC,YACAC,cAAc,iBAEd,MAAMC,EAAcC,EAAc,CACjCC,OAAQL,EAAMM,KAAKC,GAAQA,EAAKC,QAChCC,MAAOT,EAAMM,KAAKC,GAAQA,EAAKG,UAGhC,OACCC,SACCV,UAAYW,EAAMC,EAAOC,OAAQD,EAAQ,WAAYX,KAAkBD,GACvEc,KAAK,OAELC,SAAAL,EAACM,EACA,CAAAC,MAAQf,EACRgB,UAAYvB,EAA4BM,GACxCkB,MAAM,OACNC,WAAa,GACbC,YAAc,GACdrB,UAAYY,EAAQ,yBAElBU,GACDZ,SAAKV,UAAYY,EAAQ,WAAYX,KAAgBc,SAClDO,EAAOjB,KAAKE,GACbgB,SAAwBvB,UAAYY,EAAQ,eAC3CG,SAAA,CAAAL,EAAA,MAAA,CAAKc,MAAQ,GA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6F,EACR3F,YAAc0C,EACd3C,UAAYY,EAAQ,sBAIpB6B,GAAgBY,GAAeC,GAChC5C,EAACwB,EAAW,CACXH,KAAOuB,EACPnB,IAAMqB,GAAc,EACpBpB,KAAOmB,GAAe,EACtBhB,MAAQ,CACP6E,UAAW,8BAKd,EAGH5E,EAAS6E,YAAc,WACvB,IAAeC,EClNC,SACfC,EACAC,GAEA,MAAMC,SAAEA,EAAW,KAAIC,YAAEA,EAAc,GAAGC,aAAEA,EAAe,IAAOH,GAAU,GAE5E,OAAO,SAA0BI,GAChC,MAAMC,UAAEA,EAAWrG,MAAOsG,GAAgBC,EAAe,CACxDJ,eACAK,2BAA2B,EAC3BC,YAAa,CAAEzG,MAAO,IAAKC,OAAQ,OAI9ByG,EAAiBJ,EAAcnD,KAAKI,IAAK+C,EAAaL,GAAa,IACnEU,EAAkBD,EAAiBR,EAEzC,OACChH,EACC,MAAA,CAAA0H,IAAMP,EACNtF,MAAQ,CACPf,MAAO,OACP6G,UAAW,GAAIF,OACfpH,SAEDL,EAAC6G,EAAgB,CAChB/F,MAAQ0G,EACRzG,OAAS0G,EACTvF,KAAOsF,KACAN,KAIX,CACD,CDgLeU,CAAiC9F"}
@@ -1,5 +1,95 @@
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%)}
1
+ .bar-chart-module__bar-chart__lmYNi {
2
+ position: relative;
3
+ }
4
+ .bar-chart-module__bar-chart-legend__vgKKq {
5
+ margin-top: 1rem;
6
+ }
7
+ .line-chart-module__line-chart__ITM3d {
8
+ position: relative;
9
+ }
10
+ .line-chart-module__line-chart__tooltip__aqcme {
11
+ background: #fff;
12
+ padding: 0.5rem;
13
+ }
14
+ .line-chart-module__line-chart__tooltip-date__4Dzab {
15
+ font-weight: bold;
16
+ padding-bottom: 10px;
17
+ }
18
+ .line-chart-module__line-chart__tooltip-row__6A37G {
19
+ display: flex;
20
+ align-items: center;
21
+ padding: 4px 0;
22
+ justify-content: space-between;
23
+ }
24
+ .line-chart-module__line-chart__tooltip-label__IvnFF {
25
+ font-weight: 500;
26
+ padding-right: 1rem;
27
+ }
28
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
29
+ position: relative;
30
+ text-align: center;
31
+ }
32
+ .pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
33
+ margin-top: 1rem;
34
+ }
35
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
36
+ margin-bottom: 0px;
37
+ font-weight: 600;
38
+ font-size: 16px;
39
+ }
40
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
41
+ margin-top: 0px;
42
+ font-size: 14px;
43
+ }
44
+ .grid-control-module__grid-control__KOnZN .visx-line {
45
+ stroke: #d7d6d6;
46
+ stroke-width: 1px;
47
+ shape-rendering: crispEdges;
48
+ }
49
+ .legend-module__legend--horizontal__IUN13 {
50
+ display: flex;
51
+ flex-direction: row;
52
+ flex-wrap: wrap;
53
+ gap: 16px;
54
+ }
55
+ .legend-module__legend--vertical__Scfzo {
56
+ display: flex;
57
+ flex-direction: column;
58
+ gap: 8px;
59
+ }
4
60
 
5
- /*# sourceMappingURL=style.css.map*/
61
+ .legend-module__legend-item__feemn {
62
+ display: flex;
63
+ align-items: center;
64
+ gap: 8px;
65
+ font-size: 0.875rem;
66
+ }
67
+
68
+ .legend-module__legend-item-swatch__nRyXf {
69
+ border-radius: 2px;
70
+ }
71
+
72
+ .legend-module__legend-item-label__ksx6I {
73
+ color: var(--jp-gray-80, #2c3338);
74
+ display: flex;
75
+ align-items: center;
76
+ gap: 0.5rem;
77
+ }
78
+
79
+ .legend-module__legend-item-value__d9x1j {
80
+ font-weight: 500;
81
+ }
82
+ .base-tooltip-module__tooltip__OfX6n {
83
+ padding: 0.5rem;
84
+ background-color: rgba(0, 0, 0, 0.85);
85
+ color: white;
86
+ border-radius: 4px;
87
+ font-size: 14px;
88
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
89
+ position: absolute;
90
+ pointer-events: none;
91
+ transform: translate(-50%, -100%);
92
+ }
93
+ .pie-chart-module__pie-chart__R12Vh {
94
+ position: relative;
95
+ }
@@ -1,2 +1,2 @@
1
- import*as e from"@visx/event";import*as t from"@visx/group";import*as r from"@visx/shape/lib/shapes/Pie";import*as a from"@visx/text";import*as o from"@visx/tooltip";import*as n from"clsx";import*as l from"react";import*as i from"@visx/legend";import*as c from"@visx/scale";var u={d:(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},s={};function d(e){return d="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},d(e)}function m(e,t,r){return(t=function(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}u.d(s,{r:()=>L});const p=(v={localPoint:()=>e.localPoint},f={},u.d(f,v),f);var v,f;const b=(e=>{var t={};return u.d(t,e),t})({Group:()=>t.Group}),g=(e=>{var t={};return u.d(t,e),t})({default:()=>r.default}),h=(e=>{var t={};return u.d(t,e),t})({Text:()=>a.Text}),y=(e=>{var t={};return u.d(t,e),t})({useTooltip:()=>o.useTooltip}),x=(e=>{var t={};return u.d(t,e),t})({default:()=>n.default}),O=(e=>{var t={};return u.d(t,e),t})({createContext:()=>l.createContext,useCallback:()=>l.useCallback,useContext:()=>l.useContext});var E={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},R=(0,O.createContext)(E);const w=(e=>{var t={};return u.d(t,e),t})({LegendOrdinal:()=>i.LegendOrdinal}),P=(e=>{var t={};return u.d(t,e),t})({scaleOrdinal:()=>c.scaleOrdinal}),F={"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"},j=function(e){var t=e.items,r=e.className,a=e.orientation,o=void 0===a?"horizontal":a,n=(0,P.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return React.createElement("div",{className:(0,x.default)(F.legend,F["legend--".concat(o)],r),role:"list"},React.createElement(w.LegendOrdinal,{scale:n,direction:C[o],shape:"rect",shapeWidth:16,shapeHeight:16,className:F["legend-items"]},(function(e){return React.createElement("div",{className:F["legend--".concat(o)]},e.map((function(e){var r,a;return React.createElement("div",{key:e.text,className:F["legend-item"]},React.createElement("svg",{width:16,height:16},React.createElement("rect",{width:16,height:16,fill:e.value,className:F["legend-item-swatch"]})),React.createElement("span",{className:F["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:F["legend-item-value"]},null===(a=t.find((function(t){return t.label===e.text})))||void 0===a?void 0:a.value)))})))})))};var N=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))},k=function(e){var t=e.data,r=e.top,a=e.left,o=e.component,n=void 0===o?N:o,l=e.children,i=e.className;return React.createElement("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:r,left:a},role:"tooltip"},l||t&&React.createElement(n,{data:t,className:i}))};function D(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 A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const L=function(e){var t=e.data,r=e.width,a=void 0===r?500:r,o=e.label,n=e.note,l=e.className,i=e.withTooltips,c=void 0!==i&&i,u=e.clockwise,s=void 0===u||u,d=e.thickness,m=void 0===d?.4:d,v=e.showLegend,f=e.legendOrientation,E=(0,O.useContext)(R),w=(0,y.useTooltip)(),P=w.tooltipOpen,F=w.tooltipLeft,C=w.tooltipTop,N=w.tooltipData,D=w.hideTooltip,L=w.showTooltip,S=a/2,T=a/2,M=a/2,K=M*(1-m+.03),q=t.map((function(e,t){return A(A({},e),{},{index:t})})),B=s?-Math.PI/2:Math.PI/2,H=s?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||E.colors[e.index%E.colors.length]}},J=(0,O.useCallback)((function(e,t){var r=(0,p.localPoint)(e);r&&L({tooltipData:t.data,tooltipLeft:r.x,tooltipTop:r.y-10})}),[L]),W=(0,O.useCallback)((function(){D()}),[D]),z=(0,O.useCallback)((function(e){return function(t){J(t,e)}}),[J]),G=t.map((function(e,t){return{label:e.label,value:e.valueDisplay||e.value.toString(),color:I.fill(A(A({},e),{},{index:t}))}}));return React.createElement("div",{className:(0,x.default)("pie-semi-circle-chart","oJsjYo330oeLpWqpqf4w",l)},React.createElement("svg",{width:a,height:T},React.createElement(b.Group,{top:S,left:S},React.createElement(g.default,{data:q,pieValue:I.value,outerRadius:M,innerRadius:K,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:z(t),onMouseLeave:W},React.createElement("path",{d:e.path(t)||"",fill:I.fill(t.data)}))}))})),React.createElement(b.Group,null,React.createElement(h.Text,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:"bxF3iRlHVJNqwEjRY9QD"},o),React.createElement(h.Text,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:"tA3u0r3RunHmbWFBLrqW"},n)))),c&&P&&N&&React.createElement(k,{data:{label:N.label,value:N.value,valueDisplay:N.valueDisplay},top:C||0,left:F||0}),v&&React.createElement(j,{items:G,orientation:f,className:"aV40KcaCeoEycQ2crVkB"}))};var S=s.r;export{S as PieSemiCircleChart};
2
- //# sourceMappingURL=index.js.map
1
+ import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import{localPoint as i}from"@visx/event";import{Group as a}from"@visx/group";import o from"@visx/shape/lib/shapes/Pie";import{Text as r}from"@visx/text";import{useTooltip as n}from"@visx/tooltip";import s from"clsx";import{createContext as d,useContext as c,useCallback as m}from"react";import{LegendOrdinal as h}from"@visx/legend";import{scaleOrdinal as p}from"@visx/scale";import{useParentSize as g}from"@visx/responsive";const u=d({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});var v={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const _={horizontal:"row",vertical:"column"},f=({items:t,className:i,orientation:a="horizontal"})=>{const o=p({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e("div",{className:s(v.legend,v[`legend--${a}`],i),role:"list",children:e(h,{scale:o,direction:_[a],shape:"rect",shapeWidth:16,shapeHeight:16,className:v["legend-items"],children:i=>e("div",{className:v[`legend--${a}`],children:i.map((i=>l("div",{className:v["legend-item"],children:[e("svg",{width:16,height:16,children:e("rect",{width:16,height:16,fill:i.value,className:v["legend-item-swatch"]})}),l("span",{className:v["legend-item-label"],children:[i.text,t.find((e=>e.label===i.text))?.value&&e("span",{className:v["legend-item-value"],children:t.find((e=>e.label===i.text))?.value})]})]},i.text)))})})})};var x="base-tooltip-module__tooltip__OfX6n";const b=({data:e})=>l(t,{children:[e?.label,": ",e?.valueDisplay||e?.value]}),N=({data:l,top:t,left:i,component:a=b,children:o,className:r})=>e("div",{className:x,style:{top:t,left:i},role:"tooltip",children:o||l&&e(a,{data:l,className:r})});var F="pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9",w="pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y",C="pie-semi-circle-chart-module__label__nPqOg",y="pie-semi-circle-chart-module__note__LpBZQ";const D=({data:t,size:d=500,label:h,note:p,className:g,withTooltips:v=!1,clockwise:_=!0,thickness:x=.4,showLegend:b,legendOrientation:D})=>{const k=c(u),{tooltipOpen:A,tooltipLeft:z,tooltipTop:M,tooltipData:P,hideTooltip:L,showTooltip:S}=n(),T=d/2,I=d/2,R=d/2,$=R*(1-x+.03),B=t.map(((e,l)=>({...e,index:l}))),O=_?-Math.PI/2:Math.PI/2,W=_?Math.PI/2:-Math.PI/2,j={value:e=>e.value,sort:(e,l)=>l.value-e.value,fill:e=>e.color||k.colors[e.index%k.colors.length]},H=m(((e,l)=>{const t=i(e);t&&S({tooltipData:l.data,tooltipLeft:t.x,tooltipTop:t.y-10})}),[S]),X=m((()=>{L()}),[L]),q=m((e=>l=>{H(l,e)}),[H]),Q=t.map(((e,l)=>({label:e.label,value:e.valueDisplay||e.value.toString(),color:j.fill({...e,index:l})})));return l("div",{className:s("pie-semi-circle-chart",F,g),children:[e("svg",{viewBox:`0 0 ${d} ${I}`,children:l(a,{top:T,left:T,children:[e(o,{data:B,pieValue:j.value,outerRadius:R,innerRadius:$,cornerRadius:3,padAngle:.03,startAngle:O,endAngle:W,pieSort:j.sort,children:l=>l.arcs.map((t=>e("g",{onMouseMove:q(t),onMouseLeave:X,children:e("path",{d:l.path(t)||"",fill:j.fill(t.data)})},t.data.label)))}),l(a,{children:[e(r,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:C,children:h}),e(r,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:y,children:p})]})]})}),v&&A&&P&&e(N,{data:{label:P.label,value:P.value,valueDisplay:P.valueDisplay},top:M||0,left:z||0}),b&&e(f,{items:Q,orientation:D,className:w})]})};D.displayName="PieSemiCircleChart";var k=function(l,t){const{maxWidth:i=1200,aspectRatio:a=.5,debounceTime:o=50}=t||{};return function(t){const{parentRef:r,width:n}=g({debounceTime:o,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),s=n?Math.min(n,i):600,d=s*a;return e("div",{ref:r,style:{width:"100%",minHeight:`${d}px`},children:e(l,{width:s,height:d,size:s,...t})})}}(D);export{k as PieSemiCircleChart};
2
+ //# sour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2B,EAAY3B,cAE3BG,IAAMuB,GAAc,EACpBtB,KAAOqB,GAAe,IAItBP,GACD1C,MAAAC,cAAC6F,EAAM,CACN1G,MAAQyF,EACRtF,YAAcoD,EACdtD,UClLyF,yBDuL9F,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/../../../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 module \"@visx/event\"","webpack://@automattic/charts/external module \"@visx/group\"","webpack://@automattic/charts/external module \"@visx/shape/lib/shapes/Pie\"","webpack://@automattic/charts/external module \"@visx/text\"","webpack://@automattic/charts/external module \"@visx/tooltip\"","webpack://@automattic/charts/external module \"clsx\"","webpack://@automattic/charts/external module \"react\"","webpack://@automattic/charts/./src/providers/theme/themes.ts","webpack://@automattic/charts/./src/providers/theme/theme-provider.tsx","webpack://@automattic/charts/external module \"@visx/legend\"","webpack://@automattic/charts/external module \"@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","// 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))","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 };","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"localPoint\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_event_19f6f977__.localPoint) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"Group\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_group_7523624b__.Group) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"default\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_shape_lib_shapes_Pie_08ab59ce__[\"default\"]) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"Text\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_text_459b7199__.Text) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"useTooltip\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_tooltip_83ba89e9__.useTooltip) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"default\"]: () => (__WEBPACK_EXTERNAL_MODULE_clsx__[\"default\"]) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"createContext\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.createContext), [\"useCallback\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useCallback), [\"useContext\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useContext) });","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","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"LegendOrdinal\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_legend_118b7922__.LegendOrdinal) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"scaleOrdinal\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_scale_2ec4ad68__.scaleOrdinal) });","// 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__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","_typeof","Symbol","iterator","constructor","e","r","t","i","toPrimitive","TypeError","String","toPropertyKey","value","configurable","writable","y","__WEBPACK_EXTERNAL_MODULE__visx_event_19f6f977__","x","d","__WEBPACK_EXTERNAL_MODULE__visx_group_7523624b__","__WEBPACK_EXTERNAL_MODULE__visx_shape_lib_shapes_Pie_08ab59ce__","__WEBPACK_EXTERNAL_MODULE__visx_text_459b7199__","__WEBPACK_EXTERNAL_MODULE__visx_tooltip_83ba89e9__","__WEBPACK_EXTERNAL_MODULE_clsx__","__WEBPACK_EXTERNAL_MODULE_react__","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","__WEBPACK_EXTERNAL_MODULE__visx_legend_118b7922__","__WEBPACK_EXTERNAL_MODULE__visx_scale_2ec4ad68__","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","a","b","length","handleMouseMove","useCallback","event","arc","coords","localPoint","handleMouseLeave","handleArcMouseMove","legendItems","toString","Group","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","path","Text","textAnchor","verticalAnchor","Legend"],"sourceRoot":""}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/providers/theme/themes.ts","../../../../src/providers/theme/theme-provider.tsx","../../../../src/components/legend/base-legend.tsx","../../../../src/components/tooltip/base-tooltip.tsx","../../../../src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx","../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["ThemeContext","createContext","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","className","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","role","children","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","width","height","fill","value","text","find","DefaultTooltipContent","data","_Fragment","valueDisplay","BaseTooltip","top","left","component","Component","style","PieSemiCircleChart","size","note","withTooltips","clockwise","thickness","showLegend","legendOrientation","providerTheme","useContext","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","centerX","radius","innerRadius","dataWithIndex","d","index","startAngle","Math","PI","endAngle","accessors","sort","a","b","length","handleMouseMove","useCallback","event","arc","coords","localPoint","x","y","handleMouseLeave","handleArcMouseMove","legendItems","toString","viewBox","Group","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","path","Text","textAnchor","verticalAnchor","Legend","displayName","pieSemiCircleChart","WrappedComponent","config","maxWidth","aspectRatio","debounceTime","props","parentRef","parentWidth","useParentSize","enableDebounceLeadingCall","initialSize","containerWidth","min","containerHeight","ref","minHeight","withResponsive"],"mappings":"weAKA,MCEMA,EAAeC,EDFY,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,G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GAAU,GAE5E,OAAO,SAA0BI,GAChC,MAAMC,UAAEA,EAAWrF,MAAOsF,GAAgBC,EAAe,CACxDJ,eACAK,2BAA2B,EAC3BC,YAAa,CAAEzF,MAAO,IAAKC,OAAQ,OAI9ByF,EAAiBJ,EAAc9C,KAAKmD,IAAKL,EAAaL,GAAa,IACnEW,EAAkBF,EAAiBR,EAEzC,OACChG,EACC,MAAA,CAAA2G,IAAMR,EACNtE,MAAQ,CACPf,MAAO,OACP8F,UAAW,GAAIF,OACfrG,SAEDL,EAAC6F,EAAgB,CAChB/E,MAAQ0F,EACRzF,OAAS2F,EACT3E,KAAOyE,KACAN,KAIX,CACD,CD4IeW,CAA2C/E"}
@@ -1,5 +1,95 @@
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}
1
+ .bar-chart-module__bar-chart__lmYNi {
2
+ position: relative;
3
+ }
4
+ .bar-chart-module__bar-chart-legend__vgKKq {
5
+ margin-top: 1rem;
6
+ }
7
+ .pie-chart-module__pie-chart__R12Vh {
8
+ position: relative;
9
+ }
10
+ .line-chart-module__line-chart__ITM3d {
11
+ position: relative;
12
+ }
13
+ .line-chart-module__line-chart__tooltip__aqcme {
14
+ background: #fff;
15
+ padding: 0.5rem;
16
+ }
17
+ .line-chart-module__line-chart__tooltip-date__4Dzab {
18
+ font-weight: bold;
19
+ padding-bottom: 10px;
20
+ }
21
+ .line-chart-module__line-chart__tooltip-row__6A37G {
22
+ display: flex;
23
+ align-items: center;
24
+ padding: 4px 0;
25
+ justify-content: space-between;
26
+ }
27
+ .line-chart-module__line-chart__tooltip-label__IvnFF {
28
+ font-weight: 500;
29
+ padding-right: 1rem;
30
+ }
31
+ .grid-control-module__grid-control__KOnZN .visx-line {
32
+ stroke: #d7d6d6;
33
+ stroke-width: 1px;
34
+ shape-rendering: crispEdges;
35
+ }
36
+ .legend-module__legend--horizontal__IUN13 {
37
+ display: flex;
38
+ flex-direction: row;
39
+ flex-wrap: wrap;
40
+ gap: 16px;
41
+ }
42
+ .legend-module__legend--vertical__Scfzo {
43
+ display: flex;
44
+ flex-direction: column;
45
+ gap: 8px;
46
+ }
4
47
 
5
- /*# sourceMappingURL=style.css.map*/
48
+ .legend-module__legend-item__feemn {
49
+ display: flex;
50
+ align-items: center;
51
+ gap: 8px;
52
+ font-size: 0.875rem;
53
+ }
54
+
55
+ .legend-module__legend-item-swatch__nRyXf {
56
+ border-radius: 2px;
57
+ }
58
+
59
+ .legend-module__legend-item-label__ksx6I {
60
+ color: var(--jp-gray-80, #2c3338);
61
+ display: flex;
62
+ align-items: center;
63
+ gap: 0.5rem;
64
+ }
65
+
66
+ .legend-module__legend-item-value__d9x1j {
67
+ font-weight: 500;
68
+ }
69
+ .base-tooltip-module__tooltip__OfX6n {
70
+ padding: 0.5rem;
71
+ background-color: rgba(0, 0, 0, 0.85);
72
+ color: white;
73
+ border-radius: 4px;
74
+ font-size: 14px;
75
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
76
+ position: absolute;
77
+ pointer-events: none;
78
+ transform: translate(-50%, -100%);
79
+ }
80
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
81
+ position: relative;
82
+ text-align: center;
83
+ }
84
+ .pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
85
+ margin-top: 1rem;
86
+ }
87
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
88
+ margin-bottom: 0px;
89
+ font-weight: 600;
90
+ font-size: 16px;
91
+ }
92
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
93
+ margin-top: 0px;
94
+ font-size: 14px;
95
+ }
@@ -1,2 +1,2 @@
1
- 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)},t={};e.d(t,{R:()=>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,i=e.className;return React.createElement("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:l,left:o},role:"tooltip"},c||t&&React.createElement(n,{data:t,className:i}))},o=t.R;export{o as BaseTooltip};
2
- //# sourceMappingURL=index.js.map
1
+ import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";var l="base-tooltip-module__tooltip__OfX6n";const o=({data:t})=>a(e,{children:[t?.label,": ",t?.valueDisplay||t?.value]}),s=({data:a,top:e,left:s,component:i=o,children:r,className:c})=>t("div",{className:l,style:{top:e,left:s},role:"tooltip",children:r||a&&t(i,{data:a,className:c})});export{s as BaseTooltip};
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/tooltip/index.js","mappings":"AACA,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,I,sBCmClF,IAAMI,EAAwB,SAAHC,GAAA,IAAOC,EAAID,EAAJC,KAAI,OACrCC,MAAAC,cAAAD,MAAAE,SAAA,KACGH,aAAI,EAAJA,EAAMI,MAAO,MAAIJ,aAAI,EAAJA,EAAMK,gBAAgBL,aAAI,EAAJA,EAAMM,OAC7C,EAGSC,EAAc,SAAHC,GAOC,IANxBR,EAAIQ,EAAJR,KACAS,EAAGD,EAAHC,IACAC,EAAIF,EAAJE,KAAIC,EAAAH,EACJI,UAAWC,OAAS,IAAAF,EAAGb,EAAqBa,EAC5CG,EAAQN,EAARM,SACAC,EAASP,EAATO,UAEA,OACCd,MAAAC,cAAA,OAAKa,UCjDmB,uBDiDUC,MAAQ,CAAEP,IAAAA,EAAKC,KAAAA,GAASO,KAAK,WAC5DH,GAAcd,GAAQC,MAAAC,cAACW,EAAS,CAACb,KAAOA,EAAOe,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/./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))","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","DefaultTooltipContent","_ref","data","React","createElement","Fragment","label","valueDisplay","value","BaseTooltip","_ref2","top","left","_ref2$component","component","Component","children","className","style","role"],"sourceRoot":""}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/tooltip/base-tooltip.tsx"],"sourcesContent":[null],"names":["DefaultTooltipContent","data","_jsxs","_Fragment","children","label","valueDisplay","value","BaseTooltip","top","left","component","Component","className","_jsx","styles","style","role"],"mappings":"4GAmCA,MAAMA,EAAwB,EAAIC,UACjCC,EACGC,EAAA,CAAAC,SAAA,CAAAH,GAAMI,MAAK,KAAMJ,GAAMK,cAAgBL,GAAMM,SAIpCC,EAAc,EAC1BP,OACAQ,MACAC,OACAC,UAAWC,EAAYZ,EACvBI,WACAS,eAGCC,EAAK,MAAA,CAAAD,UAAYE,EAAiBC,MAAQ,CAAEP,MAAKC,QAASO,KAAK,UAC5Db,SAAAA,GAAcH,GAAQa,EAACF,GAAUX,KAAOA,EAAOY,UAAYA"}
@@ -1,3 +1,95 @@
1
- .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%)}
1
+ .bar-chart-module__bar-chart__lmYNi {
2
+ position: relative;
3
+ }
4
+ .bar-chart-module__bar-chart-legend__vgKKq {
5
+ margin-top: 1rem;
6
+ }
7
+ .pie-chart-module__pie-chart__R12Vh {
8
+ position: relative;
9
+ }
10
+ .line-chart-module__line-chart__ITM3d {
11
+ position: relative;
12
+ }
13
+ .line-chart-module__line-chart__tooltip__aqcme {
14
+ background: #fff;
15
+ padding: 0.5rem;
16
+ }
17
+ .line-chart-module__line-chart__tooltip-date__4Dzab {
18
+ font-weight: bold;
19
+ padding-bottom: 10px;
20
+ }
21
+ .line-chart-module__line-chart__tooltip-row__6A37G {
22
+ display: flex;
23
+ align-items: center;
24
+ padding: 4px 0;
25
+ justify-content: space-between;
26
+ }
27
+ .line-chart-module__line-chart__tooltip-label__IvnFF {
28
+ font-weight: 500;
29
+ padding-right: 1rem;
30
+ }
31
+ .legend-module__legend--horizontal__IUN13 {
32
+ display: flex;
33
+ flex-direction: row;
34
+ flex-wrap: wrap;
35
+ gap: 16px;
36
+ }
37
+ .legend-module__legend--vertical__Scfzo {
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: 8px;
41
+ }
2
42
 
3
- /*# sourceMappingURL=style.css.map*/
43
+ .legend-module__legend-item__feemn {
44
+ display: flex;
45
+ align-items: center;
46
+ gap: 8px;
47
+ font-size: 0.875rem;
48
+ }
49
+
50
+ .legend-module__legend-item-swatch__nRyXf {
51
+ border-radius: 2px;
52
+ }
53
+
54
+ .legend-module__legend-item-label__ksx6I {
55
+ color: var(--jp-gray-80, #2c3338);
56
+ display: flex;
57
+ align-items: center;
58
+ gap: 0.5rem;
59
+ }
60
+
61
+ .legend-module__legend-item-value__d9x1j {
62
+ font-weight: 500;
63
+ }
64
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
65
+ position: relative;
66
+ text-align: center;
67
+ }
68
+ .pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
69
+ margin-top: 1rem;
70
+ }
71
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
72
+ margin-bottom: 0px;
73
+ font-weight: 600;
74
+ font-size: 16px;
75
+ }
76
+ .pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
77
+ margin-top: 0px;
78
+ font-size: 14px;
79
+ }
80
+ .grid-control-module__grid-control__KOnZN .visx-line {
81
+ stroke: #d7d6d6;
82
+ stroke-width: 1px;
83
+ shape-rendering: crispEdges;
84
+ }
85
+ .base-tooltip-module__tooltip__OfX6n {
86
+ padding: 0.5rem;
87
+ background-color: rgba(0, 0, 0, 0.85);
88
+ color: white;
89
+ border-radius: 4px;
90
+ font-size: 14px;
91
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
92
+ position: absolute;
93
+ pointer-events: none;
94
+ transform: translate(-50%, -100%);
95
+ }