@automattic/charts 0.57.0 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -2
- package/README.md +7 -54
- package/dist/index.cjs +9607 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +32 -49
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +1612 -33
- package/dist/index.d.ts +1612 -33
- package/dist/index.js +9640 -54
- package/dist/index.js.map +1 -1
- package/package.json +9 -126
- package/src/charts/bar-chart/bar-chart.module.scss +0 -5
- package/src/charts/bar-chart/bar-chart.tsx +142 -149
- package/src/charts/bar-chart/test/bar-chart.test.tsx +48 -31
- package/src/charts/leaderboard-chart/leaderboard-chart.tsx +54 -74
- package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +4 -5
- package/src/charts/leaderboard-chart/types.ts +1 -11
- package/src/charts/line-chart/line-chart.module.scss +0 -5
- package/src/charts/line-chart/line-chart.tsx +202 -193
- package/src/charts/line-chart/private/line-chart-annotations-overlay.tsx +1 -2
- package/src/charts/line-chart/test/line-chart.test.tsx +49 -27
- package/src/charts/line-chart/types.ts +0 -1
- package/src/charts/pie-chart/pie-chart.module.scss +2 -10
- package/src/charts/pie-chart/pie-chart.tsx +212 -212
- package/src/charts/pie-chart/test/composition-api.test.tsx +44 -3
- package/src/charts/pie-chart/test/pie-chart.test.tsx +51 -44
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +2 -8
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +166 -168
- package/src/charts/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +58 -30
- package/src/charts/private/chart-composition/index.ts +2 -0
- package/src/charts/private/chart-composition/render-legend-slot.ts +22 -0
- package/src/charts/private/chart-composition/test/render-legend-slot.test.tsx +60 -0
- package/src/charts/private/chart-composition/test/use-chart-children.test.tsx +91 -0
- package/src/charts/private/chart-composition/use-chart-children.ts +34 -2
- package/src/charts/private/chart-layout/chart-layout.module.scss +7 -0
- package/src/charts/private/chart-layout/chart-layout.tsx +106 -0
- package/src/charts/private/chart-layout/index.ts +2 -0
- package/src/charts/private/chart-layout/test/chart-layout.test.tsx +167 -0
- package/src/charts/private/single-chart-context/single-chart-context.tsx +2 -2
- package/src/charts/private/svg-empty-state/index.ts +1 -0
- package/src/charts/private/svg-empty-state/svg-empty-state.module.scss +7 -0
- package/src/charts/private/svg-empty-state/svg-empty-state.tsx +40 -0
- package/src/components/legend/hooks/test/use-chart-legend-items.test.tsx +12 -8
- package/src/components/legend/hooks/use-chart-legend-items.ts +12 -13
- package/src/components/legend/index.ts +1 -8
- package/src/components/legend/legend.tsx +33 -8
- package/src/components/legend/private/base-legend.module.scss +19 -37
- package/src/components/legend/private/base-legend.tsx +0 -2
- package/src/components/legend/test/legend.test.tsx +93 -1
- package/src/components/legend/types.ts +7 -34
- package/src/hooks/index.ts +1 -1
- package/src/hooks/use-data-with-percentages.ts +24 -0
- package/src/hooks/use-interactive-legend-data.ts +18 -15
- package/src/index.ts +66 -9
- package/src/providers/chart-context/global-charts-provider.tsx +7 -1
- package/src/providers/chart-context/hooks/use-chart-registration.ts +2 -1
- package/src/providers/chart-context/types.ts +2 -2
- package/src/types.ts +110 -45
- package/src/utils/date-parsing.ts +10 -1
- package/src/utils/test/date-parsing.test.ts +12 -0
- package/src/utils/test/resolve-css-var.test.ts +4 -2
- package/tsup.config.ts +1 -1
- package/dist/base-tooltip-DOq93wjU.d.cts +0 -38
- package/dist/base-tooltip-DOq93wjU.d.ts +0 -38
- package/dist/charts/bar-chart/index.cjs +0 -15
- package/dist/charts/bar-chart/index.cjs.map +0 -1
- package/dist/charts/bar-chart/index.css +0 -153
- package/dist/charts/bar-chart/index.css.map +0 -1
- package/dist/charts/bar-chart/index.d.cts +0 -37
- package/dist/charts/bar-chart/index.d.ts +0 -37
- package/dist/charts/bar-chart/index.js +0 -15
- package/dist/charts/bar-chart/index.js.map +0 -1
- package/dist/charts/bar-list-chart/index.cjs +0 -16
- package/dist/charts/bar-list-chart/index.cjs.map +0 -1
- package/dist/charts/bar-list-chart/index.css +0 -153
- package/dist/charts/bar-list-chart/index.css.map +0 -1
- package/dist/charts/bar-list-chart/index.d.cts +0 -92
- package/dist/charts/bar-list-chart/index.d.ts +0 -92
- package/dist/charts/bar-list-chart/index.js +0 -16
- package/dist/charts/bar-list-chart/index.js.map +0 -1
- package/dist/charts/conversion-funnel-chart/index.cjs +0 -11
- package/dist/charts/conversion-funnel-chart/index.cjs.map +0 -1
- package/dist/charts/conversion-funnel-chart/index.css +0 -251
- package/dist/charts/conversion-funnel-chart/index.css.map +0 -1
- package/dist/charts/conversion-funnel-chart/index.d.cts +0 -97
- package/dist/charts/conversion-funnel-chart/index.d.ts +0 -97
- package/dist/charts/conversion-funnel-chart/index.js +0 -11
- package/dist/charts/conversion-funnel-chart/index.js.map +0 -1
- package/dist/charts/geo-chart/index.cjs +0 -13
- package/dist/charts/geo-chart/index.cjs.map +0 -1
- package/dist/charts/geo-chart/index.css +0 -117
- package/dist/charts/geo-chart/index.css.map +0 -1
- package/dist/charts/geo-chart/index.d.cts +0 -67
- package/dist/charts/geo-chart/index.d.ts +0 -67
- package/dist/charts/geo-chart/index.js +0 -13
- package/dist/charts/geo-chart/index.js.map +0 -1
- package/dist/charts/leaderboard-chart/index.cjs +0 -20
- package/dist/charts/leaderboard-chart/index.cjs.map +0 -1
- package/dist/charts/leaderboard-chart/index.css +0 -172
- package/dist/charts/leaderboard-chart/index.css.map +0 -1
- package/dist/charts/leaderboard-chart/index.d.cts +0 -46
- package/dist/charts/leaderboard-chart/index.d.ts +0 -46
- package/dist/charts/leaderboard-chart/index.js +0 -20
- package/dist/charts/leaderboard-chart/index.js.map +0 -1
- package/dist/charts/line-chart/index.cjs +0 -15
- package/dist/charts/line-chart/index.cjs.map +0 -1
- package/dist/charts/line-chart/index.css +0 -225
- package/dist/charts/line-chart/index.css.map +0 -1
- package/dist/charts/line-chart/index.d.cts +0 -99
- package/dist/charts/line-chart/index.d.ts +0 -99
- package/dist/charts/line-chart/index.js +0 -15
- package/dist/charts/line-chart/index.js.map +0 -1
- package/dist/charts/pie-chart/index.cjs +0 -18
- package/dist/charts/pie-chart/index.cjs.map +0 -1
- package/dist/charts/pie-chart/index.css +0 -143
- package/dist/charts/pie-chart/index.css.map +0 -1
- package/dist/charts/pie-chart/index.d.cts +0 -97
- package/dist/charts/pie-chart/index.d.ts +0 -97
- package/dist/charts/pie-chart/index.js +0 -18
- package/dist/charts/pie-chart/index.js.map +0 -1
- package/dist/charts/pie-semi-circle-chart/index.cjs +0 -17
- package/dist/charts/pie-semi-circle-chart/index.cjs.map +0 -1
- package/dist/charts/pie-semi-circle-chart/index.css +0 -144
- package/dist/charts/pie-semi-circle-chart/index.css.map +0 -1
- package/dist/charts/pie-semi-circle-chart/index.d.cts +0 -94
- package/dist/charts/pie-semi-circle-chart/index.d.ts +0 -94
- package/dist/charts/pie-semi-circle-chart/index.js +0 -17
- package/dist/charts/pie-semi-circle-chart/index.js.map +0 -1
- package/dist/charts/sparkline/index.cjs +0 -16
- package/dist/charts/sparkline/index.cjs.map +0 -1
- package/dist/charts/sparkline/index.css +0 -242
- package/dist/charts/sparkline/index.css.map +0 -1
- package/dist/charts/sparkline/index.d.cts +0 -113
- package/dist/charts/sparkline/index.d.ts +0 -113
- package/dist/charts/sparkline/index.js +0 -16
- package/dist/charts/sparkline/index.js.map +0 -1
- package/dist/chunk-2A34OA5O.cjs +0 -51
- package/dist/chunk-2A34OA5O.cjs.map +0 -1
- package/dist/chunk-2NCY7R4G.js +0 -3897
- package/dist/chunk-2NCY7R4G.js.map +0 -1
- package/dist/chunk-32DH6JDF.js +0 -1263
- package/dist/chunk-32DH6JDF.js.map +0 -1
- package/dist/chunk-4OPFE4RM.js +0 -614
- package/dist/chunk-4OPFE4RM.js.map +0 -1
- package/dist/chunk-6CCZL2JJ.js +0 -63
- package/dist/chunk-6CCZL2JJ.js.map +0 -1
- package/dist/chunk-77OKCVQN.cjs +0 -421
- package/dist/chunk-77OKCVQN.cjs.map +0 -1
- package/dist/chunk-7FQX4ALL.cjs +0 -219
- package/dist/chunk-7FQX4ALL.cjs.map +0 -1
- package/dist/chunk-ASLARV7L.cjs +0 -81
- package/dist/chunk-ASLARV7L.cjs.map +0 -1
- package/dist/chunk-BCX5THDQ.js +0 -403
- package/dist/chunk-BCX5THDQ.js.map +0 -1
- package/dist/chunk-BPYKWMI7.js +0 -194
- package/dist/chunk-BPYKWMI7.js.map +0 -1
- package/dist/chunk-CZGYJKG6.js +0 -421
- package/dist/chunk-CZGYJKG6.js.map +0 -1
- package/dist/chunk-D2UH4CFE.cjs +0 -120
- package/dist/chunk-D2UH4CFE.cjs.map +0 -1
- package/dist/chunk-DAU3HNEG.js +0 -344
- package/dist/chunk-DAU3HNEG.js.map +0 -1
- package/dist/chunk-H2V4JMSA.js +0 -219
- package/dist/chunk-H2V4JMSA.js.map +0 -1
- package/dist/chunk-I2276W3I.cjs +0 -66
- package/dist/chunk-I2276W3I.cjs.map +0 -1
- package/dist/chunk-I35UYJJR.cjs +0 -468
- package/dist/chunk-I35UYJJR.cjs.map +0 -1
- package/dist/chunk-IU4DYUAV.js +0 -120
- package/dist/chunk-IU4DYUAV.js.map +0 -1
- package/dist/chunk-KXRWNFQJ.js +0 -51
- package/dist/chunk-KXRWNFQJ.js.map +0 -1
- package/dist/chunk-OP6PHB2U.js +0 -81
- package/dist/chunk-OP6PHB2U.js.map +0 -1
- package/dist/chunk-PXLEMUGJ.js +0 -165
- package/dist/chunk-PXLEMUGJ.js.map +0 -1
- package/dist/chunk-RCY6XLGU.cjs +0 -63
- package/dist/chunk-RCY6XLGU.cjs.map +0 -1
- package/dist/chunk-RHHVEJHJ.cjs +0 -1263
- package/dist/chunk-RHHVEJHJ.cjs.map +0 -1
- package/dist/chunk-TO3OQBXG.cjs +0 -165
- package/dist/chunk-TO3OQBXG.cjs.map +0 -1
- package/dist/chunk-V36ERY7Y.js +0 -375
- package/dist/chunk-V36ERY7Y.js.map +0 -1
- package/dist/chunk-VJM5XCB4.cjs +0 -614
- package/dist/chunk-VJM5XCB4.cjs.map +0 -1
- package/dist/chunk-VTS3PNMS.cjs +0 -344
- package/dist/chunk-VTS3PNMS.cjs.map +0 -1
- package/dist/chunk-WLODYNLB.js +0 -1067
- package/dist/chunk-WLODYNLB.js.map +0 -1
- package/dist/chunk-XKRJL2QT.cjs +0 -375
- package/dist/chunk-XKRJL2QT.cjs.map +0 -1
- package/dist/chunk-XWYZIFZW.js +0 -66
- package/dist/chunk-XWYZIFZW.js.map +0 -1
- package/dist/chunk-Y3NNQMAX.cjs +0 -194
- package/dist/chunk-Y3NNQMAX.cjs.map +0 -1
- package/dist/chunk-YE2T52VZ.cjs +0 -1067
- package/dist/chunk-YE2T52VZ.cjs.map +0 -1
- package/dist/chunk-Z26M4V2M.js +0 -468
- package/dist/chunk-Z26M4V2M.js.map +0 -1
- package/dist/chunk-Z45KX47P.cjs +0 -3897
- package/dist/chunk-Z45KX47P.cjs.map +0 -1
- package/dist/chunk-ZH4F5RMG.cjs +0 -403
- package/dist/chunk-ZH4F5RMG.cjs.map +0 -1
- package/dist/components/legend/index.cjs +0 -11
- package/dist/components/legend/index.cjs.map +0 -1
- package/dist/components/legend/index.css +0 -103
- package/dist/components/legend/index.css.map +0 -1
- package/dist/components/legend/index.d.cts +0 -37
- package/dist/components/legend/index.d.ts +0 -37
- package/dist/components/legend/index.js +0 -11
- package/dist/components/legend/index.js.map +0 -1
- package/dist/components/tooltip/index.cjs +0 -12
- package/dist/components/tooltip/index.cjs.map +0 -1
- package/dist/components/tooltip/index.css +0 -13
- package/dist/components/tooltip/index.css.map +0 -1
- package/dist/components/tooltip/index.d.cts +0 -71
- package/dist/components/tooltip/index.d.ts +0 -71
- package/dist/components/tooltip/index.js +0 -12
- package/dist/components/tooltip/index.js.map +0 -1
- package/dist/components/trend-indicator/index.cjs +0 -8
- package/dist/components/trend-indicator/index.cjs.map +0 -1
- package/dist/components/trend-indicator/index.css +0 -27
- package/dist/components/trend-indicator/index.css.map +0 -1
- package/dist/components/trend-indicator/index.d.cts +0 -44
- package/dist/components/trend-indicator/index.d.ts +0 -44
- package/dist/components/trend-indicator/index.js +0 -8
- package/dist/components/trend-indicator/index.js.map +0 -1
- package/dist/format-metric-value-MXm5DtQ_.d.cts +0 -24
- package/dist/format-metric-value-MXm5DtQ_.d.ts +0 -24
- package/dist/hooks/index.cjs +0 -31
- package/dist/hooks/index.cjs.map +0 -1
- package/dist/hooks/index.css +0 -103
- package/dist/hooks/index.css.map +0 -1
- package/dist/hooks/index.d.cts +0 -272
- package/dist/hooks/index.d.ts +0 -272
- package/dist/hooks/index.js +0 -31
- package/dist/hooks/index.js.map +0 -1
- package/dist/leaderboard-chart-BKYYXcg2.d.ts +0 -83
- package/dist/leaderboard-chart-DR7CGb0L.d.cts +0 -83
- package/dist/legend-C2grwnWk.d.cts +0 -9
- package/dist/legend-Cj0xM5dU.d.ts +0 -9
- package/dist/providers/index.cjs +0 -21
- package/dist/providers/index.cjs.map +0 -1
- package/dist/providers/index.css +0 -103
- package/dist/providers/index.css.map +0 -1
- package/dist/providers/index.d.cts +0 -28
- package/dist/providers/index.d.ts +0 -28
- package/dist/providers/index.js +0 -21
- package/dist/providers/index.js.map +0 -1
- package/dist/themes-BmVGrYnF.d.ts +0 -67
- package/dist/themes-CyjKm-P_.d.cts +0 -67
- package/dist/types-CuUEszrM.d.ts +0 -19
- package/dist/types-DZordNiO.d.cts +0 -505
- package/dist/types-DZordNiO.d.ts +0 -505
- package/dist/types-I67mddpr.d.cts +0 -78
- package/dist/types-I67mddpr.d.ts +0 -78
- package/dist/types-KtOPPzPX.d.cts +0 -19
- package/dist/utils/index.cjs +0 -44
- package/dist/utils/index.cjs.map +0 -1
- package/dist/utils/index.d.cts +0 -226
- package/dist/utils/index.d.ts +0 -226
- package/dist/utils/index.js +0 -44
- package/dist/utils/index.js.map +0 -1
- package/dist/with-responsive-CNfhzAUu.d.cts +0 -18
- package/dist/with-responsive-CNfhzAUu.d.ts +0 -18
- package/src/hooks/use-has-legend-child.ts +0 -22
package/src/index.ts
CHANGED
|
@@ -28,8 +28,32 @@ export {
|
|
|
28
28
|
defaultTheme,
|
|
29
29
|
} from './providers';
|
|
30
30
|
|
|
31
|
-
// Types
|
|
32
|
-
export type
|
|
31
|
+
// Types - explicit exports (excludes internal types like DataPointPercentageCalculated)
|
|
32
|
+
export type {
|
|
33
|
+
Optional,
|
|
34
|
+
OrientationType,
|
|
35
|
+
AnnotationStyles,
|
|
36
|
+
DataPoint,
|
|
37
|
+
GeoData,
|
|
38
|
+
DataPointDate,
|
|
39
|
+
LeaderboardEntry,
|
|
40
|
+
GradientStop,
|
|
41
|
+
SeriesDataOptions,
|
|
42
|
+
SeriesData,
|
|
43
|
+
MultipleDataPointsDate,
|
|
44
|
+
DataPointPercentage,
|
|
45
|
+
ChartTheme,
|
|
46
|
+
CompleteChartTheme,
|
|
47
|
+
AxisOptions,
|
|
48
|
+
ScaleOptions,
|
|
49
|
+
LegendItemStyles,
|
|
50
|
+
LegendLabelStyles,
|
|
51
|
+
LegendShapeStyles,
|
|
52
|
+
LegendPosition,
|
|
53
|
+
ChartLegendConfig,
|
|
54
|
+
BaseChartProps,
|
|
55
|
+
GridProps,
|
|
56
|
+
} from './types';
|
|
33
57
|
export type * from './visx/types';
|
|
34
58
|
export type { PieChartProps, PieChartRenderTooltipParams } from './charts/pie-chart';
|
|
35
59
|
export type {
|
|
@@ -37,13 +61,7 @@ export type {
|
|
|
37
61
|
PieSemiCircleChartRenderTooltipParams,
|
|
38
62
|
} from './charts/pie-semi-circle-chart';
|
|
39
63
|
export type { GeoChartProps, GeoRegion, GeoResolution } from './charts/geo-chart';
|
|
40
|
-
export type {
|
|
41
|
-
LegendValueDisplay,
|
|
42
|
-
BaseLegendItem,
|
|
43
|
-
LegendItemStyles,
|
|
44
|
-
LegendLabelStyles,
|
|
45
|
-
LegendShapeStyles,
|
|
46
|
-
} from './components/legend';
|
|
64
|
+
export type { LegendValueDisplay, BaseLegendItem } from './components/legend';
|
|
47
65
|
export type { TrendIndicatorProps, TrendDirection } from './components/trend-indicator';
|
|
48
66
|
export type { LineStyles, GridStyles, EventHandlerParams } from '@visx/xychart';
|
|
49
67
|
export type {
|
|
@@ -51,3 +69,42 @@ export type {
|
|
|
51
69
|
GoogleDataTableRow,
|
|
52
70
|
GoogleDataTableColumnRoleType,
|
|
53
71
|
} from 'react-google-charts';
|
|
72
|
+
|
|
73
|
+
// Re-exports from removed individual entry points
|
|
74
|
+
export { useLeaderboardLegendItems } from './charts/leaderboard-chart/hooks';
|
|
75
|
+
|
|
76
|
+
// Previously available via '@automattic/charts/tooltip', '@automattic/charts/legend'
|
|
77
|
+
export { AccessibleTooltip } from './components/tooltip';
|
|
78
|
+
export type { BaseTooltipProps, TooltipData, TooltipProps } from './components/tooltip';
|
|
79
|
+
export type { LegendProps, BaseLegendProps, ChartLegendOptions } from './components/legend';
|
|
80
|
+
|
|
81
|
+
// Previously available via '@automattic/charts/bar-chart', '@automattic/charts/line-chart', etc.
|
|
82
|
+
export type { BarChartProps } from './charts/bar-chart';
|
|
83
|
+
export type {
|
|
84
|
+
BarListChartProps,
|
|
85
|
+
RenderLabelProps,
|
|
86
|
+
RenderValueProps,
|
|
87
|
+
} from './charts/bar-list-chart';
|
|
88
|
+
export type {
|
|
89
|
+
ConversionFunnelChartProps,
|
|
90
|
+
FunnelStep,
|
|
91
|
+
StepLabelRenderProps,
|
|
92
|
+
StepRateRenderProps,
|
|
93
|
+
MainMetricRenderProps,
|
|
94
|
+
TooltipRenderProps,
|
|
95
|
+
} from './charts/conversion-funnel-chart';
|
|
96
|
+
export type { LeaderboardChartProps } from './charts/leaderboard-chart';
|
|
97
|
+
export type {
|
|
98
|
+
LineChartProps,
|
|
99
|
+
LineChartAnnotationProps,
|
|
100
|
+
RenderLineGlyphProps,
|
|
101
|
+
TooltipDatum,
|
|
102
|
+
CurveType,
|
|
103
|
+
} from './charts/line-chart';
|
|
104
|
+
export type { ArcData } from './charts/pie-semi-circle-chart';
|
|
105
|
+
export type { SparklineProps, GradientConfig, SparklineDataPoint } from './charts/sparkline';
|
|
106
|
+
|
|
107
|
+
// Utilities
|
|
108
|
+
export { parseAsLocalDate, formatMetricValue, formatPercentage, mergeThemes } from './utils';
|
|
109
|
+
export * from './utils/color-utils';
|
|
110
|
+
export type { MetricValueType } from './utils';
|
|
@@ -200,7 +200,13 @@ export const GlobalChartsProvider: FC< GlobalChartsProviderProps > = ( {
|
|
|
200
200
|
const getElementStyles = useCallback< GlobalChartsContextValue[ 'getElementStyles' ] >(
|
|
201
201
|
( { data, index, overrideColor, legendShape } ) => {
|
|
202
202
|
const isSeriesData = data && typeof data === 'object' && 'data' in data && 'options' in data;
|
|
203
|
-
|
|
203
|
+
// DataPointPercentage has a numeric 'value' directly, unlike SeriesData which has 'data' array
|
|
204
|
+
const isPointPercentageData =
|
|
205
|
+
data &&
|
|
206
|
+
typeof data === 'object' &&
|
|
207
|
+
'value' in data &&
|
|
208
|
+
typeof data.value === 'number' &&
|
|
209
|
+
! ( 'data' in data );
|
|
204
210
|
|
|
205
211
|
return {
|
|
206
212
|
color: resolveColor( {
|
|
@@ -2,6 +2,7 @@ import { useEffect, useMemo } from 'react';
|
|
|
2
2
|
import { useDeepMemo } from '../../../hooks';
|
|
3
3
|
import { useGlobalChartsContext } from './use-global-charts-context';
|
|
4
4
|
import type { BaseLegendItem } from '../../../components/legend';
|
|
5
|
+
import type { ChartType } from '../../../types';
|
|
5
6
|
|
|
6
7
|
export const useChartRegistration = ( {
|
|
7
8
|
chartId,
|
|
@@ -12,7 +13,7 @@ export const useChartRegistration = ( {
|
|
|
12
13
|
}: {
|
|
13
14
|
chartId: string;
|
|
14
15
|
legendItems: BaseLegendItem[];
|
|
15
|
-
chartType:
|
|
16
|
+
chartType: ChartType;
|
|
16
17
|
isDataValid: boolean;
|
|
17
18
|
metadata?: Record< string, unknown >;
|
|
18
19
|
} ): void => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { BaseLegendItem } from '../../components/legend';
|
|
3
|
-
import type { CompleteChartTheme, DataPointPercentage, SeriesData } from '../../types';
|
|
3
|
+
import type { ChartType, CompleteChartTheme, DataPointPercentage, SeriesData } from '../../types';
|
|
4
4
|
import type { LegendShape } from '@visx/legend/lib/types';
|
|
5
5
|
import type { GlyphProps, LineStyles } from '@visx/xychart';
|
|
6
6
|
|
|
7
7
|
export interface ChartRegistration {
|
|
8
8
|
legendItems: BaseLegendItem[];
|
|
9
|
-
chartType:
|
|
9
|
+
chartType: ChartType;
|
|
10
10
|
metadata?: Record< string, unknown >;
|
|
11
11
|
}
|
|
12
12
|
|
package/src/types.ts
CHANGED
|
@@ -15,6 +15,14 @@ type ValueOf< T > = T[ keyof T ];
|
|
|
15
15
|
|
|
16
16
|
export type Optional< T, K extends keyof T > = Pick< Partial< T >, K > & Omit< T, K >;
|
|
17
17
|
|
|
18
|
+
export type ChartType =
|
|
19
|
+
| 'bar'
|
|
20
|
+
| 'conversion-funnel'
|
|
21
|
+
| 'leaderboard'
|
|
22
|
+
| 'line'
|
|
23
|
+
| 'pie'
|
|
24
|
+
| 'pie-semi-circle';
|
|
25
|
+
|
|
18
26
|
export type OrientationType = ValueOf< typeof Orientation >;
|
|
19
27
|
|
|
20
28
|
export type AnnotationStyles = {
|
|
@@ -157,23 +165,24 @@ export type MultipleDataPointsDate = {
|
|
|
157
165
|
data: DataPointDate[];
|
|
158
166
|
};
|
|
159
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Input data point for percentage-based charts (pie, donut, semi-circle).
|
|
170
|
+
* Provide values; percentages will be calculated automatically.
|
|
171
|
+
*/
|
|
160
172
|
export type DataPointPercentage = {
|
|
161
173
|
/**
|
|
162
174
|
* Label for the data point
|
|
163
175
|
*/
|
|
164
176
|
label: string;
|
|
165
177
|
/**
|
|
166
|
-
* Numerical value
|
|
178
|
+
* Numerical value used for slice sizing.
|
|
179
|
+
* Percentages are calculated automatically from values.
|
|
167
180
|
*/
|
|
168
181
|
value: number;
|
|
169
182
|
/**
|
|
170
|
-
* Formatted value for display
|
|
183
|
+
* Formatted value for display (e.g., "30K" instead of 30000)
|
|
171
184
|
*/
|
|
172
185
|
valueDisplay?: string;
|
|
173
|
-
/**
|
|
174
|
-
* Percentage value
|
|
175
|
-
*/
|
|
176
|
-
percentage: number;
|
|
177
186
|
/**
|
|
178
187
|
* Color code for the segment, by default colours are taken from the theme but this property can overrides it
|
|
179
188
|
*/
|
|
@@ -184,6 +193,17 @@ export type DataPointPercentage = {
|
|
|
184
193
|
group?: string;
|
|
185
194
|
};
|
|
186
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Internal type with calculated percentage.
|
|
198
|
+
* Used internally after percentage calculation from values.
|
|
199
|
+
*/
|
|
200
|
+
export type DataPointPercentageCalculated = DataPointPercentage & {
|
|
201
|
+
/**
|
|
202
|
+
* Calculated percentage (0-100) based on value relative to total
|
|
203
|
+
*/
|
|
204
|
+
percentage: number;
|
|
205
|
+
};
|
|
206
|
+
|
|
187
207
|
/**
|
|
188
208
|
* Base theme configuration for chart components with optional properties
|
|
189
209
|
*/
|
|
@@ -296,7 +316,7 @@ export type CompleteChartTheme = Required< ChartTheme > & {
|
|
|
296
316
|
};
|
|
297
317
|
};
|
|
298
318
|
|
|
299
|
-
|
|
319
|
+
export type AxisOptions = {
|
|
300
320
|
orientation?: OrientationType;
|
|
301
321
|
numTicks?: number;
|
|
302
322
|
axisClassName?: string;
|
|
@@ -352,6 +372,86 @@ export type ScaleOptions = {
|
|
|
352
372
|
paddingOuter?: number;
|
|
353
373
|
};
|
|
354
374
|
|
|
375
|
+
export type LegendItemStyles = {
|
|
376
|
+
/** Margin around each legend item. */
|
|
377
|
+
margin?: CSSProperties[ 'margin' ];
|
|
378
|
+
/** Flex direction for items within each legend entry. */
|
|
379
|
+
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
export type LegendLabelStyles = Pick< CSSProperties, 'justifyContent' | 'flex' | 'margin' > & {
|
|
383
|
+
/**
|
|
384
|
+
* Maximum width for legend label text as a CSS value (e.g. '200px', '50%', '10rem').
|
|
385
|
+
* When set, text overflow behavior is controlled by textOverflow.
|
|
386
|
+
*/
|
|
387
|
+
maxWidth?: string;
|
|
388
|
+
/**
|
|
389
|
+
* Controls how text behaves when it exceeds maxWidth.
|
|
390
|
+
* - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
|
|
391
|
+
* - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
|
|
392
|
+
*/
|
|
393
|
+
textOverflow?: 'ellipsis' | 'wrap';
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export type LegendShapeStyles = {
|
|
397
|
+
/** Width of the legend shape in pixels. */
|
|
398
|
+
width?: number;
|
|
399
|
+
/** Height of the legend shape in pixels. */
|
|
400
|
+
height?: number;
|
|
401
|
+
/** Margin around the legend shape. */
|
|
402
|
+
margin?: CSSProperties[ 'margin' ];
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
/** Position of the legend relative to chart content. */
|
|
406
|
+
export type LegendPosition = 'top' | 'bottom';
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Configuration object for chart legend appearance and behavior.
|
|
410
|
+
* Consolidates all legend styling and layout props into a single structured object.
|
|
411
|
+
*/
|
|
412
|
+
export type ChartLegendConfig< T = DataPoint | DataPointDate | LeaderboardEntry > = {
|
|
413
|
+
/**
|
|
414
|
+
* Layout direction of legend items.
|
|
415
|
+
*/
|
|
416
|
+
orientation?: 'horizontal' | 'vertical';
|
|
417
|
+
/**
|
|
418
|
+
* Position of the legend relative to the chart.
|
|
419
|
+
* TODO: Add 'left' | 'right' positioning support in future implementation
|
|
420
|
+
*/
|
|
421
|
+
position?: LegendPosition;
|
|
422
|
+
/**
|
|
423
|
+
* Alignment of the legend within its position.
|
|
424
|
+
*/
|
|
425
|
+
alignment?: 'start' | 'center' | 'end';
|
|
426
|
+
/**
|
|
427
|
+
* Shape of the legend marker icon.
|
|
428
|
+
*/
|
|
429
|
+
shape?: LegendShape< T, number >;
|
|
430
|
+
/**
|
|
431
|
+
* Enable interactive legend items that can toggle series visibility.
|
|
432
|
+
* Supported for all chart types that render series.
|
|
433
|
+
* Requires chartId and GlobalChartsProvider.
|
|
434
|
+
* For pie charts, percentages are recalculated so visible segments total 100%.
|
|
435
|
+
*/
|
|
436
|
+
interactive?: boolean;
|
|
437
|
+
/**
|
|
438
|
+
* Additional CSS class name for individual legend items.
|
|
439
|
+
*/
|
|
440
|
+
itemClassName?: string;
|
|
441
|
+
/**
|
|
442
|
+
* CSS styles for each legend item (margin, flexDirection).
|
|
443
|
+
*/
|
|
444
|
+
itemStyles?: LegendItemStyles;
|
|
445
|
+
/**
|
|
446
|
+
* CSS styles for legend labels (maxWidth, textOverflow, justifyContent, flex, margin).
|
|
447
|
+
*/
|
|
448
|
+
labelStyles?: LegendLabelStyles;
|
|
449
|
+
/**
|
|
450
|
+
* Styles for legend shapes (width, height, margin).
|
|
451
|
+
*/
|
|
452
|
+
shapeStyles?: LegendShapeStyles;
|
|
453
|
+
};
|
|
454
|
+
|
|
355
455
|
/**
|
|
356
456
|
* Base properties shared across all chart components
|
|
357
457
|
*/
|
|
@@ -416,45 +516,10 @@ export type BaseChartProps< T = DataPoint | DataPointDate | LeaderboardEntry > =
|
|
|
416
516
|
*/
|
|
417
517
|
showLegend?: boolean;
|
|
418
518
|
/**
|
|
419
|
-
* Legend
|
|
420
|
-
|
|
421
|
-
legendOrientation?: 'horizontal' | 'vertical';
|
|
422
|
-
/**
|
|
423
|
-
* Legend shape
|
|
424
|
-
*/
|
|
425
|
-
legendShape?: LegendShape< T, number >;
|
|
426
|
-
/**
|
|
427
|
-
* Legend position (where the legend appears)
|
|
428
|
-
* TODO: Add 'left' | 'right' positioning support in future implementation
|
|
429
|
-
*/
|
|
430
|
-
legendPosition?: 'top' | 'bottom';
|
|
431
|
-
/**
|
|
432
|
-
* Legend alignment within its position
|
|
433
|
-
*/
|
|
434
|
-
legendAlignment?: 'start' | 'center' | 'end';
|
|
435
|
-
/**
|
|
436
|
-
* Maximum width for legend items. When set, text overflow behavior is controlled by legendTextOverflow.
|
|
437
|
-
* Should be a CSS value string (e.g. '200px', '50%', '10rem')
|
|
438
|
-
*/
|
|
439
|
-
legendMaxWidth?: string;
|
|
440
|
-
/**
|
|
441
|
-
* Controls how text behaves when it exceeds legendMaxWidth.
|
|
442
|
-
* - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
|
|
443
|
-
* - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
|
|
444
|
-
*/
|
|
445
|
-
legendTextOverflow?: 'ellipsis' | 'wrap';
|
|
446
|
-
/**
|
|
447
|
-
* Additional CSS class name for legend items.
|
|
448
|
-
* This allows consumers to customize individual legend item styling.
|
|
449
|
-
*/
|
|
450
|
-
legendItemClassName?: string;
|
|
451
|
-
/**
|
|
452
|
-
* Enable interactive legend items that can toggle series visibility.
|
|
453
|
-
* Supported for all chart types that render series.
|
|
454
|
-
* Requires chartId and GlobalChartsProvider.
|
|
455
|
-
* For pie charts, percentages are recalculated so visible segments total 100%.
|
|
519
|
+
* Legend configuration object for controlling legend appearance and behavior.
|
|
520
|
+
* Includes orientation, position, alignment, shape, styling, and interactivity options.
|
|
456
521
|
*/
|
|
457
|
-
|
|
522
|
+
legend?: ChartLegendConfig< T >;
|
|
458
523
|
/**
|
|
459
524
|
* Grid visibility. x is default when orientation is vertical. y is default when orientation is horizontal.
|
|
460
525
|
*/
|
|
@@ -44,7 +44,16 @@ import { parse, parseISO, isValid } from 'date-fns';
|
|
|
44
44
|
* @return {boolean} True if the date string contains timezone information, false otherwise
|
|
45
45
|
*/
|
|
46
46
|
const hasTimezone = ( dateString: string ): boolean => {
|
|
47
|
-
|
|
47
|
+
const tIndex = dateString.indexOf( 'T' );
|
|
48
|
+
if ( tIndex === -1 ) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if ( dateString.endsWith( 'Z' ) ) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return /[+-]\d{2}:?\d{2}$/.test( dateString.slice( tIndex + 1 ) );
|
|
48
57
|
};
|
|
49
58
|
|
|
50
59
|
/**
|
|
@@ -268,6 +268,18 @@ describe( 'parseAsLocalDate', () => {
|
|
|
268
268
|
} );
|
|
269
269
|
} );
|
|
270
270
|
|
|
271
|
+
describe( 'ReDoS resilience', () => {
|
|
272
|
+
test( 'should handle adversarial input without catastrophic backtracking', () => {
|
|
273
|
+
const malicious = 'T' + 'a'.repeat( 8000000 ) + 'X';
|
|
274
|
+
const start = performance.now();
|
|
275
|
+
const result = parseAsLocalDate( malicious );
|
|
276
|
+
const elapsed = performance.now() - start;
|
|
277
|
+
|
|
278
|
+
expect( isNaN( result.getTime() ) ).toBe( true );
|
|
279
|
+
expect( elapsed ).toBeLessThan( 50 );
|
|
280
|
+
} );
|
|
281
|
+
} );
|
|
282
|
+
|
|
271
283
|
describe( 'Performance and consistency', () => {
|
|
272
284
|
test( 'should consistently parse the same input', () => {
|
|
273
285
|
const dateString = '2025-01-15T14:30:45Z';
|
|
@@ -414,7 +414,8 @@ describe( 'resolveCssVariable', () => {
|
|
|
414
414
|
if ( element === themedElement ) {
|
|
415
415
|
return {
|
|
416
416
|
getPropertyValue: ( prop: string ) => {
|
|
417
|
-
|
|
417
|
+
// eslint-disable-next-line @wordpress/no-unknown-ds-tokens -- Thinks this is a use rather than a test.
|
|
418
|
+
if ( prop === '--wpds-color-bg-interactive-brand-weak' ) {
|
|
418
419
|
return '#c029dc'; // User's custom accent color
|
|
419
420
|
}
|
|
420
421
|
return '';
|
|
@@ -427,7 +428,8 @@ describe( 'resolveCssVariable', () => {
|
|
|
427
428
|
} );
|
|
428
429
|
window.getComputedStyle = mockGetComputedStyle as unknown as typeof window.getComputedStyle;
|
|
429
430
|
|
|
430
|
-
|
|
431
|
+
// eslint-disable-next-line @wordpress/no-unknown-ds-tokens -- Thinks this is a use rather than a test.
|
|
432
|
+
const result = resolveCssVariable( '--wpds-color-bg-interactive-brand-weak', themedElement );
|
|
431
433
|
expect( result ).toBe( '#c029dc' );
|
|
432
434
|
} );
|
|
433
435
|
} );
|
package/tsup.config.ts
CHANGED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { CSSProperties, ComponentType, ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
type TooltipData = {
|
|
5
|
-
label: string;
|
|
6
|
-
value: number;
|
|
7
|
-
valueDisplay?: string;
|
|
8
|
-
};
|
|
9
|
-
type TooltipComponentProps = {
|
|
10
|
-
data: TooltipData;
|
|
11
|
-
className?: string;
|
|
12
|
-
};
|
|
13
|
-
type TooltipCommonProps = {
|
|
14
|
-
top: number;
|
|
15
|
-
left: number;
|
|
16
|
-
style?: CSSProperties;
|
|
17
|
-
className?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Whether to render the tooltip container div. When false, only renders the content.
|
|
20
|
-
* Useful when the tooltip is rendered inside a portal or custom container.
|
|
21
|
-
* @default true
|
|
22
|
-
*/
|
|
23
|
-
renderContainer?: boolean;
|
|
24
|
-
};
|
|
25
|
-
type DefaultDataTooltip = {
|
|
26
|
-
data: TooltipData;
|
|
27
|
-
component?: ComponentType<TooltipComponentProps>;
|
|
28
|
-
children?: never;
|
|
29
|
-
};
|
|
30
|
-
type CustomTooltip = {
|
|
31
|
-
children: ReactNode;
|
|
32
|
-
data?: never;
|
|
33
|
-
component?: never;
|
|
34
|
-
};
|
|
35
|
-
type BaseTooltipProps = TooltipCommonProps & (DefaultDataTooltip | CustomTooltip);
|
|
36
|
-
declare const BaseTooltip: ({ data, top, left, component: Component, children, className, style, renderContainer, }: BaseTooltipProps) => string | number | true | Iterable<ReactNode> | react_jsx_runtime.JSX.Element;
|
|
37
|
-
|
|
38
|
-
export { BaseTooltip as B, type TooltipData as T, type BaseTooltipProps as a };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { CSSProperties, ComponentType, ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
type TooltipData = {
|
|
5
|
-
label: string;
|
|
6
|
-
value: number;
|
|
7
|
-
valueDisplay?: string;
|
|
8
|
-
};
|
|
9
|
-
type TooltipComponentProps = {
|
|
10
|
-
data: TooltipData;
|
|
11
|
-
className?: string;
|
|
12
|
-
};
|
|
13
|
-
type TooltipCommonProps = {
|
|
14
|
-
top: number;
|
|
15
|
-
left: number;
|
|
16
|
-
style?: CSSProperties;
|
|
17
|
-
className?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Whether to render the tooltip container div. When false, only renders the content.
|
|
20
|
-
* Useful when the tooltip is rendered inside a portal or custom container.
|
|
21
|
-
* @default true
|
|
22
|
-
*/
|
|
23
|
-
renderContainer?: boolean;
|
|
24
|
-
};
|
|
25
|
-
type DefaultDataTooltip = {
|
|
26
|
-
data: TooltipData;
|
|
27
|
-
component?: ComponentType<TooltipComponentProps>;
|
|
28
|
-
children?: never;
|
|
29
|
-
};
|
|
30
|
-
type CustomTooltip = {
|
|
31
|
-
children: ReactNode;
|
|
32
|
-
data?: never;
|
|
33
|
-
component?: never;
|
|
34
|
-
};
|
|
35
|
-
type BaseTooltipProps = TooltipCommonProps & (DefaultDataTooltip | CustomTooltip);
|
|
36
|
-
declare const BaseTooltip: ({ data, top, left, component: Component, children, className, style, renderContainer, }: BaseTooltipProps) => string | number | true | Iterable<ReactNode> | react_jsx_runtime.JSX.Element;
|
|
37
|
-
|
|
38
|
-
export { BaseTooltip as B, type TooltipData as T, type BaseTooltipProps as a };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkVJM5XCB4cjs = require('../../chunk-VJM5XCB4.cjs');
|
|
5
|
-
require('../../chunk-Y3NNQMAX.cjs');
|
|
6
|
-
require('../../chunk-I35UYJJR.cjs');
|
|
7
|
-
require('../../chunk-ASLARV7L.cjs');
|
|
8
|
-
require('../../chunk-RHHVEJHJ.cjs');
|
|
9
|
-
require('../../chunk-VTS3PNMS.cjs');
|
|
10
|
-
require('../../chunk-EMMSS5I5.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports.BarChart = _chunkVJM5XCB4cjs.BarChartResponsive; exports.BarChartUnresponsive = _chunkVJM5XCB4cjs.BarChart;
|
|
15
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/charts/bar-chart/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,4DAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC;AACE;AACA;AACF,mHAAC","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/charts/bar-chart/index.cjs"}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/* esbuild-sass-plugin:css-chunk:src/hooks/use-tooltip-portal-relocator.module.scss */
|
|
2
|
-
.a8ccharts-jCw5dQ {
|
|
3
|
-
position: fixed;
|
|
4
|
-
inset: 0;
|
|
5
|
-
overflow: visible;
|
|
6
|
-
z-index: 1;
|
|
7
|
-
pointer-events: none;
|
|
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
|
-
|
|
104
|
-
/* esbuild-sass-plugin:css-chunk:src/components/tooltip/base-tooltip.module.scss */
|
|
105
|
-
.a8ccharts-OfX6nd {
|
|
106
|
-
padding: 0.5rem;
|
|
107
|
-
background-color: rgba(0, 0, 0, 0.85);
|
|
108
|
-
color: #fff;
|
|
109
|
-
border-radius: 4px;
|
|
110
|
-
font-size: 14px;
|
|
111
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
112
|
-
position: absolute;
|
|
113
|
-
pointer-events: none;
|
|
114
|
-
transform: translate(-50%, -100%);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* esbuild-sass-plugin:css-chunk:src/charts/private/with-responsive/with-responsive.module.scss */
|
|
118
|
-
.a8ccharts-GSKfBD {
|
|
119
|
-
min-width: 0;
|
|
120
|
-
min-height: 0;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* esbuild-sass-plugin:css-chunk:src/charts/bar-chart/bar-chart.module.scss */
|
|
124
|
-
.a8ccharts-9CsqC0 {
|
|
125
|
-
flex: 1;
|
|
126
|
-
min-height: 0;
|
|
127
|
-
}
|
|
128
|
-
.a8ccharts-3gflnB svg {
|
|
129
|
-
overflow: visible;
|
|
130
|
-
}
|
|
131
|
-
.a8ccharts-98W-yu rect {
|
|
132
|
-
transform-origin: bottom;
|
|
133
|
-
transform-box: fill-box;
|
|
134
|
-
transform: scaleY(0);
|
|
135
|
-
animation: a8ccharts-z6AsiQ 1s ease-out forwards;
|
|
136
|
-
}
|
|
137
|
-
@keyframes a8ccharts-z6AsiQ {
|
|
138
|
-
to {
|
|
139
|
-
transform: scaleY(1);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
.a8ccharts-HFA3FF rect {
|
|
143
|
-
transform-origin: left;
|
|
144
|
-
transform-box: fill-box;
|
|
145
|
-
transform: scaleX(0);
|
|
146
|
-
animation: a8ccharts-DQp37O 1s ease-out forwards;
|
|
147
|
-
}
|
|
148
|
-
@keyframes a8ccharts-DQp37O {
|
|
149
|
-
to {
|
|
150
|
-
transform: scaleX(1);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/*# sourceMappingURL=index.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["esbuild-sass-plugin:css-chunk:src/hooks/use-tooltip-portal-relocator.module.scss","esbuild-sass-plugin:css-chunk:src/components/legend/private/base-legend.module.scss","esbuild-sass-plugin:css-chunk:src/components/tooltip/base-tooltip.module.scss","esbuild-sass-plugin:css-chunk:src/charts/private/with-responsive/with-responsive.module.scss","esbuild-sass-plugin:css-chunk:src/charts/bar-chart/bar-chart.module.scss"],"sourcesContent":[".a8ccharts-jCw5dQ {\n position: fixed;\n inset: 0;\n overflow: visible;\n z-index: 1;\n pointer-events: none;\n}",".a8ccharts-AELBvX {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 16px;\n}\n.a8ccharts-fX8uQe {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.a8ccharts-fX8uQe.a8ccharts-DEe0wg {\n align-items: flex-start;\n}\n.a8ccharts-fX8uQe.a8ccharts-WBKF9I {\n align-items: center;\n}\n.a8ccharts-fX8uQe.a8ccharts-JfwMng {\n align-items: flex-end;\n}\n.a8ccharts-8Y73Kh {\n position: relative;\n}\n.a8ccharts-8Y73Kh.a8ccharts-DEe0wg {\n justify-content: flex-start;\n}\n.a8ccharts-8Y73Kh.a8ccharts-WBKF9I {\n justify-content: center;\n}\n.a8ccharts-8Y73Kh.a8ccharts-JfwMng {\n justify-content: flex-end;\n}\n.a8ccharts-TVM-IY {\n position: relative;\n}\n.a8ccharts-TVM-IY.a8ccharts-DEe0wg {\n justify-content: flex-start;\n}\n.a8ccharts-TVM-IY.a8ccharts-WBKF9I {\n justify-content: center;\n}\n.a8ccharts-TVM-IY.a8ccharts-JfwMng {\n justify-content: flex-end;\n}\n\n.a8ccharts-Vflwq8 {\n display: flex;\n align-items: center;\n font-size: 0.875rem;\n}\n.a8ccharts-qGsavM {\n cursor: pointer;\n user-select: none;\n transition: opacity 0.2s ease;\n}\n.a8ccharts-qGsavM:hover {\n opacity: 0.8;\n}\n.a8ccharts-qGsavM:focus {\n outline: 2px solid currentColor;\n outline-offset: 2px;\n border-radius: 4px;\n}\n.a8ccharts-qGsavM:focus:not(:focus-visible) {\n outline: none;\n}\n.a8ccharts-ZtDY-Q {\n opacity: 0.4;\n}\n.a8ccharts-ZtDY-Q .a8ccharts-2H65Kr {\n text-decoration: line-through;\n}\n\n.a8ccharts-2H65Kr {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n /* Text wrapping is handled at the text level, not the label container */\n}\n\n.a8ccharts-faSDBI {\n overflow-wrap: break-word;\n white-space: normal;\n hyphens: auto;\n}\n.a8ccharts-FISUIO {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 1;\n min-width: 0;\n}\n\n.a8ccharts-DTZlT- {\n font-weight: 500;\n flex-shrink: 0;\n}",".a8ccharts-OfX6nd {\n padding: 0.5rem;\n background-color: rgba(0, 0, 0, 0.85);\n color: #fff;\n border-radius: 4px;\n font-size: 14px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n position: absolute;\n pointer-events: none;\n transform: translate(-50%, -100%);\n}",".a8ccharts-GSKfBD {\n min-width: 0;\n min-height: 0;\n}",".a8ccharts-9CsqC0 {\n flex: 1;\n min-height: 0;\n}\n.a8ccharts-3gflnB svg {\n overflow: visible;\n}\n.a8ccharts-98W-yu rect {\n transform-origin: bottom;\n transform-box: fill-box;\n transform: scaleY(0);\n animation: a8ccharts-z6AsiQ 1s ease-out forwards;\n}\n@keyframes a8ccharts-z6AsiQ {\n to {\n transform: scaleY(1);\n }\n}\n.a8ccharts-HFA3FF rect {\n transform-origin: left;\n transform-box: fill-box;\n transform: scaleX(0);\n animation: a8ccharts-DQp37O 1s ease-out forwards;\n}\n@keyframes a8ccharts-DQp37O {\n to {\n transform: scaleX(1);\n }\n}"],"mappings":";AAAA,CAAC;AACC,YAAU;AACV,SAAO;AACP,YAAU;AACV,WAAS;AACT,kBAAgB;AAClB;;;ACNA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,aAAW;AACX,OAAK;AACP;AACA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,OAAK;AACP;AACA,CALC,gBAKgB,CAAC;AAChB,eAAa;AACf;AACA,CARC,gBAQgB,CAAC;AAChB,eAAa;AACf;AACA,CAXC,gBAWgB,CAAC;AAChB,eAAa;AACf;AACA,CAAC;AACC,YAAU;AACZ;AACA,CAHC,gBAGgB,CAZC;AAahB,mBAAiB;AACnB;AACA,CANC,gBAMgB,CAZC;AAahB,mBAAiB;AACnB;AACA,CATC,gBASgB,CAZC;AAahB,mBAAiB;AACnB;AACA,CAAC;AACC,YAAU;AACZ;AACA,CAHC,gBAGgB,CAxBC;AAyBhB,mBAAiB;AACnB;AACA,CANC,gBAMgB,CAxBC;AAyBhB,mBAAiB;AACnB;AACA,CATC,gBASgB,CAxBC;AAyBhB,mBAAiB;AACnB;AAEA,CAAC;AACC,WAAS;AACT,eAAa;AACb,aAAW;AACb;AACA,CAAC;AACC,UAAQ;AACR,eAAa;AACb,cAAY,QAAQ,KAAK;AAC3B;AACA,CALC,gBAKgB;AACf,WAAS;AACX;AACA,CARC,gBAQgB;AACf,WAAS,IAAI,MAAM;AACnB,kBAAgB;AAChB,iBAAe;AACjB;AACA,CAbC,gBAagB,MAAM,KAAK;AAC1B,WAAS;AACX;AACA,CAAC;AACC,WAAS;AACX;AACA,CAHC,iBAGiB,CAAC;AACjB,mBAAiB;AACnB;AAEA,CAJmB;AAKjB,WAAS;AACT,eAAa;AACb,OAAK;AAEP;AAEA,CAAC;AACC,iBAAe;AACf,eAAa;AACb,WAAS;AACX;AACA,CAAC;AACC,eAAa;AACb,YAAU;AACV,iBAAe;AACf,eAAa;AACb,aAAW;AACb;AAEA,CAAC;AACC,eAAa;AACb,eAAa;AACf;;;AChGA,CAAC;AACC,WAAS;AACT,oBAAkB,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAChC,SAAO;AACP,iBAAe;AACf,aAAW;AACX,cAAY,EAAE,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACpC,YAAU;AACV,kBAAgB;AAChB,aAAW,UAAU,IAAI,EAAE;AAC7B;;;ACVA,CAAC;AACC,aAAW;AACX,cAAY;AACd;;;ACHA,CAAC;AACC,QAAM;AACN,cAAY;AACd;AACA,CAAC,iBAAiB;AAChB,YAAU;AACZ;AACA,CAAC,iBAAiB;AAChB,oBAAkB;AAClB,iBAAe;AACf,aAAW,OAAO;AAClB,aAAW,iBAAiB,GAAG,SAAS;AAC1C;AACA,WAFa;AAGX;AACE,eAAW,OAAO;AACpB;AACF;AACA,CAAC,iBAAiB;AAChB,oBAAkB;AAClB,iBAAe;AACf,aAAW,OAAO;AAClB,aAAW,iBAAiB,GAAG,SAAS;AAC1C;AACA,WAFa;AAGX;AACE,eAAW,OAAO;AACpB;AACF;","names":[]}
|