@automattic/charts 0.56.2 → 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 +14 -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 +7 -4
- 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,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartChildren
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6CCZL2JJ.js";
|
|
4
4
|
import {
|
|
5
5
|
Children,
|
|
6
6
|
Fragment,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-SEKPIG5K.js";
|
|
20
20
|
import {
|
|
21
21
|
withResponsive
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TYIH5LMV.js";
|
|
23
23
|
import {
|
|
24
24
|
GlobalChartsContext,
|
|
25
25
|
GlobalChartsProvider,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
useGlobalChartsContext,
|
|
31
31
|
useGlobalChartsTheme,
|
|
32
32
|
usePrefersReducedMotion
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-AWNCAKZY.js";
|
|
34
34
|
import {
|
|
35
35
|
attachSubComponents,
|
|
36
36
|
formatMetricValue
|
|
@@ -223,7 +223,7 @@ var require_react_is_development = __commonJS({
|
|
|
223
223
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
224
224
|
var Element = REACT_ELEMENT_TYPE;
|
|
225
225
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
226
|
-
var
|
|
226
|
+
var Fragment5 = REACT_FRAGMENT_TYPE;
|
|
227
227
|
var Lazy = REACT_LAZY_TYPE;
|
|
228
228
|
var Memo = REACT_MEMO_TYPE;
|
|
229
229
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -282,7 +282,7 @@ var require_react_is_development = __commonJS({
|
|
|
282
282
|
exports.ContextProvider = ContextProvider;
|
|
283
283
|
exports.Element = Element;
|
|
284
284
|
exports.ForwardRef = ForwardRef;
|
|
285
|
-
exports.Fragment =
|
|
285
|
+
exports.Fragment = Fragment5;
|
|
286
286
|
exports.Lazy = Lazy;
|
|
287
287
|
exports.Memo = Memo;
|
|
288
288
|
exports.Portal = Portal;
|
|
@@ -2312,10 +2312,10 @@ var jsx = function jsx2(type, props) {
|
|
|
2312
2312
|
}
|
|
2313
2313
|
return React3.createElement.apply(null, createElementArgArray);
|
|
2314
2314
|
};
|
|
2315
|
-
(function(
|
|
2315
|
+
(function(_jsx9) {
|
|
2316
2316
|
var JSX;
|
|
2317
2317
|
/* @__PURE__ */ (function(_JSX) {
|
|
2318
|
-
})(JSX || (JSX =
|
|
2318
|
+
})(JSX || (JSX = _jsx9.JSX || (_jsx9.JSX = {})));
|
|
2319
2319
|
})(jsx || (jsx = {}));
|
|
2320
2320
|
function css() {
|
|
2321
2321
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -4254,7 +4254,7 @@ var leaderboard_chart_module_default = {
|
|
|
4254
4254
|
};
|
|
4255
4255
|
|
|
4256
4256
|
// src/charts/leaderboard-chart/leaderboard-chart.tsx
|
|
4257
|
-
import {
|
|
4257
|
+
import { jsx as _jsx8, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4258
4258
|
var defaultValueFormatter = (value) => {
|
|
4259
4259
|
return formatMetricValue(value, "number", {
|
|
4260
4260
|
useMultipliers: true,
|
|
@@ -4267,7 +4267,14 @@ var defaultDeltaFormatter = (value) => {
|
|
|
4267
4267
|
signDisplay: "exceptZero"
|
|
4268
4268
|
});
|
|
4269
4269
|
};
|
|
4270
|
-
var BarLabel = ({
|
|
4270
|
+
var BarLabel = ({
|
|
4271
|
+
label
|
|
4272
|
+
}) => /* @__PURE__ */ _jsx8(_Fragment, {
|
|
4273
|
+
children: typeof label === "string" ? /* @__PURE__ */ _jsx8(component_default4, {
|
|
4274
|
+
className: leaderboard_chart_module_default.label,
|
|
4275
|
+
children: label
|
|
4276
|
+
}) : label
|
|
4277
|
+
});
|
|
4271
4278
|
var BarWithLabel = ({
|
|
4272
4279
|
entry,
|
|
4273
4280
|
withComparison,
|
|
@@ -4277,41 +4284,30 @@ var BarWithLabel = ({
|
|
|
4277
4284
|
animation,
|
|
4278
4285
|
isPrimaryVisible = true,
|
|
4279
4286
|
isComparisonVisible = true
|
|
4280
|
-
}) => /* @__PURE__ */
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4287
|
+
}) => /* @__PURE__ */ _jsxs("div", {
|
|
4288
|
+
className: clsx(leaderboard_chart_module_default.barWithLabelContainer, {
|
|
4289
|
+
[leaderboard_chart_module_default["is-overlay"]]: withOverlayLabel
|
|
4290
|
+
}),
|
|
4291
|
+
children: [/* @__PURE__ */ _jsx8(BarLabel, {
|
|
4292
|
+
label: entry.label
|
|
4293
|
+
}), isPrimaryVisible && /* @__PURE__ */ _jsx8("div", {
|
|
4294
|
+
className: clsx(leaderboard_chart_module_default.bar, {
|
|
4295
|
+
[leaderboard_chart_module_default["bar--animated"]]: animation
|
|
4285
4296
|
}),
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
withComparison && !withOverlayLabel && isComparisonVisible && /* @__PURE__ */ jsx3(
|
|
4301
|
-
"div",
|
|
4302
|
-
{
|
|
4303
|
-
className: clsx(leaderboard_chart_module_default.bar, {
|
|
4304
|
-
[leaderboard_chart_module_default["bar--animated"]]: animation
|
|
4305
|
-
}),
|
|
4306
|
-
style: {
|
|
4307
|
-
width: entry.previousShare + "%",
|
|
4308
|
-
backgroundColor: secondaryColor
|
|
4309
|
-
}
|
|
4310
|
-
}
|
|
4311
|
-
)
|
|
4312
|
-
]
|
|
4313
|
-
}
|
|
4314
|
-
);
|
|
4297
|
+
style: {
|
|
4298
|
+
width: entry.currentShare + "%",
|
|
4299
|
+
backgroundColor: primaryColor
|
|
4300
|
+
}
|
|
4301
|
+
}), withComparison && !withOverlayLabel && isComparisonVisible && /* @__PURE__ */ _jsx8("div", {
|
|
4302
|
+
className: clsx(leaderboard_chart_module_default.bar, {
|
|
4303
|
+
[leaderboard_chart_module_default["bar--animated"]]: animation
|
|
4304
|
+
}),
|
|
4305
|
+
style: {
|
|
4306
|
+
width: entry.previousShare + "%",
|
|
4307
|
+
backgroundColor: secondaryColor
|
|
4308
|
+
}
|
|
4309
|
+
})]
|
|
4310
|
+
});
|
|
4315
4311
|
var LeaderboardChartInternal = ({
|
|
4316
4312
|
data,
|
|
4317
4313
|
chartId: providedChartId,
|
|
@@ -4337,8 +4333,12 @@ var LeaderboardChartInternal = ({
|
|
|
4337
4333
|
children
|
|
4338
4334
|
}) => {
|
|
4339
4335
|
const chartId = useChartId(providedChartId);
|
|
4340
|
-
const {
|
|
4341
|
-
|
|
4336
|
+
const {
|
|
4337
|
+
leaderboardChart: leaderboardChartSettings
|
|
4338
|
+
} = useGlobalChartsTheme();
|
|
4339
|
+
const {
|
|
4340
|
+
otherChildren
|
|
4341
|
+
} = useChartChildren(children, "LeaderboardChart");
|
|
4342
4342
|
const {
|
|
4343
4343
|
labelSpacing,
|
|
4344
4344
|
rowGap,
|
|
@@ -4347,12 +4347,19 @@ var LeaderboardChartInternal = ({
|
|
|
4347
4347
|
secondaryColor: settingsSecondaryColor,
|
|
4348
4348
|
deltaColors
|
|
4349
4349
|
} = leaderboardChartSettings;
|
|
4350
|
-
const {
|
|
4351
|
-
|
|
4350
|
+
const {
|
|
4351
|
+
getElementStyles,
|
|
4352
|
+
isSeriesVisible
|
|
4353
|
+
} = useGlobalChartsContext();
|
|
4354
|
+
const {
|
|
4355
|
+
color: resolvedPrimaryColor
|
|
4356
|
+
} = getElementStyles({
|
|
4352
4357
|
index: 0,
|
|
4353
4358
|
overrideColor: primaryColor || settingsPrimaryColor
|
|
4354
4359
|
});
|
|
4355
|
-
const {
|
|
4360
|
+
const {
|
|
4361
|
+
color: resolvedSecondaryColor
|
|
4362
|
+
} = getElementStyles({
|
|
4356
4363
|
index: 1,
|
|
4357
4364
|
overrideColor: secondaryColor || settingsSecondaryColor
|
|
4358
4365
|
});
|
|
@@ -4382,21 +4389,12 @@ var LeaderboardChartInternal = ({
|
|
|
4382
4389
|
return !isPrimaryVisible && !isComparisonVisible;
|
|
4383
4390
|
}
|
|
4384
4391
|
return !isPrimaryVisible;
|
|
4385
|
-
}, [
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
isComparisonVisible,
|
|
4392
|
+
}, [legendInteractive, isPrimaryVisible, isComparisonVisible, withComparison, withOverlayLabel]);
|
|
4393
|
+
const isDataValid = Boolean(data && data.length > 0);
|
|
4394
|
+
const chartMetadata = useMemo3(() => ({
|
|
4389
4395
|
withComparison,
|
|
4390
4396
|
withOverlayLabel
|
|
4391
|
-
]);
|
|
4392
|
-
const isDataValid = Boolean(data && data.length > 0);
|
|
4393
|
-
const chartMetadata = useMemo3(
|
|
4394
|
-
() => ({
|
|
4395
|
-
withComparison,
|
|
4396
|
-
withOverlayLabel
|
|
4397
|
-
}),
|
|
4398
|
-
[withComparison, withOverlayLabel]
|
|
4399
|
-
);
|
|
4397
|
+
}), [withComparison, withOverlayLabel]);
|
|
4400
4398
|
useChartRegistration({
|
|
4401
4399
|
chartId,
|
|
4402
4400
|
legendItems,
|
|
@@ -4406,124 +4404,110 @@ var LeaderboardChartInternal = ({
|
|
|
4406
4404
|
});
|
|
4407
4405
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
4408
4406
|
if (!data || data.length === 0) {
|
|
4409
|
-
return /* @__PURE__ */
|
|
4410
|
-
SingleChartContext.Provider,
|
|
4411
|
-
{
|
|
4412
|
-
value: {
|
|
4413
|
-
chartId,
|
|
4414
|
-
chartWidth: 0,
|
|
4415
|
-
// LeaderboardChart doesn't need specific dimensions
|
|
4416
|
-
chartHeight: 0
|
|
4417
|
-
},
|
|
4418
|
-
children: /* @__PURE__ */ jsxs(
|
|
4419
|
-
"div",
|
|
4420
|
-
{
|
|
4421
|
-
className: clsx(
|
|
4422
|
-
leaderboard_chart_module_default.leaderboardChart,
|
|
4423
|
-
{ [leaderboard_chart_module_default["leaderboardChart--loading"]]: loading },
|
|
4424
|
-
className
|
|
4425
|
-
),
|
|
4426
|
-
style,
|
|
4427
|
-
children: [
|
|
4428
|
-
/* @__PURE__ */ jsx3("div", { className: leaderboard_chart_module_default.emptyState, children: loading ? __2("Loading\u2026", "jetpack-charts") : __2("No data available", "jetpack-charts") }),
|
|
4429
|
-
otherChildren
|
|
4430
|
-
]
|
|
4431
|
-
}
|
|
4432
|
-
)
|
|
4433
|
-
}
|
|
4434
|
-
);
|
|
4435
|
-
}
|
|
4436
|
-
return /* @__PURE__ */ jsx3(
|
|
4437
|
-
SingleChartContext.Provider,
|
|
4438
|
-
{
|
|
4407
|
+
return /* @__PURE__ */ _jsx8(SingleChartContext.Provider, {
|
|
4439
4408
|
value: {
|
|
4440
4409
|
chartId,
|
|
4441
4410
|
chartWidth: 0,
|
|
4442
4411
|
// LeaderboardChart doesn't need specific dimensions
|
|
4443
4412
|
chartHeight: 0
|
|
4444
4413
|
},
|
|
4445
|
-
children: /* @__PURE__ */
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4414
|
+
children: /* @__PURE__ */ _jsxs("div", {
|
|
4415
|
+
className: clsx(leaderboard_chart_module_default.leaderboardChart, {
|
|
4416
|
+
[leaderboard_chart_module_default["leaderboardChart--loading"]]: loading
|
|
4417
|
+
}, className),
|
|
4418
|
+
style,
|
|
4419
|
+
children: [/* @__PURE__ */ _jsx8("div", {
|
|
4420
|
+
className: leaderboard_chart_module_default.emptyState,
|
|
4421
|
+
children: loading ? __2("Loading\u2026", "jetpack-charts") : __2("No data available", "jetpack-charts")
|
|
4422
|
+
}), otherChildren]
|
|
4423
|
+
})
|
|
4424
|
+
});
|
|
4425
|
+
}
|
|
4426
|
+
return /* @__PURE__ */ _jsx8(SingleChartContext.Provider, {
|
|
4427
|
+
value: {
|
|
4428
|
+
chartId,
|
|
4429
|
+
chartWidth: 0,
|
|
4430
|
+
// LeaderboardChart doesn't need specific dimensions
|
|
4431
|
+
chartHeight: 0
|
|
4432
|
+
},
|
|
4433
|
+
children: /* @__PURE__ */ _jsxs("div", {
|
|
4434
|
+
className: clsx(leaderboard_chart_module_default.leaderboardChart, {
|
|
4435
|
+
[leaderboard_chart_module_default["leaderboardChart--loading"]]: loading,
|
|
4436
|
+
[leaderboard_chart_module_default["leaderboardChart--with-legend"]]: showLegend,
|
|
4437
|
+
[leaderboard_chart_module_default["leaderboardChart--legend-top"]]: showLegend && legendPosition === "top"
|
|
4438
|
+
}, className),
|
|
4439
|
+
style,
|
|
4440
|
+
children: [allSeriesHidden ? /* @__PURE__ */ _jsx8("div", {
|
|
4441
|
+
className: leaderboard_chart_module_default.emptyState,
|
|
4442
|
+
children: __2("All series are hidden. Click legend items to show data.", "jetpack-charts")
|
|
4443
|
+
}) : /* @__PURE__ */ _jsx8(component_default6, {
|
|
4444
|
+
templateColumns: "minmax(0, 1fr) auto",
|
|
4445
|
+
rowGap,
|
|
4446
|
+
columnGap,
|
|
4447
|
+
children: data.map((entry) => {
|
|
4448
|
+
const colorIndex = Math.sign(entry.delta) + 1;
|
|
4449
|
+
const deltaColor = deltaColors[colorIndex];
|
|
4450
|
+
return /* @__PURE__ */ _jsxs(Fragment, {
|
|
4451
|
+
children: [/* @__PURE__ */ _jsx8(component_default5, {
|
|
4452
|
+
spacing: labelSpacing,
|
|
4453
|
+
children: /* @__PURE__ */ _jsx8(BarWithLabel, {
|
|
4454
|
+
entry,
|
|
4455
|
+
withComparison,
|
|
4456
|
+
withOverlayLabel,
|
|
4457
|
+
primaryColor: resolvedPrimaryColor,
|
|
4458
|
+
secondaryColor: resolvedSecondaryColor,
|
|
4459
|
+
isPrimaryVisible,
|
|
4460
|
+
isComparisonVisible,
|
|
4461
|
+
animation: animation && !loading && !prefersReducedMotion
|
|
4462
|
+
})
|
|
4463
|
+
}), /* @__PURE__ */ _jsxs("div", {
|
|
4464
|
+
className: clsx(leaderboard_chart_module_default.valueContainer, {
|
|
4465
|
+
[leaderboard_chart_module_default.overlayLabel]: withOverlayLabel
|
|
4466
|
+
}),
|
|
4467
|
+
children: [isPrimaryVisible && /* @__PURE__ */ _jsx8(component_default4, {
|
|
4468
|
+
children: valueFormatter(entry.currentValue)
|
|
4469
|
+
}), withComparison && isComparisonVisible && /* @__PURE__ */ _jsx8(component_default4, {
|
|
4470
|
+
style: {
|
|
4471
|
+
color: deltaColor
|
|
4472
|
+
},
|
|
4473
|
+
children: deltaFormatter(entry.delta)
|
|
4474
|
+
})]
|
|
4475
|
+
})]
|
|
4476
|
+
}, entry.id);
|
|
4477
|
+
})
|
|
4478
|
+
}), showLegend && /* @__PURE__ */ _jsx8(Legend, {
|
|
4479
|
+
orientation: legendOrientation,
|
|
4480
|
+
position: legendPosition,
|
|
4481
|
+
alignment: legendAlignment,
|
|
4482
|
+
shape: legendShape,
|
|
4483
|
+
shapeWidth: legendShapeWidth,
|
|
4484
|
+
shapeHeight: legendShapeHeight,
|
|
4485
|
+
chartId,
|
|
4486
|
+
interactive: legendInteractive
|
|
4487
|
+
}), otherChildren]
|
|
4488
|
+
})
|
|
4489
|
+
});
|
|
4509
4490
|
};
|
|
4510
4491
|
var LeaderboardChartWithProvider = (props) => {
|
|
4511
4492
|
const existingContext = useContext6(GlobalChartsContext);
|
|
4512
4493
|
if (existingContext) {
|
|
4513
|
-
return /* @__PURE__ */
|
|
4494
|
+
return /* @__PURE__ */ _jsx8(LeaderboardChartInternal, {
|
|
4495
|
+
...props
|
|
4496
|
+
});
|
|
4514
4497
|
}
|
|
4515
|
-
return /* @__PURE__ */
|
|
4498
|
+
return /* @__PURE__ */ _jsx8(GlobalChartsProvider, {
|
|
4499
|
+
children: /* @__PURE__ */ _jsx8(LeaderboardChartInternal, {
|
|
4500
|
+
...props
|
|
4501
|
+
})
|
|
4502
|
+
});
|
|
4516
4503
|
};
|
|
4517
4504
|
LeaderboardChartWithProvider.displayName = "LeaderboardChart";
|
|
4518
4505
|
var LeaderboardChart = attachSubComponents(LeaderboardChartWithProvider, {
|
|
4519
4506
|
Legend
|
|
4520
4507
|
});
|
|
4521
|
-
var LeaderboardChartResponsive = attachSubComponents(
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
Legend
|
|
4525
|
-
}
|
|
4526
|
-
);
|
|
4508
|
+
var LeaderboardChartResponsive = attachSubComponents(withResponsive(LeaderboardChartWithProvider), {
|
|
4509
|
+
Legend
|
|
4510
|
+
});
|
|
4527
4511
|
|
|
4528
4512
|
export {
|
|
4529
4513
|
useLeaderboardLegendItems,
|
|
@@ -4560,4 +4544,4 @@ is-plain-object/dist/is-plain-object.mjs:
|
|
|
4560
4544
|
* Released under the MIT License.
|
|
4561
4545
|
*)
|
|
4562
4546
|
*/
|
|
4563
|
-
//# sourceMappingURL=chunk-
|
|
4547
|
+
//# sourceMappingURL=chunk-PGJAZN2H.js.map
|