@automattic/charts 0.58.0 → 1.0.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 +25 -0
- package/README.md +7 -54
- package/dist/index.cjs +9606 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +20 -25
- 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 -56
- package/dist/index.js.map +1 -1
- package/package.json +8 -125
- package/src/charts/bar-chart/bar-chart.module.scss +0 -5
- package/src/charts/bar-chart/bar-chart.tsx +131 -137
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +23 -40
- package/src/charts/line-chart/line-chart.module.scss +0 -5
- package/src/charts/line-chart/line-chart.tsx +190 -183
- package/src/charts/line-chart/private/line-chart-annotations-overlay.tsx +1 -2
- package/src/charts/pie-chart/pie-chart.module.scss +2 -10
- package/src/charts/pie-chart/pie-chart.tsx +198 -199
- package/src/charts/pie-chart/test/composition-api.test.tsx +3 -3
- package/src/charts/pie-chart/test/pie-chart.test.tsx +42 -35
- 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 +155 -155
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +25 -25
- 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/legend.tsx +33 -8
- package/src/components/legend/test/legend.test.tsx +93 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-data-with-percentages.ts +24 -0
- package/src/hooks/use-interactive-legend-data.ts +18 -15
- package/src/index.ts +65 -2
- 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 +27 -7
- package/src/utils/test/resolve-css-var.test.ts +2 -0
- 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 -17
- package/dist/charts/bar-chart/index.cjs.map +0 -1
- package/dist/charts/bar-chart/index.css +0 -141
- package/dist/charts/bar-chart/index.css.map +0 -1
- package/dist/charts/bar-chart/index.d.cts +0 -36
- package/dist/charts/bar-chart/index.d.ts +0 -36
- package/dist/charts/bar-chart/index.js +0 -17
- package/dist/charts/bar-chart/index.js.map +0 -1
- package/dist/charts/bar-list-chart/index.cjs +0 -18
- package/dist/charts/bar-list-chart/index.cjs.map +0 -1
- package/dist/charts/bar-list-chart/index.css +0 -141
- 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 -18
- 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 -157
- 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 -23
- 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 -21
- package/dist/charts/leaderboard-chart/index.cjs.map +0 -1
- package/dist/charts/leaderboard-chart/index.css +0 -160
- 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 -21
- package/dist/charts/leaderboard-chart/index.js.map +0 -1
- package/dist/charts/line-chart/index.cjs +0 -17
- package/dist/charts/line-chart/index.cjs.map +0 -1
- package/dist/charts/line-chart/index.css +0 -213
- package/dist/charts/line-chart/index.css.map +0 -1
- package/dist/charts/line-chart/index.d.cts +0 -98
- package/dist/charts/line-chart/index.d.ts +0 -98
- package/dist/charts/line-chart/index.js +0 -17
- package/dist/charts/line-chart/index.js.map +0 -1
- package/dist/charts/pie-chart/index.cjs +0 -19
- package/dist/charts/pie-chart/index.cjs.map +0 -1
- package/dist/charts/pie-chart/index.css +0 -131
- package/dist/charts/pie-chart/index.css.map +0 -1
- package/dist/charts/pie-chart/index.d.cts +0 -91
- package/dist/charts/pie-chart/index.d.ts +0 -91
- package/dist/charts/pie-chart/index.js +0 -19
- package/dist/charts/pie-chart/index.js.map +0 -1
- package/dist/charts/pie-semi-circle-chart/index.cjs +0 -18
- package/dist/charts/pie-semi-circle-chart/index.cjs.map +0 -1
- package/dist/charts/pie-semi-circle-chart/index.css +0 -132
- package/dist/charts/pie-semi-circle-chart/index.css.map +0 -1
- package/dist/charts/pie-semi-circle-chart/index.d.cts +0 -88
- package/dist/charts/pie-semi-circle-chart/index.d.ts +0 -88
- package/dist/charts/pie-semi-circle-chart/index.js +0 -18
- package/dist/charts/pie-semi-circle-chart/index.js.map +0 -1
- package/dist/charts/sparkline/index.cjs +0 -18
- package/dist/charts/sparkline/index.cjs.map +0 -1
- package/dist/charts/sparkline/index.css +0 -230
- 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 -18
- 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-2I67QUIV.js +0 -895
- package/dist/chunk-2I67QUIV.js.map +0 -1
- package/dist/chunk-2ICEEQOC.js +0 -1071
- package/dist/chunk-2ICEEQOC.js.map +0 -1
- package/dist/chunk-4B7BL2DD.js +0 -120
- package/dist/chunk-4B7BL2DD.js.map +0 -1
- package/dist/chunk-4OXMTKAL.js +0 -401
- package/dist/chunk-4OXMTKAL.js.map +0 -1
- package/dist/chunk-ASLARV7L.cjs +0 -81
- package/dist/chunk-ASLARV7L.cjs.map +0 -1
- package/dist/chunk-B6NLZFRW.js +0 -617
- package/dist/chunk-B6NLZFRW.js.map +0 -1
- package/dist/chunk-BBAUQOW6.cjs +0 -120
- package/dist/chunk-BBAUQOW6.cjs.map +0 -1
- package/dist/chunk-BPYKWMI7.js +0 -194
- package/dist/chunk-BPYKWMI7.js.map +0 -1
- package/dist/chunk-CMMHCTBX.cjs +0 -373
- package/dist/chunk-CMMHCTBX.cjs.map +0 -1
- package/dist/chunk-CPPXJATQ.cjs +0 -1071
- package/dist/chunk-CPPXJATQ.cjs.map +0 -1
- package/dist/chunk-DKU775VC.js +0 -219
- package/dist/chunk-DKU775VC.js.map +0 -1
- package/dist/chunk-GRA7Y2ZG.cjs +0 -401
- package/dist/chunk-GRA7Y2ZG.cjs.map +0 -1
- package/dist/chunk-I2276W3I.cjs +0 -66
- package/dist/chunk-I2276W3I.cjs.map +0 -1
- package/dist/chunk-JJIMABHT.js +0 -351
- package/dist/chunk-JJIMABHT.js.map +0 -1
- package/dist/chunk-KJHWXOCZ.js +0 -421
- package/dist/chunk-KJHWXOCZ.js.map +0 -1
- package/dist/chunk-KRWGSOJ2.js +0 -91
- package/dist/chunk-KRWGSOJ2.js.map +0 -1
- package/dist/chunk-KXRWNFQJ.js +0 -51
- package/dist/chunk-KXRWNFQJ.js.map +0 -1
- package/dist/chunk-LTFH7SEG.js +0 -373
- package/dist/chunk-LTFH7SEG.js.map +0 -1
- package/dist/chunk-MUNOKLLE.js +0 -165
- package/dist/chunk-MUNOKLLE.js.map +0 -1
- package/dist/chunk-MXGLYWVP.cjs +0 -351
- package/dist/chunk-MXGLYWVP.cjs.map +0 -1
- package/dist/chunk-OP6PHB2U.js +0 -81
- package/dist/chunk-OP6PHB2U.js.map +0 -1
- package/dist/chunk-OYC34VTO.cjs +0 -3957
- package/dist/chunk-OYC34VTO.cjs.map +0 -1
- package/dist/chunk-PQL5I3F6.cjs +0 -421
- package/dist/chunk-PQL5I3F6.cjs.map +0 -1
- package/dist/chunk-REZTQ4PH.cjs +0 -488
- package/dist/chunk-REZTQ4PH.cjs.map +0 -1
- package/dist/chunk-TZRUHQOH.cjs +0 -91
- package/dist/chunk-TZRUHQOH.cjs.map +0 -1
- package/dist/chunk-UTYVIOWZ.js +0 -3957
- package/dist/chunk-UTYVIOWZ.js.map +0 -1
- package/dist/chunk-W2LDIX26.cjs +0 -165
- package/dist/chunk-W2LDIX26.cjs.map +0 -1
- package/dist/chunk-WSG64BVN.cjs +0 -219
- package/dist/chunk-WSG64BVN.cjs.map +0 -1
- package/dist/chunk-WTQYGUNF.js +0 -400
- package/dist/chunk-WTQYGUNF.js.map +0 -1
- package/dist/chunk-WYK7EL5R.cjs +0 -895
- package/dist/chunk-WYK7EL5R.cjs.map +0 -1
- package/dist/chunk-XC4KHJYX.cjs +0 -617
- package/dist/chunk-XC4KHJYX.cjs.map +0 -1
- package/dist/chunk-XVBH5XHE.cjs +0 -400
- package/dist/chunk-XVBH5XHE.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-YAFQVVDI.js +0 -488
- package/dist/chunk-YAFQVVDI.js.map +0 -1
- package/dist/components/legend/index.cjs +0 -12
- package/dist/components/legend/index.cjs.map +0 -1
- package/dist/components/legend/index.css +0 -91
- 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 -12
- 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 -29
- package/dist/hooks/index.cjs.map +0 -1
- package/dist/hooks/index.css +0 -9
- package/dist/hooks/index.css.map +0 -1
- package/dist/hooks/index.d.cts +0 -264
- package/dist/hooks/index.d.ts +0 -264
- package/dist/hooks/index.js +0 -29
- package/dist/hooks/index.js.map +0 -1
- package/dist/leaderboard-chart-BSbg0ufV.d.cts +0 -79
- package/dist/leaderboard-chart-odEYxxEC.d.ts +0 -79
- package/dist/legend-DFkosEvC.d.cts +0 -9
- package/dist/legend-DLswHhOk.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 -9
- 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-D0qc5JaW.d.cts +0 -67
- package/dist/themes-itO4Ht5g.d.ts +0 -67
- package/dist/types-B5f6XQ7Q.d.cts +0 -19
- package/dist/types-BsHooDbM.d.ts +0 -19
- package/dist/types-BuSrRM4p.d.ts +0 -49
- package/dist/types-ChOUI9-N.d.cts +0 -545
- package/dist/types-ChOUI9-N.d.ts +0 -545
- package/dist/types-Dfw9VOKI.d.cts +0 -49
- 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
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as ResponsiveConfig } from './with-responsive-CNfhzAUu.js';
|
|
3
|
-
import * as react from 'react';
|
|
4
|
-
import { ReactNode, FC } from 'react';
|
|
5
|
-
import { a as BaseLegendProps, B as BaseLegendItem } from './types-BuSrRM4p.js';
|
|
6
|
-
import { B as BaseChartProps, L as LeaderboardEntry } from './types-ChOUI9-N.js';
|
|
7
|
-
|
|
8
|
-
interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legend' | 'chartId' | 'width' | 'height' | 'size' | 'gap' | 'animation'> {
|
|
9
|
-
/**
|
|
10
|
-
* Whether to show comparison data
|
|
11
|
-
*/
|
|
12
|
-
withComparison?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Whether to overlay the label on top of bar
|
|
15
|
-
*/
|
|
16
|
-
withOverlayLabel?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Primary color for current period bars
|
|
19
|
-
*/
|
|
20
|
-
primaryColor?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Secondary color for comparison period bars
|
|
23
|
-
*/
|
|
24
|
-
secondaryColor?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Formatter for values
|
|
27
|
-
*/
|
|
28
|
-
valueFormatter?: (value: number) => string;
|
|
29
|
-
/**
|
|
30
|
-
* Formatter for delta values
|
|
31
|
-
*/
|
|
32
|
-
deltaFormatter?: (value: number) => string;
|
|
33
|
-
/**
|
|
34
|
-
* Whether the chart is in loading state
|
|
35
|
-
*/
|
|
36
|
-
loading?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Custom styling for the chart container
|
|
39
|
-
*/
|
|
40
|
-
style?: React.CSSProperties & {
|
|
41
|
-
'--a8c--charts--leaderboard--bar--border-radius'?: string;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Custom labels for legend items
|
|
45
|
-
*/
|
|
46
|
-
legendLabels?: {
|
|
47
|
-
/**
|
|
48
|
-
* Label for primary period data
|
|
49
|
-
*/
|
|
50
|
-
primary?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Label for comparison period data (only used when withComparison is true)
|
|
53
|
-
*/
|
|
54
|
-
comparison?: string;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Child components for composition API
|
|
58
|
-
*/
|
|
59
|
-
children?: ReactNode;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
declare const LeaderboardChart: FC<LeaderboardChartProps> & {
|
|
63
|
-
Legend: react.ForwardRefExoticComponent<Omit<BaseLegendProps, "items"> & {
|
|
64
|
-
items?: BaseLegendItem[];
|
|
65
|
-
chartId?: string;
|
|
66
|
-
} & react.RefAttributes<HTMLDivElement>>;
|
|
67
|
-
};
|
|
68
|
-
declare const LeaderboardChartResponsive: (({ resizeDebounceTime, maxWidth, aspectRatio, size, width, height, ...chartProps }: Omit<LeaderboardChartProps, "width" | "height" | "size"> & {
|
|
69
|
-
width?: number;
|
|
70
|
-
height?: number;
|
|
71
|
-
size?: number;
|
|
72
|
-
} & ResponsiveConfig) => react_jsx_runtime.JSX.Element) & {
|
|
73
|
-
Legend: react.ForwardRefExoticComponent<Omit<BaseLegendProps, "items"> & {
|
|
74
|
-
items?: BaseLegendItem[];
|
|
75
|
-
chartId?: string;
|
|
76
|
-
} & react.RefAttributes<HTMLDivElement>>;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export { LeaderboardChartResponsive as L, LeaderboardChart as a, type LeaderboardChartProps as b };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { a as BaseLegendProps, B as BaseLegendItem } from './types-Dfw9VOKI.cjs';
|
|
3
|
-
|
|
4
|
-
declare const Legend: react.ForwardRefExoticComponent<Omit<BaseLegendProps, "items"> & {
|
|
5
|
-
items?: BaseLegendItem[];
|
|
6
|
-
chartId?: string;
|
|
7
|
-
} & react.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
|
|
9
|
-
export { Legend as L };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { a as BaseLegendProps, B as BaseLegendItem } from './types-BuSrRM4p.js';
|
|
3
|
-
|
|
4
|
-
declare const Legend: react.ForwardRefExoticComponent<Omit<BaseLegendProps, "items"> & {
|
|
5
|
-
items?: BaseLegendItem[];
|
|
6
|
-
chartId?: string;
|
|
7
|
-
} & react.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
|
|
9
|
-
export { Legend as L };
|
package/dist/providers/index.cjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkWYK7EL5Rcjs = require('../chunk-WYK7EL5R.cjs');
|
|
10
|
-
require('../chunk-MXGLYWVP.cjs');
|
|
11
|
-
require('../chunk-EMMSS5I5.cjs');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
exports.GlobalChartsContext = _chunkWYK7EL5Rcjs.GlobalChartsContext; exports.GlobalChartsProvider = _chunkWYK7EL5Rcjs.GlobalChartsProvider; exports.defaultTheme = _chunkWYK7EL5Rcjs.defaultTheme; exports.useChartId = _chunkWYK7EL5Rcjs.useChartId; exports.useChartRegistration = _chunkWYK7EL5Rcjs.useChartRegistration; exports.useGlobalChartsContext = _chunkWYK7EL5Rcjs.useGlobalChartsContext; exports.useGlobalChartsTheme = _chunkWYK7EL5Rcjs.useGlobalChartsTheme;
|
|
21
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/providers/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,8cAAC","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/providers/index.cjs"}
|
package/dist/providers/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["esbuild-sass-plugin:css-chunk:src/hooks/use-tooltip-portal-relocator.module.scss"],"sourcesContent":[".a8ccharts-jCw5dQ {\n position: fixed;\n inset: 0;\n overflow: visible;\n z-index: 1;\n pointer-events: none;\n}"],"mappings":";AAAA,CAAC;AACC,YAAU;AACV,SAAO;AACP,YAAU;AACV,WAAS;AACT,kBAAgB;AAClB;","names":[]}
|
|
@@ -1,28 +0,0 @@
|
|
|
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-D0qc5JaW.cjs';
|
|
2
|
-
import { B as BaseLegendItem } from '../types-Dfw9VOKI.cjs';
|
|
3
|
-
import 'react';
|
|
4
|
-
import '../types-ChOUI9-N.cjs';
|
|
5
|
-
import '@visx/annotation/lib/components/CircleSubject';
|
|
6
|
-
import '@visx/annotation/lib/components/Connector';
|
|
7
|
-
import '@visx/annotation/lib/components/Label';
|
|
8
|
-
import '@visx/annotation/lib/components/LineSubject';
|
|
9
|
-
import '@visx/axis';
|
|
10
|
-
import '@visx/legend/lib/types';
|
|
11
|
-
import '@visx/scale';
|
|
12
|
-
import '@visx/text/lib/Text';
|
|
13
|
-
import '@visx/xychart';
|
|
14
|
-
import '@wordpress/theme';
|
|
15
|
-
import 'react-google-charts';
|
|
16
|
-
import '@visx/legend';
|
|
17
|
-
|
|
18
|
-
declare const useChartId: (providedId?: string) => string;
|
|
19
|
-
|
|
20
|
-
declare const useChartRegistration: ({ chartId, legendItems, chartType, isDataValid, metadata, }: {
|
|
21
|
-
chartId: string;
|
|
22
|
-
legendItems: BaseLegendItem[];
|
|
23
|
-
chartType: string;
|
|
24
|
-
isDataValid: boolean;
|
|
25
|
-
metadata?: Record<string, unknown>;
|
|
26
|
-
}) => void;
|
|
27
|
-
|
|
28
|
-
export { useChartId, useChartRegistration };
|
|
@@ -1,28 +0,0 @@
|
|
|
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-itO4Ht5g.js';
|
|
2
|
-
import { B as BaseLegendItem } from '../types-BuSrRM4p.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import '../types-ChOUI9-N.js';
|
|
5
|
-
import '@visx/annotation/lib/components/CircleSubject';
|
|
6
|
-
import '@visx/annotation/lib/components/Connector';
|
|
7
|
-
import '@visx/annotation/lib/components/Label';
|
|
8
|
-
import '@visx/annotation/lib/components/LineSubject';
|
|
9
|
-
import '@visx/axis';
|
|
10
|
-
import '@visx/legend/lib/types';
|
|
11
|
-
import '@visx/scale';
|
|
12
|
-
import '@visx/text/lib/Text';
|
|
13
|
-
import '@visx/xychart';
|
|
14
|
-
import '@wordpress/theme';
|
|
15
|
-
import 'react-google-charts';
|
|
16
|
-
import '@visx/legend';
|
|
17
|
-
|
|
18
|
-
declare const useChartId: (providedId?: string) => string;
|
|
19
|
-
|
|
20
|
-
declare const useChartRegistration: ({ chartId, legendItems, chartType, isDataValid, metadata, }: {
|
|
21
|
-
chartId: string;
|
|
22
|
-
legendItems: BaseLegendItem[];
|
|
23
|
-
chartType: string;
|
|
24
|
-
isDataValid: boolean;
|
|
25
|
-
metadata?: Record<string, unknown>;
|
|
26
|
-
}) => void;
|
|
27
|
-
|
|
28
|
-
export { useChartId, useChartRegistration };
|
package/dist/providers/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GlobalChartsContext,
|
|
3
|
-
GlobalChartsProvider,
|
|
4
|
-
defaultTheme,
|
|
5
|
-
useChartId,
|
|
6
|
-
useChartRegistration,
|
|
7
|
-
useGlobalChartsContext,
|
|
8
|
-
useGlobalChartsTheme
|
|
9
|
-
} from "../chunk-2I67QUIV.js";
|
|
10
|
-
import "../chunk-JJIMABHT.js";
|
|
11
|
-
import "../chunk-G3PMV62Z.js";
|
|
12
|
-
export {
|
|
13
|
-
GlobalChartsContext,
|
|
14
|
-
GlobalChartsProvider,
|
|
15
|
-
defaultTheme,
|
|
16
|
-
useChartId,
|
|
17
|
-
useChartRegistration,
|
|
18
|
-
useGlobalChartsContext,
|
|
19
|
-
useGlobalChartsTheme
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode, CSSProperties, FC } from 'react';
|
|
3
|
-
import { c as CompleteChartTheme, o as SeriesData, e as DataPointPercentage, b as ChartTheme } from './types-ChOUI9-N.cjs';
|
|
4
|
-
import { B as BaseLegendItem } from './types-Dfw9VOKI.cjs';
|
|
5
|
-
import { LegendShape } from '@visx/legend/lib/types';
|
|
6
|
-
import { LineStyles, GlyphProps } from '@visx/xychart';
|
|
7
|
-
|
|
8
|
-
interface ChartRegistration {
|
|
9
|
-
legendItems: BaseLegendItem[];
|
|
10
|
-
chartType: string;
|
|
11
|
-
metadata?: Record<string, unknown>;
|
|
12
|
-
}
|
|
13
|
-
type GetElementStylesParams = {
|
|
14
|
-
index: number;
|
|
15
|
-
data?: SeriesData | DataPointPercentage;
|
|
16
|
-
overrideColor?: string;
|
|
17
|
-
legendShape?: LegendShape<SeriesData[], number>;
|
|
18
|
-
};
|
|
19
|
-
type ElementStyles = {
|
|
20
|
-
color: string;
|
|
21
|
-
lineStyles: LineStyles;
|
|
22
|
-
glyph: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
23
|
-
shapeStyles: CSSProperties & LineStyles;
|
|
24
|
-
};
|
|
25
|
-
interface GlobalChartsContextValue {
|
|
26
|
-
charts: Map<string, ChartRegistration>;
|
|
27
|
-
registerChart: (id: string, data: ChartRegistration) => void;
|
|
28
|
-
unregisterChart: (id: string) => void;
|
|
29
|
-
getChartData: (id: string) => ChartRegistration | undefined;
|
|
30
|
-
theme: CompleteChartTheme;
|
|
31
|
-
getElementStyles: (params: GetElementStylesParams) => ElementStyles;
|
|
32
|
-
toggleSeriesVisibility: (chartId: string, seriesLabel: string) => void;
|
|
33
|
-
isSeriesVisible: (chartId: string, seriesLabel: string) => boolean;
|
|
34
|
-
getHiddenSeries: (chartId: string) => Set<string>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare const GlobalChartsContext: react.Context<GlobalChartsContextValue>;
|
|
38
|
-
interface GlobalChartsProviderProps {
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
theme?: Partial<ChartTheme>;
|
|
41
|
-
/**
|
|
42
|
-
* Optional ref to an element that chart tooltip portals should be relocated into.
|
|
43
|
-
* When provided, visx tooltip portals (normally appended to document.body) will be
|
|
44
|
-
* moved into this container so they participate in the same effective CSS stacking context.
|
|
45
|
-
* The element referenced here, or one of its ancestors, should establish the desired
|
|
46
|
-
* stacking context (for example by using `position` and `z-index`) so that tooltips
|
|
47
|
-
* appear above the relevant chart content.
|
|
48
|
-
*/
|
|
49
|
-
portalContainer?: React.RefObject<HTMLElement | null>;
|
|
50
|
-
}
|
|
51
|
-
declare const GlobalChartsProvider: FC<GlobalChartsProviderProps>;
|
|
52
|
-
|
|
53
|
-
declare const useGlobalChartsContext: () => GlobalChartsContextValue;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Hook to get the global chart theme from GlobalChartsProvider
|
|
57
|
-
*
|
|
58
|
-
* @return The global chart theme
|
|
59
|
-
*/
|
|
60
|
-
declare const useGlobalChartsTheme: () => CompleteChartTheme;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Default theme configuration
|
|
64
|
-
*/
|
|
65
|
-
declare const defaultTheme: CompleteChartTheme;
|
|
66
|
-
|
|
67
|
-
export { type ChartRegistration as C, type ElementStyles as E, GlobalChartsContext as G, GlobalChartsProvider as a, useGlobalChartsTheme as b, type GetElementStylesParams as c, defaultTheme as d, type GlobalChartsContextValue as e, useGlobalChartsContext as u };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode, CSSProperties, FC } from 'react';
|
|
3
|
-
import { c as CompleteChartTheme, o as SeriesData, e as DataPointPercentage, b as ChartTheme } from './types-ChOUI9-N.js';
|
|
4
|
-
import { B as BaseLegendItem } from './types-BuSrRM4p.js';
|
|
5
|
-
import { LegendShape } from '@visx/legend/lib/types';
|
|
6
|
-
import { LineStyles, GlyphProps } from '@visx/xychart';
|
|
7
|
-
|
|
8
|
-
interface ChartRegistration {
|
|
9
|
-
legendItems: BaseLegendItem[];
|
|
10
|
-
chartType: string;
|
|
11
|
-
metadata?: Record<string, unknown>;
|
|
12
|
-
}
|
|
13
|
-
type GetElementStylesParams = {
|
|
14
|
-
index: number;
|
|
15
|
-
data?: SeriesData | DataPointPercentage;
|
|
16
|
-
overrideColor?: string;
|
|
17
|
-
legendShape?: LegendShape<SeriesData[], number>;
|
|
18
|
-
};
|
|
19
|
-
type ElementStyles = {
|
|
20
|
-
color: string;
|
|
21
|
-
lineStyles: LineStyles;
|
|
22
|
-
glyph: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
23
|
-
shapeStyles: CSSProperties & LineStyles;
|
|
24
|
-
};
|
|
25
|
-
interface GlobalChartsContextValue {
|
|
26
|
-
charts: Map<string, ChartRegistration>;
|
|
27
|
-
registerChart: (id: string, data: ChartRegistration) => void;
|
|
28
|
-
unregisterChart: (id: string) => void;
|
|
29
|
-
getChartData: (id: string) => ChartRegistration | undefined;
|
|
30
|
-
theme: CompleteChartTheme;
|
|
31
|
-
getElementStyles: (params: GetElementStylesParams) => ElementStyles;
|
|
32
|
-
toggleSeriesVisibility: (chartId: string, seriesLabel: string) => void;
|
|
33
|
-
isSeriesVisible: (chartId: string, seriesLabel: string) => boolean;
|
|
34
|
-
getHiddenSeries: (chartId: string) => Set<string>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare const GlobalChartsContext: react.Context<GlobalChartsContextValue>;
|
|
38
|
-
interface GlobalChartsProviderProps {
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
theme?: Partial<ChartTheme>;
|
|
41
|
-
/**
|
|
42
|
-
* Optional ref to an element that chart tooltip portals should be relocated into.
|
|
43
|
-
* When provided, visx tooltip portals (normally appended to document.body) will be
|
|
44
|
-
* moved into this container so they participate in the same effective CSS stacking context.
|
|
45
|
-
* The element referenced here, or one of its ancestors, should establish the desired
|
|
46
|
-
* stacking context (for example by using `position` and `z-index`) so that tooltips
|
|
47
|
-
* appear above the relevant chart content.
|
|
48
|
-
*/
|
|
49
|
-
portalContainer?: React.RefObject<HTMLElement | null>;
|
|
50
|
-
}
|
|
51
|
-
declare const GlobalChartsProvider: FC<GlobalChartsProviderProps>;
|
|
52
|
-
|
|
53
|
-
declare const useGlobalChartsContext: () => GlobalChartsContextValue;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Hook to get the global chart theme from GlobalChartsProvider
|
|
57
|
-
*
|
|
58
|
-
* @return The global chart theme
|
|
59
|
-
*/
|
|
60
|
-
declare const useGlobalChartsTheme: () => CompleteChartTheme;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Default theme configuration
|
|
64
|
-
*/
|
|
65
|
-
declare const defaultTheme: CompleteChartTheme;
|
|
66
|
-
|
|
67
|
-
export { type ChartRegistration as C, type ElementStyles as E, GlobalChartsContext as G, GlobalChartsProvider as a, useGlobalChartsTheme as b, type GetElementStylesParams as c, defaultTheme as d, type GlobalChartsContextValue as e, useGlobalChartsContext as u };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { L as Legend } from './legend-DFkosEvC.cjs';
|
|
2
|
-
import { ComponentType, FC, PropsWithChildren } from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Base interface for chart subcomponents in the composition API
|
|
6
|
-
*/
|
|
7
|
-
interface BaseChartSubComponents {
|
|
8
|
-
Legend: ComponentType<React.ComponentProps<typeof Legend>>;
|
|
9
|
-
SVG: FC<PropsWithChildren>;
|
|
10
|
-
HTML: FC<PropsWithChildren>;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Type helper for creating chart components with composition API
|
|
14
|
-
* @template TProps - The props type for the chart component
|
|
15
|
-
* @template TSubComponents - Additional subcomponents beyond the base ones
|
|
16
|
-
*/
|
|
17
|
-
type ChartComponentWithComposition<TProps, TSubComponents extends BaseChartSubComponents = BaseChartSubComponents> = FC<TProps> & TSubComponents;
|
|
18
|
-
|
|
19
|
-
export type { ChartComponentWithComposition as C };
|
package/dist/types-BsHooDbM.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { L as Legend } from './legend-DLswHhOk.js';
|
|
2
|
-
import { ComponentType, FC, PropsWithChildren } from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Base interface for chart subcomponents in the composition API
|
|
6
|
-
*/
|
|
7
|
-
interface BaseChartSubComponents {
|
|
8
|
-
Legend: ComponentType<React.ComponentProps<typeof Legend>>;
|
|
9
|
-
SVG: FC<PropsWithChildren>;
|
|
10
|
-
HTML: FC<PropsWithChildren>;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Type helper for creating chart components with composition API
|
|
14
|
-
* @template TProps - The props type for the chart component
|
|
15
|
-
* @template TSubComponents - Additional subcomponents beyond the base ones
|
|
16
|
-
*/
|
|
17
|
-
type ChartComponentWithComposition<TProps, TSubComponents extends BaseChartSubComponents = BaseChartSubComponents> = FC<TProps> & TSubComponents;
|
|
18
|
-
|
|
19
|
-
export type { ChartComponentWithComposition as C };
|
package/dist/types-BuSrRM4p.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { LegendOrdinal } from '@visx/legend';
|
|
2
|
-
import { j as LegendPosition, h as LegendItemStyles, i as LegendLabelStyles, k as LegendShapeStyles } from './types-ChOUI9-N.js';
|
|
3
|
-
import { GlyphProps, LineStyles } from '@visx/xychart';
|
|
4
|
-
import { ComponentProps, ReactNode, CSSProperties } from 'react';
|
|
5
|
-
|
|
6
|
-
type VisxLegendProps = Pick<ComponentProps<typeof LegendOrdinal>, 'className' | 'shape' | 'fill' | 'size' | 'labelFormat' | 'labelTransform'>;
|
|
7
|
-
type BaseLegendProps = VisxLegendProps & {
|
|
8
|
-
items: BaseLegendItem[];
|
|
9
|
-
orientation?: 'horizontal' | 'vertical';
|
|
10
|
-
position?: LegendPosition;
|
|
11
|
-
alignment?: 'start' | 'center' | 'end';
|
|
12
|
-
/** Additional CSS class name for legend items. */
|
|
13
|
-
itemClassName?: string;
|
|
14
|
-
/** CSS styles for each legend item (margin, flexDirection). */
|
|
15
|
-
itemStyles?: LegendItemStyles;
|
|
16
|
-
/** Additional CSS class name for legend labels. */
|
|
17
|
-
labelClassName?: string;
|
|
18
|
-
/** CSS styles for legend labels (justifyContent, flex, margin). */
|
|
19
|
-
labelStyles?: LegendLabelStyles;
|
|
20
|
-
/** Styles for legend shapes (width, height, margin). */
|
|
21
|
-
shapeStyles?: LegendShapeStyles;
|
|
22
|
-
/**
|
|
23
|
-
* Function for rendering a custom legend layout.
|
|
24
|
-
*/
|
|
25
|
-
render?: (items: BaseLegendItem[]) => ReactNode;
|
|
26
|
-
/**
|
|
27
|
-
* Enable interactive legend items that can toggle series visibility.
|
|
28
|
-
* Requires GlobalChartsProvider and chartId to be set.
|
|
29
|
-
*/
|
|
30
|
-
interactive?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Chart ID for series visibility tracking when interactive mode is enabled.
|
|
33
|
-
*/
|
|
34
|
-
chartId?: string;
|
|
35
|
-
};
|
|
36
|
-
type LegendProps = Omit<BaseLegendProps, 'items'> & {
|
|
37
|
-
items?: BaseLegendItem[];
|
|
38
|
-
chartId?: string;
|
|
39
|
-
};
|
|
40
|
-
type BaseLegendItem = {
|
|
41
|
-
label: string;
|
|
42
|
-
value?: number | string;
|
|
43
|
-
color: string;
|
|
44
|
-
glyphSize?: number;
|
|
45
|
-
renderGlyph?: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
46
|
-
shapeStyle?: CSSProperties & LineStyles;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export type { BaseLegendItem as B, LegendProps as L, BaseLegendProps as a };
|