@sproutsocial/seeds-react-data-viz 0.7.32 → 0.15.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/dist/axis-DXzufRRj.d.mts +116 -0
- package/dist/axis-PJwu5Xmo.d.ts +116 -0
- package/dist/bar/index.d.mts +98 -0
- package/dist/bar/index.d.ts +98 -0
- package/dist/bar/index.js +186 -0
- package/dist/bar/index.js.map +1 -0
- package/dist/chartExport-CKYpuhik.d.mts +28 -0
- package/dist/chartExport-CKYpuhik.d.ts +28 -0
- package/dist/chunk-EEVKTTT3.js +968 -0
- package/dist/chunk-EEVKTTT3.js.map +1 -0
- package/dist/chunk-JXARPHQE.js +193 -0
- package/dist/chunk-JXARPHQE.js.map +1 -0
- package/dist/chunk-VSZSIN34.js +796 -0
- package/dist/chunk-VSZSIN34.js.map +1 -0
- package/dist/esm/bar/index.js +186 -0
- package/dist/esm/bar/index.js.map +1 -0
- package/dist/esm/chunk-HQM3EIZW.js +193 -0
- package/dist/esm/chunk-HQM3EIZW.js.map +1 -0
- package/dist/esm/chunk-LC3HGWDD.js +968 -0
- package/dist/esm/chunk-LC3HGWDD.js.map +1 -0
- package/dist/esm/chunk-OAN5VC7M.js +796 -0
- package/dist/esm/chunk-OAN5VC7M.js.map +1 -0
- package/dist/esm/export/index.js +41 -0
- package/dist/esm/export/index.js.map +1 -0
- package/dist/esm/index.js +262 -1315
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/line-area/index.js +151 -0
- package/dist/esm/line-area/index.js.map +1 -0
- package/dist/esm/pdfExportLibs-NWLZH5KL.js +10 -0
- package/dist/esm/pdfExportLibs-NWLZH5KL.js.map +1 -0
- package/dist/export/index.d.mts +25 -0
- package/dist/export/index.d.ts +25 -0
- package/dist/export/index.js +41 -0
- package/dist/export/index.js.map +1 -0
- package/dist/index.d.mts +56 -93
- package/dist/index.d.ts +56 -93
- package/dist/index.js +407 -1544
- package/dist/index.js.map +1 -1
- package/dist/line-area/index.d.mts +83 -0
- package/dist/line-area/index.d.ts +83 -0
- package/dist/line-area/index.js +151 -0
- package/dist/line-area/index.js.map +1 -0
- package/dist/pdfExportLibs-BZR2D3RA.js +10 -0
- package/dist/pdfExportLibs-BZR2D3RA.js.map +1 -0
- package/dist/types-B7ILUQ6_.d.mts +99 -0
- package/dist/types-B7ILUQ6_.d.ts +99 -0
- package/package.json +37 -11
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChartRenderer,
|
|
3
|
+
buildAnnotationConfig,
|
|
4
|
+
buildBaseChartOptions,
|
|
5
|
+
buildDimensionalAxis,
|
|
6
|
+
defaultValueAxisLabelFormatter,
|
|
7
|
+
makeValueAxisLabelFormatter,
|
|
8
|
+
resolveTooltipTimezone,
|
|
9
|
+
useSeedsChartSetup
|
|
10
|
+
} from "../chunk-OAN5VC7M.js";
|
|
11
|
+
import {
|
|
12
|
+
areaChartStyles,
|
|
13
|
+
lineChartStyles
|
|
14
|
+
} from "../chunk-LC3HGWDD.js";
|
|
15
|
+
|
|
16
|
+
// src/charts/line-area/LineAreaChart.tsx
|
|
17
|
+
import { memo, useMemo } from "react";
|
|
18
|
+
|
|
19
|
+
// src/charts/line-area/adapter.ts
|
|
20
|
+
var AREA_VARIANTS = /* @__PURE__ */ new Set(["area", "areaspline"]);
|
|
21
|
+
function pointY(point) {
|
|
22
|
+
if (point === null) return null;
|
|
23
|
+
if (typeof point === "number") return point;
|
|
24
|
+
if (Array.isArray(point)) return point[1];
|
|
25
|
+
return point.y;
|
|
26
|
+
}
|
|
27
|
+
function withIsolatedPointMarkers(data) {
|
|
28
|
+
return data.map((point, i) => {
|
|
29
|
+
if (point === null) return null;
|
|
30
|
+
if (pointY(point) === null) return point;
|
|
31
|
+
const prevY = i === 0 ? null : pointY(data[i - 1]);
|
|
32
|
+
const nextY = i === data.length - 1 ? null : pointY(data[i + 1]);
|
|
33
|
+
if (prevY !== null || nextY !== null) return point;
|
|
34
|
+
const marker = { enabled: true, symbol: "circle" };
|
|
35
|
+
if (typeof point === "number") return { y: point, marker };
|
|
36
|
+
if (Array.isArray(point)) return { x: point[0], y: point[1], marker };
|
|
37
|
+
return { ...point, marker };
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function buildLineAreaChartOptions(props) {
|
|
41
|
+
const tooltipTimezone = resolveTooltipTimezone(props.xAxis, props.timezone);
|
|
42
|
+
const isStacked = AREA_VARIANTS.has(props.variant) && Boolean(props.stacking);
|
|
43
|
+
const { annotations, lookup: annotationLookup } = buildAnnotationConfig(
|
|
44
|
+
props.annotations
|
|
45
|
+
);
|
|
46
|
+
const options = {
|
|
47
|
+
...buildBaseChartOptions({
|
|
48
|
+
type: props.variant,
|
|
49
|
+
description: props.description,
|
|
50
|
+
valueSuffix: props.valueSuffix,
|
|
51
|
+
reserveTopMargin: Boolean(annotations),
|
|
52
|
+
timezone: tooltipTimezone
|
|
53
|
+
}),
|
|
54
|
+
xAxis: buildDimensionalAxis(props.xAxis, tooltipTimezone ?? "UTC"),
|
|
55
|
+
yAxis: {
|
|
56
|
+
min: props.yAxis?.min,
|
|
57
|
+
max: props.yAxis?.max,
|
|
58
|
+
// Anchor the value axis to 0 (like v1/bar/area): line/spline otherwise
|
|
59
|
+
// auto-scale above 0, which truncates the axis and pushes the annotation
|
|
60
|
+
// anchor (y: 0) out of range. `soft` still extends for negative data.
|
|
61
|
+
softMin: 0,
|
|
62
|
+
softMax: 0,
|
|
63
|
+
gridLineWidth: props.yAxis?.showGridLines === false ? 0 : 1,
|
|
64
|
+
title: { text: props.yAxis?.title ?? "" },
|
|
65
|
+
// Zero-config default: abbreviate value-axis ticks (1.20K / 1.20M / 1.20B).
|
|
66
|
+
labels: {
|
|
67
|
+
// A declarative `format` drives ticks through the shared valueFormatter;
|
|
68
|
+
// absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).
|
|
69
|
+
formatter: props.yAxis?.format ? makeValueAxisLabelFormatter(props.yAxis.format) : defaultValueAxisLabelFormatter
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
plotOptions: {
|
|
73
|
+
series: {
|
|
74
|
+
animation: false,
|
|
75
|
+
// Hide point markers by default (matching v1 + designs); isolated points
|
|
76
|
+
// re-enable their own marker via `withIsolatedPointMarkers`.
|
|
77
|
+
marker: { enabled: false },
|
|
78
|
+
...props.onClick ? {
|
|
79
|
+
point: {
|
|
80
|
+
events: {
|
|
81
|
+
click: (event) => props.onClick({ position: event.point.x })
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
} : {}
|
|
85
|
+
},
|
|
86
|
+
// Type-scoped stacking: only the (area) variant stacks. `isStacked` already
|
|
87
|
+
// guarantees `props.variant` is an area variant here, so the computed key is
|
|
88
|
+
// always a valid plotOptions slot. Matches bar's per-type placement and keeps
|
|
89
|
+
// line/spline unstacked.
|
|
90
|
+
...isStacked ? { [props.variant]: { stacking: props.stacking } } : {}
|
|
91
|
+
},
|
|
92
|
+
series: props.series.map((s) => ({
|
|
93
|
+
type: props.variant,
|
|
94
|
+
name: s.name,
|
|
95
|
+
data: withIsolatedPointMarkers(s.data)
|
|
96
|
+
})),
|
|
97
|
+
...annotations ? { annotations } : {}
|
|
98
|
+
};
|
|
99
|
+
return { options, annotationLookup, tooltipTimezone };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/charts/line-area/styles.ts
|
|
103
|
+
import styled from "styled-components";
|
|
104
|
+
var LineAreaChartContainer = styled.div`
|
|
105
|
+
background-color: ${({ theme }) => theme.colors.container.background.base};
|
|
106
|
+
${(props) => props.$isArea ? areaChartStyles : lineChartStyles}
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
// src/charts/line-area/LineAreaChart.tsx
|
|
110
|
+
import { jsx } from "react/jsx-runtime";
|
|
111
|
+
var AREA_VARIANTS2 = /* @__PURE__ */ new Set(["area", "areaspline"]);
|
|
112
|
+
var LineAreaChart = memo(function LineAreaChart2(props) {
|
|
113
|
+
const { colors, patterns } = useSeedsChartSetup({
|
|
114
|
+
series: props.series,
|
|
115
|
+
includePatterns: true
|
|
116
|
+
});
|
|
117
|
+
const { options, annotationLookup, tooltipTimezone } = useMemo(
|
|
118
|
+
() => buildLineAreaChartOptions(props),
|
|
119
|
+
[props]
|
|
120
|
+
);
|
|
121
|
+
const hasOnClick = Boolean(props.onClick);
|
|
122
|
+
return /* @__PURE__ */ jsx(
|
|
123
|
+
LineAreaChartContainer,
|
|
124
|
+
{
|
|
125
|
+
$colors: colors,
|
|
126
|
+
$patterns: patterns,
|
|
127
|
+
$hasOnClick: hasOnClick,
|
|
128
|
+
$isArea: AREA_VARIANTS2.has(props.variant),
|
|
129
|
+
className: props.className,
|
|
130
|
+
children: /* @__PURE__ */ jsx(
|
|
131
|
+
ChartRenderer,
|
|
132
|
+
{
|
|
133
|
+
options,
|
|
134
|
+
series: props.series,
|
|
135
|
+
colors,
|
|
136
|
+
tooltip: props.tooltip,
|
|
137
|
+
annotationLookup,
|
|
138
|
+
hasOnClick,
|
|
139
|
+
tooltipClickLabel: props.tooltipClickLabel,
|
|
140
|
+
timezone: tooltipTimezone,
|
|
141
|
+
invalidNumberLabel: props.invalidNumberLabel,
|
|
142
|
+
onReady: props.onReady
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
});
|
|
148
|
+
export {
|
|
149
|
+
LineAreaChart
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/charts/line-area/LineAreaChart.tsx","../../../src/charts/line-area/adapter.ts","../../../src/charts/line-area/styles.ts"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport { buildLineAreaChartOptions } from \"./adapter\";\nimport { LineAreaChartContainer } from \"./styles\";\nimport type { LineAreaChartProps, LineAreaVariant } from \"./types\";\n\nconst AREA_VARIANTS = new Set<LineAreaVariant>([\"area\", \"areaspline\"]);\n\nexport const LineAreaChart = memo(function LineAreaChart(\n props: LineAreaChartProps\n) {\n const { colors, patterns } = useSeedsChartSetup({\n series: props.series,\n includePatterns: true,\n });\n const { options, annotationLookup, tooltipTimezone } = useMemo(\n () => buildLineAreaChartOptions(props),\n [props]\n );\n const hasOnClick = Boolean(props.onClick);\n\n return (\n <LineAreaChartContainer\n $colors={colors}\n $patterns={patterns}\n $hasOnClick={hasOnClick}\n $isArea={AREA_VARIANTS.has(props.variant)}\n className={props.className}\n >\n <ChartRenderer\n options={options}\n series={props.series}\n colors={colors}\n tooltip={props.tooltip}\n annotationLookup={annotationLookup}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n timezone={tooltipTimezone}\n invalidNumberLabel={props.invalidNumberLabel}\n onReady={props.onReady}\n />\n </LineAreaChartContainer>\n );\n});\n","import { buildAnnotationConfig } from \"../shared/annotations\";\nimport type { ChartAnnotationLookup } from \"../shared/annotations\";\nimport type {\n SeedsChartDataPoint,\n SeedsChartOptions,\n} from \"../shared/chartBase\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport {\n buildDimensionalAxis,\n resolveTooltipTimezone,\n} from \"../shared/axisOptions\";\nimport {\n defaultValueAxisLabelFormatter,\n makeValueAxisLabelFormatter,\n} from \"../shared/valueAxisLabelFormatter\";\nimport type { ChartDataPoint } from \"../shared/axis\";\nimport type { LineAreaChartProps, LineAreaVariant } from \"./types\";\n\n// `stacking` is meaningful only for filled variants; on `line`/`spline` it's a\n// no-op, so the adapter drops it rather than emitting a misleading option.\nconst AREA_VARIANTS = new Set<LineAreaVariant>([\"area\", \"areaspline\"]);\n\ntype SeriesPoint =\n | number\n | null\n | [number, number | null]\n | SeedsChartDataPoint;\n\nfunction pointY(point: ChartDataPoint): number | null {\n if (point === null) return null;\n if (typeof point === \"number\") return point;\n if (Array.isArray(point)) return point[1];\n return point.y;\n}\n\n// Mirrors v1's marker handling: point markers are hidden by default (set on\n// `plotOptions.series`), but an *isolated* non-null point — one with a null (or\n// the chart edge) on both sides — gets a circle marker so a point with no\n// connecting line segment stays visible. Connected points pass through\n// unchanged so the line/area renders dot-free, matching v1 and the designs.\nfunction withIsolatedPointMarkers(\n data: ReadonlyArray<ChartDataPoint>\n): SeriesPoint[] {\n return data.map((point, i): SeriesPoint => {\n if (point === null) return null; // explicit gap\n if (pointY(point) === null) return point; // tuple/object with null y — a gap\n const prevY = i === 0 ? null : pointY(data[i - 1]!);\n const nextY = i === data.length - 1 ? null : pointY(data[i + 1]!);\n if (prevY !== null || nextY !== null) return point; // connected → no marker\n const marker = { enabled: true, symbol: \"circle\" as const };\n if (typeof point === \"number\") return { y: point, marker };\n if (Array.isArray(point)) return { x: point[0], y: point[1], marker };\n return { ...point, marker };\n });\n}\n\nexport function buildLineAreaChartOptions(props: LineAreaChartProps): {\n options: SeedsChartOptions;\n annotationLookup: ChartAnnotationLookup | undefined;\n /** Resolved timezone for the tooltip date formatter; undefined on category axes. */\n tooltipTimezone: string | undefined;\n} {\n const tooltipTimezone = resolveTooltipTimezone(props.xAxis, props.timezone);\n const isStacked = AREA_VARIANTS.has(props.variant) && Boolean(props.stacking);\n const { annotations, lookup: annotationLookup } = buildAnnotationConfig(\n props.annotations\n );\n\n const options: SeedsChartOptions = {\n ...buildBaseChartOptions({\n type: props.variant,\n description: props.description,\n valueSuffix: props.valueSuffix,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipTimezone,\n }),\n xAxis: buildDimensionalAxis(props.xAxis, tooltipTimezone ?? \"UTC\"),\n yAxis: {\n min: props.yAxis?.min,\n max: props.yAxis?.max,\n // Anchor the value axis to 0 (like v1/bar/area): line/spline otherwise\n // auto-scale above 0, which truncates the axis and pushes the annotation\n // anchor (y: 0) out of range. `soft` still extends for negative data.\n softMin: 0,\n softMax: 0,\n gridLineWidth: props.yAxis?.showGridLines === false ? 0 : 1,\n title: { text: props.yAxis?.title ?? \"\" },\n // Zero-config default: abbreviate value-axis ticks (1.20K / 1.20M / 1.20B).\n labels: {\n // A declarative `format` drives ticks through the shared valueFormatter;\n // absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).\n formatter: props.yAxis?.format\n ? makeValueAxisLabelFormatter(props.yAxis.format)\n : defaultValueAxisLabelFormatter,\n },\n },\n plotOptions: {\n series: {\n animation: false,\n // Hide point markers by default (matching v1 + designs); isolated points\n // re-enable their own marker via `withIsolatedPointMarkers`.\n marker: { enabled: false },\n ...(props.onClick\n ? {\n point: {\n events: {\n click: (event) => props.onClick!({ position: event.point.x }),\n },\n },\n }\n : {}),\n },\n // Type-scoped stacking: only the (area) variant stacks. `isStacked` already\n // guarantees `props.variant` is an area variant here, so the computed key is\n // always a valid plotOptions slot. Matches bar's per-type placement and keeps\n // line/spline unstacked.\n ...(isStacked ? { [props.variant]: { stacking: props.stacking } } : {}),\n },\n series: props.series.map((s) => ({\n type: props.variant,\n name: s.name,\n data: withIsolatedPointMarkers(s.data),\n })),\n ...(annotations ? { annotations } : {}),\n };\n\n return { options, annotationLookup, tooltipTimezone };\n}\n","import styled from \"styled-components\";\nimport { lineChartStyles, areaChartStyles } from \"../../styles/chartStyles\";\nimport type {\n TypeChartStyleColor,\n TypeChartStyleHasOnClick,\n TypeChartStylePattern,\n} from \"../../types\";\n\ntype StyleProps = Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $patterns: ReadonlyArray<TypeChartStylePattern>;\n $hasOnClick: TypeChartStyleHasOnClick;\n /** `area`/`areaspline` fill below the line; `line`/`spline` show only the stroke. */\n $isArea: boolean;\n}>;\n\n// Plain styled `div` — not `Box`. Per the DS Tailwind direction, components\n// render semantic elements internally (and accept `className`) rather than\n// depending on the `Box` component. The container background — previously Box's\n// `bg` prop — is set explicitly here.\n//\n// The line/area CSS is still v1's styled-components layer (`chartStyles.ts`);\n// migrating those styles to CSS modules is a tracked clean-up follow-up.\nexport const LineAreaChartContainer = styled.div<StyleProps>`\n background-color: ${({ theme }) => theme.colors.container.background.base};\n ${(props) => (props.$isArea ? areaChartStyles : lineChartStyles)}\n`;\n"],"mappings":"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","names":["AREA_VARIANTS","LineAreaChart"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/charts/shared/pdfExportLibs.ts"],"sourcesContent":["// Lazily-loaded PDF export dependencies. This module is imported via a dynamic\n// `import(\"./pdfExportLibs\")` from `chartBase` so jspdf + svg2pdf.js land in a\n// deferred chunk (tsup `splitting: true`) and are fetched only when a consumer\n// actually exports a PDF — they stay out of the main bundle.\n//\n// It is Highcharts-free (imports jspdf/svg2pdf, never \"highcharts\"), so it does\n// not touch the engine-boundary invariant.\nimport { jsPDF } from \"jspdf\";\n// Side-effect import: svg2pdf.js patches `jsPDF.API.svg`, the method Highcharts'\n// offline-exporting calls (`pdfDoc.svg(...)`) to render the chart SVG into the PDF.\nimport \"svg2pdf.js\";\n\ninterface JsPdfGlobal {\n jspdf?: { jsPDF: typeof jsPDF };\n}\n\n/**\n * Expose jsPDF on `window.jspdf` so Highcharts' offline-exporting resolves PDF\n * support locally instead of fetching jspdf/svg2pdf from its CDN\n * (`exporting.libURL`). Highcharts checks `window.jspdf.jsPDF` and constructs\n * `new window.jspdf.jsPDF(...)`. Idempotent — safe to call before every export.\n */\nexport function loadPdfExportLibs(): void {\n (window as unknown as JsPdfGlobal).jspdf = { jsPDF };\n}\n"],"mappings":";AAOA,SAAS,aAAa;AAGtB,OAAO;AAYA,SAAS,oBAA0B;AACxC,EAAC,OAAkC,QAAQ,EAAE,MAAM;AACrD;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { C as ChartExportHandle, a as ChartExportFormat } from '../chartExport-CKYpuhik.mjs';
|
|
3
|
+
|
|
4
|
+
interface ChartExportMenuProps {
|
|
5
|
+
/** The opaque export handle surfaced by a v2 chart's `onReady` callback. */
|
|
6
|
+
exportHandle: ChartExportHandle;
|
|
7
|
+
/**
|
|
8
|
+
* Visible labels per format. Only formats with a non-empty label render an
|
|
9
|
+
* item; an empty object (or all-falsy labels) renders nothing — no dead
|
|
10
|
+
* trigger. Items always render in canonical order, never in key-insertion
|
|
11
|
+
* order.
|
|
12
|
+
*/
|
|
13
|
+
labels: Partial<Record<ChartExportFormat, string>>;
|
|
14
|
+
/** Accessible name for the icon-only trigger button. */
|
|
15
|
+
triggerAriaLabel: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Icon-only overflow button that opens a dropdown of chart export actions
|
|
19
|
+
* (PNG/SVG/PDF/CSV) for greenfield consumers, so they don't have to wire up
|
|
20
|
+
* their own menu around the `ChartExportHandle` from `onReady`. Consumes only
|
|
21
|
+
* the opaque handle — no Highcharts type crosses this boundary.
|
|
22
|
+
*/
|
|
23
|
+
declare function ChartExportMenu({ exportHandle, labels, triggerAriaLabel, }: ChartExportMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
24
|
+
|
|
25
|
+
export { ChartExportFormat, ChartExportHandle, ChartExportMenu, type ChartExportMenuProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { C as ChartExportHandle, a as ChartExportFormat } from '../chartExport-CKYpuhik.js';
|
|
3
|
+
|
|
4
|
+
interface ChartExportMenuProps {
|
|
5
|
+
/** The opaque export handle surfaced by a v2 chart's `onReady` callback. */
|
|
6
|
+
exportHandle: ChartExportHandle;
|
|
7
|
+
/**
|
|
8
|
+
* Visible labels per format. Only formats with a non-empty label render an
|
|
9
|
+
* item; an empty object (or all-falsy labels) renders nothing — no dead
|
|
10
|
+
* trigger. Items always render in canonical order, never in key-insertion
|
|
11
|
+
* order.
|
|
12
|
+
*/
|
|
13
|
+
labels: Partial<Record<ChartExportFormat, string>>;
|
|
14
|
+
/** Accessible name for the icon-only trigger button. */
|
|
15
|
+
triggerAriaLabel: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Icon-only overflow button that opens a dropdown of chart export actions
|
|
19
|
+
* (PNG/SVG/PDF/CSV) for greenfield consumers, so they don't have to wire up
|
|
20
|
+
* their own menu around the `ChartExportHandle` from `onReady`. Consumes only
|
|
21
|
+
* the opaque handle — no Highcharts type crosses this boundary.
|
|
22
|
+
*/
|
|
23
|
+
declare function ChartExportMenu({ exportHandle, labels, triggerAriaLabel, }: ChartExportMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
24
|
+
|
|
25
|
+
export { ChartExportFormat, ChartExportHandle, ChartExportMenu, type ChartExportMenuProps };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/export/ChartExportMenu.tsx
|
|
2
|
+
var _base = require('@sproutsocial/seeds-react-menu/base');
|
|
3
|
+
var _seedsreactbutton = require('@sproutsocial/seeds-react-button');
|
|
4
|
+
var _seedsreacticon = require('@sproutsocial/seeds-react-icon');
|
|
5
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
6
|
+
var ORDER = ["png", "svg", "pdf", "csv"];
|
|
7
|
+
var METHOD = {
|
|
8
|
+
png: "exportPNG",
|
|
9
|
+
svg: "exportSVG",
|
|
10
|
+
pdf: "exportPDF",
|
|
11
|
+
csv: "exportCSV"
|
|
12
|
+
};
|
|
13
|
+
function ChartExportMenu({
|
|
14
|
+
exportHandle,
|
|
15
|
+
labels,
|
|
16
|
+
triggerAriaLabel
|
|
17
|
+
}) {
|
|
18
|
+
const formats = ORDER.filter((format) => labels[format]);
|
|
19
|
+
if (formats.length === 0) return null;
|
|
20
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
21
|
+
_base.ActionMenu,
|
|
22
|
+
{
|
|
23
|
+
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreactbutton.Button, { appearance: "secondary", ariaLabel: triggerAriaLabel, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "arrow-down-to-bracket-outline", fixedWidth: true, "aria-hidden": true }) }),
|
|
24
|
+
children: formats.map((format) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
25
|
+
_base.MenuItem,
|
|
26
|
+
{
|
|
27
|
+
onClick: () => {
|
|
28
|
+
void exportHandle[METHOD[format]]().catch(() => {
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
children: labels[format]
|
|
32
|
+
},
|
|
33
|
+
format
|
|
34
|
+
))
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
exports.ChartExportMenu = ChartExportMenu;
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/export/index.js","../../src/export/ChartExportMenu.tsx"],"names":[],"mappings":"AAAA;ACAA,2DAAqC;AACrC,oEAAuB;AACvB,gEAAqB;AAiDX,+CAAA;AA5BV,IAAM,MAAA,EAA6B,CAAC,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,KAAK,CAAA;AAG9D,IAAM,OAAA,EAA6D;AAAA,EACjE,GAAA,EAAK,WAAA;AAAA,EACL,GAAA,EAAK,WAAA;AAAA,EACL,GAAA,EAAK,WAAA;AAAA,EACL,GAAA,EAAK;AACP,CAAA;AAQO,SAAS,eAAA,CAAgB;AAAA,EAC9B,YAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAyB;AACvB,EAAA,MAAM,QAAA,EAAU,KAAA,CAAM,MAAA,CAAO,CAAC,MAAA,EAAA,GAAW,MAAA,CAAO,MAAM,CAAC,CAAA;AACvD,EAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,IAAW,CAAA,EAAG,OAAO,IAAA;AAEjC,EAAA,uBACE,6BAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,OAAA,kBACE,6BAAA,wBAAC,EAAA,EAAO,UAAA,EAAW,WAAA,EAAY,SAAA,EAAW,gBAAA,EACxC,QAAA,kBAAA,6BAAA,oBAAC,EAAA,EAAK,IAAA,EAAK,+BAAA,EAAgC,UAAA,EAAU,IAAA,EAAC,aAAA,EAAW,KAAA,CAAC,EAAA,CACpE,CAAA;AAAA,MAGD,QAAA,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAC,MAAA,EAAA,mBACZ,6BAAA;AAAA,QAAC,cAAA;AAAA,QAAA;AAAA,UAEC,OAAA,EAAS,CAAA,EAAA,GAAM;AAKb,YAAA,KAAK,YAAA,CAAa,MAAA,CAAO,MAAM,CAAC,CAAA,CAAE,CAAA,CAAE,KAAA,CAAM,CAAA,EAAA,GAAM;AAAA,YAAC,CAAC,CAAA;AAAA,UACpD,CAAA;AAAA,UAEC,QAAA,EAAA,MAAA,CAAO,MAAM;AAAA,QAAA,CAAA;AAAA,QATT;AAAA,MAUP,CACD;AAAA,IAAA;AAAA,EACH,CAAA;AAEJ;ADlCA;AACE;AACF,0CAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/export/index.js","sourcesContent":[null,"import { ActionMenu, MenuItem } from \"@sproutsocial/seeds-react-menu/base\";\nimport { Button } from \"@sproutsocial/seeds-react-button\";\nimport { Icon } from \"@sproutsocial/seeds-react-icon\";\nimport type {\n ChartExportFormat,\n ChartExportHandle,\n} from \"../charts/shared/chartExport\";\n\nexport interface ChartExportMenuProps {\n /** The opaque export handle surfaced by a v2 chart's `onReady` callback. */\n exportHandle: ChartExportHandle;\n /**\n * Visible labels per format. Only formats with a non-empty label render an\n * item; an empty object (or all-falsy labels) renders nothing — no dead\n * trigger. Items always render in canonical order, never in key-insertion\n * order.\n */\n labels: Partial<Record<ChartExportFormat, string>>;\n /** Accessible name for the icon-only trigger button. */\n triggerAriaLabel: string;\n}\n\n// Canonical render order, independent of `labels` key order.\nconst ORDER: ChartExportFormat[] = [\"png\", \"svg\", \"pdf\", \"csv\"];\n\n// Maps each format to the matching handle callable.\nconst METHOD: Record<ChartExportFormat, keyof ChartExportHandle> = {\n png: \"exportPNG\",\n svg: \"exportSVG\",\n pdf: \"exportPDF\",\n csv: \"exportCSV\",\n};\n\n/**\n * Icon-only overflow button that opens a dropdown of chart export actions\n * (PNG/SVG/PDF/CSV) for greenfield consumers, so they don't have to wire up\n * their own menu around the `ChartExportHandle` from `onReady`. Consumes only\n * the opaque handle — no Highcharts type crosses this boundary.\n */\nexport function ChartExportMenu({\n exportHandle,\n labels,\n triggerAriaLabel,\n}: ChartExportMenuProps) {\n const formats = ORDER.filter((format) => labels[format]);\n if (formats.length === 0) return null;\n\n return (\n <ActionMenu\n trigger={\n <Button appearance=\"secondary\" ariaLabel={triggerAriaLabel}>\n <Icon name=\"arrow-down-to-bracket-outline\" fixedWidth aria-hidden />\n </Button>\n }\n >\n {formats.map((format) => (\n <MenuItem\n key={format}\n onClick={() => {\n // The handle is fire-and-forget by design (opaque, consumer owns no\n // UI here). Attach a no-op catch so a rejected export (e.g. a PDF\n // dynamic-import failure) is a deliberate swallow, not an unhandled\n // promise rejection.\n void exportHandle[METHOD[format]]().catch(() => {});\n }}\n >\n {labels[format]}\n </MenuItem>\n ))}\n </ActionMenu>\n );\n}\n"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,104 +1,15 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { T as TypeChartDataPoint, a as TypeChartDataStyles, b as TypeChartTooltipDateFormatter, c as TypeChartNumberFormat, d as TypeChartTooltipProps, e as TypeChartYAxisLabelFormatter, f as TypeChartTimeFormat, g as TypeChartXAnnotations, h as TypeChartStylePattern, i as TypeVerticalBarChartProps, j as TypeSeriesType, E as ExtendedTimeTicksInfoObject, k as TypeChartStyleColor, l as TypeChartStyleHasOnClick } from './types-B7ILUQ6_.mjs';
|
|
4
|
+
export { m as ExtendedAxisLabelsFormatterContextObject, n as TypeChartXAnnotationsDetails, o as TypeExtendedChart } from './types-B7ILUQ6_.mjs';
|
|
4
5
|
import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
|
|
5
6
|
import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
|
|
6
7
|
import { Table } from '@sproutsocial/seeds-react-table';
|
|
8
|
+
import { Chart, TooltipFormatterContextObject, Options, SeriesSplineOptions, SeriesAreasplineOptions, SeriesColumnOptions, AxisTickPositionsArray, AxisLabelsFormatterContextObject } from 'highcharts';
|
|
7
9
|
import { TypeIconName } from '@sproutsocial/seeds-react-icon';
|
|
8
10
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
11
|
import * as styled_components from 'styled-components';
|
|
10
12
|
|
|
11
|
-
/**
|
|
12
|
-
* Type of series to render. See {@link https://api.highcharts.com/highcharts/series} for detailed series configuration options.
|
|
13
|
-
*/
|
|
14
|
-
type TypeSeriesType = "areaspline" | "spline" | "column";
|
|
15
|
-
interface ExtendedTimeTicksInfoObject extends TimeTicksInfoObject {
|
|
16
|
-
unitName: "hour" | "day" | "week" | "month" | "year";
|
|
17
|
-
}
|
|
18
|
-
interface ExtendedAxisLabelsFormatterContextObject extends AxisLabelsFormatterContextObject {
|
|
19
|
-
tickPositionInfo: ExtendedTimeTicksInfoObject;
|
|
20
|
-
}
|
|
21
|
-
type TypeChartDataPoint = Readonly<{
|
|
22
|
-
x: number | string;
|
|
23
|
-
y: number | null;
|
|
24
|
-
}>;
|
|
25
|
-
type TypeChartDataStyles = Readonly<{
|
|
26
|
-
color?: TypeChartStyleColor;
|
|
27
|
-
}>;
|
|
28
|
-
type TypeChartNumberFormat = "decimal" | "percent" | "currency" | "duration";
|
|
29
|
-
type TypeChartTimeFormat = "12" | "24";
|
|
30
|
-
type TypeChartTooltipDateFormatter = ({ x, }: {
|
|
31
|
-
x: number | string;
|
|
32
|
-
}) => ReactNode;
|
|
33
|
-
type TypeChartTooltipProps = Readonly<{
|
|
34
|
-
data: ReadonlyArray<Readonly<{
|
|
35
|
-
color: TypeChartStyleColor;
|
|
36
|
-
name: string;
|
|
37
|
-
value: number | null;
|
|
38
|
-
icon?: ReactNode;
|
|
39
|
-
}>>;
|
|
40
|
-
x: number | string;
|
|
41
|
-
}>;
|
|
42
|
-
type TypeChartYAxisLabelFormatter = ({ y, yValues, }: Readonly<{
|
|
43
|
-
y: number;
|
|
44
|
-
yValues: ReadonlyArray<number>;
|
|
45
|
-
}>) => string;
|
|
46
|
-
type TypeChartXAnnotationsDetails = () => ReactNode;
|
|
47
|
-
type TypeChartXAnnotations = Readonly<{
|
|
48
|
-
[x: number]: Readonly<{
|
|
49
|
-
marker: () => ReactNode;
|
|
50
|
-
details: TypeChartXAnnotationsDetails;
|
|
51
|
-
}>;
|
|
52
|
-
}> | undefined;
|
|
53
|
-
type TypeChartStyleColor = string;
|
|
54
|
-
type TypeChartStylePattern = "solid" | "dashed";
|
|
55
|
-
type TypeChartStyleHasOnClick = boolean;
|
|
56
|
-
type TypeVerticalBarChartProps = Readonly<{
|
|
57
|
-
data: ReadonlyArray<Readonly<{
|
|
58
|
-
name: string;
|
|
59
|
-
points: ReadonlyArray<TypeChartDataPoint>;
|
|
60
|
-
icon?: ReactNode;
|
|
61
|
-
styles?: TypeChartDataStyles & Readonly<{
|
|
62
|
-
pattern?: TypeChartStylePattern;
|
|
63
|
-
}>;
|
|
64
|
-
}>>;
|
|
65
|
-
invalidNumberLabel: ReactNode;
|
|
66
|
-
numberLocale: Intl.LocalesArgument;
|
|
67
|
-
textLocale: Intl.LocalesArgument;
|
|
68
|
-
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
69
|
-
currency?: string;
|
|
70
|
-
numberFormat?: TypeChartNumberFormat;
|
|
71
|
-
/**
|
|
72
|
-
* The maximum number of series to display.
|
|
73
|
-
* @default 10
|
|
74
|
-
* @description We recommend limiting the number of series to 10 to maintain chart readability and accessibility.
|
|
75
|
-
*/
|
|
76
|
-
seriesLimit?: number;
|
|
77
|
-
/**
|
|
78
|
-
* If false, disables the warning when the number of series exceeds the seriesLimit.
|
|
79
|
-
* @default true
|
|
80
|
-
*/
|
|
81
|
-
showSeriesLimitWarning?: boolean;
|
|
82
|
-
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
83
|
-
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
84
|
-
onClick?: ({ x }: Readonly<{
|
|
85
|
-
x: number;
|
|
86
|
-
}>) => void;
|
|
87
|
-
tooltipClickLabel?: ReactNode;
|
|
88
|
-
timeFormat?: TypeChartTimeFormat;
|
|
89
|
-
xAnnotations?: TypeChartXAnnotations;
|
|
90
|
-
xAxisLabelFormatter?: (params: {
|
|
91
|
-
textLocale: Intl.LocalesArgument;
|
|
92
|
-
tickPositions: number[];
|
|
93
|
-
unitName: string;
|
|
94
|
-
value: string | number;
|
|
95
|
-
timeFormat?: string;
|
|
96
|
-
}) => string;
|
|
97
|
-
}>;
|
|
98
|
-
interface TypeExtendedChart extends Chart {
|
|
99
|
-
annotations?: Annotation[];
|
|
100
|
-
}
|
|
101
|
-
|
|
102
13
|
type TypeAreaChartProps = Readonly<{
|
|
103
14
|
data: ReadonlyArray<Readonly<{
|
|
104
15
|
name: string;
|
|
@@ -126,6 +37,19 @@ type TypeAreaChartProps = Readonly<{
|
|
|
126
37
|
timezone?: string;
|
|
127
38
|
xAnnotations?: TypeChartXAnnotations;
|
|
128
39
|
}>;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Use the v2 component instead:
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { LineAreaChart } from "@sproutsocial/seeds-react-data-viz/line-area";
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* `LineAreaChart` (with `variant="area"` or `"areaspline"`) is built on the shared
|
|
48
|
+
* v2 chart base — see `charts/README.md` for the architecture. The v2 prop shape
|
|
49
|
+
* differs from this legacy component and v2 does not yet cover every legacy
|
|
50
|
+
* feature (locale-aware tooltips, currency/number formatters, area totals).
|
|
51
|
+
* Migrate when ready; Claude-assisted migration guidance lands with the CE-10 codemod.
|
|
52
|
+
*/
|
|
129
53
|
declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
130
54
|
data: ReadonlyArray<Readonly<{
|
|
131
55
|
name: string;
|
|
@@ -367,6 +291,19 @@ type TypeLineChartProps = Readonly<{
|
|
|
367
291
|
timeFormat?: string;
|
|
368
292
|
}) => string;
|
|
369
293
|
}>;
|
|
294
|
+
/**
|
|
295
|
+
* @deprecated Use the v2 component instead:
|
|
296
|
+
*
|
|
297
|
+
* ```ts
|
|
298
|
+
* import { LineAreaChart } from "@sproutsocial/seeds-react-data-viz/line-area";
|
|
299
|
+
* ```
|
|
300
|
+
*
|
|
301
|
+
* `LineAreaChart` (with `variant="line"` or `"spline"`) is built on the shared
|
|
302
|
+
* v2 chart base — see `charts/README.md` for the architecture. The v2 prop shape
|
|
303
|
+
* differs from this legacy component and v2 does not yet cover every legacy
|
|
304
|
+
* feature (locale-aware tooltips, currency/number formatters). Migrate when ready;
|
|
305
|
+
* Claude-assisted migration guidance lands with the CE-9 codemod.
|
|
306
|
+
*/
|
|
370
307
|
declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
371
308
|
data: ReadonlyArray<Readonly<{
|
|
372
309
|
name: string;
|
|
@@ -401,6 +338,22 @@ declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
|
401
338
|
}) => string;
|
|
402
339
|
}>>;
|
|
403
340
|
|
|
341
|
+
/**
|
|
342
|
+
* @deprecated Use the v2 component instead:
|
|
343
|
+
*
|
|
344
|
+
* ```ts
|
|
345
|
+
* import { VerticalBarChart } from "@sproutsocial/seeds-react-data-viz/bar";
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* The v2 component is built on the shared chart base. See `charts/README.md`
|
|
349
|
+
* for the architecture. The v2 prop shape differs from this legacy component
|
|
350
|
+
* and v2 does not yet cover every legacy feature (locale-aware tooltips,
|
|
351
|
+
* formatters, interactions, annotations, legend). Use the Claude-assisted
|
|
352
|
+
* migration skill at
|
|
353
|
+
* `seeds-tooling/seeds-codemod-cli/src/usage-patterns/VERTICALBARCHARTV1_PATTERNS.md`
|
|
354
|
+
* — it documents the prop mapping and tells you when to wait rather than
|
|
355
|
+
* force-migrate.
|
|
356
|
+
*/
|
|
404
357
|
declare const VerticalBarChart: react.NamedExoticComponent<Readonly<{
|
|
405
358
|
data: ReadonlyArray<Readonly<{
|
|
406
359
|
name: string;
|
|
@@ -488,6 +441,11 @@ declare const xAxisLabelFormatter: ({ textLocale, tickPositions, unitName, value
|
|
|
488
441
|
* Helper to detect if data is hourly time data (all x values are hours of the same day)
|
|
489
442
|
* @param data - Array of series data with points containing x values
|
|
490
443
|
* @returns boolean indicating if all x values are hours of the same day
|
|
444
|
+
* @deprecated Auto-detection of hourly data is deprecated. v2 is declarative:
|
|
445
|
+
* use `xAxis={{ type: "datetime", timeFormat: "12" | "24" }}` + a top-level
|
|
446
|
+
* `timezone` instead of relying on implicit detection. See
|
|
447
|
+
* `seeds-tooling/seeds-codemod-cli/src/usage-patterns/VERTICALBARCHARTV1_PATTERNS.md`
|
|
448
|
+
* (CE-8).
|
|
491
449
|
*/
|
|
492
450
|
declare function isHourlyTimeData(data: ReadonlyArray<Readonly<{
|
|
493
451
|
points: ReadonlyArray<{
|
|
@@ -500,6 +458,11 @@ declare function isHourlyTimeData(data: ReadonlyArray<Readonly<{
|
|
|
500
458
|
* Supports both 12-hour format ("12 AM", "1 PM") and 24-hour format ("00:00", "13:00", "23:00")
|
|
501
459
|
* @param data - Array of series data with points containing x values
|
|
502
460
|
* @returns boolean indicating if all x values are hour strings
|
|
461
|
+
* @deprecated Auto-detection of hourly data is deprecated. v2 is declarative:
|
|
462
|
+
* use `xAxis={{ type: "datetime", timeFormat: "12" | "24" }}` + a top-level
|
|
463
|
+
* `timezone` instead of relying on implicit detection. See
|
|
464
|
+
* `seeds-tooling/seeds-codemod-cli/src/usage-patterns/VERTICALBARCHARTV1_PATTERNS.md`
|
|
465
|
+
* (CE-8).
|
|
503
466
|
*/
|
|
504
467
|
declare function isCategoricalHourData(data: ReadonlyArray<Readonly<{
|
|
505
468
|
points: ReadonlyArray<{
|
|
@@ -570,4 +533,4 @@ declare const donutChartStyles: styled_components.FlattenInterpolation<styled_co
|
|
|
570
533
|
$hasOnClick: TypeChartStyleHasOnClick;
|
|
571
534
|
}>, any>>;
|
|
572
535
|
|
|
573
|
-
export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ChartXAnnotationDetails, ChartXAnnotationMarker, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable,
|
|
536
|
+
export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ChartXAnnotationDetails, ChartXAnnotationMarker, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, ExtendedTimeTicksInfoObject, GlobalChartStyleOverrides, LineChart, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeAreaChartProps, TypeChartDataPoint, TypeChartDataStyles, type TypeChartLegendLabelProps, type TypeChartLegendProps, TypeChartNumberFormat, TypeChartStyleColor, TypeChartStyleHasOnClick, TypeChartStylePattern, type TypeChartTableProps, TypeChartTimeFormat, TypeChartTooltipDateFormatter, TypeChartTooltipProps, type TypeChartTooltipTableProps, TypeChartXAnnotations, TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartDataItem, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeLegendLabel, type TypeLineChartProps, TypeSeriesType, TypeVerticalBarChartProps, VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT, VerticalBarChart, areaChartOptions, areaChartStyles, baseChartOptions, baseChartStyles, columnChartOptions, donutChartOptions, donutChartStyles, generateChartTooltipPortalId, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, getStorybookCategoricalData, getStorybookSparseTimelineData, isCategoricalHourData, isHourlyTimeData, lineChartOptions, lineChartStyles, timeSeriesChartOptions, timeSeriesChartStyles, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
|