@automattic/charts 0.56.7 → 0.57.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/AGENTS.md +28 -98
- package/CHANGELOG.md +16 -0
- package/dist/charts/bar-chart/index.cjs +5 -6
- package/dist/charts/bar-chart/index.cjs.map +1 -1
- package/dist/charts/bar-chart/index.d.cts +3 -3
- package/dist/charts/bar-chart/index.d.ts +3 -3
- package/dist/charts/bar-chart/index.js +4 -5
- package/dist/charts/bar-list-chart/index.cjs +6 -7
- package/dist/charts/bar-list-chart/index.cjs.map +1 -1
- package/dist/charts/bar-list-chart/index.d.cts +3 -3
- package/dist/charts/bar-list-chart/index.d.ts +3 -3
- package/dist/charts/bar-list-chart/index.js +5 -6
- package/dist/charts/conversion-funnel-chart/index.cjs +5 -6
- package/dist/charts/conversion-funnel-chart/index.cjs.map +1 -1
- package/dist/charts/conversion-funnel-chart/index.d.cts +1 -1
- package/dist/charts/conversion-funnel-chart/index.d.ts +1 -1
- package/dist/charts/conversion-funnel-chart/index.js +4 -5
- package/dist/charts/geo-chart/index.cjs +4 -4
- package/dist/charts/geo-chart/index.d.cts +1 -1
- package/dist/charts/geo-chart/index.d.ts +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 +8 -9
- package/dist/charts/leaderboard-chart/index.css.map +1 -1
- package/dist/charts/leaderboard-chart/index.d.cts +3 -3
- package/dist/charts/leaderboard-chart/index.d.ts +3 -3
- package/dist/charts/leaderboard-chart/index.js +4 -4
- package/dist/charts/line-chart/index.cjs +5 -6
- package/dist/charts/line-chart/index.cjs.map +1 -1
- package/dist/charts/line-chart/index.d.cts +3 -3
- package/dist/charts/line-chart/index.d.ts +3 -3
- package/dist/charts/line-chart/index.js +4 -5
- package/dist/charts/pie-chart/index.cjs +5 -6
- package/dist/charts/pie-chart/index.cjs.map +1 -1
- package/dist/charts/pie-chart/index.d.cts +4 -4
- package/dist/charts/pie-chart/index.d.ts +4 -4
- package/dist/charts/pie-chart/index.js +4 -5
- package/dist/charts/pie-semi-circle-chart/index.cjs +5 -6
- package/dist/charts/pie-semi-circle-chart/index.cjs.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.d.cts +4 -4
- package/dist/charts/pie-semi-circle-chart/index.d.ts +4 -4
- package/dist/charts/pie-semi-circle-chart/index.js +4 -5
- package/dist/charts/sparkline/index.cjs +6 -7
- package/dist/charts/sparkline/index.cjs.map +1 -1
- package/dist/charts/sparkline/index.js +5 -6
- package/dist/{chunk-XD2HV7M5.js → chunk-2NCY7R4G.js} +127 -762
- package/dist/chunk-2NCY7R4G.js.map +1 -0
- package/dist/{chunk-RFSHE3HL.js → chunk-32DH6JDF.js} +64 -43
- package/dist/chunk-32DH6JDF.js.map +1 -0
- package/dist/{chunk-SSFFCBCF.js → chunk-4OPFE4RM.js} +11 -8
- package/dist/chunk-4OPFE4RM.js.map +1 -0
- package/dist/{chunk-CAFJRZPZ.cjs → chunk-77OKCVQN.cjs} +17 -17
- package/dist/{chunk-CAFJRZPZ.cjs.map → chunk-77OKCVQN.cjs.map} +1 -1
- package/dist/{chunk-K6TGILHX.cjs → chunk-7FQX4ALL.cjs} +6 -6
- package/dist/{chunk-K6TGILHX.cjs.map → chunk-7FQX4ALL.cjs.map} +1 -1
- package/dist/{chunk-7FDQGBY7.js → chunk-BCX5THDQ.js} +9 -7
- package/dist/chunk-BCX5THDQ.js.map +1 -0
- package/dist/{chunk-KHQPN77E.js → chunk-CZGYJKG6.js} +4 -4
- package/dist/{chunk-3EXJP67N.cjs → chunk-D2UH4CFE.cjs} +9 -9
- package/dist/{chunk-3EXJP67N.cjs.map → chunk-D2UH4CFE.cjs.map} +1 -1
- package/dist/{chunk-TE63Y5PX.js → chunk-DAU3HNEG.js} +2 -2
- package/dist/chunk-DAU3HNEG.js.map +1 -0
- package/dist/{chunk-MDRCAGKZ.js → chunk-H2V4JMSA.js} +3 -3
- package/dist/{chunk-UFRBUT2D.cjs → chunk-I35UYJJR.cjs} +49 -6
- package/dist/chunk-I35UYJJR.cjs.map +1 -0
- package/dist/{chunk-GWBS65VC.js → chunk-IU4DYUAV.js} +3 -3
- package/dist/{chunk-E62LCBGD.js → chunk-PXLEMUGJ.js} +3 -3
- package/dist/{chunk-YDVHT7GS.cjs → chunk-RHHVEJHJ.cjs} +83 -62
- package/dist/chunk-RHHVEJHJ.cjs.map +1 -0
- package/dist/{chunk-YAXY5L7I.cjs → chunk-TO3OQBXG.cjs} +5 -5
- package/dist/{chunk-YAXY5L7I.cjs.map → chunk-TO3OQBXG.cjs.map} +1 -1
- package/dist/{chunk-VPAEBI2F.js → chunk-V36ERY7Y.js} +9 -7
- package/dist/chunk-V36ERY7Y.js.map +1 -0
- package/dist/{chunk-X7JL2NYJ.cjs → chunk-VJM5XCB4.cjs} +33 -30
- package/dist/chunk-VJM5XCB4.cjs.map +1 -0
- package/dist/{chunk-ZVGEDXDP.cjs → chunk-VTS3PNMS.cjs} +2 -2
- package/dist/{chunk-ZVGEDXDP.cjs.map → chunk-VTS3PNMS.cjs.map} +1 -1
- package/dist/{chunk-OMS5QIJN.js → chunk-WLODYNLB.js} +9 -7
- package/dist/chunk-WLODYNLB.js.map +1 -0
- package/dist/{chunk-NQJE2CC7.cjs → chunk-XKRJL2QT.cjs} +25 -23
- package/dist/chunk-XKRJL2QT.cjs.map +1 -0
- package/dist/{chunk-O2JIANHK.cjs → chunk-YE2T52VZ.cjs} +33 -31
- package/dist/chunk-YE2T52VZ.cjs.map +1 -0
- package/dist/{chunk-IS5YYLTV.js → chunk-Z26M4V2M.js} +46 -3
- package/dist/chunk-Z26M4V2M.js.map +1 -0
- package/dist/{chunk-55ZCOYDF.cjs → chunk-Z45KX47P.cjs} +153 -788
- package/dist/chunk-Z45KX47P.cjs.map +1 -0
- package/dist/{chunk-BXFD7JIG.cjs → chunk-ZH4F5RMG.cjs} +26 -24
- package/dist/chunk-ZH4F5RMG.cjs.map +1 -0
- package/dist/components/legend/index.cjs +3 -3
- package/dist/components/legend/index.d.cts +4 -4
- package/dist/components/legend/index.d.ts +4 -4
- package/dist/components/legend/index.js +2 -2
- package/dist/components/tooltip/index.d.cts +1 -1
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/hooks/index.cjs +3 -3
- package/dist/hooks/index.d.cts +7 -3
- package/dist/hooks/index.d.ts +7 -3
- package/dist/hooks/index.js +2 -2
- package/dist/index.cjs +13 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +8 -9
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +12 -13
- package/dist/{leaderboard-chart-BSgEw_Um.d.ts → leaderboard-chart-BKYYXcg2.d.ts} +5 -9
- package/dist/{leaderboard-chart-COtgamhe.d.cts → leaderboard-chart-DR7CGb0L.d.cts} +5 -9
- package/dist/{legend-C9ahiwOt.d.cts → legend-C2grwnWk.d.cts} +1 -1
- package/dist/{legend-jjMmhSg3.d.ts → legend-Cj0xM5dU.d.ts} +1 -1
- package/dist/providers/index.cjs +3 -3
- package/dist/providers/index.d.cts +3 -3
- package/dist/providers/index.d.ts +3 -3
- package/dist/providers/index.js +2 -2
- package/dist/{themes-DQzmaSze.d.ts → themes-BmVGrYnF.d.ts} +2 -2
- package/dist/{themes-CVR5rmIs.d.cts → themes-CyjKm-P_.d.cts} +2 -2
- package/dist/{types-DQNnq5Fr.d.ts → types-CuUEszrM.d.ts} +1 -1
- package/dist/{types-CzdN7rUe.d.cts → types-DZordNiO.d.cts} +11 -7
- package/dist/{types-CzdN7rUe.d.ts → types-DZordNiO.d.ts} +11 -7
- package/dist/types-I67mddpr.d.cts +78 -0
- package/dist/types-I67mddpr.d.ts +78 -0
- package/dist/{types-BBwg4Evw.d.cts → types-KtOPPzPX.d.cts} +1 -1
- package/dist/utils/index.cjs +2 -2
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +6 -4
- package/src/charts/bar-chart/bar-chart.tsx +4 -3
- package/src/charts/bar-chart/test/bar-chart.test.tsx +30 -0
- package/src/charts/conversion-funnel-chart/test/conversion-funnel-chart.test.tsx +2 -2
- package/src/charts/leaderboard-chart/hooks/use-leaderboard-legend-items.ts +0 -2
- package/src/charts/leaderboard-chart/leaderboard-chart.module.scss +9 -10
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +95 -70
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +58 -29
- package/src/charts/leaderboard-chart/test/use-leaderboard-legend-items.test.tsx +2 -5
- package/src/charts/leaderboard-chart/types.ts +4 -7
- package/src/charts/line-chart/line-chart.tsx +2 -3
- package/src/charts/pie-chart/pie-chart.tsx +2 -3
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +2 -3
- package/src/components/legend/index.ts +8 -1
- package/src/components/legend/private/base-legend.tsx +32 -22
- package/src/components/legend/test/legend.test.tsx +148 -52
- package/src/components/legend/types.ts +42 -16
- package/src/hooks/test/use-zero-value-display.test.tsx +206 -0
- package/src/hooks/use-zero-value-display.ts +52 -23
- package/src/index.ts +7 -1
- package/src/providers/chart-context/test/chart-context.test.tsx +12 -6
- package/src/providers/chart-context/themes.ts +6 -4
- package/src/types.ts +11 -7
- package/src/utils/get-styles.ts +1 -1
- package/src/utils/test/get-styles.test.ts +12 -10
- package/dist/chunk-55ZCOYDF.cjs.map +0 -1
- package/dist/chunk-7FDQGBY7.js.map +0 -1
- package/dist/chunk-BXFD7JIG.cjs.map +0 -1
- package/dist/chunk-IS5YYLTV.js.map +0 -1
- package/dist/chunk-KNIMXN6Z.js +0 -51
- package/dist/chunk-KNIMXN6Z.js.map +0 -1
- package/dist/chunk-NQJE2CC7.cjs.map +0 -1
- package/dist/chunk-O2JIANHK.cjs.map +0 -1
- package/dist/chunk-OMS5QIJN.js.map +0 -1
- package/dist/chunk-RFSHE3HL.js.map +0 -1
- package/dist/chunk-SSFFCBCF.js.map +0 -1
- package/dist/chunk-SUDERBUA.cjs +0 -51
- package/dist/chunk-SUDERBUA.cjs.map +0 -1
- package/dist/chunk-TE63Y5PX.js.map +0 -1
- package/dist/chunk-UFRBUT2D.cjs.map +0 -1
- package/dist/chunk-VPAEBI2F.js.map +0 -1
- package/dist/chunk-X7JL2NYJ.cjs.map +0 -1
- package/dist/chunk-XD2HV7M5.js.map +0 -1
- package/dist/chunk-YDVHT7GS.cjs.map +0 -1
- package/dist/types-C05PdDJa.d.cts +0 -57
- package/dist/types-C05PdDJa.d.ts +0 -57
- /package/dist/{chunk-KHQPN77E.js.map → chunk-CZGYJKG6.js.map} +0 -0
- /package/dist/{chunk-MDRCAGKZ.js.map → chunk-H2V4JMSA.js.map} +0 -0
- /package/dist/{chunk-GWBS65VC.js.map → chunk-IU4DYUAV.js.map} +0 -0
- /package/dist/{chunk-E62LCBGD.js.map → chunk-PXLEMUGJ.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { BarChart, BarChartUnresponsive } from './charts/bar-chart/index.js';
|
|
2
2
|
export { BarListChart, BarListChartUnresponsive } from './charts/bar-list-chart/index.js';
|
|
3
3
|
export { ConversionFunnelChart } from './charts/conversion-funnel-chart/index.js';
|
|
4
|
-
export { A as AnnotationStyles, B as BaseChartProps, a as ButtonWithPopover, C as ChartTheme, b as CompleteChartTheme, D as DataPoint, c as DataPointDate, d as DataPointPercentage, G as GeoData, e as GradientStop, f as GridProps, L as LeaderboardEntry, M as MultipleDataPointsDate, O as Optional, g as OrientationType, P as PopoverButtonAttributes, h as PopoverElement, i as PopoverElementAttributes, S as ScaleOptions, j as SeriesData, k as SeriesDataOptions, T as ToggleEvent } from './types-
|
|
4
|
+
export { A as AnnotationStyles, B as BaseChartProps, a as ButtonWithPopover, C as ChartTheme, b as CompleteChartTheme, D as DataPoint, c as DataPointDate, d as DataPointPercentage, G as GeoData, e as GradientStop, f as GridProps, L as LeaderboardEntry, M as MultipleDataPointsDate, O as Optional, g as OrientationType, P as PopoverButtonAttributes, h as PopoverElement, i as PopoverElementAttributes, S as ScaleOptions, j as SeriesData, k as SeriesDataOptions, T as ToggleEvent } from './types-DZordNiO.js';
|
|
5
5
|
export { GeoChart, GeoChartProps, GeoChartUnresponsive, GeoRegion, GeoResolution } from './charts/geo-chart/index.js';
|
|
6
|
-
export { L as LeaderboardChart, a as LeaderboardChartUnresponsive } from './leaderboard-chart-
|
|
7
|
-
export {
|
|
8
|
-
export { L as Legend } from './legend-jjMmhSg3.js';
|
|
6
|
+
export { L as LeaderboardChart, a as LeaderboardChartUnresponsive } from './leaderboard-chart-BKYYXcg2.js';
|
|
7
|
+
export { L as Legend } from './legend-Cj0xM5dU.js';
|
|
9
8
|
export { LegendValueDisplay, useChartLegendItems } from './components/legend/index.js';
|
|
10
|
-
export { B as BaseLegendItem } from './types-
|
|
9
|
+
export { B as BaseLegendItem, L as LegendItemStyles, a as LegendLabelStyles, b as LegendShapeStyles } from './types-I67mddpr.js';
|
|
10
|
+
export { EventHandlerParams, GridStyles, LineStyles } from '@visx/xychart';
|
|
11
11
|
export { LineChart, LineChartUnresponsive } from './charts/line-chart/index.js';
|
|
12
12
|
export { RenderTooltipParams } from '@visx/xychart/lib/components/Tooltip';
|
|
13
13
|
export { PieChart, PieChartProps, PieChartRenderTooltipParams, PieChartUnresponsive } from './charts/pie-chart/index.js';
|
|
@@ -15,7 +15,7 @@ export { PieSemiCircleChart, PieSemiCircleChartProps, PieSemiCircleChartRenderTo
|
|
|
15
15
|
export { Sparkline, SparklineUnresponsive } from './charts/sparkline/index.js';
|
|
16
16
|
export { B as BaseTooltip } from './base-tooltip-DOq93wjU.js';
|
|
17
17
|
export { TrendDirection, TrendIndicator, TrendIndicatorProps } from './components/trend-indicator/index.js';
|
|
18
|
-
export { G as GlobalChartsContext, a as GlobalChartsProvider, a as ThemeProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from './themes-
|
|
18
|
+
export { G as GlobalChartsContext, a as GlobalChartsProvider, a as ThemeProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from './themes-BmVGrYnF.js';
|
|
19
19
|
export { GoogleDataTableColumn, GoogleDataTableColumnRoleType, GoogleDataTableRow } from 'react-google-charts';
|
|
20
20
|
import 'react';
|
|
21
21
|
import './with-responsive-CNfhzAUu.js';
|
|
@@ -31,5 +31,5 @@ import '@visx/scale';
|
|
|
31
31
|
import '@visx/text/lib/Text';
|
|
32
32
|
import '@wordpress/theme';
|
|
33
33
|
import '@visx/legend';
|
|
34
|
-
import './types-
|
|
34
|
+
import './types-CuUEszrM.js';
|
|
35
35
|
import '@visx/shape/lib/shapes/Pie';
|
package/dist/index.js
CHANGED
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LeaderboardChart,
|
|
3
3
|
LeaderboardChartResponsive
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2NCY7R4G.js";
|
|
5
5
|
import {
|
|
6
6
|
PieChart,
|
|
7
7
|
PieChartResponsive
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BCX5THDQ.js";
|
|
9
9
|
import "./chunk-NFRB2POF.js";
|
|
10
10
|
import {
|
|
11
11
|
PieSemiCircleChart,
|
|
12
12
|
PieSemiCircleChartResponsive
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-V36ERY7Y.js";
|
|
14
14
|
import "./chunk-KXRWNFQJ.js";
|
|
15
15
|
import "./chunk-6CCZL2JJ.js";
|
|
16
16
|
import {
|
|
17
17
|
Sparkline,
|
|
18
18
|
SparklineUnresponsive
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PXLEMUGJ.js";
|
|
20
20
|
import {
|
|
21
21
|
LineChart,
|
|
22
22
|
LineChartResponsive
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-WLODYNLB.js";
|
|
24
24
|
import {
|
|
25
25
|
TrendIndicator
|
|
26
26
|
} from "./chunk-XWYZIFZW.js";
|
|
27
27
|
import {
|
|
28
28
|
BarListChart,
|
|
29
29
|
BarListChartResponsive
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-H2V4JMSA.js";
|
|
31
31
|
import {
|
|
32
32
|
BarChart,
|
|
33
33
|
BarChartResponsive
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-4OPFE4RM.js";
|
|
35
35
|
import {
|
|
36
36
|
BaseTooltip
|
|
37
37
|
} from "./chunk-BPYKWMI7.js";
|
|
38
38
|
import {
|
|
39
39
|
ConversionFunnelChartWithProvider
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-KNIMXN6Z.js";
|
|
40
|
+
} from "./chunk-CZGYJKG6.js";
|
|
41
|
+
import "./chunk-Z26M4V2M.js";
|
|
43
42
|
import {
|
|
44
43
|
GeoChartResponsive,
|
|
45
44
|
GeoChartWithProvider
|
|
46
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-IU4DYUAV.js";
|
|
47
46
|
import "./chunk-OP6PHB2U.js";
|
|
48
47
|
import {
|
|
49
48
|
GlobalChartsContext,
|
|
@@ -53,8 +52,8 @@ import {
|
|
|
53
52
|
useChartLegendItems,
|
|
54
53
|
useGlobalChartsContext,
|
|
55
54
|
useGlobalChartsTheme
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import "./chunk-
|
|
55
|
+
} from "./chunk-32DH6JDF.js";
|
|
56
|
+
import "./chunk-DAU3HNEG.js";
|
|
58
57
|
import "./chunk-G3PMV62Z.js";
|
|
59
58
|
export {
|
|
60
59
|
BarChartResponsive as BarChart,
|
|
@@ -2,10 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { R as ResponsiveConfig } from './with-responsive-CNfhzAUu.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode, FC } from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import { B as BaseChartProps, L as LeaderboardEntry } from './types-
|
|
5
|
+
import { b as LegendShapeStyles, c as BaseLegendProps, B as BaseLegendItem } from './types-I67mddpr.js';
|
|
6
|
+
import { B as BaseChartProps, L as LeaderboardEntry } from './types-DZordNiO.js';
|
|
7
7
|
|
|
8
|
-
interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'legendInteractive' | 'animation'> {
|
|
8
|
+
interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'gap' | 'legendInteractive' | 'animation'> {
|
|
9
9
|
/**
|
|
10
10
|
* Whether to show comparison data
|
|
11
11
|
*/
|
|
@@ -41,13 +41,9 @@ interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, '
|
|
|
41
41
|
'--a8c--charts--leaderboard--bar--border-radius'?: string;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Styles for legend shapes (width, height, margin).
|
|
45
45
|
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Height of legend shapes in pixels
|
|
49
|
-
*/
|
|
50
|
-
legendShapeHeight?: number;
|
|
46
|
+
legendShapeStyles?: LegendShapeStyles;
|
|
51
47
|
/**
|
|
52
48
|
* Custom labels for legend items
|
|
53
49
|
*/
|
|
@@ -2,10 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { R as ResponsiveConfig } from './with-responsive-CNfhzAUu.cjs';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode, FC } from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import { B as BaseChartProps, L as LeaderboardEntry } from './types-
|
|
5
|
+
import { b as LegendShapeStyles, c as BaseLegendProps, B as BaseLegendItem } from './types-I67mddpr.cjs';
|
|
6
|
+
import { B as BaseChartProps, L as LeaderboardEntry } from './types-DZordNiO.cjs';
|
|
7
7
|
|
|
8
|
-
interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'legendInteractive' | 'animation'> {
|
|
8
|
+
interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'gap' | 'legendInteractive' | 'animation'> {
|
|
9
9
|
/**
|
|
10
10
|
* Whether to show comparison data
|
|
11
11
|
*/
|
|
@@ -41,13 +41,9 @@ interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, '
|
|
|
41
41
|
'--a8c--charts--leaderboard--bar--border-radius'?: string;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Styles for legend shapes (width, height, margin).
|
|
45
45
|
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Height of legend shapes in pixels
|
|
49
|
-
*/
|
|
50
|
-
legendShapeHeight?: number;
|
|
46
|
+
legendShapeStyles?: LegendShapeStyles;
|
|
51
47
|
/**
|
|
52
48
|
* Custom labels for legend items
|
|
53
49
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { c as BaseLegendProps, B as BaseLegendItem } from './types-I67mddpr.cjs';
|
|
3
3
|
|
|
4
4
|
declare const Legend: react.ForwardRefExoticComponent<Omit<BaseLegendProps, "items"> & {
|
|
5
5
|
items?: BaseLegendItem[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { c as BaseLegendProps, B as BaseLegendItem } from './types-I67mddpr.js';
|
|
3
3
|
|
|
4
4
|
declare const Legend: react.ForwardRefExoticComponent<Omit<BaseLegendProps, "items"> & {
|
|
5
5
|
items?: BaseLegendItem[];
|
package/dist/providers/index.cjs
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../chunk-
|
|
9
|
+
var _chunkRHHVEJHJcjs = require('../chunk-RHHVEJHJ.cjs');
|
|
10
|
+
require('../chunk-VTS3PNMS.cjs');
|
|
11
11
|
require('../chunk-EMMSS5I5.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -17,5 +17,5 @@ require('../chunk-EMMSS5I5.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.GlobalChartsContext =
|
|
20
|
+
exports.GlobalChartsContext = _chunkRHHVEJHJcjs.GlobalChartsContext; exports.GlobalChartsProvider = _chunkRHHVEJHJcjs.GlobalChartsProvider; exports.defaultTheme = _chunkRHHVEJHJcjs.defaultTheme; exports.useChartId = _chunkRHHVEJHJcjs.useChartId; exports.useChartRegistration = _chunkRHHVEJHJcjs.useChartRegistration; exports.useGlobalChartsContext = _chunkRHHVEJHJcjs.useGlobalChartsContext; exports.useGlobalChartsTheme = _chunkRHHVEJHJcjs.useGlobalChartsTheme;
|
|
21
21
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { C as ChartRegistration, E as ElementStyles, c as GetElementStylesParams, G as GlobalChartsContext, e as GlobalChartsContextValue, a as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from '../themes-
|
|
2
|
-
import { B as BaseLegendItem } from '../types-
|
|
1
|
+
export { C as ChartRegistration, E as ElementStyles, c as GetElementStylesParams, G as GlobalChartsContext, e as GlobalChartsContextValue, a as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from '../themes-CyjKm-P_.cjs';
|
|
2
|
+
import { B as BaseLegendItem } from '../types-I67mddpr.cjs';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-DZordNiO.cjs';
|
|
5
5
|
import '@visx/annotation/lib/components/CircleSubject';
|
|
6
6
|
import '@visx/annotation/lib/components/Connector';
|
|
7
7
|
import '@visx/annotation/lib/components/Label';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { C as ChartRegistration, E as ElementStyles, c as GetElementStylesParams, G as GlobalChartsContext, e as GlobalChartsContextValue, a as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from '../themes-
|
|
2
|
-
import { B as BaseLegendItem } from '../types-
|
|
1
|
+
export { C as ChartRegistration, E as ElementStyles, c as GetElementStylesParams, G as GlobalChartsContext, e as GlobalChartsContextValue, a as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from '../themes-BmVGrYnF.js';
|
|
2
|
+
import { B as BaseLegendItem } from '../types-I67mddpr.js';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-DZordNiO.js';
|
|
5
5
|
import '@visx/annotation/lib/components/CircleSubject';
|
|
6
6
|
import '@visx/annotation/lib/components/Connector';
|
|
7
7
|
import '@visx/annotation/lib/components/Label';
|
package/dist/providers/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
useChartRegistration,
|
|
7
7
|
useGlobalChartsContext,
|
|
8
8
|
useGlobalChartsTheme
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-32DH6JDF.js";
|
|
10
|
+
import "../chunk-DAU3HNEG.js";
|
|
11
11
|
import "../chunk-G3PMV62Z.js";
|
|
12
12
|
export {
|
|
13
13
|
GlobalChartsContext,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, CSSProperties, FC } from 'react';
|
|
3
|
-
import { b as CompleteChartTheme, j as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-
|
|
4
|
-
import { B as BaseLegendItem } from './types-
|
|
3
|
+
import { b as CompleteChartTheme, j as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-DZordNiO.js';
|
|
4
|
+
import { B as BaseLegendItem } from './types-I67mddpr.js';
|
|
5
5
|
import { LegendShape } from '@visx/legend/lib/types';
|
|
6
6
|
import { LineStyles, GlyphProps } from '@visx/xychart';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, CSSProperties, FC } from 'react';
|
|
3
|
-
import { b as CompleteChartTheme, j as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-
|
|
4
|
-
import { B as BaseLegendItem } from './types-
|
|
3
|
+
import { b as CompleteChartTheme, j as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-DZordNiO.cjs';
|
|
4
|
+
import { B as BaseLegendItem } from './types-I67mddpr.cjs';
|
|
5
5
|
import { LegendShape } from '@visx/legend/lib/types';
|
|
6
6
|
import { LineStyles, GlyphProps } from '@visx/xychart';
|
|
7
7
|
|
|
@@ -192,14 +192,17 @@ type ChartTheme = {
|
|
|
192
192
|
xAxisLineStyles?: LineStyles;
|
|
193
193
|
/** Styles for series lines */
|
|
194
194
|
seriesLineStyles?: LineStyles[];
|
|
195
|
-
/** Styles for legend shapes */
|
|
196
|
-
legendShapeStyles?: Record<string, unknown>[];
|
|
197
195
|
/** Array of render functions for glyphs */
|
|
198
196
|
glyphs?: Array<(<Datum extends object>(props: GlyphProps<Datum>) => ReactNode)>;
|
|
199
|
-
/**
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
197
|
+
/** Legend specific settings */
|
|
198
|
+
legend?: {
|
|
199
|
+
/** Styles for legend shapes */
|
|
200
|
+
shapeStyles?: Record<string, unknown>[];
|
|
201
|
+
/** Styles for legend labels */
|
|
202
|
+
labelStyles?: CSSProperties;
|
|
203
|
+
/** Styles for legend container */
|
|
204
|
+
containerStyles?: CSSProperties;
|
|
205
|
+
};
|
|
203
206
|
/** Styles for small SVG text (eg. axis tick labels), passed through to the XYChart theme. */
|
|
204
207
|
svgLabelSmall?: TextProps;
|
|
205
208
|
annotationStyles?: AnnotationStyles;
|
|
@@ -260,6 +263,7 @@ type CompleteChartTheme = Required<ChartTheme> & {
|
|
|
260
263
|
lineChart: {
|
|
261
264
|
lineStyles: Record<NonNullable<SeriesDataOptions['type']>, LineStyles>;
|
|
262
265
|
};
|
|
266
|
+
legend: Required<NonNullable<ChartTheme['legend']>>;
|
|
263
267
|
sparkline: Required<NonNullable<ChartTheme['sparkline']>> & {
|
|
264
268
|
margin: Required<NonNullable<ChartTheme['sparkline']>['margin']>;
|
|
265
269
|
};
|
|
@@ -416,7 +420,7 @@ type BaseChartProps<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
416
420
|
legendItemClassName?: string;
|
|
417
421
|
/**
|
|
418
422
|
* Enable interactive legend items that can toggle series visibility.
|
|
419
|
-
* Supported for
|
|
423
|
+
* Supported for all chart types that render series.
|
|
420
424
|
* Requires chartId and GlobalChartsProvider.
|
|
421
425
|
* For pie charts, percentages are recalculated so visible segments total 100%.
|
|
422
426
|
*/
|
|
@@ -192,14 +192,17 @@ type ChartTheme = {
|
|
|
192
192
|
xAxisLineStyles?: LineStyles;
|
|
193
193
|
/** Styles for series lines */
|
|
194
194
|
seriesLineStyles?: LineStyles[];
|
|
195
|
-
/** Styles for legend shapes */
|
|
196
|
-
legendShapeStyles?: Record<string, unknown>[];
|
|
197
195
|
/** Array of render functions for glyphs */
|
|
198
196
|
glyphs?: Array<(<Datum extends object>(props: GlyphProps<Datum>) => ReactNode)>;
|
|
199
|
-
/**
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
197
|
+
/** Legend specific settings */
|
|
198
|
+
legend?: {
|
|
199
|
+
/** Styles for legend shapes */
|
|
200
|
+
shapeStyles?: Record<string, unknown>[];
|
|
201
|
+
/** Styles for legend labels */
|
|
202
|
+
labelStyles?: CSSProperties;
|
|
203
|
+
/** Styles for legend container */
|
|
204
|
+
containerStyles?: CSSProperties;
|
|
205
|
+
};
|
|
203
206
|
/** Styles for small SVG text (eg. axis tick labels), passed through to the XYChart theme. */
|
|
204
207
|
svgLabelSmall?: TextProps;
|
|
205
208
|
annotationStyles?: AnnotationStyles;
|
|
@@ -260,6 +263,7 @@ type CompleteChartTheme = Required<ChartTheme> & {
|
|
|
260
263
|
lineChart: {
|
|
261
264
|
lineStyles: Record<NonNullable<SeriesDataOptions['type']>, LineStyles>;
|
|
262
265
|
};
|
|
266
|
+
legend: Required<NonNullable<ChartTheme['legend']>>;
|
|
263
267
|
sparkline: Required<NonNullable<ChartTheme['sparkline']>> & {
|
|
264
268
|
margin: Required<NonNullable<ChartTheme['sparkline']>['margin']>;
|
|
265
269
|
};
|
|
@@ -416,7 +420,7 @@ type BaseChartProps<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
416
420
|
legendItemClassName?: string;
|
|
417
421
|
/**
|
|
418
422
|
* Enable interactive legend items that can toggle series visibility.
|
|
419
|
-
* Supported for
|
|
423
|
+
* Supported for all chart types that render series.
|
|
420
424
|
* Requires chartId and GlobalChartsProvider.
|
|
421
425
|
* For pie charts, percentages are recalculated so visible segments total 100%.
|
|
422
426
|
*/
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { LegendOrdinal } from '@visx/legend';
|
|
2
|
+
import { GlyphProps, LineStyles } from '@visx/xychart';
|
|
3
|
+
import { ComponentProps, ReactNode, CSSProperties } from 'react';
|
|
4
|
+
|
|
5
|
+
type VisxLegendProps = Pick<ComponentProps<typeof LegendOrdinal>, 'className' | 'shape' | 'fill' | 'size' | 'labelFormat' | 'labelTransform'>;
|
|
6
|
+
type LegendItemStyles = {
|
|
7
|
+
/** Margin around each legend item. */
|
|
8
|
+
margin?: CSSProperties['margin'];
|
|
9
|
+
/** Flex direction for items within each legend entry. */
|
|
10
|
+
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
11
|
+
};
|
|
12
|
+
type LegendLabelStyles = Pick<CSSProperties, 'justifyContent' | 'flex' | 'margin'> & {
|
|
13
|
+
/**
|
|
14
|
+
* Maximum width for legend label text as a CSS value (e.g. '200px', '50%', '10rem').
|
|
15
|
+
* When set, text overflow behavior is controlled by textOverflow.
|
|
16
|
+
*/
|
|
17
|
+
maxWidth?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Controls how text behaves when it exceeds maxWidth.
|
|
20
|
+
* - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
|
|
21
|
+
* - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
|
|
22
|
+
*/
|
|
23
|
+
textOverflow?: 'ellipsis' | 'wrap';
|
|
24
|
+
};
|
|
25
|
+
type LegendShapeStyles = {
|
|
26
|
+
/** Width of the legend shape in pixels. */
|
|
27
|
+
width?: number;
|
|
28
|
+
/** Height of the legend shape in pixels. */
|
|
29
|
+
height?: number;
|
|
30
|
+
/** Margin around the legend shape. */
|
|
31
|
+
margin?: CSSProperties['margin'];
|
|
32
|
+
};
|
|
33
|
+
type BaseLegendProps = VisxLegendProps & {
|
|
34
|
+
items: BaseLegendItem[];
|
|
35
|
+
orientation?: 'horizontal' | 'vertical';
|
|
36
|
+
/**
|
|
37
|
+
* TODO: Add 'left' | 'right' positioning support in future implementation
|
|
38
|
+
*/
|
|
39
|
+
position?: 'top' | 'bottom';
|
|
40
|
+
alignment?: 'start' | 'center' | 'end';
|
|
41
|
+
/** Additional CSS class name for legend items. */
|
|
42
|
+
itemClassName?: string;
|
|
43
|
+
/** CSS styles for each legend item (margin, flexDirection). */
|
|
44
|
+
itemStyles?: LegendItemStyles;
|
|
45
|
+
/** Additional CSS class name for legend labels. */
|
|
46
|
+
labelClassName?: string;
|
|
47
|
+
/** CSS styles for legend labels (justifyContent, flex, margin). */
|
|
48
|
+
labelStyles?: LegendLabelStyles;
|
|
49
|
+
/** Styles for legend shapes (width, height, margin). */
|
|
50
|
+
shapeStyles?: LegendShapeStyles;
|
|
51
|
+
/**
|
|
52
|
+
* Function for rendering a custom legend layout.
|
|
53
|
+
*/
|
|
54
|
+
render?: (items: BaseLegendItem[]) => ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* Enable interactive legend items that can toggle series visibility.
|
|
57
|
+
* Requires GlobalChartsProvider and chartId to be set.
|
|
58
|
+
*/
|
|
59
|
+
interactive?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Chart ID for series visibility tracking when interactive mode is enabled.
|
|
62
|
+
*/
|
|
63
|
+
chartId?: string;
|
|
64
|
+
};
|
|
65
|
+
type LegendProps = Omit<BaseLegendProps, 'items'> & {
|
|
66
|
+
items?: BaseLegendItem[];
|
|
67
|
+
chartId?: string;
|
|
68
|
+
};
|
|
69
|
+
type BaseLegendItem = {
|
|
70
|
+
label: string;
|
|
71
|
+
value?: number | string;
|
|
72
|
+
color: string;
|
|
73
|
+
glyphSize?: number;
|
|
74
|
+
renderGlyph?: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
75
|
+
shapeStyle?: CSSProperties & LineStyles;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type { BaseLegendItem as B, LegendItemStyles as L, LegendLabelStyles as a, LegendShapeStyles as b, BaseLegendProps as c, LegendProps as d };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { LegendOrdinal } from '@visx/legend';
|
|
2
|
+
import { GlyphProps, LineStyles } from '@visx/xychart';
|
|
3
|
+
import { ComponentProps, ReactNode, CSSProperties } from 'react';
|
|
4
|
+
|
|
5
|
+
type VisxLegendProps = Pick<ComponentProps<typeof LegendOrdinal>, 'className' | 'shape' | 'fill' | 'size' | 'labelFormat' | 'labelTransform'>;
|
|
6
|
+
type LegendItemStyles = {
|
|
7
|
+
/** Margin around each legend item. */
|
|
8
|
+
margin?: CSSProperties['margin'];
|
|
9
|
+
/** Flex direction for items within each legend entry. */
|
|
10
|
+
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
11
|
+
};
|
|
12
|
+
type LegendLabelStyles = Pick<CSSProperties, 'justifyContent' | 'flex' | 'margin'> & {
|
|
13
|
+
/**
|
|
14
|
+
* Maximum width for legend label text as a CSS value (e.g. '200px', '50%', '10rem').
|
|
15
|
+
* When set, text overflow behavior is controlled by textOverflow.
|
|
16
|
+
*/
|
|
17
|
+
maxWidth?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Controls how text behaves when it exceeds maxWidth.
|
|
20
|
+
* - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
|
|
21
|
+
* - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
|
|
22
|
+
*/
|
|
23
|
+
textOverflow?: 'ellipsis' | 'wrap';
|
|
24
|
+
};
|
|
25
|
+
type LegendShapeStyles = {
|
|
26
|
+
/** Width of the legend shape in pixels. */
|
|
27
|
+
width?: number;
|
|
28
|
+
/** Height of the legend shape in pixels. */
|
|
29
|
+
height?: number;
|
|
30
|
+
/** Margin around the legend shape. */
|
|
31
|
+
margin?: CSSProperties['margin'];
|
|
32
|
+
};
|
|
33
|
+
type BaseLegendProps = VisxLegendProps & {
|
|
34
|
+
items: BaseLegendItem[];
|
|
35
|
+
orientation?: 'horizontal' | 'vertical';
|
|
36
|
+
/**
|
|
37
|
+
* TODO: Add 'left' | 'right' positioning support in future implementation
|
|
38
|
+
*/
|
|
39
|
+
position?: 'top' | 'bottom';
|
|
40
|
+
alignment?: 'start' | 'center' | 'end';
|
|
41
|
+
/** Additional CSS class name for legend items. */
|
|
42
|
+
itemClassName?: string;
|
|
43
|
+
/** CSS styles for each legend item (margin, flexDirection). */
|
|
44
|
+
itemStyles?: LegendItemStyles;
|
|
45
|
+
/** Additional CSS class name for legend labels. */
|
|
46
|
+
labelClassName?: string;
|
|
47
|
+
/** CSS styles for legend labels (justifyContent, flex, margin). */
|
|
48
|
+
labelStyles?: LegendLabelStyles;
|
|
49
|
+
/** Styles for legend shapes (width, height, margin). */
|
|
50
|
+
shapeStyles?: LegendShapeStyles;
|
|
51
|
+
/**
|
|
52
|
+
* Function for rendering a custom legend layout.
|
|
53
|
+
*/
|
|
54
|
+
render?: (items: BaseLegendItem[]) => ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* Enable interactive legend items that can toggle series visibility.
|
|
57
|
+
* Requires GlobalChartsProvider and chartId to be set.
|
|
58
|
+
*/
|
|
59
|
+
interactive?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Chart ID for series visibility tracking when interactive mode is enabled.
|
|
62
|
+
*/
|
|
63
|
+
chartId?: string;
|
|
64
|
+
};
|
|
65
|
+
type LegendProps = Omit<BaseLegendProps, 'items'> & {
|
|
66
|
+
items?: BaseLegendItem[];
|
|
67
|
+
chartId?: string;
|
|
68
|
+
};
|
|
69
|
+
type BaseLegendItem = {
|
|
70
|
+
label: string;
|
|
71
|
+
value?: number | string;
|
|
72
|
+
color: string;
|
|
73
|
+
glyphSize?: number;
|
|
74
|
+
renderGlyph?: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
75
|
+
shapeStyle?: CSSProperties & LineStyles;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type { BaseLegendItem as B, LegendItemStyles as L, LegendLabelStyles as a, LegendShapeStyles as b, BaseLegendProps as c, LegendProps as d };
|
package/dist/utils/index.cjs
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkVTS3PNMScjs = require('../chunk-VTS3PNMS.cjs');
|
|
22
22
|
require('../chunk-EMMSS5I5.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
@@ -40,5 +40,5 @@ require('../chunk-EMMSS5I5.cjs');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
exports.attachSubComponents =
|
|
43
|
+
exports.attachSubComponents = _chunkVTS3PNMScjs.attachSubComponents; exports.formatMetricValue = _chunkVTS3PNMScjs.formatMetricValue; exports.formatPercentage = _chunkVTS3PNMScjs.formatPercentage; exports.getColorDistance = _chunkVTS3PNMScjs.getColorDistance; exports.getItemShapeStyles = _chunkVTS3PNMScjs.getItemShapeStyles; exports.getLongestTickWidth = _chunkVTS3PNMScjs.getLongestTickWidth; exports.getSeriesLineStyles = _chunkVTS3PNMScjs.getSeriesLineStyles; exports.getSeriesStroke = _chunkVTS3PNMScjs.getSeriesStroke; exports.hexToRgba = _chunkVTS3PNMScjs.hexToRgba; exports.isSafari = _chunkVTS3PNMScjs.isSafari; exports.isValidHexColor = _chunkVTS3PNMScjs.isValidHexColor; exports.lightenHexColor = _chunkVTS3PNMScjs.lightenHexColor; exports.mergeThemes = _chunkVTS3PNMScjs.mergeThemes; exports.normalizeColorToHex = _chunkVTS3PNMScjs.normalizeColorToHex; exports.parseAsLocalDate = _chunkVTS3PNMScjs.parseAsLocalDate; exports.parseHslString = _chunkVTS3PNMScjs.parseHslString; exports.parseRgbString = _chunkVTS3PNMScjs.parseRgbString; exports.resolveCssVariable = _chunkVTS3PNMScjs.resolveCssVariable; exports.validateHexColor = _chunkVTS3PNMScjs.validateHexColor;
|
|
44
44
|
//# sourceMappingURL=index.cjs.map
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { M as MetricValueType, f as formatMetricValue } from '../format-metric-value-MXm5DtQ_.cjs';
|
|
2
2
|
import { TickFormatter } from '@visx/axis';
|
|
3
3
|
import { AnyD3Scale, ScaleInput } from '@visx/scale';
|
|
4
|
-
import { j as SeriesData, C as ChartTheme, b as CompleteChartTheme } from '../types-
|
|
4
|
+
import { j as SeriesData, C as ChartTheme, b as CompleteChartTheme } from '../types-DZordNiO.cjs';
|
|
5
5
|
import { LegendShape } from '@visx/legend/lib/types';
|
|
6
6
|
import { LineStyles } from '@visx/xychart';
|
|
7
7
|
import '@visx/annotation/lib/components/CircleSubject';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { M as MetricValueType, f as formatMetricValue } from '../format-metric-value-MXm5DtQ_.js';
|
|
2
2
|
import { TickFormatter } from '@visx/axis';
|
|
3
3
|
import { AnyD3Scale, ScaleInput } from '@visx/scale';
|
|
4
|
-
import { j as SeriesData, C as ChartTheme, b as CompleteChartTheme } from '../types-
|
|
4
|
+
import { j as SeriesData, C as ChartTheme, b as CompleteChartTheme } from '../types-DZordNiO.js';
|
|
5
5
|
import { LegendShape } from '@visx/legend/lib/types';
|
|
6
6
|
import { LineStyles } from '@visx/xychart';
|
|
7
7
|
import '@visx/annotation/lib/components/CircleSubject';
|
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/charts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Display charts within Automattic products.",
|
|
5
5
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/charts/#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -177,10 +177,10 @@
|
|
|
177
177
|
"storybook": "cd ../storybook && pnpm run storybook:dev",
|
|
178
178
|
"test": "TZ=UTC jest --config=tests/jest.config.cjs",
|
|
179
179
|
"test-coverage": "pnpm run test --coverage",
|
|
180
|
-
"typecheck": "
|
|
180
|
+
"typecheck": "tsgo --noEmit"
|
|
181
181
|
},
|
|
182
182
|
"dependencies": {
|
|
183
|
-
"@automattic/number-formatters": "^1.1.
|
|
183
|
+
"@automattic/number-formatters": "^1.1.1",
|
|
184
184
|
"@babel/runtime": "7.28.6",
|
|
185
185
|
"@react-spring/web": "9.7.5",
|
|
186
186
|
"@visx/annotation": "^3.12.0",
|
|
@@ -224,6 +224,7 @@
|
|
|
224
224
|
"@types/jest": "^30.0.0",
|
|
225
225
|
"@types/react": "18.3.28",
|
|
226
226
|
"@types/react-dom": "18.3.7",
|
|
227
|
+
"@typescript/native-preview": "7.0.0-dev.20260225.1",
|
|
227
228
|
"@visx/glyph": "3.12.0",
|
|
228
229
|
"@wordpress/components": "32.2.0",
|
|
229
230
|
"@wordpress/element": "6.40.0",
|
|
@@ -232,13 +233,14 @@
|
|
|
232
233
|
"esbuild": "0.25.9",
|
|
233
234
|
"esbuild-plugin-babel": "^0.2.3",
|
|
234
235
|
"esbuild-sass-plugin": "^3.1.0",
|
|
236
|
+
"identity-obj-proxy": "^3.0.0",
|
|
235
237
|
"jest": "30.2.0",
|
|
236
238
|
"jest-extended": "7.0.0",
|
|
237
239
|
"postcss": "8.5.6",
|
|
238
240
|
"postcss-modules": "6.0.1",
|
|
239
241
|
"react": "18.3.1",
|
|
240
242
|
"react-dom": "18.3.1",
|
|
241
|
-
"sass-embedded": "1.97.
|
|
243
|
+
"sass-embedded": "1.97.3",
|
|
242
244
|
"storybook": "10.2.11",
|
|
243
245
|
"tsup": "8.5.1",
|
|
244
246
|
"typescript": "5.9.3"
|
|
@@ -110,8 +110,10 @@ const BarChartInternal: FC< BarChartProps > = ( {
|
|
|
110
110
|
const dataSorted = useChartDataTransform( data );
|
|
111
111
|
|
|
112
112
|
// Transform data to add a small value for zero bars to make them visible
|
|
113
|
+
// For vertical bars, height determines bar pixel height; for horizontal bars, width does
|
|
113
114
|
const dataWithVisibleZeros = useZeroValueDisplay( dataSorted, {
|
|
114
115
|
enabled: showZeroValues,
|
|
116
|
+
valueAxisLength: horizontal ? width : height,
|
|
115
117
|
} );
|
|
116
118
|
|
|
117
119
|
// Create legend items using the reusable hook
|
|
@@ -330,9 +332,8 @@ const BarChartInternal: FC< BarChartProps > = ( {
|
|
|
330
332
|
orientation={ legendOrientation }
|
|
331
333
|
position={ legendPosition }
|
|
332
334
|
alignment={ legendAlignment }
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
legendItemClassName={ legendItemClassName }
|
|
335
|
+
labelStyles={ { maxWidth: legendMaxWidth, textOverflow: legendTextOverflow } }
|
|
336
|
+
itemClassName={ legendItemClassName }
|
|
336
337
|
className={ styles[ 'bar-chart__legend' ] }
|
|
337
338
|
shape={ legendShape }
|
|
338
339
|
chartId={ chartId }
|