@automattic/charts 0.56.7 → 0.58.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 +30 -0
- package/dist/charts/bar-chart/index.cjs +7 -6
- package/dist/charts/bar-chart/index.cjs.map +1 -1
- package/dist/charts/bar-chart/index.css +12 -24
- package/dist/charts/bar-chart/index.css.map +1 -1
- package/dist/charts/bar-chart/index.d.cts +3 -4
- package/dist/charts/bar-chart/index.d.ts +3 -4
- package/dist/charts/bar-chart/index.js +6 -5
- package/dist/charts/bar-list-chart/index.cjs +8 -7
- package/dist/charts/bar-list-chart/index.cjs.map +1 -1
- package/dist/charts/bar-list-chart/index.css +12 -24
- package/dist/charts/bar-list-chart/index.css.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 +7 -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.css +0 -94
- package/dist/charts/conversion-funnel-chart/index.css.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.css +0 -94
- package/dist/charts/geo-chart/index.css.map +1 -1
- 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 +7 -6
- package/dist/charts/leaderboard-chart/index.cjs.map +1 -1
- package/dist/charts/leaderboard-chart/index.css +20 -33
- 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 +6 -5
- package/dist/charts/line-chart/index.cjs +7 -6
- package/dist/charts/line-chart/index.cjs.map +1 -1
- package/dist/charts/line-chart/index.css +12 -24
- package/dist/charts/line-chart/index.css.map +1 -1
- package/dist/charts/line-chart/index.d.cts +3 -4
- package/dist/charts/line-chart/index.d.ts +3 -4
- package/dist/charts/line-chart/index.js +6 -5
- package/dist/charts/pie-chart/index.cjs +7 -7
- package/dist/charts/pie-chart/index.css +12 -24
- package/dist/charts/pie-chart/index.css.map +1 -1
- package/dist/charts/pie-chart/index.d.cts +7 -13
- package/dist/charts/pie-chart/index.d.ts +7 -13
- 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 -24
- package/dist/charts/pie-semi-circle-chart/index.css.map +1 -1
- package/dist/charts/pie-semi-circle-chart/index.d.cts +7 -13
- package/dist/charts/pie-semi-circle-chart/index.d.ts +7 -13
- package/dist/charts/pie-semi-circle-chart/index.js +6 -6
- package/dist/charts/sparkline/index.cjs +8 -7
- package/dist/charts/sparkline/index.cjs.map +1 -1
- package/dist/charts/sparkline/index.css +12 -24
- package/dist/charts/sparkline/index.css.map +1 -1
- package/dist/charts/sparkline/index.js +7 -6
- package/dist/{chunk-RFSHE3HL.js → chunk-2I67QUIV.js} +84 -431
- package/dist/chunk-2I67QUIV.js.map +1 -0
- package/dist/{chunk-OMS5QIJN.js → chunk-2ICEEQOC.js} +31 -25
- package/dist/chunk-2ICEEQOC.js.map +1 -0
- package/dist/{chunk-GWBS65VC.js → chunk-4B7BL2DD.js} +3 -3
- package/dist/{chunk-7FDQGBY7.js → chunk-4OXMTKAL.js} +24 -24
- package/dist/chunk-4OXMTKAL.js.map +1 -0
- package/dist/{chunk-SSFFCBCF.js → chunk-B6NLZFRW.js} +32 -26
- package/dist/chunk-B6NLZFRW.js.map +1 -0
- package/dist/{chunk-3EXJP67N.cjs → chunk-BBAUQOW6.cjs} +9 -9
- package/dist/{chunk-3EXJP67N.cjs.map → chunk-BBAUQOW6.cjs.map} +1 -1
- package/dist/{chunk-NQJE2CC7.cjs → chunk-CMMHCTBX.cjs} +45 -45
- package/dist/chunk-CMMHCTBX.cjs.map +1 -0
- package/dist/{chunk-O2JIANHK.cjs → chunk-CPPXJATQ.cjs} +51 -45
- package/dist/chunk-CPPXJATQ.cjs.map +1 -0
- package/dist/{chunk-MDRCAGKZ.js → chunk-DKU775VC.js} +3 -3
- package/dist/{chunk-BXFD7JIG.cjs → chunk-GRA7Y2ZG.cjs} +46 -46
- package/dist/chunk-GRA7Y2ZG.cjs.map +1 -0
- package/dist/{chunk-TE63Y5PX.js → chunk-JJIMABHT.js} +10 -3
- package/dist/chunk-JJIMABHT.js.map +1 -0
- package/dist/{chunk-KHQPN77E.js → chunk-KJHWXOCZ.js} +4 -4
- package/dist/{chunk-6CCZL2JJ.js → chunk-KRWGSOJ2.js} +30 -2
- package/dist/chunk-KRWGSOJ2.js.map +1 -0
- package/dist/{chunk-VPAEBI2F.js → chunk-LTFH7SEG.js} +24 -24
- package/dist/chunk-LTFH7SEG.js.map +1 -0
- package/dist/{chunk-E62LCBGD.js → chunk-MUNOKLLE.js} +3 -3
- package/dist/{chunk-ZVGEDXDP.cjs → chunk-MXGLYWVP.cjs} +10 -3
- package/dist/chunk-MXGLYWVP.cjs.map +1 -0
- package/dist/{chunk-55ZCOYDF.cjs → chunk-OYC34VTO.cjs} +252 -827
- package/dist/chunk-OYC34VTO.cjs.map +1 -0
- package/dist/{chunk-CAFJRZPZ.cjs → chunk-PQL5I3F6.cjs} +17 -17
- package/dist/{chunk-CAFJRZPZ.cjs.map → chunk-PQL5I3F6.cjs.map} +1 -1
- package/dist/{chunk-UFRBUT2D.cjs → chunk-REZTQ4PH.cjs} +87 -24
- package/dist/chunk-REZTQ4PH.cjs.map +1 -0
- package/dist/{chunk-RCY6XLGU.cjs → chunk-TZRUHQOH.cjs} +36 -8
- package/dist/chunk-TZRUHQOH.cjs.map +1 -0
- package/dist/{chunk-XD2HV7M5.js → chunk-UTYVIOWZ.js} +226 -801
- package/dist/chunk-UTYVIOWZ.js.map +1 -0
- package/dist/{chunk-YAXY5L7I.cjs → chunk-W2LDIX26.cjs} +5 -5
- package/dist/{chunk-YAXY5L7I.cjs.map → chunk-W2LDIX26.cjs.map} +1 -1
- package/dist/{chunk-K6TGILHX.cjs → chunk-WSG64BVN.cjs} +6 -6
- package/dist/{chunk-K6TGILHX.cjs.map → chunk-WSG64BVN.cjs.map} +1 -1
- package/dist/chunk-WTQYGUNF.js +400 -0
- package/dist/chunk-WTQYGUNF.js.map +1 -0
- package/dist/{chunk-YDVHT7GS.cjs → chunk-WYK7EL5R.cjs} +100 -447
- package/dist/chunk-WYK7EL5R.cjs.map +1 -0
- package/dist/{chunk-X7JL2NYJ.cjs → chunk-XC4KHJYX.cjs} +51 -45
- package/dist/chunk-XC4KHJYX.cjs.map +1 -0
- package/dist/chunk-XVBH5XHE.cjs +400 -0
- package/dist/chunk-XVBH5XHE.cjs.map +1 -0
- package/dist/{chunk-IS5YYLTV.js → chunk-YAFQVVDI.js} +85 -22
- package/dist/chunk-YAFQVVDI.js.map +1 -0
- package/dist/components/legend/index.cjs +4 -3
- package/dist/components/legend/index.cjs.map +1 -1
- package/dist/components/legend/index.css +12 -24
- package/dist/components/legend/index.css.map +1 -1
- package/dist/components/legend/index.d.cts +4 -4
- package/dist/components/legend/index.d.ts +4 -4
- package/dist/components/legend/index.js +3 -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 -5
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.css +0 -94
- package/dist/hooks/index.css.map +1 -1
- package/dist/hooks/index.d.cts +9 -13
- package/dist/hooks/index.d.ts +9 -13
- package/dist/hooks/index.js +2 -4
- package/dist/index.cjs +18 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +20 -33
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +17 -16
- package/dist/{leaderboard-chart-COtgamhe.d.cts → leaderboard-chart-BSbg0ufV.d.cts} +3 -11
- package/dist/{leaderboard-chart-BSgEw_Um.d.ts → leaderboard-chart-odEYxxEC.d.ts} +3 -11
- package/dist/{legend-C9ahiwOt.d.cts → legend-DFkosEvC.d.cts} +1 -1
- package/dist/{legend-jjMmhSg3.d.ts → legend-DLswHhOk.d.ts} +1 -1
- package/dist/providers/index.cjs +3 -3
- package/dist/providers/index.css +0 -94
- package/dist/providers/index.css.map +1 -1
- 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-CVR5rmIs.d.cts → themes-D0qc5JaW.d.cts} +2 -2
- package/dist/{themes-DQzmaSze.d.ts → themes-itO4Ht5g.d.ts} +2 -2
- package/dist/{types-BBwg4Evw.d.cts → types-B5f6XQ7Q.d.cts} +1 -1
- package/dist/{types-DQNnq5Fr.d.ts → types-BsHooDbM.d.ts} +1 -1
- package/dist/{types-C05PdDJa.d.cts → types-BuSrRM4p.d.ts} +15 -23
- package/dist/{types-CzdN7rUe.d.cts → types-ChOUI9-N.d.cts} +90 -46
- package/dist/{types-CzdN7rUe.d.ts → types-ChOUI9-N.d.ts} +90 -46
- package/dist/{types-C05PdDJa.d.ts → types-Dfw9VOKI.d.cts} +15 -23
- 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 +10 -8
- package/src/charts/bar-chart/bar-chart.tsx +19 -19
- package/src/charts/bar-chart/test/bar-chart.test.tsx +78 -31
- 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 +124 -102
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +61 -33
- package/src/charts/leaderboard-chart/test/use-leaderboard-legend-items.test.tsx +2 -5
- package/src/charts/leaderboard-chart/types.ts +2 -15
- package/src/charts/line-chart/line-chart.tsx +18 -17
- package/src/charts/line-chart/test/line-chart.test.tsx +49 -27
- package/src/charts/line-chart/types.ts +0 -1
- package/src/charts/pie-chart/pie-chart.tsx +23 -23
- package/src/charts/pie-chart/test/composition-api.test.tsx +41 -0
- package/src/charts/pie-chart/test/pie-chart.test.tsx +9 -9
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +21 -24
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +33 -5
- package/src/charts/private/chart-composition/index.ts +2 -0
- package/src/charts/private/chart-composition/render-legend-slot.ts +22 -0
- package/src/charts/private/chart-composition/test/render-legend-slot.test.tsx +60 -0
- package/src/charts/private/chart-composition/test/use-chart-children.test.tsx +91 -0
- package/src/charts/private/chart-composition/use-chart-children.ts +34 -2
- package/src/components/legend/private/base-legend.module.scss +19 -37
- package/src/components/legend/private/base-legend.tsx +32 -24
- package/src/components/legend/test/legend.test.tsx +148 -52
- package/src/components/legend/types.ts +23 -24
- package/src/hooks/index.ts +0 -1
- package/src/hooks/test/use-zero-value-display.test.tsx +206 -0
- package/src/hooks/use-zero-value-display.ts +52 -23
- 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 +93 -44
- package/src/utils/date-parsing.ts +10 -1
- package/src/utils/get-styles.ts +1 -1
- package/src/utils/test/date-parsing.test.ts +12 -0
- package/src/utils/test/get-styles.test.ts +12 -10
- package/src/utils/test/resolve-css-var.test.ts +2 -2
- package/tsup.config.ts +1 -1
- package/dist/chunk-55ZCOYDF.cjs.map +0 -1
- package/dist/chunk-6CCZL2JJ.js.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-RCY6XLGU.cjs.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/chunk-ZVGEDXDP.cjs.map +0 -1
- package/src/hooks/use-has-legend-child.ts +0 -22
- /package/dist/{chunk-GWBS65VC.js.map → chunk-4B7BL2DD.js.map} +0 -0
- /package/dist/{chunk-MDRCAGKZ.js.map → chunk-DKU775VC.js.map} +0 -0
- /package/dist/{chunk-KHQPN77E.js.map → chunk-KJHWXOCZ.js.map} +0 -0
- /package/dist/{chunk-E62LCBGD.js.map → chunk-MUNOKLLE.js.map} +0 -0
package/dist/providers/index.cjs
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../chunk-
|
|
9
|
+
var _chunkWYK7EL5Rcjs = require('../chunk-WYK7EL5R.cjs');
|
|
10
|
+
require('../chunk-MXGLYWVP.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 = _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
21
|
//# sourceMappingURL=index.cjs.map
|
package/dist/providers/index.css
CHANGED
|
@@ -6,98 +6,4 @@
|
|
|
6
6
|
z-index: 1;
|
|
7
7
|
pointer-events: none;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
/* esbuild-sass-plugin:css-chunk:src/components/legend/private/base-legend.module.scss */
|
|
11
|
-
.a8ccharts-AELBvX {
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: row;
|
|
14
|
-
flex-wrap: wrap;
|
|
15
|
-
gap: 16px;
|
|
16
|
-
}
|
|
17
|
-
.a8ccharts-fX8uQe {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
gap: 8px;
|
|
21
|
-
}
|
|
22
|
-
.a8ccharts-fX8uQe.a8ccharts-DEe0wg {
|
|
23
|
-
align-items: flex-start;
|
|
24
|
-
}
|
|
25
|
-
.a8ccharts-fX8uQe.a8ccharts-WBKF9I {
|
|
26
|
-
align-items: center;
|
|
27
|
-
}
|
|
28
|
-
.a8ccharts-fX8uQe.a8ccharts-JfwMng {
|
|
29
|
-
align-items: flex-end;
|
|
30
|
-
}
|
|
31
|
-
.a8ccharts-8Y73Kh {
|
|
32
|
-
position: relative;
|
|
33
|
-
}
|
|
34
|
-
.a8ccharts-8Y73Kh.a8ccharts-DEe0wg {
|
|
35
|
-
justify-content: flex-start;
|
|
36
|
-
}
|
|
37
|
-
.a8ccharts-8Y73Kh.a8ccharts-WBKF9I {
|
|
38
|
-
justify-content: center;
|
|
39
|
-
}
|
|
40
|
-
.a8ccharts-8Y73Kh.a8ccharts-JfwMng {
|
|
41
|
-
justify-content: flex-end;
|
|
42
|
-
}
|
|
43
|
-
.a8ccharts-TVM-IY {
|
|
44
|
-
position: relative;
|
|
45
|
-
}
|
|
46
|
-
.a8ccharts-TVM-IY.a8ccharts-DEe0wg {
|
|
47
|
-
justify-content: flex-start;
|
|
48
|
-
}
|
|
49
|
-
.a8ccharts-TVM-IY.a8ccharts-WBKF9I {
|
|
50
|
-
justify-content: center;
|
|
51
|
-
}
|
|
52
|
-
.a8ccharts-TVM-IY.a8ccharts-JfwMng {
|
|
53
|
-
justify-content: flex-end;
|
|
54
|
-
}
|
|
55
|
-
.a8ccharts-Vflwq8 {
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
font-size: 0.875rem;
|
|
59
|
-
}
|
|
60
|
-
.a8ccharts-qGsavM {
|
|
61
|
-
cursor: pointer;
|
|
62
|
-
user-select: none;
|
|
63
|
-
transition: opacity 0.2s ease;
|
|
64
|
-
}
|
|
65
|
-
.a8ccharts-qGsavM:hover {
|
|
66
|
-
opacity: 0.8;
|
|
67
|
-
}
|
|
68
|
-
.a8ccharts-qGsavM:focus {
|
|
69
|
-
outline: 2px solid currentColor;
|
|
70
|
-
outline-offset: 2px;
|
|
71
|
-
border-radius: 4px;
|
|
72
|
-
}
|
|
73
|
-
.a8ccharts-qGsavM:focus:not(:focus-visible) {
|
|
74
|
-
outline: none;
|
|
75
|
-
}
|
|
76
|
-
.a8ccharts-ZtDY-Q {
|
|
77
|
-
opacity: 0.4;
|
|
78
|
-
}
|
|
79
|
-
.a8ccharts-ZtDY-Q .a8ccharts-2H65Kr {
|
|
80
|
-
text-decoration: line-through;
|
|
81
|
-
}
|
|
82
|
-
.a8ccharts-2H65Kr {
|
|
83
|
-
display: flex;
|
|
84
|
-
align-items: center;
|
|
85
|
-
gap: 0.5rem;
|
|
86
|
-
}
|
|
87
|
-
.a8ccharts-faSDBI {
|
|
88
|
-
overflow-wrap: break-word;
|
|
89
|
-
white-space: normal;
|
|
90
|
-
hyphens: auto;
|
|
91
|
-
}
|
|
92
|
-
.a8ccharts-FISUIO {
|
|
93
|
-
white-space: nowrap;
|
|
94
|
-
overflow: hidden;
|
|
95
|
-
text-overflow: ellipsis;
|
|
96
|
-
flex-shrink: 1;
|
|
97
|
-
min-width: 0;
|
|
98
|
-
}
|
|
99
|
-
.a8ccharts-DTZlT- {
|
|
100
|
-
font-weight: 500;
|
|
101
|
-
flex-shrink: 0;
|
|
102
|
-
}
|
|
103
9
|
/*# sourceMappingURL=index.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["esbuild-sass-plugin:css-chunk:src/hooks/use-tooltip-portal-relocator.module.scss"
|
|
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,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-D0qc5JaW.cjs';
|
|
2
|
+
import { B as BaseLegendItem } from '../types-Dfw9VOKI.cjs';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-ChOUI9-N.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-itO4Ht5g.js';
|
|
2
|
+
import { B as BaseLegendItem } from '../types-BuSrRM4p.js';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-ChOUI9-N.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-2I67QUIV.js";
|
|
10
|
+
import "../chunk-JJIMABHT.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 {
|
|
4
|
-
import { B as BaseLegendItem } from './types-
|
|
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
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 {
|
|
4
|
-
import { B as BaseLegendItem } from './types-
|
|
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
5
|
import { LegendShape } from '@visx/legend/lib/types';
|
|
6
6
|
import { LineStyles, GlyphProps } from '@visx/xychart';
|
|
7
7
|
|
|
@@ -1,32 +1,24 @@
|
|
|
1
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';
|
|
2
3
|
import { GlyphProps, LineStyles } from '@visx/xychart';
|
|
3
4
|
import { ComponentProps, ReactNode, CSSProperties } from 'react';
|
|
4
5
|
|
|
5
|
-
type
|
|
6
|
-
type BaseLegendProps =
|
|
6
|
+
type VisxLegendProps = Pick<ComponentProps<typeof LegendOrdinal>, 'className' | 'shape' | 'fill' | 'size' | 'labelFormat' | 'labelTransform'>;
|
|
7
|
+
type BaseLegendProps = VisxLegendProps & {
|
|
7
8
|
items: BaseLegendItem[];
|
|
8
9
|
orientation?: 'horizontal' | 'vertical';
|
|
9
|
-
|
|
10
|
-
* TODO: Add 'left' | 'right' positioning support in future implementation
|
|
11
|
-
*/
|
|
12
|
-
position?: 'top' | 'bottom';
|
|
10
|
+
position?: LegendPosition;
|
|
13
11
|
alignment?: 'start' | 'center' | 'end';
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
textOverflow?: 'ellipsis' | 'wrap';
|
|
25
|
-
/**
|
|
26
|
-
* Additional CSS class name for legend items.
|
|
27
|
-
* This allows consumers to customize individual legend item styling.
|
|
28
|
-
*/
|
|
29
|
-
legendItemClassName?: string;
|
|
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;
|
|
30
22
|
/**
|
|
31
23
|
* Function for rendering a custom legend layout.
|
|
32
24
|
*/
|
|
@@ -47,7 +39,7 @@ type LegendProps = Omit<BaseLegendProps, 'items'> & {
|
|
|
47
39
|
};
|
|
48
40
|
type BaseLegendItem = {
|
|
49
41
|
label: string;
|
|
50
|
-
value
|
|
42
|
+
value?: number | string;
|
|
51
43
|
color: string;
|
|
52
44
|
glyphSize?: number;
|
|
53
45
|
renderGlyph?: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
|
|
@@ -8,7 +8,7 @@ import { ScaleType, ScaleInput } from '@visx/scale';
|
|
|
8
8
|
import { TextProps } from '@visx/text/lib/Text';
|
|
9
9
|
import { EventHandlerParams, LineStyles, GridStyles, GlyphProps } from '@visx/xychart';
|
|
10
10
|
import { GapSize } from '@wordpress/theme';
|
|
11
|
-
import { PointerEvent,
|
|
11
|
+
import { PointerEvent, CSSProperties, ReactNode } from 'react';
|
|
12
12
|
import { GoogleDataTableColumn, GoogleDataTableRow } from 'react-google-charts';
|
|
13
13
|
|
|
14
14
|
type ValueOf<T> = T[keyof T];
|
|
@@ -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
|
};
|
|
@@ -318,6 +322,81 @@ type ScaleOptions = {
|
|
|
318
322
|
*/
|
|
319
323
|
paddingOuter?: number;
|
|
320
324
|
};
|
|
325
|
+
type LegendItemStyles = {
|
|
326
|
+
/** Margin around each legend item. */
|
|
327
|
+
margin?: CSSProperties['margin'];
|
|
328
|
+
/** Flex direction for items within each legend entry. */
|
|
329
|
+
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
330
|
+
};
|
|
331
|
+
type LegendLabelStyles = Pick<CSSProperties, 'justifyContent' | 'flex' | 'margin'> & {
|
|
332
|
+
/**
|
|
333
|
+
* Maximum width for legend label text as a CSS value (e.g. '200px', '50%', '10rem').
|
|
334
|
+
* When set, text overflow behavior is controlled by textOverflow.
|
|
335
|
+
*/
|
|
336
|
+
maxWidth?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Controls how text behaves when it exceeds maxWidth.
|
|
339
|
+
* - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
|
|
340
|
+
* - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
|
|
341
|
+
*/
|
|
342
|
+
textOverflow?: 'ellipsis' | 'wrap';
|
|
343
|
+
};
|
|
344
|
+
type LegendShapeStyles = {
|
|
345
|
+
/** Width of the legend shape in pixels. */
|
|
346
|
+
width?: number;
|
|
347
|
+
/** Height of the legend shape in pixels. */
|
|
348
|
+
height?: number;
|
|
349
|
+
/** Margin around the legend shape. */
|
|
350
|
+
margin?: CSSProperties['margin'];
|
|
351
|
+
};
|
|
352
|
+
/** Position of the legend relative to chart content. */
|
|
353
|
+
type LegendPosition = 'top' | 'bottom';
|
|
354
|
+
/**
|
|
355
|
+
* Configuration object for chart legend appearance and behavior.
|
|
356
|
+
* Consolidates all legend styling and layout props into a single structured object.
|
|
357
|
+
*/
|
|
358
|
+
type ChartLegendConfig<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
359
|
+
/**
|
|
360
|
+
* Layout direction of legend items.
|
|
361
|
+
*/
|
|
362
|
+
orientation?: 'horizontal' | 'vertical';
|
|
363
|
+
/**
|
|
364
|
+
* Position of the legend relative to the chart.
|
|
365
|
+
* TODO: Add 'left' | 'right' positioning support in future implementation
|
|
366
|
+
*/
|
|
367
|
+
position?: LegendPosition;
|
|
368
|
+
/**
|
|
369
|
+
* Alignment of the legend within its position.
|
|
370
|
+
*/
|
|
371
|
+
alignment?: 'start' | 'center' | 'end';
|
|
372
|
+
/**
|
|
373
|
+
* Shape of the legend marker icon.
|
|
374
|
+
*/
|
|
375
|
+
shape?: LegendShape<T, number>;
|
|
376
|
+
/**
|
|
377
|
+
* Enable interactive legend items that can toggle series visibility.
|
|
378
|
+
* Supported for all chart types that render series.
|
|
379
|
+
* Requires chartId and GlobalChartsProvider.
|
|
380
|
+
* For pie charts, percentages are recalculated so visible segments total 100%.
|
|
381
|
+
*/
|
|
382
|
+
interactive?: boolean;
|
|
383
|
+
/**
|
|
384
|
+
* Additional CSS class name for individual legend items.
|
|
385
|
+
*/
|
|
386
|
+
itemClassName?: string;
|
|
387
|
+
/**
|
|
388
|
+
* CSS styles for each legend item (margin, flexDirection).
|
|
389
|
+
*/
|
|
390
|
+
itemStyles?: LegendItemStyles;
|
|
391
|
+
/**
|
|
392
|
+
* CSS styles for legend labels (maxWidth, textOverflow, justifyContent, flex, margin).
|
|
393
|
+
*/
|
|
394
|
+
labelStyles?: LegendLabelStyles;
|
|
395
|
+
/**
|
|
396
|
+
* Styles for legend shapes (width, height, margin).
|
|
397
|
+
*/
|
|
398
|
+
shapeStyles?: LegendShapeStyles;
|
|
399
|
+
};
|
|
321
400
|
/**
|
|
322
401
|
* Base properties shared across all chart components
|
|
323
402
|
*/
|
|
@@ -382,45 +461,10 @@ type BaseChartProps<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
382
461
|
*/
|
|
383
462
|
showLegend?: boolean;
|
|
384
463
|
/**
|
|
385
|
-
* Legend
|
|
386
|
-
|
|
387
|
-
legendOrientation?: 'horizontal' | 'vertical';
|
|
388
|
-
/**
|
|
389
|
-
* Legend shape
|
|
390
|
-
*/
|
|
391
|
-
legendShape?: LegendShape<T, number>;
|
|
392
|
-
/**
|
|
393
|
-
* Legend position (where the legend appears)
|
|
394
|
-
* TODO: Add 'left' | 'right' positioning support in future implementation
|
|
395
|
-
*/
|
|
396
|
-
legendPosition?: 'top' | 'bottom';
|
|
397
|
-
/**
|
|
398
|
-
* Legend alignment within its position
|
|
399
|
-
*/
|
|
400
|
-
legendAlignment?: 'start' | 'center' | 'end';
|
|
401
|
-
/**
|
|
402
|
-
* Maximum width for legend items. When set, text overflow behavior is controlled by legendTextOverflow.
|
|
403
|
-
* Should be a CSS value string (e.g. '200px', '50%', '10rem')
|
|
404
|
-
*/
|
|
405
|
-
legendMaxWidth?: string;
|
|
406
|
-
/**
|
|
407
|
-
* Controls how text behaves when it exceeds legendMaxWidth.
|
|
408
|
-
* - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
|
|
409
|
-
* - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
|
|
410
|
-
*/
|
|
411
|
-
legendTextOverflow?: 'ellipsis' | 'wrap';
|
|
412
|
-
/**
|
|
413
|
-
* Additional CSS class name for legend items.
|
|
414
|
-
* This allows consumers to customize individual legend item styling.
|
|
415
|
-
*/
|
|
416
|
-
legendItemClassName?: string;
|
|
417
|
-
/**
|
|
418
|
-
* Enable interactive legend items that can toggle series visibility.
|
|
419
|
-
* Supported for LineChart, PieChart, and PieSemiCircleChart.
|
|
420
|
-
* Requires chartId and GlobalChartsProvider.
|
|
421
|
-
* For pie charts, percentages are recalculated so visible segments total 100%.
|
|
464
|
+
* Legend configuration object for controlling legend appearance and behavior.
|
|
465
|
+
* Includes orientation, position, alignment, shape, styling, and interactivity options.
|
|
422
466
|
*/
|
|
423
|
-
|
|
467
|
+
legend?: ChartLegendConfig<T>;
|
|
424
468
|
/**
|
|
425
469
|
* Grid visibility. x is default when orientation is vertical. y is default when orientation is horizontal.
|
|
426
470
|
*/
|
|
@@ -498,4 +542,4 @@ interface ToggleEvent extends Event {
|
|
|
498
542
|
oldState: 'open' | 'closed';
|
|
499
543
|
}
|
|
500
544
|
|
|
501
|
-
export type { AnnotationStyles as A, BaseChartProps as B,
|
|
545
|
+
export type { AnnotationStyles as A, BaseChartProps as B, ChartLegendConfig as C, DataPoint as D, GeoData as G, LeaderboardEntry as L, MultipleDataPointsDate as M, Optional as O, PopoverButtonAttributes as P, ScaleOptions as S, ToggleEvent as T, ButtonWithPopover as a, ChartTheme as b, CompleteChartTheme as c, DataPointDate as d, DataPointPercentage as e, GradientStop as f, GridProps as g, LegendItemStyles as h, LegendLabelStyles as i, LegendPosition as j, LegendShapeStyles as k, OrientationType as l, PopoverElement as m, PopoverElementAttributes as n, SeriesData as o, SeriesDataOptions as p };
|
|
@@ -8,7 +8,7 @@ import { ScaleType, ScaleInput } from '@visx/scale';
|
|
|
8
8
|
import { TextProps } from '@visx/text/lib/Text';
|
|
9
9
|
import { EventHandlerParams, LineStyles, GridStyles, GlyphProps } from '@visx/xychart';
|
|
10
10
|
import { GapSize } from '@wordpress/theme';
|
|
11
|
-
import { PointerEvent,
|
|
11
|
+
import { PointerEvent, CSSProperties, ReactNode } from 'react';
|
|
12
12
|
import { GoogleDataTableColumn, GoogleDataTableRow } from 'react-google-charts';
|
|
13
13
|
|
|
14
14
|
type ValueOf<T> = T[keyof T];
|
|
@@ -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
|
};
|
|
@@ -318,6 +322,81 @@ type ScaleOptions = {
|
|
|
318
322
|
*/
|
|
319
323
|
paddingOuter?: number;
|
|
320
324
|
};
|
|
325
|
+
type LegendItemStyles = {
|
|
326
|
+
/** Margin around each legend item. */
|
|
327
|
+
margin?: CSSProperties['margin'];
|
|
328
|
+
/** Flex direction for items within each legend entry. */
|
|
329
|
+
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
330
|
+
};
|
|
331
|
+
type LegendLabelStyles = Pick<CSSProperties, 'justifyContent' | 'flex' | 'margin'> & {
|
|
332
|
+
/**
|
|
333
|
+
* Maximum width for legend label text as a CSS value (e.g. '200px', '50%', '10rem').
|
|
334
|
+
* When set, text overflow behavior is controlled by textOverflow.
|
|
335
|
+
*/
|
|
336
|
+
maxWidth?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Controls how text behaves when it exceeds maxWidth.
|
|
339
|
+
* - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
|
|
340
|
+
* - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
|
|
341
|
+
*/
|
|
342
|
+
textOverflow?: 'ellipsis' | 'wrap';
|
|
343
|
+
};
|
|
344
|
+
type LegendShapeStyles = {
|
|
345
|
+
/** Width of the legend shape in pixels. */
|
|
346
|
+
width?: number;
|
|
347
|
+
/** Height of the legend shape in pixels. */
|
|
348
|
+
height?: number;
|
|
349
|
+
/** Margin around the legend shape. */
|
|
350
|
+
margin?: CSSProperties['margin'];
|
|
351
|
+
};
|
|
352
|
+
/** Position of the legend relative to chart content. */
|
|
353
|
+
type LegendPosition = 'top' | 'bottom';
|
|
354
|
+
/**
|
|
355
|
+
* Configuration object for chart legend appearance and behavior.
|
|
356
|
+
* Consolidates all legend styling and layout props into a single structured object.
|
|
357
|
+
*/
|
|
358
|
+
type ChartLegendConfig<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
359
|
+
/**
|
|
360
|
+
* Layout direction of legend items.
|
|
361
|
+
*/
|
|
362
|
+
orientation?: 'horizontal' | 'vertical';
|
|
363
|
+
/**
|
|
364
|
+
* Position of the legend relative to the chart.
|
|
365
|
+
* TODO: Add 'left' | 'right' positioning support in future implementation
|
|
366
|
+
*/
|
|
367
|
+
position?: LegendPosition;
|
|
368
|
+
/**
|
|
369
|
+
* Alignment of the legend within its position.
|
|
370
|
+
*/
|
|
371
|
+
alignment?: 'start' | 'center' | 'end';
|
|
372
|
+
/**
|
|
373
|
+
* Shape of the legend marker icon.
|
|
374
|
+
*/
|
|
375
|
+
shape?: LegendShape<T, number>;
|
|
376
|
+
/**
|
|
377
|
+
* Enable interactive legend items that can toggle series visibility.
|
|
378
|
+
* Supported for all chart types that render series.
|
|
379
|
+
* Requires chartId and GlobalChartsProvider.
|
|
380
|
+
* For pie charts, percentages are recalculated so visible segments total 100%.
|
|
381
|
+
*/
|
|
382
|
+
interactive?: boolean;
|
|
383
|
+
/**
|
|
384
|
+
* Additional CSS class name for individual legend items.
|
|
385
|
+
*/
|
|
386
|
+
itemClassName?: string;
|
|
387
|
+
/**
|
|
388
|
+
* CSS styles for each legend item (margin, flexDirection).
|
|
389
|
+
*/
|
|
390
|
+
itemStyles?: LegendItemStyles;
|
|
391
|
+
/**
|
|
392
|
+
* CSS styles for legend labels (maxWidth, textOverflow, justifyContent, flex, margin).
|
|
393
|
+
*/
|
|
394
|
+
labelStyles?: LegendLabelStyles;
|
|
395
|
+
/**
|
|
396
|
+
* Styles for legend shapes (width, height, margin).
|
|
397
|
+
*/
|
|
398
|
+
shapeStyles?: LegendShapeStyles;
|
|
399
|
+
};
|
|
321
400
|
/**
|
|
322
401
|
* Base properties shared across all chart components
|
|
323
402
|
*/
|
|
@@ -382,45 +461,10 @@ type BaseChartProps<T = DataPoint | DataPointDate | LeaderboardEntry> = {
|
|
|
382
461
|
*/
|
|
383
462
|
showLegend?: boolean;
|
|
384
463
|
/**
|
|
385
|
-
* Legend
|
|
386
|
-
|
|
387
|
-
legendOrientation?: 'horizontal' | 'vertical';
|
|
388
|
-
/**
|
|
389
|
-
* Legend shape
|
|
390
|
-
*/
|
|
391
|
-
legendShape?: LegendShape<T, number>;
|
|
392
|
-
/**
|
|
393
|
-
* Legend position (where the legend appears)
|
|
394
|
-
* TODO: Add 'left' | 'right' positioning support in future implementation
|
|
395
|
-
*/
|
|
396
|
-
legendPosition?: 'top' | 'bottom';
|
|
397
|
-
/**
|
|
398
|
-
* Legend alignment within its position
|
|
399
|
-
*/
|
|
400
|
-
legendAlignment?: 'start' | 'center' | 'end';
|
|
401
|
-
/**
|
|
402
|
-
* Maximum width for legend items. When set, text overflow behavior is controlled by legendTextOverflow.
|
|
403
|
-
* Should be a CSS value string (e.g. '200px', '50%', '10rem')
|
|
404
|
-
*/
|
|
405
|
-
legendMaxWidth?: string;
|
|
406
|
-
/**
|
|
407
|
-
* Controls how text behaves when it exceeds legendMaxWidth.
|
|
408
|
-
* - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
|
|
409
|
-
* - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
|
|
410
|
-
*/
|
|
411
|
-
legendTextOverflow?: 'ellipsis' | 'wrap';
|
|
412
|
-
/**
|
|
413
|
-
* Additional CSS class name for legend items.
|
|
414
|
-
* This allows consumers to customize individual legend item styling.
|
|
415
|
-
*/
|
|
416
|
-
legendItemClassName?: string;
|
|
417
|
-
/**
|
|
418
|
-
* Enable interactive legend items that can toggle series visibility.
|
|
419
|
-
* Supported for LineChart, PieChart, and PieSemiCircleChart.
|
|
420
|
-
* Requires chartId and GlobalChartsProvider.
|
|
421
|
-
* For pie charts, percentages are recalculated so visible segments total 100%.
|
|
464
|
+
* Legend configuration object for controlling legend appearance and behavior.
|
|
465
|
+
* Includes orientation, position, alignment, shape, styling, and interactivity options.
|
|
422
466
|
*/
|
|
423
|
-
|
|
467
|
+
legend?: ChartLegendConfig<T>;
|
|
424
468
|
/**
|
|
425
469
|
* Grid visibility. x is default when orientation is vertical. y is default when orientation is horizontal.
|
|
426
470
|
*/
|
|
@@ -498,4 +542,4 @@ interface ToggleEvent extends Event {
|
|
|
498
542
|
oldState: 'open' | 'closed';
|
|
499
543
|
}
|
|
500
544
|
|
|
501
|
-
export type { AnnotationStyles as A, BaseChartProps as B,
|
|
545
|
+
export type { AnnotationStyles as A, BaseChartProps as B, ChartLegendConfig as C, DataPoint as D, GeoData as G, LeaderboardEntry as L, MultipleDataPointsDate as M, Optional as O, PopoverButtonAttributes as P, ScaleOptions as S, ToggleEvent as T, ButtonWithPopover as a, ChartTheme as b, CompleteChartTheme as c, DataPointDate as d, DataPointPercentage as e, GradientStop as f, GridProps as g, LegendItemStyles as h, LegendLabelStyles as i, LegendPosition as j, LegendShapeStyles as k, OrientationType as l, PopoverElement as m, PopoverElementAttributes as n, SeriesData as o, SeriesDataOptions as p };
|