@automattic/charts 0.56.3 → 0.56.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/charts/bar-chart/index.cjs +5 -5
- package/dist/charts/bar-chart/index.css +12 -0
- package/dist/charts/bar-chart/index.css.map +1 -1
- package/dist/charts/bar-chart/index.js +4 -4
- package/dist/charts/bar-list-chart/index.cjs +6 -6
- package/dist/charts/bar-list-chart/index.css +12 -0
- package/dist/charts/bar-list-chart/index.css.map +1 -1
- package/dist/charts/bar-list-chart/index.js +5 -5
- package/dist/charts/conversion-funnel-chart/index.cjs +5 -3
- package/dist/charts/conversion-funnel-chart/index.cjs.map +1 -1
- package/dist/charts/conversion-funnel-chart/index.css +14 -1
- package/dist/charts/conversion-funnel-chart/index.css.map +1 -1
- package/dist/charts/conversion-funnel-chart/index.d.cts +2 -0
- package/dist/charts/conversion-funnel-chart/index.d.ts +2 -0
- package/dist/charts/conversion-funnel-chart/index.js +4 -2
- package/dist/charts/geo-chart/index.cjs +4 -4
- package/dist/charts/geo-chart/index.css +12 -0
- package/dist/charts/geo-chart/index.css.map +1 -1
- package/dist/charts/geo-chart/index.js +3 -3
- package/dist/charts/leaderboard-chart/index.cjs +5 -5
- package/dist/charts/leaderboard-chart/index.css +12 -0
- package/dist/charts/leaderboard-chart/index.css.map +1 -1
- package/dist/charts/leaderboard-chart/index.js +4 -4
- package/dist/charts/line-chart/index.cjs +5 -5
- package/dist/charts/line-chart/index.css +12 -0
- package/dist/charts/line-chart/index.css.map +1 -1
- package/dist/charts/line-chart/index.js +4 -4
- package/dist/charts/pie-chart/index.cjs +7 -7
- package/dist/charts/pie-chart/index.css +12 -0
- package/dist/charts/pie-chart/index.css.map +1 -1
- package/dist/charts/pie-chart/index.js +6 -6
- package/dist/charts/pie-semi-circle-chart/index.cjs +7 -7
- package/dist/charts/pie-semi-circle-chart/index.css +12 -0
- package/dist/charts/pie-semi-circle-chart/index.css.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.js +6 -6
- package/dist/charts/sparkline/index.cjs +6 -6
- package/dist/charts/sparkline/index.css +12 -0
- package/dist/charts/sparkline/index.css.map +1 -1
- package/dist/charts/sparkline/index.js +5 -5
- package/dist/{chunk-OTZT3MC2.cjs → chunk-2A34OA5O.cjs} +19 -20
- package/dist/chunk-2A34OA5O.cjs.map +1 -0
- package/dist/chunk-4YYROZDJ.cjs +375 -0
- package/dist/chunk-4YYROZDJ.cjs.map +1 -0
- package/dist/{chunk-YYQ4IK5V.cjs → chunk-5N77S5N3.cjs} +103 -80
- package/dist/chunk-5N77S5N3.cjs.map +1 -0
- package/dist/chunk-66BXSWMW.cjs +1065 -0
- package/dist/chunk-66BXSWMW.cjs.map +1 -0
- package/dist/{chunk-CEZGL6YP.js → chunk-6CCZL2JJ.js} +15 -7
- package/dist/chunk-6CCZL2JJ.js.map +1 -0
- package/dist/{chunk-NW3RUYK2.cjs → chunk-7QDEU3KN.cjs} +15 -22
- package/dist/chunk-7QDEU3KN.cjs.map +1 -0
- package/dist/{chunk-H34CJSR6.js → chunk-AWNCAKZY.js} +367 -358
- package/dist/chunk-AWNCAKZY.js.map +1 -0
- package/dist/{chunk-5XI443YP.js → chunk-BPYKWMI7.js} +72 -64
- package/dist/chunk-BPYKWMI7.js.map +1 -0
- package/dist/{chunk-7UJPVCMB.cjs → chunk-CERFRCXD.cjs} +265 -262
- package/dist/chunk-CERFRCXD.cjs.map +1 -0
- package/dist/chunk-CMHPXSCI.js +351 -0
- package/dist/chunk-CMHPXSCI.js.map +1 -0
- package/dist/chunk-EBDUXL5K.js +421 -0
- package/dist/chunk-EBDUXL5K.js.map +1 -0
- package/dist/{chunk-2VPPTJS2.js → chunk-FZYJM5PN.js} +256 -253
- package/dist/chunk-FZYJM5PN.js.map +1 -0
- package/dist/chunk-GBDFC74U.cjs +165 -0
- package/dist/chunk-GBDFC74U.cjs.map +1 -0
- package/dist/{chunk-ODF5O5PV.cjs → chunk-HNEG3EFJ.cjs} +154 -170
- package/dist/chunk-HNEG3EFJ.cjs.map +1 -0
- package/dist/{chunk-SRXJLAKG.cjs → chunk-I2276W3I.cjs} +28 -37
- package/dist/chunk-I2276W3I.cjs.map +1 -0
- package/dist/chunk-KKPZ4MVF.js +375 -0
- package/dist/chunk-KKPZ4MVF.js.map +1 -0
- package/dist/chunk-KMYJJTSR.cjs +421 -0
- package/dist/chunk-KMYJJTSR.cjs.map +1 -0
- package/dist/{chunk-A3AEEGKR.js → chunk-KXRWNFQJ.js} +20 -21
- package/dist/chunk-KXRWNFQJ.js.map +1 -0
- package/dist/{chunk-TVV7ZI7C.cjs → chunk-LSV7F26B.cjs} +362 -353
- package/dist/chunk-LSV7F26B.cjs.map +1 -0
- package/dist/{chunk-T4J6TI55.js → chunk-M7PRGJFE.js} +102 -79
- package/dist/chunk-M7PRGJFE.js.map +1 -0
- package/dist/{chunk-TNRKEBTA.js → chunk-PGJAZN2H.js} +148 -164
- package/dist/{chunk-TNRKEBTA.js.map → chunk-PGJAZN2H.js.map} +1 -1
- package/dist/chunk-R23BFDIW.js +1065 -0
- package/dist/chunk-R23BFDIW.js.map +1 -0
- package/dist/{chunk-HIWNB5PK.cjs → chunk-RCY6XLGU.cjs} +13 -5
- package/dist/chunk-RCY6XLGU.cjs.map +1 -0
- package/dist/chunk-RSYD434G.cjs +351 -0
- package/dist/chunk-RSYD434G.cjs.map +1 -0
- package/dist/{chunk-C33AQZEC.js → chunk-TYIH5LMV.js} +16 -23
- package/dist/chunk-TYIH5LMV.js.map +1 -0
- package/dist/chunk-WMWAUOQ4.js +165 -0
- package/dist/chunk-WMWAUOQ4.js.map +1 -0
- package/dist/chunk-XWYZIFZW.js +66 -0
- package/dist/chunk-XWYZIFZW.js.map +1 -0
- package/dist/{chunk-7HROSZRS.cjs → chunk-Y3NNQMAX.cjs} +70 -62
- package/dist/chunk-Y3NNQMAX.cjs.map +1 -0
- package/dist/chunk-ZXEFMKVP.cjs +120 -0
- package/dist/chunk-ZXEFMKVP.cjs.map +1 -0
- package/dist/chunk-ZY4FXLMM.js +120 -0
- package/dist/chunk-ZY4FXLMM.js.map +1 -0
- package/dist/components/legend/index.cjs +2 -2
- package/dist/components/legend/index.css +12 -0
- package/dist/components/legend/index.css.map +1 -1
- package/dist/components/legend/index.js +1 -1
- package/dist/components/tooltip/index.cjs +2 -2
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/trend-indicator/index.cjs +2 -2
- package/dist/components/trend-indicator/index.js +1 -1
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.css +12 -0
- package/dist/hooks/index.css.map +1 -1
- package/dist/hooks/index.d.cts +28 -2
- package/dist/hooks/index.d.ts +28 -2
- package/dist/hooks/index.js +3 -1
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +14 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/dist/providers/index.cjs +2 -2
- package/dist/providers/index.css +12 -0
- package/dist/providers/index.css.map +1 -1
- package/dist/providers/index.d.cts +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +1 -1
- package/dist/{themes-DQs9rbN5.d.cts → themes-BDVaIfBz.d.cts} +9 -0
- package/dist/{themes-CRV5fVzJ.d.ts → themes-mcS8QNkQ.d.ts} +9 -0
- package/package.json +5 -1
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss +2 -1
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx +16 -6
- package/src/charts/conversion-funnel-chart/test/conversion-funnel-chart.test.tsx +34 -0
- package/src/charts/conversion-funnel-chart/types.ts +2 -0
- package/src/charts/pie-chart/pie-chart.tsx +2 -3
- package/src/hooks/index.ts +1 -0
- package/src/hooks/test/use-tooltip-portal-relocator.test.ts +216 -0
- package/src/hooks/use-tooltip-portal-relocator.module.scss +10 -0
- package/src/hooks/use-tooltip-portal-relocator.ts +177 -0
- package/src/providers/chart-context/global-charts-provider.tsx +18 -1
- package/tsup.config.ts +11 -0
- package/dist/chunk-2VPPTJS2.js.map +0 -1
- package/dist/chunk-5XI443YP.js.map +0 -1
- package/dist/chunk-7HROSZRS.cjs.map +0 -1
- package/dist/chunk-7UJPVCMB.cjs.map +0 -1
- package/dist/chunk-A3AEEGKR.js.map +0 -1
- package/dist/chunk-C33AQZEC.js.map +0 -1
- package/dist/chunk-CEZGL6YP.js.map +0 -1
- package/dist/chunk-COOC2TVQ.js +0 -167
- package/dist/chunk-COOC2TVQ.js.map +0 -1
- package/dist/chunk-EJHLLXBV.js +0 -362
- package/dist/chunk-EJHLLXBV.js.map +0 -1
- package/dist/chunk-FWMJ2FR2.js +0 -121
- package/dist/chunk-FWMJ2FR2.js.map +0 -1
- package/dist/chunk-GRYNIPWH.cjs +0 -385
- package/dist/chunk-GRYNIPWH.cjs.map +0 -1
- package/dist/chunk-H34CJSR6.js.map +0 -1
- package/dist/chunk-HIWNB5PK.cjs.map +0 -1
- package/dist/chunk-IZWC33YN.cjs +0 -357
- package/dist/chunk-IZWC33YN.cjs.map +0 -1
- package/dist/chunk-KOF32DBL.cjs +0 -1058
- package/dist/chunk-KOF32DBL.cjs.map +0 -1
- package/dist/chunk-LHWRZMF7.cjs +0 -362
- package/dist/chunk-LHWRZMF7.cjs.map +0 -1
- package/dist/chunk-MFRS2PEY.cjs +0 -121
- package/dist/chunk-MFRS2PEY.cjs.map +0 -1
- package/dist/chunk-MMDLXS6O.js +0 -75
- package/dist/chunk-MMDLXS6O.js.map +0 -1
- package/dist/chunk-NW3RUYK2.cjs.map +0 -1
- package/dist/chunk-ODF5O5PV.cjs.map +0 -1
- package/dist/chunk-OTZT3MC2.cjs.map +0 -1
- package/dist/chunk-SBRMWDWM.js +0 -357
- package/dist/chunk-SBRMWDWM.js.map +0 -1
- package/dist/chunk-SRXJLAKG.cjs.map +0 -1
- package/dist/chunk-T4J6TI55.js.map +0 -1
- package/dist/chunk-TVV7ZI7C.cjs.map +0 -1
- package/dist/chunk-XVMXWV3C.cjs +0 -167
- package/dist/chunk-XVMXWV3C.cjs.map +0 -1
- package/dist/chunk-YYQ4IK5V.cjs.map +0 -1
- package/dist/chunk-ZDNCF642.js +0 -1058
- package/dist/chunk-ZDNCF642.js.map +0 -1
- package/dist/chunk-ZWBUEHKF.js +0 -385
- package/dist/chunk-ZWBUEHKF.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-OTZT3MC2.cjs","../src/charts/private/radial-wipe-animation/radial-wipe-animation.tsx"],"names":[],"mappings":"AAAA;AC8EI,+CAAA;AAnCJ,SAAS,mBAAA,CAAqB;AAAA,EAC7B,EAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA,EAAc,CAAA;AAAA,EACd,WAAA,EAAa,GAAA;AAAA,EACb,eAAA,EAAiB,GAAA;AAAA,EACjB,UAAA,EAAY,WAAA;AAAA,EACZ,WAAA,EAAa;AACd,CAAA,EAA8B;AAC7B,EAAA,MAAM,YAAA,EAAA,CACH,OAAA,EAAS,WAAA,EAAA,EAAgB,EAAA;AAAA,EAC3B,CAAA;AAED,EAAA,MAAM,OAAA,EAAS,UAAA,IAAc,YAAA,EAAc,CAAA,EAAA,EAAK,CAAA;AAEhD,EAAA,MAAM,sBAAA,EAAwB,EAAA,EAAI,eAAA,GAAkB,eAAA,GAAkB,GAAA;AACtE,EAAA,MAAM,kBAAA,EAAoB,CAAA;AAAA,EAAA;AAK1B,EAAA;AAEE,IAAA;AAAC,IAAA;AAAA,MAAA;AACK,MAAA;AACA,MAAA;AACD,MAAA;AACO,MAAA;AACN,MAAA;AACE,MAAA;AACP,MAAA;AACgB,MAAA;AACC,MAAA;AACkD,MAAA;AAEnE,QAAA;AAAC,QAAA;AAAA,UAAA;AACc,UAAA;AACT,UAAA;AACF,UAAA;AACG,UAAA;AACD,UAAA;AACI,UAAA;AACE,UAAA;AAC2B,QAAA;AAAA,MAAA;AACvC,IAAA;AAAA,EAAA;AAIJ;AAEA;AD9CA;AACA;AACA;AACA","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-OTZT3MC2.cjs","sourcesContent":[null,"/**\n * This animation uses the SVG self-drawing technique (source: https://www.joshwcomeau.com/svg/friendly-introduction-to-svg/),\n * leveraging stroke-dasharray and stroke-dashoffset properties to create the effect.\n *\n * Here, we reverse the animation to \"un-draw\" the circle for the revealing / radial wipe effect:\n * - Initially, the entire circle is drawn with a white mask.\n * - The circle's border (stroke) is drawn with a black stroke, wide enough to cover the circle.\n * - The stroke is then \"un-drawn,\" creating the wipe animation.\n * - A white mask makes the area visible, while a black mask makes the area invisible.\n */\n\ntype Angle = `${ number }deg` | `${ number }rad` | `${ number }grad` | `${ number }turn` | 0 | '0';\n\n/**\n * RadialWipeAnimationProps - SVG mask props that requires a radial wipe animation effect.\n *\n * @param {object} props - The properties object.\n * @param {string} props.id - The unique ID for the mask.\n * @param {number} props.radius - The outer radius of the radial wipe.\n * @param {number} [props.innerRadius=0] - The inner radius of the radial wipe.\n * @param {number} [props.durationMs=1000] - The duration of the animation in milliseconds.\n * @param {number} [props.wipePercentage=100] - The percentage of the wipe animation to complete.\n * @param {'clockwise' | 'counter-clockwise'} [props.direction='clockwise'] - The direction of the wipe animation.\n * @param {Angle} [props.startAngle='-90deg'] - The starting angle of the wipe animation.\n *\n * @return {JSX.Element} The radial wipe mask element.\n */\nexport type RadialWipeAnimationProps = {\n\tid: string;\n\tradius: number;\n\tinnerRadius?: number;\n\tdurationMs?: number;\n\tstartAngle?: Angle;\n\tdirection?: 'clockwise' | 'counter-clockwise';\n\twipePercentage?: number;\n};\n\n/**\n * Renders a SVG mask that creates a radial wipe animation effect.\n *\n * @param {RadialWipeAnimationProps} props - Component props\n * @return {JSX.Element} The rendered mask component\n */\nfunction RadialWipeAnimation( {\n\tid,\n\tradius,\n\tinnerRadius = 0,\n\tdurationMs = 1000,\n\twipePercentage = 100,\n\tdirection = 'clockwise',\n\tstartAngle = '-90deg',\n}: RadialWipeAnimationProps ) {\n\tconst strokeWidth =\n\t\t( radius - innerRadius ) * 2 + // The stroke is centered on the circumference, so we need to double the width.\n\t\t1; // Added 1 to prevent sub-pixel rendering issues.\n\n\tconst scaleY = direction === 'clockwise' ? -1 : 1;\n\n\tconst isValidWipePercentage = 0 < wipePercentage && wipePercentage <= 100;\n\tconst animationDuration = `${\n\t\t// If wipePercentage is invalid, set animation duration to 0 to disable animation.\n\t\tisValidWipePercentage ? durationMs * ( 100 / wipePercentage ) : 0\n\t}ms`;\n\n\treturn (\n\t\t<mask id={ id }>\n\t\t\t<circle\n\t\t\t\tcx={ 0 }\n\t\t\t\tcy={ 0 }\n\t\t\t\tr={ radius }\n\t\t\t\tpathLength=\"100\"\n\t\t\t\tfill=\"white\"\n\t\t\t\tstroke=\"black\" // The stroke will be un-drawn, hence 'black' mask.\n\t\t\t\tstrokeWidth={ strokeWidth }\n\t\t\t\tstrokeDasharray=\"100, 1000\"\n\t\t\t\tstrokeDashoffset=\"0\"\n\t\t\t\tstyle={ { transform: `rotate(${ startAngle }) scaleY(${ scaleY })` } }\n\t\t\t>\n\t\t\t\t<animate\n\t\t\t\t\tattributeName=\"stroke-dashoffset\"\n\t\t\t\t\tfrom=\"0\"\n\t\t\t\t\tto=\"100.1\"\n\t\t\t\t\tdur={ animationDuration }\n\t\t\t\t\tfill=\"freeze\" // Same as CSS 'forwards' to retain the final state after animation.\n\t\t\t\t\tcalcMode=\"spline\" // custom easing\n\t\t\t\t\tkeySplines=\"0.42 0 0.58 1;0 0 1 1\" // ease-in-out ; linear (unimportant)\n\t\t\t\t\tkeyTimes={ `0;${ wipePercentage / 100 };1` }\n\t\t\t\t/>\n\t\t\t</circle>\n\t\t</mask>\n\t);\n}\n\nexport default RadialWipeAnimation;\n"]}
|
package/dist/chunk-SBRMWDWM.js
DELETED
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getStringWidth
|
|
3
|
-
} from "./chunk-NFRB2POF.js";
|
|
4
|
-
import {
|
|
5
|
-
radial_wipe_animation_default
|
|
6
|
-
} from "./chunk-A3AEEGKR.js";
|
|
7
|
-
import {
|
|
8
|
-
ChartHTML,
|
|
9
|
-
ChartSVG,
|
|
10
|
-
useChartChildren
|
|
11
|
-
} from "./chunk-CEZGL6YP.js";
|
|
12
|
-
import {
|
|
13
|
-
BaseTooltip
|
|
14
|
-
} from "./chunk-5XI443YP.js";
|
|
15
|
-
import {
|
|
16
|
-
withResponsive
|
|
17
|
-
} from "./chunk-C33AQZEC.js";
|
|
18
|
-
import {
|
|
19
|
-
GlobalChartsContext,
|
|
20
|
-
GlobalChartsProvider,
|
|
21
|
-
Legend,
|
|
22
|
-
SingleChartContext,
|
|
23
|
-
useChartId,
|
|
24
|
-
useChartLegendItems,
|
|
25
|
-
useChartRegistration,
|
|
26
|
-
useElementHeight,
|
|
27
|
-
useGlobalChartsContext,
|
|
28
|
-
useGlobalChartsTheme,
|
|
29
|
-
useInteractiveLegendData,
|
|
30
|
-
usePrefersReducedMotion
|
|
31
|
-
} from "./chunk-H34CJSR6.js";
|
|
32
|
-
import {
|
|
33
|
-
attachSubComponents
|
|
34
|
-
} from "./chunk-TE63Y5PX.js";
|
|
35
|
-
|
|
36
|
-
// src/charts/pie-chart/pie-chart.tsx
|
|
37
|
-
import { Group } from "@visx/group";
|
|
38
|
-
import { Pie } from "@visx/shape";
|
|
39
|
-
import { useTooltip, useTooltipInPortal } from "@visx/tooltip";
|
|
40
|
-
import { __ } from "@wordpress/i18n";
|
|
41
|
-
import clsx from "clsx";
|
|
42
|
-
import { useCallback, useContext, useMemo } from "react";
|
|
43
|
-
|
|
44
|
-
// src/charts/pie-chart/pie-chart.module.scss
|
|
45
|
-
var pie_chart_module_default = {
|
|
46
|
-
"pie-chart": "a8ccharts-C-n-Gu",
|
|
47
|
-
"pie-chart--legend-top": "a8ccharts-Mu0uxl"
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// src/charts/pie-chart/pie-chart.tsx
|
|
51
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
52
|
-
var renderDefaultPieTooltip = ({ tooltipData }) => {
|
|
53
|
-
return /* @__PURE__ */ jsx(BaseTooltip, { data: tooltipData, top: 0, left: 0, renderContainer: false });
|
|
54
|
-
};
|
|
55
|
-
var validateData = (data) => {
|
|
56
|
-
if (!data.length) {
|
|
57
|
-
return { isValid: false, message: "No data available" };
|
|
58
|
-
}
|
|
59
|
-
const hasNegativeValues = data.some((item) => item.percentage < 0 || item.value < 0);
|
|
60
|
-
if (hasNegativeValues) {
|
|
61
|
-
return { isValid: false, message: "Invalid data: Negative values are not allowed" };
|
|
62
|
-
}
|
|
63
|
-
const totalPercentage = data.reduce((sum, item) => sum + item.percentage, 0);
|
|
64
|
-
if (Math.abs(totalPercentage - 100) > 0.01) {
|
|
65
|
-
return { isValid: false, message: "Invalid percentage total: Must equal 100" };
|
|
66
|
-
}
|
|
67
|
-
return { isValid: true, message: "" };
|
|
68
|
-
};
|
|
69
|
-
var PieChartInternal = ({
|
|
70
|
-
data,
|
|
71
|
-
chartId: providedChartId,
|
|
72
|
-
withTooltips = false,
|
|
73
|
-
className,
|
|
74
|
-
showLegend = false,
|
|
75
|
-
legendOrientation = "horizontal",
|
|
76
|
-
legendPosition = "bottom",
|
|
77
|
-
legendAlignment = "center",
|
|
78
|
-
legendMaxWidth,
|
|
79
|
-
legendTextOverflow = "wrap",
|
|
80
|
-
legendItemClassName,
|
|
81
|
-
legendShape = "circle",
|
|
82
|
-
size,
|
|
83
|
-
animation,
|
|
84
|
-
thickness = 1,
|
|
85
|
-
padding = 0,
|
|
86
|
-
gapScale = 0,
|
|
87
|
-
cornerScale = 0,
|
|
88
|
-
showLabels = true,
|
|
89
|
-
legendValueDisplay = "percentage",
|
|
90
|
-
legendInteractive = false,
|
|
91
|
-
children = null,
|
|
92
|
-
tooltipOffsetX = 0,
|
|
93
|
-
tooltipOffsetY = -15,
|
|
94
|
-
renderTooltip = renderDefaultPieTooltip
|
|
95
|
-
}) => {
|
|
96
|
-
const providerTheme = useGlobalChartsTheme();
|
|
97
|
-
const chartId = useChartId(providedChartId);
|
|
98
|
-
const [legendRef, legendHeight] = useElementHeight();
|
|
99
|
-
const { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } = useTooltip();
|
|
100
|
-
const { containerRef, TooltipInPortal, containerBounds } = useTooltipInPortal({
|
|
101
|
-
detectBounds: true,
|
|
102
|
-
scroll: true,
|
|
103
|
-
debounce: 0
|
|
104
|
-
});
|
|
105
|
-
const onMouseLeave = useCallback(() => {
|
|
106
|
-
if (!withTooltips) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
hideTooltip();
|
|
110
|
-
}, [withTooltips, hideTooltip]);
|
|
111
|
-
const { getElementStyles, isSeriesVisible } = useGlobalChartsContext();
|
|
112
|
-
const { visibleData, allSegmentsHidden, legendData } = useInteractiveLegendData({
|
|
113
|
-
data,
|
|
114
|
-
chartId,
|
|
115
|
-
legendInteractive,
|
|
116
|
-
isSeriesVisible
|
|
117
|
-
});
|
|
118
|
-
const legendOptions = useMemo(
|
|
119
|
-
() => ({ showValues: true, legendValueDisplay }),
|
|
120
|
-
[legendValueDisplay]
|
|
121
|
-
);
|
|
122
|
-
const legendItems = useChartLegendItems(legendData, legendOptions);
|
|
123
|
-
const { isValid, message } = validateData(data);
|
|
124
|
-
const { svgChildren, htmlChildren, otherChildren } = useChartChildren(children, "PieChart");
|
|
125
|
-
const chartMetadata = useMemo(
|
|
126
|
-
() => ({
|
|
127
|
-
thickness,
|
|
128
|
-
gapScale,
|
|
129
|
-
cornerScale
|
|
130
|
-
}),
|
|
131
|
-
[thickness, gapScale, cornerScale]
|
|
132
|
-
);
|
|
133
|
-
useChartRegistration({
|
|
134
|
-
chartId,
|
|
135
|
-
legendItems,
|
|
136
|
-
chartType: "pie",
|
|
137
|
-
isDataValid: isValid,
|
|
138
|
-
metadata: chartMetadata
|
|
139
|
-
});
|
|
140
|
-
const prefersReducedMotion = usePrefersReducedMotion();
|
|
141
|
-
if (!isValid) {
|
|
142
|
-
return /* @__PURE__ */ jsx("div", { className: clsx("pie-chart", pie_chart_module_default["pie-chart"], className), children: /* @__PURE__ */ jsx("div", { className: pie_chart_module_default["error-message"], children: message }) });
|
|
143
|
-
}
|
|
144
|
-
const width = size;
|
|
145
|
-
const height = size;
|
|
146
|
-
const adjustedHeight = showLegend && legendPosition === "top" ? height - legendHeight : height;
|
|
147
|
-
const radius = Math.min(width, adjustedHeight) / 2;
|
|
148
|
-
const centerX = width / 2;
|
|
149
|
-
const centerY = adjustedHeight / 2;
|
|
150
|
-
const padAngle = gapScale * (2 * Math.PI / data.length);
|
|
151
|
-
const outerRadius = radius - padding;
|
|
152
|
-
const innerRadius = thickness === 0 ? 0 : outerRadius * (1 - thickness);
|
|
153
|
-
const maxCornerRadius = (outerRadius - innerRadius) / 2;
|
|
154
|
-
const cornerRadius = cornerScale ? Math.min(cornerScale * outerRadius, maxCornerRadius) : 0;
|
|
155
|
-
const dataWithIndex = visibleData.map((d) => {
|
|
156
|
-
const originalIndex = data.findIndex((item) => item.label === d.label);
|
|
157
|
-
return {
|
|
158
|
-
...d,
|
|
159
|
-
index: originalIndex >= 0 ? originalIndex : 0
|
|
160
|
-
};
|
|
161
|
-
});
|
|
162
|
-
const accessors = {
|
|
163
|
-
value: (d) => d.value,
|
|
164
|
-
fill: (d) => {
|
|
165
|
-
return getElementStyles({ data: d, index: d.index }).color;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
return /* @__PURE__ */ jsx(
|
|
169
|
-
SingleChartContext.Provider,
|
|
170
|
-
{
|
|
171
|
-
value: {
|
|
172
|
-
chartId,
|
|
173
|
-
chartWidth: width,
|
|
174
|
-
chartHeight: adjustedHeight
|
|
175
|
-
},
|
|
176
|
-
children: /* @__PURE__ */ jsxs(
|
|
177
|
-
"div",
|
|
178
|
-
{
|
|
179
|
-
ref: containerRef,
|
|
180
|
-
className: clsx(
|
|
181
|
-
"pie-chart",
|
|
182
|
-
pie_chart_module_default["pie-chart"],
|
|
183
|
-
{ [pie_chart_module_default["pie-chart--legend-top"]]: showLegend && legendPosition === "top" },
|
|
184
|
-
className
|
|
185
|
-
),
|
|
186
|
-
children: [
|
|
187
|
-
/* @__PURE__ */ jsxs(
|
|
188
|
-
"svg",
|
|
189
|
-
{
|
|
190
|
-
viewBox: `0 0 ${width} ${adjustedHeight}`,
|
|
191
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
192
|
-
width,
|
|
193
|
-
height: adjustedHeight,
|
|
194
|
-
children: [
|
|
195
|
-
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
196
|
-
radial_wipe_animation_default,
|
|
197
|
-
{
|
|
198
|
-
id: `radial-wipe-${chartId}`,
|
|
199
|
-
radius: outerRadius,
|
|
200
|
-
innerRadius
|
|
201
|
-
}
|
|
202
|
-
) }),
|
|
203
|
-
/* @__PURE__ */ jsxs(
|
|
204
|
-
Group,
|
|
205
|
-
{
|
|
206
|
-
top: centerY,
|
|
207
|
-
left: centerX,
|
|
208
|
-
mask: animation && !prefersReducedMotion ? `url(#radial-wipe-${chartId})` : null,
|
|
209
|
-
children: [
|
|
210
|
-
allSegmentsHidden ? /* @__PURE__ */ jsx(
|
|
211
|
-
"text",
|
|
212
|
-
{
|
|
213
|
-
textAnchor: "middle",
|
|
214
|
-
dy: ".33em",
|
|
215
|
-
fill: providerTheme.gridColor || "#ccc",
|
|
216
|
-
fontSize: "14",
|
|
217
|
-
fontFamily: "-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif",
|
|
218
|
-
children: __(
|
|
219
|
-
"All segments are hidden. Click legend items to show data.",
|
|
220
|
-
"jetpack-charts"
|
|
221
|
-
)
|
|
222
|
-
}
|
|
223
|
-
) : /* @__PURE__ */ jsx(
|
|
224
|
-
Pie,
|
|
225
|
-
{
|
|
226
|
-
data: dataWithIndex,
|
|
227
|
-
pieValue: accessors.value,
|
|
228
|
-
outerRadius,
|
|
229
|
-
innerRadius,
|
|
230
|
-
padAngle,
|
|
231
|
-
cornerRadius,
|
|
232
|
-
children: (pie) => {
|
|
233
|
-
return pie.arcs.map((arc, index) => {
|
|
234
|
-
const [centroidX, centroidY] = pie.path.centroid(arc);
|
|
235
|
-
const hasSpaceForLabel = arc.endAngle - arc.startAngle >= 0.25;
|
|
236
|
-
const handleMouseMove = (event) => {
|
|
237
|
-
if (!withTooltips) {
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
if (containerBounds.width === 0 || containerBounds.height === 0) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
showTooltip({
|
|
244
|
-
tooltipData: arc.data,
|
|
245
|
-
tooltipLeft: event.clientX - containerBounds.left + tooltipOffsetX,
|
|
246
|
-
tooltipTop: event.clientY - containerBounds.top + tooltipOffsetY
|
|
247
|
-
});
|
|
248
|
-
};
|
|
249
|
-
const pathProps = {
|
|
250
|
-
d: pie.path(arc) || "",
|
|
251
|
-
fill: accessors.fill(arc.data),
|
|
252
|
-
"data-testid": "pie-segment"
|
|
253
|
-
};
|
|
254
|
-
const groupProps = {};
|
|
255
|
-
if (withTooltips) {
|
|
256
|
-
groupProps.onMouseMove = handleMouseMove;
|
|
257
|
-
groupProps.onMouseLeave = onMouseLeave;
|
|
258
|
-
}
|
|
259
|
-
const fontSize = 12;
|
|
260
|
-
const estimatedTextWidth = getStringWidth(arc.data.label, { fontSize });
|
|
261
|
-
const labelPadding = 6;
|
|
262
|
-
const backgroundWidth = estimatedTextWidth + labelPadding * 2;
|
|
263
|
-
const backgroundHeight = fontSize + labelPadding * 2;
|
|
264
|
-
return /* @__PURE__ */ jsxs("g", { ...groupProps, children: [
|
|
265
|
-
/* @__PURE__ */ jsx("path", { ...pathProps }),
|
|
266
|
-
showLabels && hasSpaceForLabel && /* @__PURE__ */ jsxs("g", { children: [
|
|
267
|
-
providerTheme.labelBackgroundColor && /* @__PURE__ */ jsx(
|
|
268
|
-
"rect",
|
|
269
|
-
{
|
|
270
|
-
x: centroidX - backgroundWidth / 2,
|
|
271
|
-
y: centroidY - backgroundHeight / 2,
|
|
272
|
-
width: backgroundWidth,
|
|
273
|
-
height: backgroundHeight,
|
|
274
|
-
fill: providerTheme.labelBackgroundColor,
|
|
275
|
-
rx: 4,
|
|
276
|
-
ry: 4,
|
|
277
|
-
pointerEvents: "none"
|
|
278
|
-
}
|
|
279
|
-
),
|
|
280
|
-
/* @__PURE__ */ jsx(
|
|
281
|
-
"text",
|
|
282
|
-
{
|
|
283
|
-
x: centroidX,
|
|
284
|
-
y: centroidY,
|
|
285
|
-
dy: ".33em",
|
|
286
|
-
fill: providerTheme.labelTextColor || "#333",
|
|
287
|
-
fontSize,
|
|
288
|
-
textAnchor: "middle",
|
|
289
|
-
pointerEvents: "none",
|
|
290
|
-
children: arc.data.label
|
|
291
|
-
}
|
|
292
|
-
)
|
|
293
|
-
] })
|
|
294
|
-
] }, `arc-${index}`);
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
),
|
|
299
|
-
!allSegmentsHidden && svgChildren
|
|
300
|
-
]
|
|
301
|
-
}
|
|
302
|
-
)
|
|
303
|
-
]
|
|
304
|
-
}
|
|
305
|
-
),
|
|
306
|
-
showLegend && /* @__PURE__ */ jsx(
|
|
307
|
-
Legend,
|
|
308
|
-
{
|
|
309
|
-
orientation: legendOrientation,
|
|
310
|
-
position: legendPosition,
|
|
311
|
-
alignment: legendAlignment,
|
|
312
|
-
maxWidth: legendMaxWidth,
|
|
313
|
-
textOverflow: legendTextOverflow,
|
|
314
|
-
legendItemClassName,
|
|
315
|
-
className: pie_chart_module_default["pie-chart-legend"],
|
|
316
|
-
shape: legendShape,
|
|
317
|
-
ref: legendRef,
|
|
318
|
-
chartId,
|
|
319
|
-
interactive: legendInteractive
|
|
320
|
-
}
|
|
321
|
-
),
|
|
322
|
-
withTooltips && tooltipOpen && tooltipData && /* @__PURE__ */ jsx(TooltipInPortal, { top: tooltipTop || 0, left: tooltipLeft || 0, children: /* @__PURE__ */ jsx("div", { role: "tooltip", children: renderTooltip({ tooltipData }) }) }),
|
|
323
|
-
htmlChildren,
|
|
324
|
-
otherChildren
|
|
325
|
-
]
|
|
326
|
-
}
|
|
327
|
-
)
|
|
328
|
-
}
|
|
329
|
-
);
|
|
330
|
-
};
|
|
331
|
-
var PieChartWithProvider = (props) => {
|
|
332
|
-
const existingContext = useContext(GlobalChartsContext);
|
|
333
|
-
if (existingContext) {
|
|
334
|
-
return /* @__PURE__ */ jsx(PieChartInternal, { ...props });
|
|
335
|
-
}
|
|
336
|
-
return /* @__PURE__ */ jsx(GlobalChartsProvider, { children: /* @__PURE__ */ jsx(PieChartInternal, { ...props }) });
|
|
337
|
-
};
|
|
338
|
-
PieChartWithProvider.displayName = "PieChart";
|
|
339
|
-
var PieChart = attachSubComponents(PieChartWithProvider, {
|
|
340
|
-
Legend,
|
|
341
|
-
SVG: ChartSVG,
|
|
342
|
-
HTML: ChartHTML
|
|
343
|
-
});
|
|
344
|
-
var PieChartResponsive = attachSubComponents(
|
|
345
|
-
withResponsive(PieChartWithProvider),
|
|
346
|
-
{
|
|
347
|
-
Legend,
|
|
348
|
-
SVG: ChartSVG,
|
|
349
|
-
HTML: ChartHTML
|
|
350
|
-
}
|
|
351
|
-
);
|
|
352
|
-
|
|
353
|
-
export {
|
|
354
|
-
PieChart,
|
|
355
|
-
PieChartResponsive
|
|
356
|
-
};
|
|
357
|
-
//# sourceMappingURL=chunk-SBRMWDWM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/charts/pie-chart/pie-chart.tsx","../src/charts/pie-chart/pie-chart.module.scss"],"sourcesContent":["import { Group } from '@visx/group';\nimport { Pie } from '@visx/shape';\nimport { useTooltip, useTooltipInPortal } from '@visx/tooltip';\nimport { __ } from '@wordpress/i18n';\nimport clsx from 'clsx';\nimport { useCallback, useContext, useMemo } from 'react';\nimport { Legend, useChartLegendItems } from '../../components/legend';\nimport { BaseTooltip } from '../../components/tooltip';\nimport { useElementHeight, useInteractiveLegendData, usePrefersReducedMotion } from '../../hooks';\nimport {\n\tGlobalChartsProvider,\n\tuseChartId,\n\tuseChartRegistration,\n\tuseGlobalChartsContext,\n\tuseGlobalChartsTheme,\n\tGlobalChartsContext,\n} from '../../providers';\nimport { attachSubComponents } from '../../utils';\nimport { getStringWidth } from '../../visx/text';\nimport { ChartSVG, ChartHTML, useChartChildren } from '../private/chart-composition';\nimport { RadialWipeAnimation } from '../private/radial-wipe-animation/';\nimport { SingleChartContext } from '../private/single-chart-context';\nimport { withResponsive, ResponsiveConfig } from '../private/with-responsive';\nimport styles from './pie-chart.module.scss';\nimport type { LegendValueDisplay } from '../../components/legend';\nimport type { BaseChartProps, DataPointPercentage, Optional } from '../../types';\nimport type { ChartComponentWithComposition } from '../private/chart-composition';\nimport type { SVGProps, MouseEvent, ReactNode, FC } from 'react';\n\n/**\n * Parameters passed to the renderTooltip function for pie charts.\n */\nexport type PieChartRenderTooltipParams = {\n\t/**\n\t * The data point being hovered, including label, value, and percentage.\n\t */\n\ttooltipData: DataPointPercentage;\n};\n\n/**\n * Default tooltip renderer for pie charts.\n * Renders a BaseTooltip with the hovered segment's data.\n *\n * @param {PieChartRenderTooltipParams} params - The tooltip parameters containing the hovered data point\n * @return {ReactNode} The rendered tooltip content\n */\nconst renderDefaultPieTooltip = ( { tooltipData }: PieChartRenderTooltipParams ): ReactNode => {\n\treturn <BaseTooltip data={ tooltipData } top={ 0 } left={ 0 } renderContainer={ false } />;\n};\n\nexport interface 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\t/**\n\t * Add padding to the chart\n\t */\n\tpadding?: number;\n\n\t/**\n\t * Thickness of the pie chart.\n\t * A value between 0 and 1, where 0 means no thickness\n\t * and 1 means the maximum thickness.\n\t */\n\tthickness?: number;\n\n\t/**\n\t * Scale of the gap between groups in the pie chart\n\t * A value between 0 and 1, where 0 means no gap.\n\t */\n\tgapScale?: number;\n\n\t/**\n\t * Scale of the corner radius for the pie chart segments.\n\t * A value between 0 and 1, where 0 means no corner radius.\n\t */\n\tcornerScale?: number;\n\n\t/**\n\t * Whether to show labels on pie segments. Defaults to true.\n\t */\n\tshowLabels?: boolean;\n\n\t/**\n\t * What type of value to display in the legend when showValues is true.\n\t * - 'percentage': Shows percentage values (e.g., \"23%\") [default]\n\t * - 'value': Shows raw numeric values (e.g., \"30000\")\n\t * - 'valueDisplay': Shows formatted values (e.g., \"30K\")\n\t * - 'none': Shows no values, only labels\n\t */\n\tlegendValueDisplay?: LegendValueDisplay;\n\n\t/**\n\t * Enable interactive legend items that can toggle segment visibility.\n\t * Requires chartId and GlobalChartsProvider.\n\t * When segments are hidden, percentages are recalculated so visible segments total 100%.\n\t */\n\tlegendInteractive?: boolean;\n\n\t/**\n\t * Use the children prop to render additional elements on the chart.\n\t */\n\tchildren?: ReactNode;\n\n\t/**\n\t * Horizontal offset for tooltip positioning in pixels (default: 0)\n\t */\n\ttooltipOffsetX?: number;\n\n\t/**\n\t * Vertical offset for tooltip positioning in pixels (default: -15)\n\t */\n\ttooltipOffsetY?: number;\n\n\t/**\n\t * Custom render function for tooltip content.\n\t * When provided, replaces the default BaseTooltip with custom content.\n\t */\n\trenderTooltip?: ( params: PieChartRenderTooltipParams ) => ReactNode;\n}\n\n// Base props type with optional responsive properties\ntype PieChartBaseProps = Optional< PieChartProps, 'size' >;\n\n// Composition API types\ntype PieChartComponent = ChartComponentWithComposition< PieChartBaseProps >;\ntype PieChartResponsiveComponent = ChartComponentWithComposition<\n\tPieChartBaseProps & ResponsiveConfig\n>;\n\n/**\n * Validates the pie chart data\n * @param data - The data to validate\n * @return Object containing validation result and error message\n */\nconst validateData = ( data: DataPointPercentage[] ) => {\n\tif ( ! data.length ) {\n\t\treturn { isValid: false, message: 'No data available' };\n\t}\n\n\t// Check for negative values\n\tconst hasNegativeValues = data.some( item => item.percentage < 0 || item.value < 0 );\n\tif ( hasNegativeValues ) {\n\t\treturn { isValid: false, message: 'Invalid data: Negative values are not allowed' };\n\t}\n\n\t// Validate total percentage\n\tconst totalPercentage = data.reduce( ( sum, item ) => sum + item.percentage, 0 );\n\tif ( Math.abs( totalPercentage - 100 ) > 0.01 ) {\n\t\t// Using small epsilon for floating point comparison\n\t\treturn { isValid: false, message: 'Invalid percentage total: Must equal 100' };\n\t}\n\n\treturn { isValid: true, message: '' };\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 PieChartInternal = ( {\n\tdata,\n\tchartId: providedChartId,\n\twithTooltips = false,\n\tclassName,\n\tshowLegend = false,\n\tlegendOrientation = 'horizontal',\n\tlegendPosition = 'bottom',\n\tlegendAlignment = 'center',\n\tlegendMaxWidth,\n\tlegendTextOverflow = 'wrap',\n\tlegendItemClassName,\n\tlegendShape = 'circle',\n\tsize,\n\tanimation,\n\tthickness = 1,\n\tpadding = 0,\n\tgapScale = 0,\n\tcornerScale = 0,\n\tshowLabels = true,\n\tlegendValueDisplay = 'percentage',\n\tlegendInteractive = false,\n\tchildren = null,\n\ttooltipOffsetX = 0,\n\ttooltipOffsetY = -15,\n\trenderTooltip = renderDefaultPieTooltip,\n}: PieChartProps ) => {\n\tconst providerTheme = useGlobalChartsTheme();\n\tconst chartId = useChartId( providedChartId );\n\tconst [ legendRef, legendHeight ] = useElementHeight< HTMLDivElement >();\n\tconst { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =\n\t\tuseTooltip< DataPointPercentage >();\n\n\t// Set up portal tooltip for better z-index handling\n\t// We get containerBounds to cancel out stale offsets in the position calculation\n\tconst { containerRef, TooltipInPortal, containerBounds } = useTooltipInPortal( {\n\t\tdetectBounds: true,\n\t\tscroll: true,\n\t\tdebounce: 0,\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\tconst { getElementStyles, isSeriesVisible } = useGlobalChartsContext();\n\n\t// Filter and recalculate data for interactive legends\n\tconst { visibleData, allSegmentsHidden, legendData } = useInteractiveLegendData( {\n\t\tdata,\n\t\tchartId,\n\t\tlegendInteractive,\n\t\tisSeriesVisible,\n\t} );\n\n\t// Memoize legend options to prevent unnecessary re-calculations\n\tconst legendOptions = useMemo(\n\t\t() => ( { showValues: true, legendValueDisplay } ),\n\t\t[ legendValueDisplay ]\n\t);\n\n\t// Create legend items using legendData (has recalculated percentages for visible items)\n\tconst legendItems = useChartLegendItems( legendData, legendOptions );\n\n\tconst { isValid, message } = validateData( data );\n\n\t// Process children to extract compound components\n\tconst { svgChildren, htmlChildren, otherChildren } = useChartChildren( children, 'PieChart' );\n\n\t// Memoize metadata to prevent unnecessary re-registration\n\tconst chartMetadata = useMemo(\n\t\t() => ( {\n\t\t\tthickness,\n\t\t\tgapScale,\n\t\t\tcornerScale,\n\t\t} ),\n\t\t[ thickness, gapScale, cornerScale ]\n\t);\n\n\t// Register chart with context only if data is valid\n\tuseChartRegistration( {\n\t\tchartId,\n\t\tlegendItems,\n\t\tchartType: 'pie',\n\t\tisDataValid: isValid,\n\t\tmetadata: chartMetadata,\n\t} );\n\n\tconst prefersReducedMotion = usePrefersReducedMotion();\n\n\tif ( ! isValid ) {\n\t\treturn (\n\t\t\t<div className={ clsx( 'pie-chart', styles[ 'pie-chart' ], className ) }>\n\t\t\t\t<div className={ styles[ 'error-message' ] }>{ message }</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst width = size;\n\tconst height = size;\n\tconst adjustedHeight = showLegend && legendPosition === 'top' ? height - legendHeight : height;\n\n\t// Calculate radius based on width/height\n\tconst radius = Math.min( width, adjustedHeight ) / 2;\n\n\t// Center the chart in the available space\n\tconst centerX = width / 2;\n\tconst centerY = adjustedHeight / 2;\n\n\t// Calculate the angle between each (use original data length for consistent spacing)\n\tconst padAngle = gapScale * ( ( 2 * Math.PI ) / data.length );\n\n\tconst outerRadius = radius - padding;\n\tconst innerRadius = thickness === 0 ? 0 : outerRadius * ( 1 - thickness );\n\n\tconst maxCornerRadius = ( outerRadius - innerRadius ) / 2;\n\tconst cornerRadius = cornerScale ? Math.min( cornerScale * outerRadius, maxCornerRadius ) : 0;\n\n\t// Map the data to include index for color assignment\n\t// When interactive, we need to find the original index to maintain consistent colors\n\tconst dataWithIndex = visibleData.map( d => {\n\t\tconst originalIndex = data.findIndex( item => item.label === d.label );\n\t\treturn {\n\t\t\t...d,\n\t\t\tindex: originalIndex >= 0 ? originalIndex : 0,\n\t\t};\n\t} );\n\n\tconst accessors = {\n\t\tvalue: ( d: DataPointPercentage ) => d.value,\n\t\tfill: ( d: DataPointPercentage & { index: number } ) => {\n\t\t\treturn getElementStyles( { data: d, index: d.index } ).color;\n\t\t},\n\t};\n\n\treturn (\n\t\t<SingleChartContext.Provider\n\t\t\tvalue={ {\n\t\t\t\tchartId,\n\t\t\t\tchartWidth: width,\n\t\t\t\tchartHeight: adjustedHeight,\n\t\t\t} }\n\t\t>\n\t\t\t<div\n\t\t\t\tref={ containerRef }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'pie-chart',\n\t\t\t\t\tstyles[ 'pie-chart' ],\n\t\t\t\t\t{ [ styles[ 'pie-chart--legend-top' ] ]: showLegend && legendPosition === 'top' },\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\tviewBox={ `0 0 ${ width } ${ adjustedHeight }` }\n\t\t\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\twidth={ width }\n\t\t\t\t\theight={ adjustedHeight }\n\t\t\t\t>\n\t\t\t\t\t<defs>\n\t\t\t\t\t\t<RadialWipeAnimation\n\t\t\t\t\t\t\tid={ `radial-wipe-${ chartId }` }\n\t\t\t\t\t\t\tradius={ outerRadius }\n\t\t\t\t\t\t\tinnerRadius={ innerRadius }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</defs>\n\n\t\t\t\t\t<Group\n\t\t\t\t\t\ttop={ centerY }\n\t\t\t\t\t\tleft={ centerX }\n\t\t\t\t\t\tmask={ animation && ! prefersReducedMotion ? `url(#radial-wipe-${ chartId })` : null }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ allSegmentsHidden ? (\n\t\t\t\t\t\t\t<text\n\t\t\t\t\t\t\t\ttextAnchor=\"middle\"\n\t\t\t\t\t\t\t\tdy=\".33em\"\n\t\t\t\t\t\t\t\tfill={ providerTheme.gridColor || '#ccc' }\n\t\t\t\t\t\t\t\tfontSize=\"14\"\n\t\t\t\t\t\t\t\tfontFamily=\"-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'All segments are hidden. Click legend items to show data.',\n\t\t\t\t\t\t\t\t\t'jetpack-charts'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</text>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Pie< DataPointPercentage & { index: number } >\n\t\t\t\t\t\t\t\tdata={ dataWithIndex }\n\t\t\t\t\t\t\t\tpieValue={ accessors.value }\n\t\t\t\t\t\t\t\touterRadius={ outerRadius }\n\t\t\t\t\t\t\t\tinnerRadius={ innerRadius }\n\t\t\t\t\t\t\t\tpadAngle={ padAngle }\n\t\t\t\t\t\t\t\tcornerRadius={ cornerRadius }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ pie => {\n\t\t\t\t\t\t\t\t\treturn pie.arcs.map( ( arc, index ) => {\n\t\t\t\t\t\t\t\t\t\tconst [ centroidX, centroidY ] = pie.path.centroid( arc );\n\t\t\t\t\t\t\t\t\t\tconst hasSpaceForLabel = arc.endAngle - arc.startAngle >= 0.25;\n\t\t\t\t\t\t\t\t\t\tconst handleMouseMove = ( event: MouseEvent< SVGElement > ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( ! withTooltips ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Don't show tooltip until container bounds are measured\n\t\t\t\t\t\t\t\t\t\t\tif ( containerBounds.width === 0 || containerBounds.height === 0 ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Use clientX/Y and subtract containerBounds to cancel out any stale offset.\n\t\t\t\t\t\t\t\t\t\t\t// TooltipInPortal calculates: tooltipLeft + containerBounds.left + scrollX\n\t\t\t\t\t\t\t\t\t\t\t// By passing (clientX - containerBounds.left), we get:\n\t\t\t\t\t\t\t\t\t\t\t// (clientX - containerBounds.left) + containerBounds.left + scrollX = clientX + scrollX\n\t\t\t\t\t\t\t\t\t\t\t// This gives correct page coordinates regardless of stale bounds.\n\t\t\t\t\t\t\t\t\t\t\tshowTooltip( {\n\t\t\t\t\t\t\t\t\t\t\t\ttooltipData: arc.data,\n\t\t\t\t\t\t\t\t\t\t\t\ttooltipLeft: event.clientX - containerBounds.left + tooltipOffsetX,\n\t\t\t\t\t\t\t\t\t\t\t\ttooltipTop: event.clientY - containerBounds.top + tooltipOffsetY,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\tconst pathProps: SVGProps< SVGPathElement > & { 'data-testid'?: string } = {\n\t\t\t\t\t\t\t\t\t\t\td: pie.path( arc ) || '',\n\t\t\t\t\t\t\t\t\t\t\tfill: accessors.fill( arc.data ),\n\t\t\t\t\t\t\t\t\t\t\t'data-testid': 'pie-segment',\n\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\tconst groupProps: SVGProps< SVGGElement > = {};\n\t\t\t\t\t\t\t\t\t\tif ( withTooltips ) {\n\t\t\t\t\t\t\t\t\t\t\tgroupProps.onMouseMove = handleMouseMove;\n\t\t\t\t\t\t\t\t\t\t\tgroupProps.onMouseLeave = onMouseLeave;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Estimate text width more accurately for background sizing\n\t\t\t\t\t\t\t\t\t\tconst fontSize = 12;\n\t\t\t\t\t\t\t\t\t\tconst estimatedTextWidth = getStringWidth( arc.data.label, { fontSize } );\n\t\t\t\t\t\t\t\t\t\tconst labelPadding = 6;\n\t\t\t\t\t\t\t\t\t\tconst backgroundWidth = estimatedTextWidth + labelPadding * 2;\n\t\t\t\t\t\t\t\t\t\tconst backgroundHeight = fontSize + labelPadding * 2;\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<g key={ `arc-${ index }` } { ...groupProps }>\n\t\t\t\t\t\t\t\t\t\t\t\t<path { ...pathProps } />\n\t\t\t\t\t\t\t\t\t\t\t\t{ showLabels && hasSpaceForLabel && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<g>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ providerTheme.labelBackgroundColor && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx={ centroidX - backgroundWidth / 2 }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty={ centroidY - backgroundHeight / 2 }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth={ backgroundWidth }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight={ backgroundHeight }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill={ providerTheme.labelBackgroundColor }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trx={ 4 }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\try={ 4 }\n\t\t\t\t\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\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<text\n\t\t\t\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\t\t\t\ty={ centroidY }\n\t\t\t\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\t\t\t\tfill={ providerTheme.labelTextColor || '#333' }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfontSize={ fontSize }\n\t\t\t\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\t\t\t\tpointerEvents=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\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\t\t\t</text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</g>\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</g>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t</Pie>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ /* Render SVG children (like Group, Text) inside the SVG */ }\n\t\t\t\t\t\t{ ! allSegmentsHidden && svgChildren }\n\t\t\t\t\t</Group>\n\t\t\t\t</svg>\n\n\t\t\t\t{ showLegend && (\n\t\t\t\t\t<Legend\n\t\t\t\t\t\torientation={ legendOrientation }\n\t\t\t\t\t\tposition={ legendPosition }\n\t\t\t\t\t\talignment={ legendAlignment }\n\t\t\t\t\t\tmaxWidth={ legendMaxWidth }\n\t\t\t\t\t\ttextOverflow={ legendTextOverflow }\n\t\t\t\t\t\tlegendItemClassName={ legendItemClassName }\n\t\t\t\t\t\tclassName={ styles[ 'pie-chart-legend' ] }\n\t\t\t\t\t\tshape={ legendShape }\n\t\t\t\t\t\tref={ legendRef }\n\t\t\t\t\t\tchartId={ chartId }\n\t\t\t\t\t\tinteractive={ legendInteractive }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ withTooltips && tooltipOpen && tooltipData && (\n\t\t\t\t\t<TooltipInPortal top={ tooltipTop || 0 } left={ tooltipLeft || 0 }>\n\t\t\t\t\t\t<div role=\"tooltip\">{ renderTooltip( { tooltipData } ) }</div>\n\t\t\t\t\t</TooltipInPortal>\n\t\t\t\t) }\n\n\t\t\t\t{ /* Render HTML component children from PieChart.HTML */ }\n\t\t\t\t{ htmlChildren }\n\n\t\t\t\t{ /* Render other React children for backward compatibility */ }\n\t\t\t\t{ otherChildren }\n\t\t\t</div>\n\t\t</SingleChartContext.Provider>\n\t);\n};\n\nconst PieChartWithProvider: FC< PieChartProps > = props => {\n\tconst existingContext = useContext( GlobalChartsContext );\n\n\t// If we're already in a GlobalChartsProvider context, don't create a new one\n\tif ( existingContext ) {\n\t\treturn <PieChartInternal { ...props } />;\n\t}\n\n\t// Otherwise, create our own GlobalChartsProvider\n\treturn (\n\t\t<GlobalChartsProvider>\n\t\t\t<PieChartInternal { ...props } />\n\t\t</GlobalChartsProvider>\n\t);\n};\n\nPieChartWithProvider.displayName = 'PieChart';\n\n// Create PieChart with composition API\nconst PieChart = attachSubComponents( PieChartWithProvider, {\n\tLegend: Legend,\n\tSVG: ChartSVG,\n\tHTML: ChartHTML,\n} ) as PieChartComponent;\n\n// Create responsive PieChart with composition API\nconst PieChartResponsive = attachSubComponents(\n\twithResponsive< PieChartProps >( PieChartWithProvider ),\n\t{\n\t\tLegend: Legend,\n\t\tSVG: ChartSVG,\n\t\tHTML: ChartHTML,\n\t}\n) as PieChartResponsiveComponent;\n\nexport { PieChartResponsive as default, PieChart as PieChartUnresponsive };\n","import 'css-chunk:src/charts/pie-chart/pie-chart.module.scss';export default {\n \"pie-chart\": \"a8ccharts-C-n-Gu\",\n \"pie-chart--legend-top\": \"a8ccharts-Mu0uxl\"\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,YAAY,0BAA0B;AAC/C,SAAS,UAAU;AACnB,OAAO,UAAU;AACjB,SAAS,aAAa,YAAY,eAAe;;;ACLa,IAAO,2BAAQ;AAAA,EAC3E,aAAa;AAAA,EACb,yBAAyB;AAC3B;;;AD4CQ,cA0WK,YA1WL;AADR,IAAM,0BAA0B,CAAE,EAAE,YAAY,MAA+C;AAC9F,SAAO,oBAAC,eAAY,MAAO,aAAc,KAAM,GAAI,MAAO,GAAI,iBAAkB,OAAQ;AACzF;AAyFA,IAAM,eAAe,CAAE,SAAiC;AACvD,MAAK,CAAE,KAAK,QAAS;AACpB,WAAO,EAAE,SAAS,OAAO,SAAS,oBAAoB;AAAA,EACvD;AAGA,QAAM,oBAAoB,KAAK,KAAM,UAAQ,KAAK,aAAa,KAAK,KAAK,QAAQ,CAAE;AACnF,MAAK,mBAAoB;AACxB,WAAO,EAAE,SAAS,OAAO,SAAS,gDAAgD;AAAA,EACnF;AAGA,QAAM,kBAAkB,KAAK,OAAQ,CAAE,KAAK,SAAU,MAAM,KAAK,YAAY,CAAE;AAC/E,MAAK,KAAK,IAAK,kBAAkB,GAAI,IAAI,MAAO;AAE/C,WAAO,EAAE,SAAS,OAAO,SAAS,2CAA2C;AAAA,EAC9E;AAEA,SAAO,EAAE,SAAS,MAAM,SAAS,GAAG;AACrC;AAQA,IAAM,mBAAmB,CAAE;AAAA,EAC1B;AAAA,EACA,SAAS;AAAA,EACT,eAAe;AAAA,EACf;AAAA,EACA,aAAa;AAAA,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AAAA,oCACZ;AAAA,qCACD;AAAA,qCA3BO,OAAQ,KAAM,EA6BvB;AAAA,8BAEF,CAAE;AAAA,4BACH;AAAA;AAAA,wBACD;AAAA,wBAIC,CAAE,qBAAqB;AAAA;AAAA;AAAA,kBAC1B;AAAA;AAAA;AAAA,YACD;AAAA,YAEE,cACD;AAAA,cAAC;AAAA;AAAA,gBACA,aAAc;AAAA,gBACd,UAAW;AAAA,gBACX,WAAY;AAAA,gBACZ,UAAW;AAAA,gBACX,cAAe;AAAA,gBACf;AAAA,gBACA,WAAY,yBAAQ,kBAAmB;AAAA,gBACvC,OAAQ;AAAA,gBACR,KAAM;AAAA,gBACN;AAAA,gBACA,aAAc;AAAA;AAAA,YACf;AAAA,YAGC,gBAAgB,eAAe,eAChC,oBAAC,mBAAgB,KAAM,cAAc,GAAI,MAAO,eAAe,GAC9D,8BAAC,SAAI,MAAK,WAAY,wBAAe,EAAE,YAAY,CAAE,GAAG,GACzD;AAAA,YAIC;AAAA,YAGA;AAAA;AAAA;AAAA,MACH;AAAA;AAAA,EACD;AAEF;AAEA,IAAM,uBAA4C,WAAS;AAC1D,QAAM,kBAAkB,WAAY,mBAAoB;AAGxD,MAAK,iBAAkB;AACtB,WAAO,oBAAC,oBAAmB,GAAG,OAAQ;AAAA,EACvC;AAGA,SACC,oBAAC,wBACA,8BAAC,oBAAmB,GAAG,OAAQ,GAChC;AAEF;AAEA,qBAAqB,cAAc;AAGnC,IAAM,WAAW,oBAAqB,sBAAsB;AAAA,EAC3D;AAAA,EACA,KAAK;AAAA,EACL,MAAM;AACP,CAAE;AAGF,IAAM,qBAAqB;AAAA,EAC1B,eAAiC,oBAAqB;AAAA,EACtD;AAAA,IACC;AAAA,IACA,KAAK;AAAA,IACL,MAAM;AAAA,EACP;AACD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-SRXJLAKG.cjs","../src/components/trend-indicator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ACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA,EAAW;AACZ,CAAA,EAAyB;AACxB,EAAA,MAAM,UAAA,EAAY,CAAA,EAAA;AAGjB,EAAA;AAAC,IAAA;AAAA,IAAA;AACY,MAAA;AACX,QAAA;AACA,QAAA;AACA,QAAA;AACD,MAAA;AACA,MAAA;AACa,MAAA;AAEX,MAAA;AAAY,QAAA;AACd,wBAAA;AAAgE,MAAA;AAAA,IAAA;AACjE,EAAA;AAEF;ADMqB;AACA;AACA;AACA","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-SRXJLAKG.cjs","sourcesContent":[null,"import clsx from 'clsx';\nimport styles from './trend-indicator.module.scss';\nimport type { TrendIndicatorProps, TrendDirection } from './types';\n\nconst DIRECTION_LABELS: Record< TrendDirection, string > = {\n\tup: 'Increase',\n\tdown: 'Decrease',\n\tneutral: 'No change',\n};\n\nconst Icon = ( { direction }: { direction: TrendDirection } ) => {\n\tif ( direction === 'neutral' ) {\n\t\treturn null;\n\t}\n\n\tconst isUp = direction === 'up';\n\treturn (\n\t\t<svg\n\t\t\tclassName={ styles[ 'trend-indicator__icon' ] }\n\t\t\tviewBox=\"0 0 16 16\"\n\t\t\tfill=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<path\n\t\t\t\td={ isUp ? 'M8 13V3M4 7l4-4 4 4' : 'M8 3v10M4 9l4 4 4-4' }\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t/>\n\t\t</svg>\n\t);\n};\n\n/**\n * TrendIndicator displays a directional trend with a value.\n * Used to show percentage changes or growth metrics.\n *\n * @param {TrendIndicatorProps} props - Component props\n * @return {JSX.Element} The rendered trend indicator\n */\nexport function TrendIndicator( {\n\tdirection,\n\tvalue,\n\tclassName,\n\tstyle,\n\tshowIcon = true,\n}: TrendIndicatorProps ) {\n\tconst ariaLabel = `${ DIRECTION_LABELS[ direction ] }: ${ value }`;\n\n\treturn (\n\t\t<span\n\t\t\tclassName={ clsx(\n\t\t\t\tstyles[ 'trend-indicator' ],\n\t\t\t\tstyles[ `trend-indicator--${ direction }` ],\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tstyle={ style }\n\t\t\taria-label={ ariaLabel }\n\t\t>\n\t\t\t{ showIcon && <Icon direction={ direction } /> }\n\t\t\t<span className={ styles[ 'trend-indicator__value' ] }>{ value }</span>\n\t\t</span>\n\t);\n}\n","import 'css-chunk:src/components/trend-indicator/trend-indicator.module.scss';export default {\n \"trend-indicator\": \"a8ccharts-tGw1PY\",\n \"trend-indicator--up\": \"a8ccharts-Fn-D1W\",\n \"trend-indicator--down\": \"a8ccharts-HqtGQO\",\n \"trend-indicator--neutral\": \"a8ccharts-S10nvO\",\n \"trend-indicator__icon\": \"a8ccharts-5HjpOT\",\n \"trend-indicator__value\": \"a8ccharts-muLL2Q\"\n};"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/charts/bar-list-chart/bar-list-chart.tsx"],"sourcesContent":["import { formatNumberCompact } from '@automattic/number-formatters';\nimport { Group } from '@visx/group';\nimport { createScale, scaleBand } from '@visx/scale';\nimport { Text, type TextProps } from '@visx/text';\nimport { useContext, useMemo } from 'react';\nimport { GlobalChartsContext, GlobalChartsProvider } from '../../providers';\nimport { BarChartUnresponsive } from '../bar-chart';\nimport { withResponsive } from '../private/with-responsive';\nimport type { SeriesData } from '../..';\nimport type { ScaleOptions } from '../../types';\nimport type { BarChartProps } from '../bar-chart/bar-chart';\nimport type { AxisRendererProps, AxisScale } from '@visx/axis';\nimport type { AnyD3Scale } from '@visx/scale';\nimport type { ComponentType, FC } from 'react';\n\nexport interface BarListChartProps\n\textends Exclude< BarChartProps, 'orientation' | 'size' | 'gridVisibility' > {\n\toptions?: {\n\t\t/**\n\t\t * Scale for the y axis. Exclude the type property.\n\t\t */\n\t\tyScale: Omit< ScaleOptions, 'type' >;\n\t\t/**\n\t\t * Scale for the x axis. Exclude the type property.\n\t\t */\n\t\txScale: Omit< ScaleOptions, 'type' >;\n\t\t/**\n\t\t * Formatter for the label.\n\t\t */\n\t\tlabelFormatter?: ( value: string ) => string;\n\t\t/**\n\t\t * Formatter for the value.\n\t\t */\n\t\tvalueFormatter?: ( value: number ) => string;\n\t\t/**\n\t\t * y offset of the label and value. Default is based on the number of series, automatically computed.\n\t\t */\n\t\tyOffset?: number;\n\t\t/**\n\t\t * x position of the label.\n\t\t */\n\t\tlabelPosition?: number;\n\t\t/**\n\t\t * x position of the value.\n\t\t */\n\t\tvaluePosition?: number;\n\t\t/**\n\t\t * Custom render function for the label.\n\t\t */\n\t\tlabelComponent?: ComponentType< RenderLabelProps >;\n\t\t/**\n\t\t * Custom render function for the value.\n\t\t */\n\t\tvalueComponent?: ComponentType< RenderValueProps >;\n\t};\n}\n\nexport interface RenderLabelProps {\n\ttextProps: TextProps;\n\tx: number;\n\ty: number;\n\tlabel: string;\n\tformatter: ( value: string ) => string;\n}\n\nexport interface RenderValueProps {\n\ttextProps: TextProps;\n\tx: number;\n\ty: number;\n\tvalue: number;\n\t/**\n\t * Original data\n\t */\n\tdata: SeriesData[];\n\t/**\n\t * Index of the data point\n\t */\n\tindex: number;\n\tformatter: ( value: number ) => string;\n}\n\n/**\n * Get the bandwidth of a scale\n * @param scale - The scale to get the bandwidth of\n * @return The bandwidth of the scale\n */\nconst getScaleBandwidth = < Scale extends AxisScale >( scale?: Scale ) => {\n\t// Broaden type before using 'xxx' in s as typeguard.\n\tconst s = scale as AxisScale;\n\treturn s && 'bandwidth' in s ? s?.bandwidth() ?? 0 : 0;\n};\n\nconst DefaultLabelComponent = ( { textProps, x, y, label, formatter } ) => {\n\treturn (\n\t\t<Text { ...textProps } textAnchor=\"start\" x={ x } y={ y }>\n\t\t\t{ formatter( label ) }\n\t\t</Text>\n\t);\n};\n\nconst DefaultValueComponent = ( { textProps, x, y, value, formatter }: RenderValueProps ) => {\n\treturn (\n\t\t<Text { ...textProps } textAnchor=\"end\" x={ x } y={ y } fontWeight={ 500 }>\n\t\t\t{ formatter( value ) }\n\t\t</Text>\n\t);\n};\n\nconst AxisRenderer = ( {\n\tticks,\n\ttickLabelProps,\n\tyOffset,\n\tlabelPosition,\n\tvaluePosition,\n\tdata,\n\tlabelFormatter,\n\tvalueFormatter,\n\tLabelComponent = DefaultLabelComponent,\n\tValueComponent = DefaultValueComponent,\n}: AxisRendererProps< AnyD3Scale > & {\n\tyOffset: number;\n\tlabelPosition: number;\n\tvaluePosition: number;\n\tdata: SeriesData[];\n\tlabelFormatter?: ( value: string ) => string;\n\tvalueFormatter?: ( value: number ) => string;\n\tLabelComponent?: ComponentType< RenderLabelProps >;\n\tValueComponent?: ComponentType< RenderValueProps >;\n} ) => {\n\tif ( ticks.length === 0 ) {\n\t\treturn null;\n\t}\n\n\t// compute the max tick label size to compute label offset\n\tconst allTickLabelProps = ticks.map( ( { value, index } ) =>\n\t\ttypeof tickLabelProps === 'function' ? tickLabelProps( value, index, ticks ) : {}\n\t);\n\n\treturn ticks.map( ( { from, formattedValue }, index ) => {\n\t\tconst textProps = allTickLabelProps[ index ] ?? {};\n\t\t// No need to pass textAnchor and dx. It will be handled by the component.\n\t\tdelete textProps.textAnchor;\n\t\tdelete textProps.dx;\n\n\t\tconst sum = data.reduce(\n\t\t\t( acc, { data: seriesData } ) => acc + ( seriesData[ index ]?.value ?? 0 ),\n\t\t\t0\n\t\t);\n\t\tconst y = from.y + yOffset;\n\n\t\treturn (\n\t\t\t<Group key={ index }>\n\t\t\t\t<LabelComponent\n\t\t\t\t\ttextProps={ textProps }\n\t\t\t\t\tx={ labelPosition }\n\t\t\t\t\ty={ y }\n\t\t\t\t\tlabel={ formattedValue }\n\t\t\t\t\tformatter={ labelFormatter }\n\t\t\t\t/>\n\t\t\t\t<ValueComponent\n\t\t\t\t\ttextProps={ textProps }\n\t\t\t\t\tx={ valuePosition }\n\t\t\t\t\ty={ y }\n\t\t\t\t\tvalue={ sum }\n\t\t\t\t\tformatter={ valueFormatter }\n\t\t\t\t\tdata={ data }\n\t\t\t\t\tindex={ index }\n\t\t\t\t/>\n\t\t\t</Group>\n\t\t);\n\t} );\n};\n\n/**\n * Calculate the default y offset for the bar list chart.\n * @param data - The data to calculate the default y offset for.\n * @param yScaleConfig - The y scale configuration.\n * @param height - The height of the chart.\n * @param isMultiSeries - Whether the chart is a multi series chart.\n * @return The default y offset.\n */\nconst getDefaultYOffset = (\n\tdata: SeriesData[],\n\tyScaleConfig: Omit< ScaleOptions, 'type' >,\n\theight: number,\n\tisMultiSeries: boolean\n) => {\n\tif ( ! isMultiSeries ) {\n\t\treturn 0;\n\t}\n\n\tconst dataKeys = data.map( ( { label } ) => label );\n\n\tconst yScale = createScale< string >( {\n\t\ttype: 'band' as const,\n\t\trange: [ 0, height ],\n\t\tdomain: dataKeys,\n\t\t...yScaleConfig,\n\t} );\n\n\tconst groupScale = scaleBand< string >( {\n\t\tdomain: dataKeys,\n\t\trange: [ 0, getScaleBandwidth( yScale ) ],\n\t\tpadding: yScaleConfig.paddingInner,\n\t} );\n\n\tconst GAP_BETWEEN_BARS = 6;\n\tconst barThickness = getScaleBandwidth( groupScale );\n\n\t// Use negative value to move the label up.\n\treturn -( barThickness + GAP_BETWEEN_BARS );\n};\n\nconst BarListChartInternal: FC< BarListChartProps > = ( {\n\tdata,\n\twidth,\n\theight,\n\toptions = {},\n\tmargin = {\n\t\tleft: 0,\n\t\tright: 20,\n\t\tbottom: 0,\n\t\ttop: 0,\n\t},\n\t...rest\n} ) => {\n\tconst chartOptions = useMemo( () => {\n\t\tconst isMultiSeries = data.length > 1;\n\n\t\tconst defaultYScale = {\n\t\t\t// For multi series, set default padding larger to look better.\n\t\t\tpaddingInner: isMultiSeries ? 0.3 : 0.1,\n\t\t\tpadding: isMultiSeries ? 0.3 : 0.1,\n\t\t};\n\t\tconst defaultXScale = {\n\t\t\t// Always begin at zero since the x axis is hidden.\n\t\t\tzero: true,\n\t\t};\n\t\tconst yScale = {\n\t\t\t...defaultYScale,\n\t\t\t...( options.yScale ?? {} ),\n\t\t};\n\t\tconst xScale = {\n\t\t\t...defaultXScale,\n\t\t\t...( options.xScale ?? {} ),\n\t\t};\n\n\t\treturn {\n\t\t\tyScale,\n\t\t\txScale,\n\t\t\tlabelPosition: options.labelPosition ?? ( isMultiSeries ? 0 : 10 ),\n\t\t\tvalueFormatter: options.valueFormatter ?? ( value => formatNumberCompact( value ) ),\n\t\t\tlabelFormatter: options.labelFormatter ?? ( value => String( value ) ),\n\t\t\tvaluePosition: options.valuePosition ?? width,\n\t\t\tyOffset: options.yOffset ?? getDefaultYOffset( data, yScale, height, isMultiSeries ),\n\t\t};\n\t}, [ options, width, data, height ] );\n\n\treturn (\n\t\t<BarChartUnresponsive\n\t\t\torientation=\"horizontal\"\n\t\t\tgridVisibility={ 'none' }\n\t\t\tdata={ data }\n\t\t\twidth={ width }\n\t\t\theight={ height }\n\t\t\tmargin={ margin }\n\t\t\toptions={ {\n\t\t\t\taxis: {\n\t\t\t\t\ty: {\n\t\t\t\t\t\tchildren: ( renderProps: AxisRendererProps< AnyD3Scale > ) => (\n\t\t\t\t\t\t\t<AxisRenderer\n\t\t\t\t\t\t\t\t{ ...renderProps }\n\t\t\t\t\t\t\t\tdata={ data }\n\t\t\t\t\t\t\t\tyOffset={ chartOptions.yOffset }\n\t\t\t\t\t\t\t\tlabelPosition={ chartOptions.labelPosition }\n\t\t\t\t\t\t\t\tvaluePosition={ chartOptions.valuePosition }\n\t\t\t\t\t\t\t\tlabelFormatter={ chartOptions.labelFormatter }\n\t\t\t\t\t\t\t\tvalueFormatter={ chartOptions.valueFormatter }\n\t\t\t\t\t\t\t\tLabelComponent={ options.labelComponent }\n\t\t\t\t\t\t\t\tValueComponent={ options.valueComponent }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\tx: {\n\t\t\t\t\t\tchildren: () => null,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\txScale: chartOptions.xScale,\n\t\t\t\tyScale: chartOptions.yScale,\n\t\t\t} }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n};\n\nconst BarListChart: FC< BarListChartProps > = props => {\n\tconst existingContext = useContext( GlobalChartsContext );\n\n\t// If we're already in a GlobalChartsProvider context, render the core component directly\n\tif ( existingContext ) {\n\t\treturn <BarListChartInternal { ...props } />;\n\t}\n\n\t// Otherwise, wrap with our own GlobalChartsProvider\n\treturn (\n\t\t<GlobalChartsProvider>\n\t\t\t<BarListChartInternal { ...props } />\n\t\t</GlobalChartsProvider>\n\t);\n};\n\nBarListChart.displayName = 'BarListChart';\n\nconst BarListChartResponsive = withResponsive< BarListChartProps >( BarListChart );\n\nexport { BarListChartResponsive as default, BarListChart as BarListChartUnresponsive };\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,2BAA2B;AACpC,SAAS,aAAa;AACtB,SAAS,aAAa,iBAAiB;AACvC,SAAS,YAA4B;AACrC,SAAS,YAAY,eAAe;AA0FlC,cAyDC,YAzDD;AARF,IAAM,oBAAoB,CAA6B,UAAmB;AAEzE,QAAM,IAAI;AACV,SAAO,KAAK,eAAe,IAAI,GAAG,UAAU,KAAK,IAAI;AACtD;AAEA,IAAM,wBAAwB,CAAE,EAAE,WAAW,GAAG,GAAG,OAAO,UAAU,MAAO;AAC1E,SACC,oBAAC,QAAO,GAAG,WAAY,YAAW,SAAQ,GAAQ,GAC/C,oBAAW,KAAM,GACpB;AAEF;AAEA,IAAM,wBAAwB,CAAE,EAAE,WAAW,GAAG,GAAG,OAAO,UAAU,MAAyB;AAC5F,SACC,oBAAC,QAAO,GAAG,WAAY,YAAW,OAAM,GAAQ,GAAQ,YAAa,KAClE,oBAAW,KAAM,GACpB;AAEF;AAEA,IAAM,eAAe,CAAE;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA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