@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
package/dist/index.d.ts
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_.js';
|
|
4
|
+
export { m as ExtendedAxisLabelsFormatterContextObject, n as TypeChartXAnnotationsDetails, o as TypeExtendedChart } from './types-B7ILUQ6_.js';
|
|
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 };
|