@sproutsocial/seeds-react-data-viz 0.2.2 → 0.3.1
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/esm/index.js +249 -102
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +22 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.js +258 -111
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { TimeTicksInfoObject, AxisLabelsFormatterContextObject, Chart, TooltipFormatterContextObject, Options, SeriesSplineOptions, SeriesAreasplineOptions, AxisTickPositionsArray } from 'highcharts';
|
|
3
|
+
import { TimeTicksInfoObject, AxisLabelsFormatterContextObject, Chart, Annotation, TooltipFormatterContextObject, Options, SeriesSplineOptions, SeriesAreasplineOptions, AxisTickPositionsArray } from 'highcharts';
|
|
4
4
|
import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
|
|
5
5
|
import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
|
|
6
6
|
import { Table } from '@sproutsocial/seeds-react-table';
|
|
@@ -38,9 +38,19 @@ type TypeChartYAxisLabelFormatter = ({ y, yValues, }: Readonly<{
|
|
|
38
38
|
y: number;
|
|
39
39
|
yValues: ReadonlyArray<number>;
|
|
40
40
|
}>) => string;
|
|
41
|
+
type TypeChartXAnnotationsDetails = () => ReactNode;
|
|
42
|
+
type TypeChartXAnnotations = Readonly<{
|
|
43
|
+
[x: number]: Readonly<{
|
|
44
|
+
marker: () => ReactNode;
|
|
45
|
+
details: TypeChartXAnnotationsDetails;
|
|
46
|
+
}>;
|
|
47
|
+
}> | undefined;
|
|
41
48
|
type TypeChartStyleColor = string;
|
|
42
49
|
type TypeChartStylePattern = "solid" | "dashed";
|
|
43
50
|
type TypeChartStyleHasOnClick = boolean;
|
|
51
|
+
interface TypeExtendedChart extends Chart {
|
|
52
|
+
annotations?: Annotation[];
|
|
53
|
+
}
|
|
44
54
|
|
|
45
55
|
type TypeAreaChartProps = Readonly<{
|
|
46
56
|
data: ReadonlyArray<Readonly<{
|
|
@@ -55,6 +65,7 @@ type TypeAreaChartProps = Readonly<{
|
|
|
55
65
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
56
66
|
tooltipTotalLabel: ReactNode;
|
|
57
67
|
currency?: string;
|
|
68
|
+
disableTooltips?: boolean;
|
|
58
69
|
numberFormat?: TypeChartNumberFormat;
|
|
59
70
|
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
60
71
|
total: number | null;
|
|
@@ -65,6 +76,7 @@ type TypeAreaChartProps = Readonly<{
|
|
|
65
76
|
}>) => void;
|
|
66
77
|
tooltipClickLabel?: ReactNode;
|
|
67
78
|
timeFormat?: TypeChartTimeFormat;
|
|
79
|
+
xAnnotations?: TypeChartXAnnotations;
|
|
68
80
|
}>;
|
|
69
81
|
declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
70
82
|
data: ReadonlyArray<Readonly<{
|
|
@@ -79,6 +91,7 @@ declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
|
79
91
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
80
92
|
tooltipTotalLabel: ReactNode;
|
|
81
93
|
currency?: string;
|
|
94
|
+
disableTooltips?: boolean;
|
|
82
95
|
numberFormat?: TypeChartNumberFormat;
|
|
83
96
|
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
84
97
|
total: number | null;
|
|
@@ -89,6 +102,7 @@ declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
|
89
102
|
}>) => void;
|
|
90
103
|
tooltipClickLabel?: ReactNode;
|
|
91
104
|
timeFormat?: TypeChartTimeFormat;
|
|
105
|
+
xAnnotations?: TypeChartXAnnotations;
|
|
92
106
|
}>>;
|
|
93
107
|
|
|
94
108
|
type TypeLegendLabel = Readonly<{
|
|
@@ -219,6 +233,7 @@ type TypeDonutChartProps = Readonly<{
|
|
|
219
233
|
numberLocale: Intl.LocalesArgument;
|
|
220
234
|
textLocale: Intl.LocalesArgument;
|
|
221
235
|
currency?: string;
|
|
236
|
+
disableTooltips?: boolean;
|
|
222
237
|
hideLegend?: boolean;
|
|
223
238
|
numberFormat?: TypeChartNumberFormat;
|
|
224
239
|
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
@@ -233,6 +248,7 @@ declare const DonutChart: react.NamedExoticComponent<Readonly<{
|
|
|
233
248
|
numberLocale: Intl.LocalesArgument;
|
|
234
249
|
textLocale: Intl.LocalesArgument;
|
|
235
250
|
currency?: string;
|
|
251
|
+
disableTooltips?: boolean;
|
|
236
252
|
hideLegend?: boolean;
|
|
237
253
|
numberFormat?: TypeChartNumberFormat;
|
|
238
254
|
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
@@ -269,6 +285,7 @@ type TypeLineChartProps = Readonly<{
|
|
|
269
285
|
textLocale: Intl.LocalesArgument;
|
|
270
286
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
271
287
|
currency?: string;
|
|
288
|
+
disableTooltips?: boolean;
|
|
272
289
|
numberFormat?: TypeChartNumberFormat;
|
|
273
290
|
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
274
291
|
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
@@ -277,6 +294,7 @@ type TypeLineChartProps = Readonly<{
|
|
|
277
294
|
}>) => void;
|
|
278
295
|
tooltipClickLabel?: ReactNode;
|
|
279
296
|
timeFormat?: TypeChartTimeFormat;
|
|
297
|
+
xAnnotations?: TypeChartXAnnotations;
|
|
280
298
|
}>;
|
|
281
299
|
declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
282
300
|
data: ReadonlyArray<Readonly<{
|
|
@@ -292,6 +310,7 @@ declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
|
292
310
|
textLocale: Intl.LocalesArgument;
|
|
293
311
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
294
312
|
currency?: string;
|
|
313
|
+
disableTooltips?: boolean;
|
|
295
314
|
numberFormat?: TypeChartNumberFormat;
|
|
296
315
|
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
297
316
|
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
@@ -300,6 +319,7 @@ declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
|
300
319
|
}>) => void;
|
|
301
320
|
tooltipClickLabel?: ReactNode;
|
|
302
321
|
timeFormat?: TypeChartTimeFormat;
|
|
322
|
+
xAnnotations?: TypeChartXAnnotations;
|
|
303
323
|
}>>;
|
|
304
324
|
|
|
305
325
|
declare const baseChartOptions: Options;
|
|
@@ -363,4 +383,4 @@ declare const donutChartStyles: styled_components.FlattenInterpolation<styled_co
|
|
|
363
383
|
$colors: ReadonlyArray<TypeChartStyleColor>;
|
|
364
384
|
}>, any>>;
|
|
365
385
|
|
|
366
|
-
export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, GlobalChartStyleOverrides, LineChart, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeAreaChartProps, type TypeChartDataPoint, type TypeChartDataStyles, type TypeChartLegendLabelProps, type TypeChartLegendProps, type TypeChartNumberFormat, type TypeChartStyleColor, type TypeChartStyleHasOnClick, type TypeChartStylePattern, type TypeChartTableProps, type TypeChartTimeFormat, type TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartTooltipTableProps, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeLegendLabel, type TypeLineChartProps, areaChartOptions, areaChartStyles, baseChartOptions, baseChartStyles, donutChartOptions, donutChartStyles, generateChartTooltipPortalId, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, lineChartOptions, lineChartStyles, timeSeriesChartStyles, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
|
|
386
|
+
export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, GlobalChartStyleOverrides, LineChart, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeAreaChartProps, type TypeChartDataPoint, type TypeChartDataStyles, type TypeChartLegendLabelProps, type TypeChartLegendProps, type TypeChartNumberFormat, type TypeChartStyleColor, type TypeChartStyleHasOnClick, type TypeChartStylePattern, type TypeChartTableProps, type TypeChartTimeFormat, type TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartTooltipTableProps, type TypeChartXAnnotations, type TypeChartXAnnotationsDetails, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeExtendedChart, type TypeLegendLabel, type TypeLineChartProps, areaChartOptions, areaChartStyles, baseChartOptions, baseChartStyles, donutChartOptions, donutChartStyles, generateChartTooltipPortalId, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, lineChartOptions, lineChartStyles, timeSeriesChartStyles, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { TimeTicksInfoObject, AxisLabelsFormatterContextObject, Chart, TooltipFormatterContextObject, Options, SeriesSplineOptions, SeriesAreasplineOptions, AxisTickPositionsArray } from 'highcharts';
|
|
3
|
+
import { TimeTicksInfoObject, AxisLabelsFormatterContextObject, Chart, Annotation, TooltipFormatterContextObject, Options, SeriesSplineOptions, SeriesAreasplineOptions, AxisTickPositionsArray } from 'highcharts';
|
|
4
4
|
import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
|
|
5
5
|
import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
|
|
6
6
|
import { Table } from '@sproutsocial/seeds-react-table';
|
|
@@ -38,9 +38,19 @@ type TypeChartYAxisLabelFormatter = ({ y, yValues, }: Readonly<{
|
|
|
38
38
|
y: number;
|
|
39
39
|
yValues: ReadonlyArray<number>;
|
|
40
40
|
}>) => string;
|
|
41
|
+
type TypeChartXAnnotationsDetails = () => ReactNode;
|
|
42
|
+
type TypeChartXAnnotations = Readonly<{
|
|
43
|
+
[x: number]: Readonly<{
|
|
44
|
+
marker: () => ReactNode;
|
|
45
|
+
details: TypeChartXAnnotationsDetails;
|
|
46
|
+
}>;
|
|
47
|
+
}> | undefined;
|
|
41
48
|
type TypeChartStyleColor = string;
|
|
42
49
|
type TypeChartStylePattern = "solid" | "dashed";
|
|
43
50
|
type TypeChartStyleHasOnClick = boolean;
|
|
51
|
+
interface TypeExtendedChart extends Chart {
|
|
52
|
+
annotations?: Annotation[];
|
|
53
|
+
}
|
|
44
54
|
|
|
45
55
|
type TypeAreaChartProps = Readonly<{
|
|
46
56
|
data: ReadonlyArray<Readonly<{
|
|
@@ -55,6 +65,7 @@ type TypeAreaChartProps = Readonly<{
|
|
|
55
65
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
56
66
|
tooltipTotalLabel: ReactNode;
|
|
57
67
|
currency?: string;
|
|
68
|
+
disableTooltips?: boolean;
|
|
58
69
|
numberFormat?: TypeChartNumberFormat;
|
|
59
70
|
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
60
71
|
total: number | null;
|
|
@@ -65,6 +76,7 @@ type TypeAreaChartProps = Readonly<{
|
|
|
65
76
|
}>) => void;
|
|
66
77
|
tooltipClickLabel?: ReactNode;
|
|
67
78
|
timeFormat?: TypeChartTimeFormat;
|
|
79
|
+
xAnnotations?: TypeChartXAnnotations;
|
|
68
80
|
}>;
|
|
69
81
|
declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
70
82
|
data: ReadonlyArray<Readonly<{
|
|
@@ -79,6 +91,7 @@ declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
|
79
91
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
80
92
|
tooltipTotalLabel: ReactNode;
|
|
81
93
|
currency?: string;
|
|
94
|
+
disableTooltips?: boolean;
|
|
82
95
|
numberFormat?: TypeChartNumberFormat;
|
|
83
96
|
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
84
97
|
total: number | null;
|
|
@@ -89,6 +102,7 @@ declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
|
89
102
|
}>) => void;
|
|
90
103
|
tooltipClickLabel?: ReactNode;
|
|
91
104
|
timeFormat?: TypeChartTimeFormat;
|
|
105
|
+
xAnnotations?: TypeChartXAnnotations;
|
|
92
106
|
}>>;
|
|
93
107
|
|
|
94
108
|
type TypeLegendLabel = Readonly<{
|
|
@@ -219,6 +233,7 @@ type TypeDonutChartProps = Readonly<{
|
|
|
219
233
|
numberLocale: Intl.LocalesArgument;
|
|
220
234
|
textLocale: Intl.LocalesArgument;
|
|
221
235
|
currency?: string;
|
|
236
|
+
disableTooltips?: boolean;
|
|
222
237
|
hideLegend?: boolean;
|
|
223
238
|
numberFormat?: TypeChartNumberFormat;
|
|
224
239
|
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
@@ -233,6 +248,7 @@ declare const DonutChart: react.NamedExoticComponent<Readonly<{
|
|
|
233
248
|
numberLocale: Intl.LocalesArgument;
|
|
234
249
|
textLocale: Intl.LocalesArgument;
|
|
235
250
|
currency?: string;
|
|
251
|
+
disableTooltips?: boolean;
|
|
236
252
|
hideLegend?: boolean;
|
|
237
253
|
numberFormat?: TypeChartNumberFormat;
|
|
238
254
|
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
@@ -269,6 +285,7 @@ type TypeLineChartProps = Readonly<{
|
|
|
269
285
|
textLocale: Intl.LocalesArgument;
|
|
270
286
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
271
287
|
currency?: string;
|
|
288
|
+
disableTooltips?: boolean;
|
|
272
289
|
numberFormat?: TypeChartNumberFormat;
|
|
273
290
|
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
274
291
|
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
@@ -277,6 +294,7 @@ type TypeLineChartProps = Readonly<{
|
|
|
277
294
|
}>) => void;
|
|
278
295
|
tooltipClickLabel?: ReactNode;
|
|
279
296
|
timeFormat?: TypeChartTimeFormat;
|
|
297
|
+
xAnnotations?: TypeChartXAnnotations;
|
|
280
298
|
}>;
|
|
281
299
|
declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
282
300
|
data: ReadonlyArray<Readonly<{
|
|
@@ -292,6 +310,7 @@ declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
|
292
310
|
textLocale: Intl.LocalesArgument;
|
|
293
311
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
294
312
|
currency?: string;
|
|
313
|
+
disableTooltips?: boolean;
|
|
295
314
|
numberFormat?: TypeChartNumberFormat;
|
|
296
315
|
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
297
316
|
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
@@ -300,6 +319,7 @@ declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
|
300
319
|
}>) => void;
|
|
301
320
|
tooltipClickLabel?: ReactNode;
|
|
302
321
|
timeFormat?: TypeChartTimeFormat;
|
|
322
|
+
xAnnotations?: TypeChartXAnnotations;
|
|
303
323
|
}>>;
|
|
304
324
|
|
|
305
325
|
declare const baseChartOptions: Options;
|
|
@@ -363,4 +383,4 @@ declare const donutChartStyles: styled_components.FlattenInterpolation<styled_co
|
|
|
363
383
|
$colors: ReadonlyArray<TypeChartStyleColor>;
|
|
364
384
|
}>, any>>;
|
|
365
385
|
|
|
366
|
-
export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, GlobalChartStyleOverrides, LineChart, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeAreaChartProps, type TypeChartDataPoint, type TypeChartDataStyles, type TypeChartLegendLabelProps, type TypeChartLegendProps, type TypeChartNumberFormat, type TypeChartStyleColor, type TypeChartStyleHasOnClick, type TypeChartStylePattern, type TypeChartTableProps, type TypeChartTimeFormat, type TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartTooltipTableProps, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeLegendLabel, type TypeLineChartProps, areaChartOptions, areaChartStyles, baseChartOptions, baseChartStyles, donutChartOptions, donutChartStyles, generateChartTooltipPortalId, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, lineChartOptions, lineChartStyles, timeSeriesChartStyles, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
|
|
386
|
+
export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, GlobalChartStyleOverrides, LineChart, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeAreaChartProps, type TypeChartDataPoint, type TypeChartDataStyles, type TypeChartLegendLabelProps, type TypeChartLegendProps, type TypeChartNumberFormat, type TypeChartStyleColor, type TypeChartStyleHasOnClick, type TypeChartStylePattern, type TypeChartTableProps, type TypeChartTimeFormat, type TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartTooltipTableProps, type TypeChartXAnnotations, type TypeChartXAnnotationsDetails, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeExtendedChart, type TypeLegendLabel, type TypeLineChartProps, areaChartOptions, areaChartStyles, baseChartOptions, baseChartStyles, donutChartOptions, donutChartStyles, generateChartTooltipPortalId, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, lineChartOptions, lineChartStyles, timeSeriesChartStyles, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
|