@sproutsocial/seeds-react-data-viz 0.3.0 → 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 +16 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -65,6 +65,7 @@ type TypeAreaChartProps = Readonly<{
|
|
|
65
65
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
66
66
|
tooltipTotalLabel: ReactNode;
|
|
67
67
|
currency?: string;
|
|
68
|
+
disableTooltips?: boolean;
|
|
68
69
|
numberFormat?: TypeChartNumberFormat;
|
|
69
70
|
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
70
71
|
total: number | null;
|
|
@@ -90,6 +91,7 @@ declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
|
90
91
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
91
92
|
tooltipTotalLabel: ReactNode;
|
|
92
93
|
currency?: string;
|
|
94
|
+
disableTooltips?: boolean;
|
|
93
95
|
numberFormat?: TypeChartNumberFormat;
|
|
94
96
|
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
95
97
|
total: number | null;
|
|
@@ -231,6 +233,7 @@ type TypeDonutChartProps = Readonly<{
|
|
|
231
233
|
numberLocale: Intl.LocalesArgument;
|
|
232
234
|
textLocale: Intl.LocalesArgument;
|
|
233
235
|
currency?: string;
|
|
236
|
+
disableTooltips?: boolean;
|
|
234
237
|
hideLegend?: boolean;
|
|
235
238
|
numberFormat?: TypeChartNumberFormat;
|
|
236
239
|
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
@@ -245,6 +248,7 @@ declare const DonutChart: react.NamedExoticComponent<Readonly<{
|
|
|
245
248
|
numberLocale: Intl.LocalesArgument;
|
|
246
249
|
textLocale: Intl.LocalesArgument;
|
|
247
250
|
currency?: string;
|
|
251
|
+
disableTooltips?: boolean;
|
|
248
252
|
hideLegend?: boolean;
|
|
249
253
|
numberFormat?: TypeChartNumberFormat;
|
|
250
254
|
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
@@ -281,6 +285,7 @@ type TypeLineChartProps = Readonly<{
|
|
|
281
285
|
textLocale: Intl.LocalesArgument;
|
|
282
286
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
283
287
|
currency?: string;
|
|
288
|
+
disableTooltips?: boolean;
|
|
284
289
|
numberFormat?: TypeChartNumberFormat;
|
|
285
290
|
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
286
291
|
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
@@ -305,6 +310,7 @@ declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
|
305
310
|
textLocale: Intl.LocalesArgument;
|
|
306
311
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
307
312
|
currency?: string;
|
|
313
|
+
disableTooltips?: boolean;
|
|
308
314
|
numberFormat?: TypeChartNumberFormat;
|
|
309
315
|
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
310
316
|
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
package/dist/index.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ type TypeAreaChartProps = Readonly<{
|
|
|
65
65
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
66
66
|
tooltipTotalLabel: ReactNode;
|
|
67
67
|
currency?: string;
|
|
68
|
+
disableTooltips?: boolean;
|
|
68
69
|
numberFormat?: TypeChartNumberFormat;
|
|
69
70
|
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
70
71
|
total: number | null;
|
|
@@ -90,6 +91,7 @@ declare const AreaChart: react.NamedExoticComponent<Readonly<{
|
|
|
90
91
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
91
92
|
tooltipTotalLabel: ReactNode;
|
|
92
93
|
currency?: string;
|
|
94
|
+
disableTooltips?: boolean;
|
|
93
95
|
numberFormat?: TypeChartNumberFormat;
|
|
94
96
|
tooltip?: ({ data, total, x, }: TypeChartTooltipProps & Readonly<{
|
|
95
97
|
total: number | null;
|
|
@@ -231,6 +233,7 @@ type TypeDonutChartProps = Readonly<{
|
|
|
231
233
|
numberLocale: Intl.LocalesArgument;
|
|
232
234
|
textLocale: Intl.LocalesArgument;
|
|
233
235
|
currency?: string;
|
|
236
|
+
disableTooltips?: boolean;
|
|
234
237
|
hideLegend?: boolean;
|
|
235
238
|
numberFormat?: TypeChartNumberFormat;
|
|
236
239
|
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
@@ -245,6 +248,7 @@ declare const DonutChart: react.NamedExoticComponent<Readonly<{
|
|
|
245
248
|
numberLocale: Intl.LocalesArgument;
|
|
246
249
|
textLocale: Intl.LocalesArgument;
|
|
247
250
|
currency?: string;
|
|
251
|
+
disableTooltips?: boolean;
|
|
248
252
|
hideLegend?: boolean;
|
|
249
253
|
numberFormat?: TypeChartNumberFormat;
|
|
250
254
|
tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
|
|
@@ -281,6 +285,7 @@ type TypeLineChartProps = Readonly<{
|
|
|
281
285
|
textLocale: Intl.LocalesArgument;
|
|
282
286
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
283
287
|
currency?: string;
|
|
288
|
+
disableTooltips?: boolean;
|
|
284
289
|
numberFormat?: TypeChartNumberFormat;
|
|
285
290
|
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
286
291
|
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
|
@@ -305,6 +310,7 @@ declare const LineChart: react.NamedExoticComponent<Readonly<{
|
|
|
305
310
|
textLocale: Intl.LocalesArgument;
|
|
306
311
|
tooltipDateFormatter: TypeChartTooltipDateFormatter;
|
|
307
312
|
currency?: string;
|
|
313
|
+
disableTooltips?: boolean;
|
|
308
314
|
numberFormat?: TypeChartNumberFormat;
|
|
309
315
|
tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
|
|
310
316
|
yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
|
package/dist/index.js
CHANGED
|
@@ -883,6 +883,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
883
883
|
seriesType,
|
|
884
884
|
textLocale,
|
|
885
885
|
currency = "USD",
|
|
886
|
+
disableTooltips = false,
|
|
886
887
|
numberFormat = "decimal",
|
|
887
888
|
yAxisLabelFormatter: yAxisLabelFormatter2,
|
|
888
889
|
onClick,
|
|
@@ -964,6 +965,9 @@ var useTimeSeriesChartOptions = ({
|
|
|
964
965
|
}
|
|
965
966
|
},
|
|
966
967
|
series: transformDataToSeries({ data }, seriesType),
|
|
968
|
+
tooltip: {
|
|
969
|
+
enabled: !disableTooltips
|
|
970
|
+
},
|
|
967
971
|
xAxis: {
|
|
968
972
|
labels: {
|
|
969
973
|
formatter: function() {
|
|
@@ -1185,6 +1189,7 @@ var AreaChartWithData = (0, import_react16.memo)(function AreaChartWithData2({
|
|
|
1185
1189
|
tooltipTotalLabel,
|
|
1186
1190
|
// optional
|
|
1187
1191
|
currency = "USD",
|
|
1192
|
+
disableTooltips = false,
|
|
1188
1193
|
numberFormat = "decimal",
|
|
1189
1194
|
tooltip,
|
|
1190
1195
|
yAxisLabelFormatter: yAxisLabelFormatter2,
|
|
@@ -1196,6 +1201,7 @@ var AreaChartWithData = (0, import_react16.memo)(function AreaChartWithData2({
|
|
|
1196
1201
|
const { options, chart, callback } = useTimeSeriesChartOptions({
|
|
1197
1202
|
currency,
|
|
1198
1203
|
data,
|
|
1204
|
+
disableTooltips,
|
|
1199
1205
|
numberFormat,
|
|
1200
1206
|
numberLocale,
|
|
1201
1207
|
seriesType: "areaspline",
|
|
@@ -1232,7 +1238,7 @@ var AreaChartWithData = (0, import_react16.memo)(function AreaChartWithData2({
|
|
|
1232
1238
|
annotationContext: chart.annotations?.[0]
|
|
1233
1239
|
}
|
|
1234
1240
|
) : null,
|
|
1235
|
-
chart ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1241
|
+
chart && !disableTooltips ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1236
1242
|
ChartTooltipPortal,
|
|
1237
1243
|
{
|
|
1238
1244
|
chart,
|
|
@@ -1388,6 +1394,7 @@ var DonutChartWithData = (0, import_react19.memo)(
|
|
|
1388
1394
|
textLocale = "en-us",
|
|
1389
1395
|
// optional
|
|
1390
1396
|
currency = "USD",
|
|
1397
|
+
disableTooltips = false,
|
|
1391
1398
|
hideLegend = false,
|
|
1392
1399
|
numberFormat = "decimal",
|
|
1393
1400
|
tooltip
|
|
@@ -1435,7 +1442,10 @@ var DonutChartWithData = (0, import_react19.memo)(
|
|
|
1435
1442
|
};
|
|
1436
1443
|
})
|
|
1437
1444
|
}
|
|
1438
|
-
]
|
|
1445
|
+
],
|
|
1446
|
+
tooltip: {
|
|
1447
|
+
enabled: !disableTooltips
|
|
1448
|
+
}
|
|
1439
1449
|
});
|
|
1440
1450
|
}, [data]);
|
|
1441
1451
|
const colors = data.map(
|
|
@@ -1452,7 +1462,7 @@ var DonutChartWithData = (0, import_react19.memo)(
|
|
|
1452
1462
|
callback
|
|
1453
1463
|
}
|
|
1454
1464
|
),
|
|
1455
|
-
chart ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1465
|
+
chart && !disableTooltips ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1456
1466
|
ChartTooltipPortal,
|
|
1457
1467
|
{
|
|
1458
1468
|
chart,
|
|
@@ -1674,6 +1684,7 @@ var LineChartWithData = (0, import_react23.memo)(function LineChartWithData2({
|
|
|
1674
1684
|
tooltipDateFormatter,
|
|
1675
1685
|
// optional
|
|
1676
1686
|
currency = "USD",
|
|
1687
|
+
disableTooltips = false,
|
|
1677
1688
|
numberFormat = "decimal",
|
|
1678
1689
|
tooltip,
|
|
1679
1690
|
yAxisLabelFormatter: yAxisLabelFormatter2,
|
|
@@ -1685,6 +1696,7 @@ var LineChartWithData = (0, import_react23.memo)(function LineChartWithData2({
|
|
|
1685
1696
|
const { options, chart, callback } = useTimeSeriesChartOptions({
|
|
1686
1697
|
currency,
|
|
1687
1698
|
data,
|
|
1699
|
+
disableTooltips,
|
|
1688
1700
|
numberFormat,
|
|
1689
1701
|
numberLocale,
|
|
1690
1702
|
seriesType: "spline",
|
|
@@ -1732,7 +1744,7 @@ var LineChartWithData = (0, import_react23.memo)(function LineChartWithData2({
|
|
|
1732
1744
|
annotationContext: chart.annotations?.[0]
|
|
1733
1745
|
}
|
|
1734
1746
|
) : null,
|
|
1735
|
-
chart ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1747
|
+
chart && !disableTooltips ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1736
1748
|
ChartTooltipPortal,
|
|
1737
1749
|
{
|
|
1738
1750
|
chart,
|