@sproutsocial/seeds-react-data-viz 0.1.0 → 0.1.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/README.md +1 -1
- package/dist/esm/index.css +1006 -0
- package/dist/esm/index.css.map +1 -0
- package/dist/esm/index.js +2879 -425
- package/dist/esm/index.js.map +1 -1
- package/dist/index.css +1006 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +196 -48
- package/dist/index.d.ts +196 -48
- package/dist/index.js +2843 -401
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,118 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { TimeTicksInfoObject, AxisLabelsFormatterContextObject, Options, SeriesSplineOptions, SeriesAreasplineOptions, TooltipFormatterContextObject, AxisTickPositionsArray } from 'highcharts';
|
|
5
4
|
import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
|
|
6
5
|
import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
|
|
6
|
+
import { Table } from '@sproutsocial/racine';
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
8
|
import * as styled_components from 'styled-components';
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
interface ExtendedTimeTicksInfoObject extends TimeTicksInfoObject {
|
|
11
|
+
unitName: "hour" | "day" | "week" | "month" | "year";
|
|
12
|
+
}
|
|
13
|
+
interface ExtendedAxisLabelsFormatterContextObject extends AxisLabelsFormatterContextObject {
|
|
14
|
+
tickPositionInfo: ExtendedTimeTicksInfoObject;
|
|
15
|
+
}
|
|
16
|
+
type TypeChartDataPoint = Readonly<{
|
|
17
|
+
x: number;
|
|
18
|
+
y: number | null;
|
|
19
|
+
}>;
|
|
20
|
+
type TypeChartDataStyles = Readonly<{
|
|
21
|
+
color?: TypeChartStyleColor;
|
|
22
|
+
}>;
|
|
23
|
+
type TypeChartNumberFormat = "decimal" | "percent" | "currency" | "duration";
|
|
24
|
+
type TypeChartTooltipDateFormatter = ({ x }: {
|
|
25
|
+
x: number;
|
|
26
|
+
}) => ReactNode;
|
|
27
|
+
type TypeChartTooltipProps = Readonly<{
|
|
28
|
+
data: ReadonlyArray<Readonly<{
|
|
29
|
+
color: TypeChartStyleColor;
|
|
30
|
+
name: string;
|
|
31
|
+
value: number | null;
|
|
32
|
+
icon?: ReactNode;
|
|
33
|
+
}>>;
|
|
34
|
+
x: number;
|
|
35
|
+
}>;
|
|
36
|
+
type TypeChartYAxisLabelFormatter = ({ y, yValues, }: Readonly<{
|
|
37
|
+
y: number;
|
|
38
|
+
yValues: ReadonlyArray<number>;
|
|
39
|
+
}>) => string;
|
|
40
|
+
type TypeChartStyleColor = string;
|
|
41
|
+
type TypeChartStylePattern = "solid" | "dashed";
|
|
42
|
+
type TypeChartStyleHasOnClick = boolean;
|
|
43
|
+
|
|
44
|
+
type TypeAreaChartProps = Readonly<{
|
|
45
|
+
data: ReadonlyArray<Readonly<{
|
|
46
|
+
name: string;
|
|
47
|
+
points: ReadonlyArray<TypeChartDataPoint>;
|
|
48
|
+
icon?: ReactNode;
|
|
49
|
+
styles?: TypeChartDataStyles;
|
|
50
|
+
}>>;
|
|
51
|
+
invalidNumberLabel: ReactNode;
|
|
52
|
+
numberLocale: Intl.LocalesArgument;
|
|
53
|
+
textLocale: Intl.LocalesArgument;
|
|
54
|
+
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
55
|
+
tooltipTotalLabel: ReactNode;
|
|
56
|
+
currency?: string;
|
|
57
|
+
numberFormat?: TypeChartNumberFormat;
|
|
58
|
+
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
59
|
+
total: number | null;
|
|
60
|
+
}>) => ReactNode;
|
|
61
|
+
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
62
|
+
onClick?: ({ x }: Readonly<{
|
|
63
|
+
x: number;
|
|
64
|
+
}>) => void;
|
|
65
|
+
tooltipClickLabel?: ReactNode;
|
|
66
|
+
}>;
|
|
67
|
+
declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
68
|
+
data: ReadonlyArray<Readonly<{
|
|
69
|
+
name: string;
|
|
70
|
+
points: ReadonlyArray<TypeChartDataPoint>;
|
|
71
|
+
icon?: ReactNode;
|
|
72
|
+
styles?: TypeChartDataStyles;
|
|
73
|
+
}>>;
|
|
74
|
+
invalidNumberLabel: ReactNode;
|
|
75
|
+
numberLocale: Intl.LocalesArgument;
|
|
76
|
+
textLocale: Intl.LocalesArgument;
|
|
77
|
+
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
78
|
+
tooltipTotalLabel: ReactNode;
|
|
79
|
+
currency?: string;
|
|
80
|
+
numberFormat?: TypeChartNumberFormat;
|
|
81
|
+
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
82
|
+
total: number | null;
|
|
83
|
+
}>) => ReactNode;
|
|
84
|
+
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
85
|
+
onClick?: ({ x }: Readonly<{
|
|
86
|
+
x: number;
|
|
87
|
+
}>) => void;
|
|
88
|
+
tooltipClickLabel?: ReactNode;
|
|
89
|
+
}>>;
|
|
90
|
+
|
|
91
|
+
type TypeLegendLabel = Readonly<{
|
|
92
|
+
content: React.ReactNode;
|
|
93
|
+
color?: string;
|
|
94
|
+
}>;
|
|
95
|
+
type TypeChartLegendProps = Readonly<{
|
|
96
|
+
legendLabels: ReadonlyArray<TypeLegendLabel>;
|
|
97
|
+
containerBoxProps?: TypeBoxProps;
|
|
98
|
+
stacked?: boolean;
|
|
99
|
+
}>;
|
|
100
|
+
declare const ChartLegend: react.NamedExoticComponent<Readonly<{
|
|
101
|
+
legendLabels: ReadonlyArray<TypeLegendLabel>;
|
|
102
|
+
containerBoxProps?: TypeBoxProps;
|
|
103
|
+
stacked?: boolean;
|
|
104
|
+
}>>;
|
|
105
|
+
|
|
106
|
+
type TypeChartLegendLabelProps = Readonly<{
|
|
107
|
+
children: TypeLegendLabel["content"];
|
|
108
|
+
color: TypeLegendLabel["color"];
|
|
109
|
+
containerBoxProps?: TypeBoxProps;
|
|
110
|
+
}>;
|
|
111
|
+
declare const ChartLegendLabel: react.NamedExoticComponent<Readonly<{
|
|
112
|
+
children: TypeLegendLabel["content"];
|
|
113
|
+
color: TypeLegendLabel["color"];
|
|
114
|
+
containerBoxProps?: TypeBoxProps;
|
|
115
|
+
}>>;
|
|
9
116
|
|
|
10
117
|
type TypeChartTableProps = Readonly<{
|
|
11
118
|
rows: ReadonlyArray<{
|
|
@@ -28,6 +135,30 @@ declare const ChartTable: react.NamedExoticComponent<Readonly<{
|
|
|
28
135
|
}>;
|
|
29
136
|
}>>;
|
|
30
137
|
|
|
138
|
+
declare const ChartTooltip: react.NamedExoticComponent<Readonly<{
|
|
139
|
+
children: React.ReactNode;
|
|
140
|
+
}>>;
|
|
141
|
+
|
|
142
|
+
type TypeChartTooltipFooterProps = {
|
|
143
|
+
children: React.ReactNode;
|
|
144
|
+
};
|
|
145
|
+
declare const ChartTooltipFooter: react.NamedExoticComponent<TypeChartTooltipFooterProps>;
|
|
146
|
+
|
|
147
|
+
type TypeChartTooltipHeaderProps = {
|
|
148
|
+
children: React.ReactNode;
|
|
149
|
+
};
|
|
150
|
+
declare const ChartTooltipHeader: react.NamedExoticComponent<TypeChartTooltipHeaderProps>;
|
|
151
|
+
|
|
152
|
+
type TypeChartTooltipTableProps = {
|
|
153
|
+
rows: TypeChartTableProps["rows"];
|
|
154
|
+
};
|
|
155
|
+
declare const ChartTooltipTable: react.NamedExoticComponent<TypeChartTooltipTableProps>;
|
|
156
|
+
|
|
157
|
+
type TypeChartTooltipTitleProps = {
|
|
158
|
+
children: React.ReactNode;
|
|
159
|
+
};
|
|
160
|
+
declare const ChartTooltipTitle: react.NamedExoticComponent<TypeChartTooltipTitleProps>;
|
|
161
|
+
|
|
31
162
|
type TypeColorBoxProps = TypeBoxProps;
|
|
32
163
|
/**
|
|
33
164
|
* ColorBox extends Box to apply basic styles.
|
|
@@ -62,74 +193,82 @@ type TypeNetworkColorBoxProps = Readonly<TypeColorBoxProps & {
|
|
|
62
193
|
*/
|
|
63
194
|
declare const NetworkColorBox: ({ networkColor, ...props }: TypeNetworkColorBoxProps) => react_jsx_runtime.JSX.Element;
|
|
64
195
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
declare const DONUT_CHART_WIDTH: number;
|
|
72
|
-
declare const donutChartOptions: Options;
|
|
73
|
-
|
|
74
|
-
interface ExtendedTimeTicksInfoObject extends TimeTicksInfoObject {
|
|
75
|
-
unitName: "hour" | "day" | "week" | "month" | "year";
|
|
76
|
-
}
|
|
77
|
-
interface ExtendedAxisLabelsFormatterContextObject extends AxisLabelsFormatterContextObject {
|
|
78
|
-
tickPositionInfo: ExtendedTimeTicksInfoObject;
|
|
79
|
-
}
|
|
80
|
-
type TypeChartDataPoint = Readonly<{
|
|
81
|
-
x: number;
|
|
82
|
-
y: number | null;
|
|
196
|
+
type TypeDonutChartTooltipProps = Readonly<{
|
|
197
|
+
color: string;
|
|
198
|
+
name: string;
|
|
199
|
+
percent: number | null;
|
|
200
|
+
value: number | null;
|
|
201
|
+
icon?: ReactNode;
|
|
83
202
|
}>;
|
|
84
|
-
type
|
|
85
|
-
|
|
203
|
+
type TypeDonutChartProps = Readonly<{
|
|
204
|
+
data: ReadonlyArray<Readonly<{
|
|
205
|
+
name: string;
|
|
206
|
+
value: number;
|
|
207
|
+
icon?: ReactNode;
|
|
208
|
+
styles?: TypeChartDataStyles;
|
|
209
|
+
}>>;
|
|
210
|
+
numberLocale: Intl.LocalesArgument;
|
|
211
|
+
textLocale: Intl.LocalesArgument;
|
|
212
|
+
currency?: string;
|
|
213
|
+
hideLegend?: boolean;
|
|
214
|
+
numberFormat?: TypeChartNumberFormat;
|
|
215
|
+
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
86
216
|
}>;
|
|
87
|
-
|
|
88
|
-
type TypeChartTooltipDateFormatter = ({ x }: {
|
|
89
|
-
x: number;
|
|
90
|
-
}) => ReactNode;
|
|
91
|
-
type TypeChartTooltipProps = Readonly<{
|
|
217
|
+
declare const DonutChart: react.NamedExoticComponent<Readonly<{
|
|
92
218
|
data: ReadonlyArray<Readonly<{
|
|
93
|
-
color: TypeChartStyleColor;
|
|
94
219
|
name: string;
|
|
95
|
-
value: number
|
|
220
|
+
value: number;
|
|
96
221
|
icon?: ReactNode;
|
|
222
|
+
styles?: TypeChartDataStyles;
|
|
97
223
|
}>>;
|
|
98
|
-
|
|
224
|
+
numberLocale: Intl.LocalesArgument;
|
|
225
|
+
textLocale: Intl.LocalesArgument;
|
|
226
|
+
currency?: string;
|
|
227
|
+
hideLegend?: boolean;
|
|
228
|
+
numberFormat?: TypeChartNumberFormat;
|
|
229
|
+
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
230
|
+
}>>;
|
|
231
|
+
|
|
232
|
+
type TypeDonutChartLegendTableProps = Readonly<{
|
|
233
|
+
data: TypeDonutChartProps["data"];
|
|
234
|
+
numberLocale: TypeDonutChartProps["numberLocale"];
|
|
235
|
+
textLocale: TypeDonutChartProps["textLocale"];
|
|
236
|
+
totalLabel: React.ReactNode;
|
|
237
|
+
currency?: TypeDonutChartProps["currency"];
|
|
238
|
+
numberFormat?: TypeDonutChartProps["numberFormat"];
|
|
99
239
|
}>;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
240
|
+
declare const DonutChartLegendTable: react.NamedExoticComponent<Readonly<{
|
|
241
|
+
data: TypeDonutChartProps["data"];
|
|
242
|
+
numberLocale: TypeDonutChartProps["numberLocale"];
|
|
243
|
+
textLocale: TypeDonutChartProps["textLocale"];
|
|
244
|
+
totalLabel: React.ReactNode;
|
|
245
|
+
currency?: TypeDonutChartProps["currency"];
|
|
246
|
+
numberFormat?: TypeDonutChartProps["numberFormat"];
|
|
247
|
+
}>>;
|
|
107
248
|
|
|
108
|
-
type
|
|
249
|
+
type TypeLineChartProps = Readonly<{
|
|
109
250
|
data: ReadonlyArray<Readonly<{
|
|
110
251
|
name: string;
|
|
111
252
|
points: ReadonlyArray<TypeChartDataPoint>;
|
|
112
253
|
icon?: ReactNode;
|
|
113
|
-
styles?: TypeChartDataStyles
|
|
254
|
+
styles?: TypeChartDataStyles & Readonly<{
|
|
255
|
+
pattern?: TypeChartStylePattern;
|
|
256
|
+
}>;
|
|
114
257
|
}>>;
|
|
115
258
|
invalidNumberLabel: ReactNode;
|
|
116
259
|
numberLocale: Intl.LocalesArgument;
|
|
117
260
|
textLocale: Intl.LocalesArgument;
|
|
118
261
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
119
|
-
tooltipTotalLabel: ReactNode;
|
|
120
262
|
currency?: string;
|
|
121
263
|
numberFormat?: TypeChartNumberFormat;
|
|
122
|
-
tooltip?: ({ data,
|
|
123
|
-
total: number | null;
|
|
124
|
-
}>) => ReactNode;
|
|
264
|
+
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
125
265
|
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
126
266
|
onClick?: ({ x }: Readonly<{
|
|
127
267
|
x: number;
|
|
128
268
|
}>) => void;
|
|
129
269
|
tooltipClickLabel?: ReactNode;
|
|
130
270
|
}>;
|
|
131
|
-
|
|
132
|
-
type TypeLineChartProps = Readonly<{
|
|
271
|
+
declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
133
272
|
data: ReadonlyArray<Readonly<{
|
|
134
273
|
name: string;
|
|
135
274
|
points: ReadonlyArray<TypeChartDataPoint>;
|
|
@@ -150,7 +289,16 @@ type TypeLineChartProps = Readonly<{
|
|
|
150
289
|
x: number;
|
|
151
290
|
}>) => void;
|
|
152
291
|
tooltipClickLabel?: ReactNode;
|
|
153
|
-
}
|
|
292
|
+
}>>;
|
|
293
|
+
|
|
294
|
+
declare const baseChartOptions: Options;
|
|
295
|
+
declare const TIME_SERIES_CHART_HEIGHT = 275;
|
|
296
|
+
declare const lineChartOptions: Options;
|
|
297
|
+
declare const areaChartOptions: Options;
|
|
298
|
+
declare const DONUT_CHART_HALO_SIZE = 10;
|
|
299
|
+
declare const DONUT_CHART_HEIGHT: number;
|
|
300
|
+
declare const DONUT_CHART_WIDTH: number;
|
|
301
|
+
declare const donutChartOptions: Options;
|
|
154
302
|
|
|
155
303
|
type TypeTimeSeriesOptions = SeriesSplineOptions | SeriesAreasplineOptions;
|
|
156
304
|
declare const transformDataToSeries: ({ data }: {
|
|
@@ -182,4 +330,4 @@ type TypeYAxisLabelFormatterProps = Readonly<{
|
|
|
182
330
|
}>;
|
|
183
331
|
declare const yAxisLabelFormatter: ({ numberLocale, textLocale, tickPositions, value, currency, numberFormat, }: TypeYAxisLabelFormatterProps) => string;
|
|
184
332
|
|
|
185
|
-
export { ChartTable, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeChartDataPoint, type TypeChartDataStyles, type TypeChartNumberFormat, type TypeChartStyleColor, type TypeChartStyleHasOnClick, type TypeChartStylePattern, type TypeChartTableProps, type TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, areaChartOptions, baseChartOptions, donutChartOptions, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, lineChartOptions, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
|
|
333
|
+
export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipTable, ChartTooltipTitle, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, 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 TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartTooltipTableProps, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeLegendLabel, type TypeLineChartProps, areaChartOptions, baseChartOptions, donutChartOptions, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, lineChartOptions, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
|