@automattic/charts 0.57.0 → 0.59.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.
- package/CHANGELOG.md +36 -2
- package/README.md +7 -54
- package/dist/index.cjs +9607 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +32 -49
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +1612 -33
- package/dist/index.d.ts +1612 -33
- package/dist/index.js +9640 -54
- package/dist/index.js.map +1 -1
- package/package.json +9 -126
- package/src/charts/bar-chart/bar-chart.module.scss +0 -5
- package/src/charts/bar-chart/bar-chart.tsx +142 -149
- package/src/charts/bar-chart/test/bar-chart.test.tsx +48 -31
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +54 -74
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +4 -5
- package/src/charts/leaderboard-chart/types.ts +1 -11
- package/src/charts/line-chart/line-chart.module.scss +0 -5
- package/src/charts/line-chart/line-chart.tsx +202 -193
- package/src/charts/line-chart/private/line-chart-annotations-overlay.tsx +1 -2
- package/src/charts/line-chart/test/line-chart.test.tsx +49 -27
- package/src/charts/line-chart/types.ts +0 -1
- package/src/charts/pie-chart/pie-chart.module.scss +2 -10
- package/src/charts/pie-chart/pie-chart.tsx +212 -212
- package/src/charts/pie-chart/test/composition-api.test.tsx +44 -3
- package/src/charts/pie-chart/test/pie-chart.test.tsx +51 -44
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +2 -8
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +166 -168
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +58 -30
- package/src/charts/private/chart-composition/index.ts +2 -0
- package/src/charts/private/chart-composition/render-legend-slot.ts +22 -0
- package/src/charts/private/chart-composition/test/render-legend-slot.test.tsx +60 -0
- package/src/charts/private/chart-composition/test/use-chart-children.test.tsx +91 -0
- package/src/charts/private/chart-composition/use-chart-children.ts +34 -2
- package/src/charts/private/chart-layout/chart-layout.module.scss +7 -0
- package/src/charts/private/chart-layout/chart-layout.tsx +106 -0
- package/src/charts/private/chart-layout/index.ts +2 -0
- package/src/charts/private/chart-layout/test/chart-layout.test.tsx +167 -0
- package/src/charts/private/single-chart-context/single-chart-context.tsx +2 -2
- package/src/charts/private/svg-empty-state/index.ts +1 -0
- package/src/charts/private/svg-empty-state/svg-empty-state.module.scss +7 -0
- package/src/charts/private/svg-empty-state/svg-empty-state.tsx +40 -0
- package/src/components/legend/hooks/test/use-chart-legend-items.test.tsx +12 -8
- package/src/components/legend/hooks/use-chart-legend-items.ts +12 -13
- package/src/components/legend/index.ts +1 -8
- package/src/components/legend/legend.tsx +33 -8
- package/src/components/legend/private/base-legend.module.scss +19 -37
- package/src/components/legend/private/base-legend.tsx +0 -2
- package/src/components/legend/test/legend.test.tsx +93 -1
- package/src/components/legend/types.ts +7 -34
- package/src/hooks/index.ts +1 -1
- package/src/hooks/use-data-with-percentages.ts +24 -0
- package/src/hooks/use-interactive-legend-data.ts +18 -15
- package/src/index.ts +66 -9
- package/src/providers/chart-context/global-charts-provider.tsx +7 -1
- package/src/providers/chart-context/hooks/use-chart-registration.ts +2 -1
- package/src/providers/chart-context/types.ts +2 -2
- package/src/types.ts +110 -45
- package/src/utils/date-parsing.ts +10 -1
- package/src/utils/test/date-parsing.test.ts +12 -0
- package/src/utils/test/resolve-css-var.test.ts +4 -2
- package/tsup.config.ts +1 -1
- package/dist/base-tooltip-DOq93wjU.d.cts +0 -38
- package/dist/base-tooltip-DOq93wjU.d.ts +0 -38
- package/dist/charts/bar-chart/index.cjs +0 -15
- package/dist/charts/bar-chart/index.cjs.map +0 -1
- package/dist/charts/bar-chart/index.css +0 -153
- package/dist/charts/bar-chart/index.css.map +0 -1
- package/dist/charts/bar-chart/index.d.cts +0 -37
- package/dist/charts/bar-chart/index.d.ts +0 -37
- package/dist/charts/bar-chart/index.js +0 -15
- package/dist/charts/bar-chart/index.js.map +0 -1
- package/dist/charts/bar-list-chart/index.cjs +0 -16
- package/dist/charts/bar-list-chart/index.cjs.map +0 -1
- package/dist/charts/bar-list-chart/index.css +0 -153
- package/dist/charts/bar-list-chart/index.css.map +0 -1
- package/dist/charts/bar-list-chart/index.d.cts +0 -92
- package/dist/charts/bar-list-chart/index.d.ts +0 -92
- package/dist/charts/bar-list-chart/index.js +0 -16
- package/dist/charts/bar-list-chart/index.js.map +0 -1
- package/dist/charts/conversion-funnel-chart/index.cjs +0 -11
- package/dist/charts/conversion-funnel-chart/index.cjs.map +0 -1
- package/dist/charts/conversion-funnel-chart/index.css +0 -251
- package/dist/charts/conversion-funnel-chart/index.css.map +0 -1
- package/dist/charts/conversion-funnel-chart/index.d.cts +0 -97
- package/dist/charts/conversion-funnel-chart/index.d.ts +0 -97
- package/dist/charts/conversion-funnel-chart/index.js +0 -11
- package/dist/charts/conversion-funnel-chart/index.js.map +0 -1
- package/dist/charts/geo-chart/index.cjs +0 -13
- package/dist/charts/geo-chart/index.cjs.map +0 -1
- package/dist/charts/geo-chart/index.css +0 -117
- package/dist/charts/geo-chart/index.css.map +0 -1
- package/dist/charts/geo-chart/index.d.cts +0 -67
- package/dist/charts/geo-chart/index.d.ts +0 -67
- package/dist/charts/geo-chart/index.js +0 -13
- package/dist/charts/geo-chart/index.js.map +0 -1
- package/dist/charts/leaderboard-chart/index.cjs +0 -20
- package/dist/charts/leaderboard-chart/index.cjs.map +0 -1
- package/dist/charts/leaderboard-chart/index.css +0 -172
- package/dist/charts/leaderboard-chart/index.css.map +0 -1
- package/dist/charts/leaderboard-chart/index.d.cts +0 -46
- package/dist/charts/leaderboard-chart/index.d.ts +0 -46
- package/dist/charts/leaderboard-chart/index.js +0 -20
- package/dist/charts/leaderboard-chart/index.js.map +0 -1
- package/dist/charts/line-chart/index.cjs +0 -15
- package/dist/charts/line-chart/index.cjs.map +0 -1
- package/dist/charts/line-chart/index.css +0 -225
- package/dist/charts/line-chart/index.css.map +0 -1
- package/dist/charts/line-chart/index.d.cts +0 -99
- package/dist/charts/line-chart/index.d.ts +0 -99
- package/dist/charts/line-chart/index.js +0 -15
- package/dist/charts/line-chart/index.js.map +0 -1
- package/dist/charts/pie-chart/index.cjs +0 -18
- package/dist/charts/pie-chart/index.cjs.map +0 -1
- package/dist/charts/pie-chart/index.css +0 -143
- package/dist/charts/pie-chart/index.css.map +0 -1
- package/dist/charts/pie-chart/index.d.cts +0 -97
- package/dist/charts/pie-chart/index.d.ts +0 -97
- package/dist/charts/pie-chart/index.js +0 -18
- package/dist/charts/pie-chart/index.js.map +0 -1
- package/dist/charts/pie-semi-circle-chart/index.cjs +0 -17
- package/dist/charts/pie-semi-circle-chart/index.cjs.map +0 -1
- package/dist/charts/pie-semi-circle-chart/index.css +0 -144
- package/dist/charts/pie-semi-circle-chart/index.css.map +0 -1
- package/dist/charts/pie-semi-circle-chart/index.d.cts +0 -94
- package/dist/charts/pie-semi-circle-chart/index.d.ts +0 -94
- package/dist/charts/pie-semi-circle-chart/index.js +0 -17
- package/dist/charts/pie-semi-circle-chart/index.js.map +0 -1
- package/dist/charts/sparkline/index.cjs +0 -16
- package/dist/charts/sparkline/index.cjs.map +0 -1
- package/dist/charts/sparkline/index.css +0 -242
- package/dist/charts/sparkline/index.css.map +0 -1
- package/dist/charts/sparkline/index.d.cts +0 -113
- package/dist/charts/sparkline/index.d.ts +0 -113
- package/dist/charts/sparkline/index.js +0 -16
- package/dist/charts/sparkline/index.js.map +0 -1
- package/dist/chunk-2A34OA5O.cjs +0 -51
- package/dist/chunk-2A34OA5O.cjs.map +0 -1
- package/dist/chunk-2NCY7R4G.js +0 -3897
- package/dist/chunk-2NCY7R4G.js.map +0 -1
- package/dist/chunk-32DH6JDF.js +0 -1263
- package/dist/chunk-32DH6JDF.js.map +0 -1
- package/dist/chunk-4OPFE4RM.js +0 -614
- package/dist/chunk-4OPFE4RM.js.map +0 -1
- package/dist/chunk-6CCZL2JJ.js +0 -63
- package/dist/chunk-6CCZL2JJ.js.map +0 -1
- package/dist/chunk-77OKCVQN.cjs +0 -421
- package/dist/chunk-77OKCVQN.cjs.map +0 -1
- package/dist/chunk-7FQX4ALL.cjs +0 -219
- package/dist/chunk-7FQX4ALL.cjs.map +0 -1
- package/dist/chunk-ASLARV7L.cjs +0 -81
- package/dist/chunk-ASLARV7L.cjs.map +0 -1
- package/dist/chunk-BCX5THDQ.js +0 -403
- package/dist/chunk-BCX5THDQ.js.map +0 -1
- package/dist/chunk-BPYKWMI7.js +0 -194
- package/dist/chunk-BPYKWMI7.js.map +0 -1
- package/dist/chunk-CZGYJKG6.js +0 -421
- package/dist/chunk-CZGYJKG6.js.map +0 -1
- package/dist/chunk-D2UH4CFE.cjs +0 -120
- package/dist/chunk-D2UH4CFE.cjs.map +0 -1
- package/dist/chunk-DAU3HNEG.js +0 -344
- package/dist/chunk-DAU3HNEG.js.map +0 -1
- package/dist/chunk-H2V4JMSA.js +0 -219
- package/dist/chunk-H2V4JMSA.js.map +0 -1
- package/dist/chunk-I2276W3I.cjs +0 -66
- package/dist/chunk-I2276W3I.cjs.map +0 -1
- package/dist/chunk-I35UYJJR.cjs +0 -468
- package/dist/chunk-I35UYJJR.cjs.map +0 -1
- package/dist/chunk-IU4DYUAV.js +0 -120
- package/dist/chunk-IU4DYUAV.js.map +0 -1
- package/dist/chunk-KXRWNFQJ.js +0 -51
- package/dist/chunk-KXRWNFQJ.js.map +0 -1
- package/dist/chunk-OP6PHB2U.js +0 -81
- package/dist/chunk-OP6PHB2U.js.map +0 -1
- package/dist/chunk-PXLEMUGJ.js +0 -165
- package/dist/chunk-PXLEMUGJ.js.map +0 -1
- package/dist/chunk-RCY6XLGU.cjs +0 -63
- package/dist/chunk-RCY6XLGU.cjs.map +0 -1
- package/dist/chunk-RHHVEJHJ.cjs +0 -1263
- package/dist/chunk-RHHVEJHJ.cjs.map +0 -1
- package/dist/chunk-TO3OQBXG.cjs +0 -165
- package/dist/chunk-TO3OQBXG.cjs.map +0 -1
- package/dist/chunk-V36ERY7Y.js +0 -375
- package/dist/chunk-V36ERY7Y.js.map +0 -1
- package/dist/chunk-VJM5XCB4.cjs +0 -614
- package/dist/chunk-VJM5XCB4.cjs.map +0 -1
- package/dist/chunk-VTS3PNMS.cjs +0 -344
- package/dist/chunk-VTS3PNMS.cjs.map +0 -1
- package/dist/chunk-WLODYNLB.js +0 -1067
- package/dist/chunk-WLODYNLB.js.map +0 -1
- package/dist/chunk-XKRJL2QT.cjs +0 -375
- package/dist/chunk-XKRJL2QT.cjs.map +0 -1
- package/dist/chunk-XWYZIFZW.js +0 -66
- package/dist/chunk-XWYZIFZW.js.map +0 -1
- package/dist/chunk-Y3NNQMAX.cjs +0 -194
- package/dist/chunk-Y3NNQMAX.cjs.map +0 -1
- package/dist/chunk-YE2T52VZ.cjs +0 -1067
- package/dist/chunk-YE2T52VZ.cjs.map +0 -1
- package/dist/chunk-Z26M4V2M.js +0 -468
- package/dist/chunk-Z26M4V2M.js.map +0 -1
- package/dist/chunk-Z45KX47P.cjs +0 -3897
- package/dist/chunk-Z45KX47P.cjs.map +0 -1
- package/dist/chunk-ZH4F5RMG.cjs +0 -403
- package/dist/chunk-ZH4F5RMG.cjs.map +0 -1
- package/dist/components/legend/index.cjs +0 -11
- package/dist/components/legend/index.cjs.map +0 -1
- package/dist/components/legend/index.css +0 -103
- package/dist/components/legend/index.css.map +0 -1
- package/dist/components/legend/index.d.cts +0 -37
- package/dist/components/legend/index.d.ts +0 -37
- package/dist/components/legend/index.js +0 -11
- package/dist/components/legend/index.js.map +0 -1
- package/dist/components/tooltip/index.cjs +0 -12
- package/dist/components/tooltip/index.cjs.map +0 -1
- package/dist/components/tooltip/index.css +0 -13
- package/dist/components/tooltip/index.css.map +0 -1
- package/dist/components/tooltip/index.d.cts +0 -71
- package/dist/components/tooltip/index.d.ts +0 -71
- package/dist/components/tooltip/index.js +0 -12
- package/dist/components/tooltip/index.js.map +0 -1
- package/dist/components/trend-indicator/index.cjs +0 -8
- package/dist/components/trend-indicator/index.cjs.map +0 -1
- package/dist/components/trend-indicator/index.css +0 -27
- package/dist/components/trend-indicator/index.css.map +0 -1
- package/dist/components/trend-indicator/index.d.cts +0 -44
- package/dist/components/trend-indicator/index.d.ts +0 -44
- package/dist/components/trend-indicator/index.js +0 -8
- package/dist/components/trend-indicator/index.js.map +0 -1
- package/dist/format-metric-value-MXm5DtQ_.d.cts +0 -24
- package/dist/format-metric-value-MXm5DtQ_.d.ts +0 -24
- package/dist/hooks/index.cjs +0 -31
- package/dist/hooks/index.cjs.map +0 -1
- package/dist/hooks/index.css +0 -103
- package/dist/hooks/index.css.map +0 -1
- package/dist/hooks/index.d.cts +0 -272
- package/dist/hooks/index.d.ts +0 -272
- package/dist/hooks/index.js +0 -31
- package/dist/hooks/index.js.map +0 -1
- package/dist/leaderboard-chart-BKYYXcg2.d.ts +0 -83
- package/dist/leaderboard-chart-DR7CGb0L.d.cts +0 -83
- package/dist/legend-C2grwnWk.d.cts +0 -9
- package/dist/legend-Cj0xM5dU.d.ts +0 -9
- package/dist/providers/index.cjs +0 -21
- package/dist/providers/index.cjs.map +0 -1
- package/dist/providers/index.css +0 -103
- package/dist/providers/index.css.map +0 -1
- package/dist/providers/index.d.cts +0 -28
- package/dist/providers/index.d.ts +0 -28
- package/dist/providers/index.js +0 -21
- package/dist/providers/index.js.map +0 -1
- package/dist/themes-BmVGrYnF.d.ts +0 -67
- package/dist/themes-CyjKm-P_.d.cts +0 -67
- package/dist/types-CuUEszrM.d.ts +0 -19
- package/dist/types-DZordNiO.d.cts +0 -505
- package/dist/types-DZordNiO.d.ts +0 -505
- package/dist/types-I67mddpr.d.cts +0 -78
- package/dist/types-I67mddpr.d.ts +0 -78
- package/dist/types-KtOPPzPX.d.cts +0 -19
- package/dist/utils/index.cjs +0 -44
- package/dist/utils/index.cjs.map +0 -1
- package/dist/utils/index.d.cts +0 -226
- package/dist/utils/index.d.ts +0 -226
- package/dist/utils/index.js +0 -44
- package/dist/utils/index.js.map +0 -1
- package/dist/with-responsive-CNfhzAUu.d.cts +0 -18
- package/dist/with-responsive-CNfhzAUu.d.ts +0 -18
- package/src/hooks/use-has-legend-child.ts +0 -22
package/dist/chunk-CZGYJKG6.js
DELETED
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Stack
|
|
3
|
-
} from "./chunk-Z26M4V2M.js";
|
|
4
|
-
import {
|
|
5
|
-
GlobalChartsContext,
|
|
6
|
-
GlobalChartsProvider,
|
|
7
|
-
useChartId,
|
|
8
|
-
useChartRegistration,
|
|
9
|
-
useGlobalChartsContext,
|
|
10
|
-
useGlobalChartsTheme,
|
|
11
|
-
usePrefersReducedMotion
|
|
12
|
-
} from "./chunk-32DH6JDF.js";
|
|
13
|
-
import {
|
|
14
|
-
formatPercentage,
|
|
15
|
-
hexToRgba
|
|
16
|
-
} from "./chunk-DAU3HNEG.js";
|
|
17
|
-
|
|
18
|
-
// src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx
|
|
19
|
-
import { useTooltip, useTooltipInPortal } from "@visx/tooltip";
|
|
20
|
-
import clsx from "clsx";
|
|
21
|
-
import { useRef, useMemo, useEffect, useCallback as useCallback2, useContext } from "react";
|
|
22
|
-
|
|
23
|
-
// src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss
|
|
24
|
-
var conversion_funnel_chart_module_default = {
|
|
25
|
-
"conversionFunnelChart": "a8ccharts-lK-YNK",
|
|
26
|
-
"loading": "a8ccharts-DbHKK5",
|
|
27
|
-
"main-metric": "a8ccharts-61WPYr",
|
|
28
|
-
"main-rate": "a8ccharts-RRRI6x",
|
|
29
|
-
"change-indicator": "a8ccharts-661iwx",
|
|
30
|
-
"funnel-container": "a8ccharts-Z7EGnW",
|
|
31
|
-
"funnel-step": "a8ccharts-VqFY0l",
|
|
32
|
-
"blurred": "a8ccharts-7dTRBs",
|
|
33
|
-
"step-header": "a8ccharts-2JsQiV",
|
|
34
|
-
"step-label": "a8ccharts-6OabC4",
|
|
35
|
-
"step-rate": "a8ccharts-9wSZ6n",
|
|
36
|
-
"bar-container": "a8ccharts-sSmCTi",
|
|
37
|
-
"disabled": "a8ccharts-PLWVAW",
|
|
38
|
-
"funnel-bar": "a8ccharts-EzczI-",
|
|
39
|
-
"selected": "a8ccharts-wNpZEu",
|
|
40
|
-
"funnel-bar--animated": "a8ccharts-68HQJl",
|
|
41
|
-
"stretch": "a8ccharts-CmtieZ",
|
|
42
|
-
"tooltip-wrapper": "a8ccharts-2TeoCn",
|
|
43
|
-
"tooltip-title": "a8ccharts-jkRitH",
|
|
44
|
-
"tooltip-content": "a8ccharts-8jgT-3",
|
|
45
|
-
"empty-state": "a8ccharts-Ml6MMr"
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// src/charts/conversion-funnel-chart/private/use-funnel-selection.ts
|
|
49
|
-
import { useCallback, useState } from "react";
|
|
50
|
-
var useFunnelSelection = (hideTooltip) => {
|
|
51
|
-
const [clickedStep, setClickedStep] = useState(null);
|
|
52
|
-
const handleBarClick = useCallback(
|
|
53
|
-
(stepId) => {
|
|
54
|
-
if (clickedStep === stepId) {
|
|
55
|
-
setClickedStep(null);
|
|
56
|
-
hideTooltip?.();
|
|
57
|
-
} else {
|
|
58
|
-
setClickedStep(stepId);
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
[clickedStep, hideTooltip]
|
|
62
|
-
);
|
|
63
|
-
const handleBarKeyDown = useCallback(
|
|
64
|
-
(stepId, event) => {
|
|
65
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
if (clickedStep === stepId) {
|
|
68
|
-
setClickedStep(null);
|
|
69
|
-
hideTooltip?.();
|
|
70
|
-
} else {
|
|
71
|
-
setClickedStep(stepId);
|
|
72
|
-
}
|
|
73
|
-
} else if (event.key === "Escape") {
|
|
74
|
-
event.preventDefault();
|
|
75
|
-
setClickedStep(null);
|
|
76
|
-
hideTooltip?.();
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
[clickedStep, hideTooltip]
|
|
80
|
-
);
|
|
81
|
-
const clearSelection = useCallback(() => {
|
|
82
|
-
setClickedStep(null);
|
|
83
|
-
hideTooltip?.();
|
|
84
|
-
}, [hideTooltip]);
|
|
85
|
-
const getStepState = useCallback(
|
|
86
|
-
(stepId) => ({
|
|
87
|
-
isClicked: clickedStep === stepId,
|
|
88
|
-
isBlurred: clickedStep !== null && clickedStep !== stepId
|
|
89
|
-
}),
|
|
90
|
-
[clickedStep]
|
|
91
|
-
);
|
|
92
|
-
return {
|
|
93
|
-
clickedStep,
|
|
94
|
-
handleBarClick,
|
|
95
|
-
handleBarKeyDown,
|
|
96
|
-
clearSelection,
|
|
97
|
-
getStepState
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx
|
|
102
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
103
|
-
var ConversionFunnelChartInternal = ({
|
|
104
|
-
mainRate,
|
|
105
|
-
changeIndicator,
|
|
106
|
-
steps,
|
|
107
|
-
loading = false,
|
|
108
|
-
animation,
|
|
109
|
-
className,
|
|
110
|
-
chartId: providedChartId,
|
|
111
|
-
height,
|
|
112
|
-
style,
|
|
113
|
-
renderStepLabel,
|
|
114
|
-
renderStepRate,
|
|
115
|
-
renderMainMetric,
|
|
116
|
-
renderTooltip
|
|
117
|
-
}) => {
|
|
118
|
-
const chartId = useChartId(providedChartId);
|
|
119
|
-
const {
|
|
120
|
-
conversionFunnelChart: conversionFunnelChartSettings
|
|
121
|
-
} = useGlobalChartsTheme();
|
|
122
|
-
const {
|
|
123
|
-
getElementStyles
|
|
124
|
-
} = useGlobalChartsContext();
|
|
125
|
-
const chartRef = useRef(null);
|
|
126
|
-
const selectedBarRef = useRef(null);
|
|
127
|
-
const {
|
|
128
|
-
tooltipData,
|
|
129
|
-
tooltipLeft,
|
|
130
|
-
tooltipTop,
|
|
131
|
-
tooltipOpen,
|
|
132
|
-
showTooltip,
|
|
133
|
-
hideTooltip
|
|
134
|
-
} = useTooltip();
|
|
135
|
-
const {
|
|
136
|
-
handleBarClick,
|
|
137
|
-
handleBarKeyDown,
|
|
138
|
-
clearSelection,
|
|
139
|
-
getStepState
|
|
140
|
-
} = useFunnelSelection(hideTooltip);
|
|
141
|
-
const {
|
|
142
|
-
containerRef: portalContainerRef,
|
|
143
|
-
TooltipInPortal,
|
|
144
|
-
containerBounds
|
|
145
|
-
} = useTooltipInPortal({
|
|
146
|
-
// use TooltipWithBounds for boundary detection
|
|
147
|
-
detectBounds: true,
|
|
148
|
-
// when tooltip containers are scrolled, this will correctly update the Tooltip position
|
|
149
|
-
scroll: true
|
|
150
|
-
});
|
|
151
|
-
const clearSelectionAndRef = useCallback2(() => {
|
|
152
|
-
clearSelection();
|
|
153
|
-
selectedBarRef.current = null;
|
|
154
|
-
hideTooltip();
|
|
155
|
-
}, [clearSelection, hideTooltip]);
|
|
156
|
-
const showTooltipAt = useCallback2((step, x, y) => {
|
|
157
|
-
showTooltip({
|
|
158
|
-
tooltipData: step,
|
|
159
|
-
tooltipLeft: x,
|
|
160
|
-
tooltipTop: y - 10
|
|
161
|
-
});
|
|
162
|
-
}, [showTooltip]);
|
|
163
|
-
const getMouseTooltipCoords = useCallback2((event) => {
|
|
164
|
-
if (containerBounds.width === 0 || containerBounds.height === 0) {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
x: event.clientX - containerBounds.left,
|
|
169
|
-
y: event.clientY - containerBounds.top
|
|
170
|
-
};
|
|
171
|
-
}, [containerBounds.width, containerBounds.height, containerBounds.left, containerBounds.top]);
|
|
172
|
-
const getKeyboardTooltipCoords = useCallback2((event) => {
|
|
173
|
-
if (containerBounds.width === 0 || containerBounds.height === 0) {
|
|
174
|
-
return null;
|
|
175
|
-
}
|
|
176
|
-
const rect = event.currentTarget.getBoundingClientRect();
|
|
177
|
-
const x = rect.left + rect.width / 2 - containerBounds.left;
|
|
178
|
-
const y = rect.top - containerBounds.top;
|
|
179
|
-
return {
|
|
180
|
-
x,
|
|
181
|
-
y
|
|
182
|
-
};
|
|
183
|
-
}, [containerBounds.width, containerBounds.height, containerBounds.left, containerBounds.top]);
|
|
184
|
-
const handleStepInteraction = useCallback2((step, event, interactionType) => {
|
|
185
|
-
selectedBarRef.current = event.currentTarget;
|
|
186
|
-
const {
|
|
187
|
-
isClicked
|
|
188
|
-
} = getStepState(step.id);
|
|
189
|
-
if (isClicked) {
|
|
190
|
-
if (interactionType === "click") {
|
|
191
|
-
handleBarClick(step.id);
|
|
192
|
-
} else {
|
|
193
|
-
handleBarKeyDown(step.id, event);
|
|
194
|
-
}
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
if (interactionType === "click") {
|
|
198
|
-
handleBarClick(step.id);
|
|
199
|
-
const coords = getMouseTooltipCoords(event);
|
|
200
|
-
if (coords) {
|
|
201
|
-
showTooltipAt(step, coords.x, coords.y);
|
|
202
|
-
}
|
|
203
|
-
} else {
|
|
204
|
-
handleBarKeyDown(step.id, event);
|
|
205
|
-
const coords = getKeyboardTooltipCoords(event);
|
|
206
|
-
if (coords) {
|
|
207
|
-
showTooltipAt(step, coords.x, coords.y);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}, [getStepState, handleBarClick, handleBarKeyDown, showTooltipAt, getMouseTooltipCoords, getKeyboardTooltipCoords]);
|
|
211
|
-
const stepHandlers = useMemo(() => {
|
|
212
|
-
const handlers = /* @__PURE__ */ new Map();
|
|
213
|
-
steps.forEach((step) => {
|
|
214
|
-
const onClick = (event) => {
|
|
215
|
-
event.stopPropagation();
|
|
216
|
-
handleStepInteraction(step, event, "click");
|
|
217
|
-
};
|
|
218
|
-
const onKeyDown = (event) => {
|
|
219
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
220
|
-
handleStepInteraction(step, event, "keyboard");
|
|
221
|
-
} else {
|
|
222
|
-
selectedBarRef.current = event.currentTarget;
|
|
223
|
-
handleBarKeyDown(step.id, event);
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
handlers.set(step.id, {
|
|
227
|
-
onClick,
|
|
228
|
-
onKeyDown
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
return handlers;
|
|
232
|
-
}, [steps, handleStepInteraction, handleBarKeyDown]);
|
|
233
|
-
useEffect(() => {
|
|
234
|
-
const handleDocumentClick = (event) => {
|
|
235
|
-
if (selectedBarRef.current && !selectedBarRef.current.contains(event.target)) {
|
|
236
|
-
clearSelectionAndRef();
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
document.addEventListener("mousedown", handleDocumentClick);
|
|
240
|
-
return () => {
|
|
241
|
-
document.removeEventListener("mousedown", handleDocumentClick);
|
|
242
|
-
};
|
|
243
|
-
}, [clearSelectionAndRef]);
|
|
244
|
-
const resolvedHeight = height ?? style?.height ?? "100%";
|
|
245
|
-
const {
|
|
246
|
-
primaryColor,
|
|
247
|
-
backgroundColor,
|
|
248
|
-
positiveChangeColor,
|
|
249
|
-
negativeChangeColor
|
|
250
|
-
} = conversionFunnelChartSettings;
|
|
251
|
-
const {
|
|
252
|
-
color: barColor
|
|
253
|
-
} = getElementStyles ? getElementStyles({
|
|
254
|
-
index: 0,
|
|
255
|
-
overrideColor: primaryColor
|
|
256
|
-
}) : {
|
|
257
|
-
color: primaryColor || "#000000"
|
|
258
|
-
};
|
|
259
|
-
const isPositiveChange = changeIndicator?.startsWith("+");
|
|
260
|
-
const changeColor = isPositiveChange ? positiveChangeColor : negativeChangeColor;
|
|
261
|
-
const barBackgroundColor = backgroundColor || hexToRgba(barColor, 0.08) || "rgba(0, 0, 0, 0.08)";
|
|
262
|
-
const renderDefaultMainMetric = () => /* @__PURE__ */ _jsxs(_Fragment, {
|
|
263
|
-
children: [/* @__PURE__ */ _jsx("span", {
|
|
264
|
-
className: conversion_funnel_chart_module_default["main-rate"],
|
|
265
|
-
children: formatPercentage(mainRate)
|
|
266
|
-
}), changeIndicator && /* @__PURE__ */ _jsx("span", {
|
|
267
|
-
className: conversion_funnel_chart_module_default["change-indicator"],
|
|
268
|
-
style: {
|
|
269
|
-
color: changeColor
|
|
270
|
-
},
|
|
271
|
-
children: changeIndicator
|
|
272
|
-
})]
|
|
273
|
-
});
|
|
274
|
-
const renderDefaultTooltip = (step) => /* @__PURE__ */ _jsxs(_Fragment, {
|
|
275
|
-
children: [/* @__PURE__ */ _jsx("div", {
|
|
276
|
-
className: conversion_funnel_chart_module_default["tooltip-title"],
|
|
277
|
-
children: step.label
|
|
278
|
-
}), /* @__PURE__ */ _jsxs("div", {
|
|
279
|
-
className: conversion_funnel_chart_module_default["tooltip-content"],
|
|
280
|
-
children: [formatPercentage(step.rate), ` \u2022 ${step.count ?? "no"} items`]
|
|
281
|
-
})]
|
|
282
|
-
});
|
|
283
|
-
const isDataValid = Boolean(steps && steps.length > 0);
|
|
284
|
-
const chartMetadata = useMemo(() => ({
|
|
285
|
-
mainRate,
|
|
286
|
-
changeIndicator,
|
|
287
|
-
stepsCount: steps?.length || 0
|
|
288
|
-
}), [mainRate, changeIndicator, steps?.length]);
|
|
289
|
-
useChartRegistration({
|
|
290
|
-
chartId,
|
|
291
|
-
legendItems: [],
|
|
292
|
-
chartType: "conversion-funnel",
|
|
293
|
-
isDataValid,
|
|
294
|
-
metadata: chartMetadata
|
|
295
|
-
});
|
|
296
|
-
const prefersReducedMotion = usePrefersReducedMotion();
|
|
297
|
-
if (!isDataValid) {
|
|
298
|
-
return /* @__PURE__ */ _jsx(Stack, {
|
|
299
|
-
direction: "column",
|
|
300
|
-
className: clsx(conversion_funnel_chart_module_default.conversionFunnelChart, loading && conversion_funnel_chart_module_default.loading, className),
|
|
301
|
-
style: {
|
|
302
|
-
...style,
|
|
303
|
-
height: resolvedHeight
|
|
304
|
-
},
|
|
305
|
-
children: /* @__PURE__ */ _jsx("div", {
|
|
306
|
-
className: conversion_funnel_chart_module_default["empty-state"],
|
|
307
|
-
children: loading ? "Loading..." : "No data available"
|
|
308
|
-
})
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
const maxRate = Math.max(...steps.map((step) => step.rate));
|
|
312
|
-
return /* @__PURE__ */ _jsxs(_Fragment, {
|
|
313
|
-
children: [/* @__PURE__ */ _jsxs(Stack, {
|
|
314
|
-
direction: "column",
|
|
315
|
-
ref: (node) => {
|
|
316
|
-
portalContainerRef(node);
|
|
317
|
-
chartRef.current = node;
|
|
318
|
-
},
|
|
319
|
-
className: clsx(conversion_funnel_chart_module_default.conversionFunnelChart, loading && conversion_funnel_chart_module_default.loading, className),
|
|
320
|
-
style: {
|
|
321
|
-
...style,
|
|
322
|
-
height: resolvedHeight
|
|
323
|
-
},
|
|
324
|
-
children: [renderMainMetric ? renderMainMetric({
|
|
325
|
-
mainRate,
|
|
326
|
-
changeIndicator,
|
|
327
|
-
className: conversion_funnel_chart_module_default["main-metric"],
|
|
328
|
-
changeColor
|
|
329
|
-
}) : /* @__PURE__ */ _jsx("div", {
|
|
330
|
-
className: conversion_funnel_chart_module_default["main-metric"],
|
|
331
|
-
children: renderDefaultMainMetric()
|
|
332
|
-
}), /* @__PURE__ */ _jsx("div", {
|
|
333
|
-
className: conversion_funnel_chart_module_default["funnel-container"],
|
|
334
|
-
children: steps.map((step, index) => {
|
|
335
|
-
const barHeight = step.rate / maxRate * 100;
|
|
336
|
-
const {
|
|
337
|
-
isBlurred
|
|
338
|
-
} = getStepState(step.id);
|
|
339
|
-
return /* @__PURE__ */ _jsxs("div", {
|
|
340
|
-
className: clsx(conversion_funnel_chart_module_default["funnel-step"], isBlurred && conversion_funnel_chart_module_default.blurred),
|
|
341
|
-
children: [/* @__PURE__ */ _jsxs("div", {
|
|
342
|
-
className: conversion_funnel_chart_module_default["step-header"],
|
|
343
|
-
children: [renderStepLabel ? renderStepLabel({
|
|
344
|
-
step,
|
|
345
|
-
index,
|
|
346
|
-
className: conversion_funnel_chart_module_default["step-label"]
|
|
347
|
-
}) : /* @__PURE__ */ _jsx("span", {
|
|
348
|
-
className: conversion_funnel_chart_module_default["step-label"],
|
|
349
|
-
children: step.label
|
|
350
|
-
}), renderStepRate ? renderStepRate({
|
|
351
|
-
step,
|
|
352
|
-
index,
|
|
353
|
-
className: conversion_funnel_chart_module_default["step-rate"]
|
|
354
|
-
}) : /* @__PURE__ */ _jsx("span", {
|
|
355
|
-
className: conversion_funnel_chart_module_default["step-rate"],
|
|
356
|
-
children: formatPercentage(step.rate)
|
|
357
|
-
})]
|
|
358
|
-
}), /* @__PURE__ */ _jsx("div", {
|
|
359
|
-
className: clsx(conversion_funnel_chart_module_default["bar-container"], isBlurred && conversion_funnel_chart_module_default.disabled),
|
|
360
|
-
onClick: stepHandlers.get(step.id)?.onClick,
|
|
361
|
-
onKeyDown: stepHandlers.get(step.id)?.onKeyDown,
|
|
362
|
-
role: "button",
|
|
363
|
-
tabIndex: isBlurred ? -1 : 0,
|
|
364
|
-
"aria-label": step.label,
|
|
365
|
-
style: {
|
|
366
|
-
backgroundColor: barBackgroundColor
|
|
367
|
-
},
|
|
368
|
-
children: /* @__PURE__ */ _jsx("div", {
|
|
369
|
-
className: clsx(conversion_funnel_chart_module_default["funnel-bar"], {
|
|
370
|
-
[conversion_funnel_chart_module_default["funnel-bar--animated"]]: animation && !loading && !prefersReducedMotion
|
|
371
|
-
}),
|
|
372
|
-
style: {
|
|
373
|
-
height: `${barHeight}%`,
|
|
374
|
-
backgroundColor: barColor
|
|
375
|
-
}
|
|
376
|
-
})
|
|
377
|
-
})]
|
|
378
|
-
}, step.id);
|
|
379
|
-
})
|
|
380
|
-
})]
|
|
381
|
-
}), tooltipOpen && tooltipData && (() => {
|
|
382
|
-
const tooltipContent = renderTooltip ? renderTooltip({
|
|
383
|
-
step: tooltipData,
|
|
384
|
-
index: steps.findIndex((s) => s.id === tooltipData.id),
|
|
385
|
-
top: tooltipTop,
|
|
386
|
-
left: tooltipLeft,
|
|
387
|
-
className: conversion_funnel_chart_module_default["tooltip-wrapper"]
|
|
388
|
-
}) : renderDefaultTooltip(tooltipData);
|
|
389
|
-
if (!tooltipContent) return null;
|
|
390
|
-
return /* @__PURE__ */ _jsx(
|
|
391
|
-
TooltipInPortal,
|
|
392
|
-
{
|
|
393
|
-
top: tooltipTop,
|
|
394
|
-
left: tooltipLeft,
|
|
395
|
-
className: conversion_funnel_chart_module_default["tooltip-wrapper"],
|
|
396
|
-
children: tooltipContent
|
|
397
|
-
},
|
|
398
|
-
Math.random()
|
|
399
|
-
);
|
|
400
|
-
})()]
|
|
401
|
-
});
|
|
402
|
-
};
|
|
403
|
-
var ConversionFunnelChartWithProvider = (props) => {
|
|
404
|
-
const existingContext = useContext(GlobalChartsContext);
|
|
405
|
-
if (existingContext) {
|
|
406
|
-
return /* @__PURE__ */ _jsx(ConversionFunnelChartInternal, {
|
|
407
|
-
...props
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
return /* @__PURE__ */ _jsx(GlobalChartsProvider, {
|
|
411
|
-
children: /* @__PURE__ */ _jsx(ConversionFunnelChartInternal, {
|
|
412
|
-
...props
|
|
413
|
-
})
|
|
414
|
-
});
|
|
415
|
-
};
|
|
416
|
-
ConversionFunnelChartWithProvider.displayName = "ConversionFunnelChart";
|
|
417
|
-
|
|
418
|
-
export {
|
|
419
|
-
ConversionFunnelChartWithProvider
|
|
420
|
-
};
|
|
421
|
-
//# sourceMappingURL=chunk-CZGYJKG6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx","../src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss","../src/charts/conversion-funnel-chart/private/use-funnel-selection.ts"],"sourcesContent":["import { useTooltip, useTooltipInPortal } from '@visx/tooltip';\nimport { Stack } from '@wordpress/ui';\nimport clsx from 'clsx';\nimport { useRef, useMemo, useEffect, useCallback, useContext } from 'react';\nimport { usePrefersReducedMotion } from '../../hooks';\nimport { GlobalChartsProvider, GlobalChartsContext, useChartId, useChartRegistration, useGlobalChartsTheme, useGlobalChartsContext } from '../../providers';\nimport { formatPercentage, hexToRgba } from '../../utils';\nimport styles from './conversion-funnel-chart.module.scss';\nimport { useFunnelSelection } from './private';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * Internal ConversionFunnelChart component with chart registration\n *\n * @param props - Component props\n * @param props.chartId - Optional unique identifier for the chart\n * @param props.mainRate - Main conversion rate to highlight\n * @param props.changeIndicator - Change indicator (e.g., +2%, -1.5%)\n * @param props.steps - Array of funnel steps\n * @param props.loading - Whether the chart is in loading state\n * @param props.animation - Whether to show chart animation on initial render or not\n * @param props.className - Additional CSS class name\n * @param props.height - Height of the chart container. Falls back to style.height if set, otherwise defaults to \"100%\".\n * @param props.style - Custom styling\n * @param props.renderStepLabel - Custom render function for step labels\n * @param props.renderStepRate - Custom render function for step rates\n * @param props.renderMainMetric - Custom render function for the entire main metric section\n * @param props.renderTooltip - Custom render function for tooltip content\n * @return JSX element representing the conversion funnel chart\n */\nconst ConversionFunnelChartInternal = ({\n mainRate,\n changeIndicator,\n steps,\n loading = false,\n animation,\n className,\n chartId: providedChartId,\n height,\n style,\n renderStepLabel,\n renderStepRate,\n renderMainMetric,\n renderTooltip\n}) => {\n const chartId = useChartId(providedChartId);\n const {\n conversionFunnelChart: conversionFunnelChartSettings\n } = useGlobalChartsTheme();\n const {\n getElementStyles\n } = useGlobalChartsContext();\n const chartRef = useRef(null);\n const selectedBarRef = useRef(null);\n\n // Use @visx/tooltip hooks for tooltip positioning\n const {\n tooltipData,\n tooltipLeft,\n tooltipTop,\n tooltipOpen,\n showTooltip,\n hideTooltip\n } = useTooltip();\n\n // Use custom hook for selection management\n const {\n handleBarClick,\n handleBarKeyDown,\n clearSelection,\n getStepState\n } = useFunnelSelection(hideTooltip);\n const {\n containerRef: portalContainerRef,\n TooltipInPortal,\n containerBounds\n } = useTooltipInPortal({\n // use TooltipWithBounds for boundary detection\n detectBounds: true,\n // when tooltip containers are scrolled, this will correctly update the Tooltip position\n scroll: true\n });\n\n // Wrapper to clear selectedBarRef after clearing selection\n const clearSelectionAndRef = useCallback(() => {\n clearSelection();\n selectedBarRef.current = null;\n hideTooltip();\n }, [clearSelection, hideTooltip]);\n\n // Helper function to show tooltip at specific coordinates\n const showTooltipAt = useCallback((step, x, y) => {\n showTooltip({\n tooltipData: step,\n tooltipLeft: x,\n tooltipTop: y - 10\n });\n }, [showTooltip]);\n\n // Helper function to get tooltip coordinates for mouse events\n // Use clientX/Y and subtract containerBounds to cancel out any stale offset.\n // TooltipInPortal calculates: tooltipLeft + containerBounds.left + scrollX\n // By passing (clientX - containerBounds.left), we get correct page coordinates\n // regardless of whether bounds are stale (e.g., after dashboard customization).\n const getMouseTooltipCoords = useCallback(event => {\n // Don't return coords until container bounds are measured\n if (containerBounds.width === 0 || containerBounds.height === 0) {\n return null;\n }\n return {\n x: event.clientX - containerBounds.left,\n y: event.clientY - containerBounds.top\n };\n }, [containerBounds.width, containerBounds.height, containerBounds.left, containerBounds.top]);\n\n // Helper function to get tooltip coordinates for keyboard events\n // Use fresh getBoundingClientRect() and subtract containerBounds to cancel out stale offset.\n const getKeyboardTooltipCoords = useCallback(event => {\n // Don't return coords until container bounds are measured\n if (containerBounds.width === 0 || containerBounds.height === 0) {\n return null;\n }\n const rect = event.currentTarget.getBoundingClientRect();\n // Calculate center of element in viewport coordinates, then subtract containerBounds\n const x = rect.left + rect.width / 2 - containerBounds.left;\n const y = rect.top - containerBounds.top;\n return {\n x,\n y\n };\n }, [containerBounds.width, containerBounds.height, containerBounds.left, containerBounds.top]);\n\n // Helper function to handle step interaction (both click and keyboard)\n const handleStepInteraction = useCallback((step, event, interactionType) => {\n // Store reference to the interacted element\n selectedBarRef.current = event.currentTarget;\n\n // Check if deselecting the same step\n const {\n isClicked\n } = getStepState(step.id);\n if (isClicked) {\n // Deselecting - clear selection (tooltip will be hidden by hook)\n if (interactionType === 'click') {\n handleBarClick(step.id);\n } else {\n handleBarKeyDown(step.id, event);\n }\n return;\n }\n\n // Selecting - handle selection and show tooltip\n if (interactionType === 'click') {\n handleBarClick(step.id);\n const coords = getMouseTooltipCoords(event);\n if (coords) {\n showTooltipAt(step, coords.x, coords.y);\n }\n } else {\n handleBarKeyDown(step.id, event);\n const coords = getKeyboardTooltipCoords(event);\n if (coords) {\n showTooltipAt(step, coords.x, coords.y);\n }\n }\n }, [getStepState, handleBarClick, handleBarKeyDown, showTooltipAt, getMouseTooltipCoords, getKeyboardTooltipCoords]);\n\n // Create handler factories to avoid arrow functions in JSX\n const stepHandlers = useMemo(() => {\n const handlers = new Map();\n steps.forEach(step => {\n const onClick = event => {\n event.stopPropagation();\n handleStepInteraction(step, event, 'click');\n };\n const onKeyDown = event => {\n if (event.key === 'Enter' || event.key === ' ') {\n handleStepInteraction(step, event, 'keyboard');\n } else {\n // For other keys (like Escape), just handle the selection\n selectedBarRef.current = event.currentTarget;\n handleBarKeyDown(step.id, event);\n }\n };\n handlers.set(step.id, {\n onClick,\n onKeyDown\n });\n });\n return handlers;\n }, [steps, handleStepInteraction, handleBarKeyDown]);\n\n // Handle document-level click to clear selection when clicking outside selected bar\n useEffect(() => {\n const handleDocumentClick = event => {\n // Only clear selection if there's an active selection and click is outside the selected bar\n if (selectedBarRef.current && !selectedBarRef.current.contains(event.target)) {\n clearSelectionAndRef();\n }\n };\n document.addEventListener('mousedown', handleDocumentClick);\n return () => {\n document.removeEventListener('mousedown', handleDocumentClick);\n };\n }, [clearSelectionAndRef]);\n\n // Resolve height: explicit height prop > style.height > default 100%\n const resolvedHeight = height ?? style?.height ?? '100%';\n\n // Get component settings from theme with fallbacks\n const {\n primaryColor,\n backgroundColor,\n positiveChangeColor,\n negativeChangeColor\n } = conversionFunnelChartSettings;\n\n // Resolve bar color using getElementStyles with primaryColor as override\n const {\n color: barColor\n } = getElementStyles ? getElementStyles({\n index: 0,\n overrideColor: primaryColor\n }) : {\n color: primaryColor || '#000000'\n };\n\n // Determine change indicator color\n const isPositiveChange = changeIndicator?.startsWith('+');\n const changeColor = isPositiveChange ? positiveChangeColor : negativeChangeColor;\n\n // Create light background version of primary color if not set\n const barBackgroundColor = backgroundColor || hexToRgba(barColor, 0.08) || 'rgba(0, 0, 0, 0.08)';\n\n // Default main metric rendering function\n const renderDefaultMainMetric = () => /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"span\", {\n className: styles['main-rate'],\n children: formatPercentage(mainRate)\n }), changeIndicator && /*#__PURE__*/_jsx(\"span\", {\n className: styles['change-indicator'],\n style: {\n color: changeColor\n },\n children: changeIndicator\n })]\n });\n\n // Default tooltip rendering function\n const renderDefaultTooltip = step => /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"div\", {\n className: styles['tooltip-title'],\n children: step.label\n }), /*#__PURE__*/_jsxs(\"div\", {\n className: styles['tooltip-content'],\n children: [formatPercentage(step.rate), ` • ${step.count ?? 'no'} items`]\n })]\n });\n\n // Validate data\n const isDataValid = Boolean(steps && steps.length > 0);\n\n // Memoize metadata to prevent unnecessary re-registration\n const chartMetadata = useMemo(() => ({\n mainRate,\n changeIndicator,\n stepsCount: steps?.length || 0\n }), [mainRate, changeIndicator, steps?.length]);\n useChartRegistration({\n chartId,\n legendItems: [],\n chartType: 'conversion-funnel',\n isDataValid,\n metadata: chartMetadata\n });\n const prefersReducedMotion = usePrefersReducedMotion();\n\n // Handle empty or undefined data\n if (!isDataValid) {\n return /*#__PURE__*/_jsx(Stack, {\n direction: \"column\",\n className: clsx(styles.conversionFunnelChart, loading && styles.loading, className),\n style: {\n ...style,\n height: resolvedHeight\n },\n children: /*#__PURE__*/_jsx(\"div\", {\n className: styles['empty-state'],\n children: loading ? 'Loading...' : 'No data available'\n })\n });\n }\n\n // Calculate bar heights relative to the maximum (first step)\n const maxRate = Math.max(...steps.map(step => step.rate));\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsxs(Stack, {\n direction: \"column\",\n ref: node => {\n // Set containerRef for @visx coordinate system\n portalContainerRef(node);\n chartRef.current = node;\n },\n className: clsx(styles.conversionFunnelChart, loading && styles.loading, className),\n style: {\n ...style,\n height: resolvedHeight\n },\n children: [renderMainMetric ? renderMainMetric({\n mainRate,\n changeIndicator,\n className: styles['main-metric'],\n changeColor\n }) : /*#__PURE__*/_jsx(\"div\", {\n className: styles['main-metric'],\n children: renderDefaultMainMetric()\n }), /*#__PURE__*/_jsx(\"div\", {\n className: styles['funnel-container'],\n children: steps.map((step, index) => {\n const barHeight = step.rate / maxRate * 100;\n const {\n isBlurred\n } = getStepState(step.id);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: clsx(styles['funnel-step'], isBlurred && styles.blurred),\n children: [/*#__PURE__*/_jsxs(\"div\", {\n className: styles['step-header'],\n children: [renderStepLabel ? renderStepLabel({\n step,\n index,\n className: styles['step-label']\n }) : /*#__PURE__*/_jsx(\"span\", {\n className: styles['step-label'],\n children: step.label\n }), renderStepRate ? renderStepRate({\n step,\n index,\n className: styles['step-rate']\n }) : /*#__PURE__*/_jsx(\"span\", {\n className: styles['step-rate'],\n children: formatPercentage(step.rate)\n })]\n }), /*#__PURE__*/_jsx(\"div\", {\n className: clsx(styles['bar-container'], isBlurred && styles.disabled),\n onClick: stepHandlers.get(step.id)?.onClick,\n onKeyDown: stepHandlers.get(step.id)?.onKeyDown,\n role: \"button\",\n tabIndex: isBlurred ? -1 : 0,\n \"aria-label\": step.label,\n style: {\n backgroundColor: barBackgroundColor\n },\n children: /*#__PURE__*/_jsx(\"div\", {\n className: clsx(styles['funnel-bar'], {\n [styles['funnel-bar--animated']]: animation && !loading && !prefersReducedMotion\n }),\n style: {\n height: `${barHeight}%`,\n backgroundColor: barColor\n }\n })\n })]\n }, step.id);\n })\n })]\n }), tooltipOpen && tooltipData && (() => {\n const tooltipContent = renderTooltip ? renderTooltip({\n step: tooltipData,\n index: steps.findIndex(s => s.id === tooltipData.id),\n top: tooltipTop,\n left: tooltipLeft,\n className: styles['tooltip-wrapper']\n }) : renderDefaultTooltip(tooltipData);\n\n // Don't render tooltip if renderTooltip returns falsy\n if (!tooltipContent) return null;\n return /*#__PURE__*/_jsx(TooltipInPortal\n // set this to random so it correctly updates with parent bounds\n , {\n top: tooltipTop,\n left: tooltipLeft,\n className: styles['tooltip-wrapper'],\n children: tooltipContent\n }, Math.random());\n })()]\n });\n};\n\n/**\n * ConversionFunnelChart component with provider wrapper\n *\n * @param props - Component props\n * @return JSX element representing the conversion funnel chart\n */\nconst ConversionFunnelChartWithProvider = props => {\n const existingContext = useContext(GlobalChartsContext);\n\n // If we're already in a GlobalChartsProvider context, don't create a new one\n if (existingContext) {\n return /*#__PURE__*/_jsx(ConversionFunnelChartInternal, {\n ...props\n });\n }\n\n // Otherwise, create our own GlobalChartsProvider\n return /*#__PURE__*/_jsx(GlobalChartsProvider, {\n children: /*#__PURE__*/_jsx(ConversionFunnelChartInternal, {\n ...props\n })\n });\n};\nConversionFunnelChartWithProvider.displayName = 'ConversionFunnelChart';\nexport { ConversionFunnelChartWithProvider as default };","import 'css-chunk:src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss';export default {\n \"conversionFunnelChart\": \"a8ccharts-lK-YNK\",\n \"loading\": \"a8ccharts-DbHKK5\",\n \"main-metric\": \"a8ccharts-61WPYr\",\n \"main-rate\": \"a8ccharts-RRRI6x\",\n \"change-indicator\": \"a8ccharts-661iwx\",\n \"funnel-container\": \"a8ccharts-Z7EGnW\",\n \"funnel-step\": \"a8ccharts-VqFY0l\",\n \"blurred\": \"a8ccharts-7dTRBs\",\n \"step-header\": \"a8ccharts-2JsQiV\",\n \"step-label\": \"a8ccharts-6OabC4\",\n \"step-rate\": \"a8ccharts-9wSZ6n\",\n \"bar-container\": \"a8ccharts-sSmCTi\",\n \"disabled\": \"a8ccharts-PLWVAW\",\n \"funnel-bar\": \"a8ccharts-EzczI-\",\n \"selected\": \"a8ccharts-wNpZEu\",\n \"funnel-bar--animated\": \"a8ccharts-68HQJl\",\n \"stretch\": \"a8ccharts-CmtieZ\",\n \"tooltip-wrapper\": \"a8ccharts-2TeoCn\",\n \"tooltip-title\": \"a8ccharts-jkRitH\",\n \"tooltip-content\": \"a8ccharts-8jgT-3\",\n \"empty-state\": \"a8ccharts-Ml6MMr\"\n};","import { useCallback, useState } from 'react';\n\n/**\n * Custom hook to manage funnel bar selection state and interactions\n * @param hideTooltip - Function to hide tooltip when selection is cleared\n * @return Object containing selection state and event handlers\n */\nexport const useFunnelSelection = ( hideTooltip?: () => void ) => {\n\tconst [ clickedStep, setClickedStep ] = useState< string | null >( null );\n\n\t// Handle bar click\n\tconst handleBarClick = useCallback(\n\t\t( stepId: string ) => {\n\t\t\tif ( clickedStep === stepId ) {\n\t\t\t\t// If clicking the same step, deselect it\n\t\t\t\tsetClickedStep( null );\n\t\t\t\thideTooltip?.();\n\t\t\t} else {\n\t\t\t\t// Otherwise, select this step\n\t\t\t\tsetClickedStep( stepId );\n\t\t\t}\n\t\t},\n\t\t[ clickedStep, hideTooltip ]\n\t);\n\n\t// Handle bar keydown\n\tconst handleBarKeyDown = useCallback(\n\t\t( stepId: string, event: React.KeyboardEvent ) => {\n\t\t\tif ( event.key === 'Enter' || event.key === ' ' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( clickedStep === stepId ) {\n\t\t\t\t\tsetClickedStep( null );\n\t\t\t\t\thideTooltip?.();\n\t\t\t\t} else {\n\t\t\t\t\tsetClickedStep( stepId );\n\t\t\t\t}\n\t\t\t} else if ( event.key === 'Escape' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetClickedStep( null );\n\t\t\t\thideTooltip?.();\n\t\t\t}\n\t\t},\n\t\t[ clickedStep, hideTooltip ]\n\t);\n\n\t// Clear selection (for chart-level click)\n\tconst clearSelection = useCallback( () => {\n\t\tsetClickedStep( null );\n\t\thideTooltip?.();\n\t}, [ hideTooltip ] );\n\n\t// Get step state helpers\n\tconst getStepState = useCallback(\n\t\t( stepId: string ) => ( {\n\t\t\tisClicked: clickedStep === stepId,\n\t\t\tisBlurred: clickedStep !== null && clickedStep !== stepId,\n\t\t} ),\n\t\t[ clickedStep ]\n\t);\n\n\treturn {\n\t\tclickedStep,\n\t\thandleBarClick,\n\t\thandleBarKeyDown,\n\t\tclearSelection,\n\t\tgetStepState,\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,0BAA0B;AAE/C,OAAO,UAAU;AACjB,SAAS,QAAQ,SAAS,WAAW,eAAAA,cAAa,kBAAkB;;;ACHsB,IAAO,yCAAQ;AAAA,EACvG,yBAAyB;AAAA,EACzB,WAAW;AAAA,EACX,eAAe;AAAA,EACf,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,eAAe;AAAA,EACf,WAAW;AAAA,EACX,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,wBAAwB;AAAA,EACxB,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,eAAe;AACjB;;;ACtBA,SAAS,aAAa,gBAAgB;AAO/B,IAAM,qBAAqB,CAAE,gBAA8B;AACjE,QAAM,CAAE,aAAa,cAAe,IAAI,SAA2B,IAAK;AAGxE,QAAM,iBAAiB;AAAA,IACtB,CAAE,WAAoB;AACrB,UAAK,gBAAgB,QAAS;AAE7B,uBAAgB,IAAK;AACrB,sBAAc;AAAA,MACf,OAAO;AAEN,uBAAgB,MAAO;AAAA,MACxB;AAAA,IACD;AAAA,IACA,CAAE,aAAa,WAAY;AAAA,EAC5B;AAGA,QAAM,mBAAmB;AAAA,IACxB,CAAE,QAAgB,UAAgC;AACjD,UAAK,MAAM,QAAQ,WAAW,MAAM,QAAQ,KAAM;AACjD,cAAM,eAAe;AACrB,YAAK,gBAA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BACpC,CAAC,uCAAO,sBAAsB,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC;AAAA,gBAC9D,CAAC;AAAA,gBACD,OAAO;AAAA,kBACL,QAAQ,GAAG,SAAS;AAAA,kBACpB,iBAAiB;AAAA,gBACnB;AAAA,cACF,CAAC;AAAA,YACH,CAAC,CAAC;AAAA,UACJ,GAAG,KAAK,EAAE;AAAA,QACZ,CAAC;AAAA,MACH,CAAC,CAAC;AAAA,IACJ,CAAC,GAAG,eAAe,gBAAgB,MAAM;AACvC,YAAM,iBAAiB,gBAAgB,cAAc;AAAA,QACnD,MAAM;AAAA,QACN,OAAO,MAAM,UAAU,OAAK,EAAE,OAAO,YAAY,EAAE;AAAA,QACnD,KAAK;AAAA,QACL,MAAM;AAAA,QACN,WAAW,uCAAO,iBAAiB;AAAA,MACrC,CAAC,IAAI,qBAAqB,WAAW;AAGrC,UAAI,CAAC,eAAgB,QAAO;AAC5B,aAAoB;AAAA,QAAK;AAAA,QAEvB;AAAA,UACA,KAAK;AAAA,UACL,MAAM;AAAA,UACN,WAAW,uCAAO,iBAAiB;AAAA,UACnC,UAAU;AAAA,QACZ;AAAA,QAAG,KAAK,OAAO;AAAA,MAAC;AAAA,IAClB,GAAG,CAAC;AAAA,EACN,CAAC;AACH;AAQA,IAAM,oCAAoC,WAAS;AACjD,QAAM,kBAAkB,WAAW,mBAAmB;AAGtD,MAAI,iBAAiB;AACnB,WAAoB,qBAAK,+BAA+B;AAAA,MACtD,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAGA,SAAoB,qBAAK,sBAAsB;AAAA,IAC7C,UAAuB,qBAAK,+BAA+B;AAAA,MACzD,GAAG;AAAA,IACL,CAAC;AAAA,EACH,CAAC;AACH;AACA,kCAAkC,cAAc;","names":["useCallback","useCallback"]}
|
package/dist/chunk-D2UH4CFE.cjs
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
-
|
|
3
|
-
var _chunkASLARV7Lcjs = require('./chunk-ASLARV7L.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _chunkRHHVEJHJcjs = require('./chunk-RHHVEJHJ.cjs');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _chunkVTS3PNMScjs = require('./chunk-VTS3PNMS.cjs');
|
|
14
|
-
|
|
15
|
-
// src/charts/geo-chart/geo-chart.tsx
|
|
16
|
-
var _i18n = require('@wordpress/i18n');
|
|
17
|
-
var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);
|
|
18
|
-
var _react = require('react');
|
|
19
|
-
var _reactgooglecharts = require('react-google-charts');
|
|
20
|
-
|
|
21
|
-
// src/charts/geo-chart/geo-chart.module.scss
|
|
22
|
-
var geo_chart_module_default = {
|
|
23
|
-
"container": "a8ccharts-JvcqOz"
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// src/charts/geo-chart/geo-chart.tsx
|
|
27
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
28
|
-
var DEFAULT_FEATURE_FILL_COLOR = "#ffffff";
|
|
29
|
-
var DEFAULT_BACKGROUND_COLOR = "#ffffff";
|
|
30
|
-
var GeoChartInternal = ({
|
|
31
|
-
className,
|
|
32
|
-
data,
|
|
33
|
-
width,
|
|
34
|
-
height,
|
|
35
|
-
region = "world",
|
|
36
|
-
resolution = "countries",
|
|
37
|
-
renderPlaceholder
|
|
38
|
-
}) => {
|
|
39
|
-
const {
|
|
40
|
-
getElementStyles,
|
|
41
|
-
theme: {
|
|
42
|
-
geoChart: {
|
|
43
|
-
featureFillColor
|
|
44
|
-
},
|
|
45
|
-
backgroundColor
|
|
46
|
-
}
|
|
47
|
-
} = _chunkRHHVEJHJcjs.useGlobalChartsContext.call(void 0, );
|
|
48
|
-
const loadingPlaceholder = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {
|
|
49
|
-
className: _clsx2.default.call(void 0, "geo-chart", geo_chart_module_default.container, className),
|
|
50
|
-
style: {
|
|
51
|
-
width,
|
|
52
|
-
height
|
|
53
|
-
},
|
|
54
|
-
children: renderPlaceholder ? renderPlaceholder() : _i18n.__.call(void 0, "Loading map", "jetpack-charts")
|
|
55
|
-
});
|
|
56
|
-
const fullColorHex = getElementStyles({
|
|
57
|
-
index: 0
|
|
58
|
-
}).color;
|
|
59
|
-
const lightColorHex = _chunkVTS3PNMScjs.lightenHexColor.call(void 0, fullColorHex, 0.8);
|
|
60
|
-
const backgroundColorHex = _chunkVTS3PNMScjs.normalizeColorToHex.call(void 0, backgroundColor, null, _chunkVTS3PNMScjs.resolveCssVariable) || DEFAULT_BACKGROUND_COLOR;
|
|
61
|
-
const defaultFillColorHex = _chunkVTS3PNMScjs.normalizeColorToHex.call(void 0, featureFillColor, null, _chunkVTS3PNMScjs.resolveCssVariable) || DEFAULT_FEATURE_FILL_COLOR;
|
|
62
|
-
const hasHtmlTooltips = _react.useMemo.call(void 0, () => data.length > 0 && data[0].some((col) => typeof col === "object" && col !== null && "role" in col && col.role === "tooltip" && "p" in col && typeof col.p === "object" && col.p !== null && "html" in col.p && col.p.html === true), [data]);
|
|
63
|
-
const options = _react.useMemo.call(void 0, () => ({
|
|
64
|
-
...region !== "world" && {
|
|
65
|
-
region
|
|
66
|
-
},
|
|
67
|
-
...resolution !== "countries" && {
|
|
68
|
-
resolution
|
|
69
|
-
},
|
|
70
|
-
colorAxis: {
|
|
71
|
-
colors: [lightColorHex, fullColorHex]
|
|
72
|
-
},
|
|
73
|
-
backgroundColor: backgroundColorHex,
|
|
74
|
-
datalessRegionColor: defaultFillColorHex,
|
|
75
|
-
defaultColor: defaultFillColorHex,
|
|
76
|
-
tooltip: {
|
|
77
|
-
trigger: "focus",
|
|
78
|
-
isHtml: hasHtmlTooltips
|
|
79
|
-
},
|
|
80
|
-
legend: "none",
|
|
81
|
-
keepAspectRatio: true
|
|
82
|
-
}), [region, resolution, lightColorHex, fullColorHex, backgroundColorHex, defaultFillColorHex, hasHtmlTooltips]);
|
|
83
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {
|
|
84
|
-
className: _clsx2.default.call(void 0, "geo-chart", geo_chart_module_default.container, className),
|
|
85
|
-
style: {
|
|
86
|
-
width,
|
|
87
|
-
height,
|
|
88
|
-
backgroundColor
|
|
89
|
-
},
|
|
90
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactgooglecharts.Chart, {
|
|
91
|
-
chartType: "GeoChart",
|
|
92
|
-
width,
|
|
93
|
-
height,
|
|
94
|
-
data,
|
|
95
|
-
options,
|
|
96
|
-
loader: loadingPlaceholder
|
|
97
|
-
})
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
var GeoChartWithProvider = (props) => {
|
|
101
|
-
const existingContext = _react.useContext.call(void 0, _chunkRHHVEJHJcjs.GlobalChartsContext);
|
|
102
|
-
if (existingContext) {
|
|
103
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GeoChartInternal, {
|
|
104
|
-
...props
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRHHVEJHJcjs.GlobalChartsProvider, {
|
|
108
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GeoChartInternal, {
|
|
109
|
-
...props
|
|
110
|
-
})
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
GeoChartWithProvider.displayName = "GeoChart";
|
|
114
|
-
var GeoChartResponsive = _chunkASLARV7Lcjs.withResponsive.call(void 0, GeoChartWithProvider);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
exports.GeoChartWithProvider = GeoChartWithProvider; exports.GeoChartResponsive = GeoChartResponsive;
|
|
120
|
-
//# sourceMappingURL=chunk-D2UH4CFE.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/chunk-D2UH4CFE.cjs","../src/charts/geo-chart/geo-chart.tsx","../src/charts/geo-chart/geo-chart.module.scss"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACXA,uCAAmB;AACnB,wEAAiB;AACjB,8BAAoC;AACpC,wDAAsB;ADatB;AACA;AEpB8D,IAAO,yBAAA,EAAQ;AAAA,EAC3E,WAAA,EAAa;AACf,CAAA;AFsBA;AACA;ACVA,+CAA4B;AAC5B,IAAM,2BAAA,EAA6B,SAAA;AACnC,IAAM,yBAAA,EAA2B,SAAA;AAqBjC,IAAM,iBAAA,EAAmB,CAAC;AAAA,EACxB,SAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,EAAS,OAAA;AAAA,EACT,WAAA,EAAa,WAAA;AAAA,EACb;AACF,CAAA,EAAA,GAAM;AACJ,EAAA,MAAM;AAAA,IACJ,gBAAA;AAAA,IACA,KAAA,EAAO;AAAA,MACL,QAAA,EAAU;AAAA,QACR;AAAA,MACF,CAAA;AAAA,MACA;AAAA,IACF;AAAA,EACF,EAAA,EAAI,sDAAA,CAAuB;AAG3B,EAAA,MAAM,mBAAA,kBAAkC,6BAAA,KAAK,EAAO;AAAA,IAClD,SAAA,EAAW,4BAAA,WAAK,EAAa,wBAAA,CAAO,SAAA,EAAW,SAAS,CAAA;AAAA,IACxD,KAAA,EAAO;AAAA,MACL,KAAA;AAAA,MACA;AAAA,IACF,CAAA;AAAA,IACA,QAAA,EAAU,kBAAA,EAAoB,iBAAA,CAAkB,EAAA,EAAI,sBAAA,aAAG,EAAe,gBAAgB;AAAA,EACxF,CAAC,CAAA;AAGD,EAAA,MAAM,aAAA,EAAe,g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projects/js-packages/charts/dist/chunk-D2UH4CFE.cjs","sourcesContent":[null,"/**\n * External dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport clsx from 'clsx';\nimport { useContext, useMemo } from 'react';\nimport { Chart } from 'react-google-charts';\n/**\n * Internal dependencies\n */\nimport { GlobalChartsContext, GlobalChartsProvider, useGlobalChartsContext } from '../../providers';\nimport { lightenHexColor, normalizeColorToHex } from '../../utils/color-utils';\nimport { resolveCssVariable } from '../../utils/resolve-css-var';\nimport { withResponsive } from '../private/with-responsive';\nimport styles from './geo-chart.module.scss';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DEFAULT_FEATURE_FILL_COLOR = '#ffffff';\nconst DEFAULT_BACKGROUND_COLOR = '#ffffff';\n\n/**\n * Renders a geographical chart using Google Charts GeoChart to visualize data.\n *\n * Supports the full Google Charts data format including custom tooltips, formatted values,\n * and multiple data columns for maximum flexibility.\n *\n * Locations can be identified by full name (e.g., 'United States', 'California') or codes\n * (e.g., 'US', 'US-CA'). Full names are recommended for better readability in tooltips.\n *\n * @param props - The props for the GeoChart component\n * @param props.data - Data in Google Charts format (array of arrays with headers)\n * @param props.width - Width of the chart in pixels\n * @param props.height - Height of the chart in pixels\n * @param props.region - Region to display ('world', 'US', or ISO 3166-1 alpha-2 code)\n * @param props.resolution - Resolution level ('countries', 'provinces', or 'metros')\n * @param props.className - Additional CSS class name for the chart container\n * @param props.renderPlaceholder - Optional render function for the loading placeholder\n * @return A React component displaying an interactive map with data visualization\n */\nconst GeoChartInternal = ({\n className,\n data,\n width,\n height,\n region = 'world',\n resolution = 'countries',\n renderPlaceholder\n}) => {\n const {\n getElementStyles,\n theme: {\n geoChart: {\n featureFillColor\n },\n backgroundColor\n }\n } = useGlobalChartsContext();\n\n // Render loading placeholder\n const loadingPlaceholder = /*#__PURE__*/_jsx(\"div\", {\n className: clsx('geo-chart', styles.container, className),\n style: {\n width,\n height\n },\n children: renderPlaceholder ? renderPlaceholder() : __('Loading map', 'jetpack-charts')\n });\n\n // Google charts doesn't accept CSS variables, so we need to convert them to hex colors\n const fullColorHex = getElementStyles({\n index: 0\n }).color;\n const lightColorHex = lightenHexColor(fullColorHex, 0.8);\n // Use normalizeColorToHex to ensure HSL/RGB values from CSS variables are converted to hex\n const backgroundColorHex = normalizeColorToHex(backgroundColor, null, resolveCssVariable) || DEFAULT_BACKGROUND_COLOR;\n const defaultFillColorHex = normalizeColorToHex(featureFillColor, null, resolveCssVariable) || DEFAULT_FEATURE_FILL_COLOR;\n\n // Check if data has HTML tooltips (column with role: 'tooltip' and p.html: true)\n const hasHtmlTooltips = useMemo(() => data.length > 0 && data[0].some(col => typeof col === 'object' && col !== null && 'role' in col && col.role === 'tooltip' && 'p' in col && typeof col.p === 'object' && col.p !== null && 'html' in col.p && col.p.html === true), [data]);\n const options = useMemo(() => ({\n ...(region !== 'world' && {\n region\n }),\n ...(resolution !== 'countries' && {\n resolution\n }),\n colorAxis: {\n colors: [lightColorHex, fullColorHex]\n },\n backgroundColor: backgroundColorHex,\n datalessRegionColor: defaultFillColorHex,\n defaultColor: defaultFillColorHex,\n tooltip: {\n trigger: 'focus',\n isHtml: hasHtmlTooltips\n },\n legend: 'none',\n keepAspectRatio: true\n }), [region, resolution, lightColorHex, fullColorHex, backgroundColorHex, defaultFillColorHex, hasHtmlTooltips]);\n return /*#__PURE__*/_jsx(\"div\", {\n className: clsx('geo-chart', styles.container, className),\n style: {\n width,\n height,\n backgroundColor\n },\n children: /*#__PURE__*/_jsx(Chart, {\n chartType: \"GeoChart\",\n width: width,\n height: height,\n data: data,\n options: options,\n loader: loadingPlaceholder\n })\n });\n};\nconst GeoChartWithProvider = props => {\n const existingContext = useContext(GlobalChartsContext);\n\n // If we're already in a GlobalChartsProvider context, don't create a new one\n if (existingContext) {\n return /*#__PURE__*/_jsx(GeoChartInternal, {\n ...props\n });\n }\n\n // Otherwise, create our own GlobalChartsProvider\n return /*#__PURE__*/_jsx(GlobalChartsProvider, {\n children: /*#__PURE__*/_jsx(GeoChartInternal, {\n ...props\n })\n });\n};\nGeoChartWithProvider.displayName = 'GeoChart';\nconst GeoChartResponsive = withResponsive(GeoChartWithProvider);\nexport { GeoChartResponsive as default, GeoChartWithProvider as GeoChartUnresponsive };","import 'css-chunk:src/charts/geo-chart/geo-chart.module.scss';export default {\n \"container\": \"a8ccharts-JvcqOz\"\n};"]}
|