@sproutsocial/seeds-react-data-viz 0.16.1 → 0.17.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/annotations-CjFoRPXf.d.mts +20 -0
- package/dist/annotations-CjFoRPXf.d.ts +20 -0
- package/dist/axis-WOeYkTO1.d.mts +44 -0
- package/dist/axis-WOeYkTO1.d.ts +44 -0
- package/dist/bar/index.d.mts +3 -1
- package/dist/bar/index.d.ts +3 -1
- package/dist/bar/index.js +12 -8
- package/dist/bar/index.js.map +1 -1
- package/dist/{axis-BVPkC6iF.d.ts → chartBase-C-l7yYGx.d.ts} +5 -59
- package/dist/{axis-BjucJt39.d.mts → chartBase-Cn_5CUJi.d.mts} +5 -59
- package/dist/{chunk-EJYDQYLE.js → chunk-2K7PFHIM.js} +92 -245
- package/dist/chunk-2K7PFHIM.js.map +1 -0
- package/dist/chunk-6D7P3IOT.js +150 -0
- package/dist/chunk-6D7P3IOT.js.map +1 -0
- package/dist/chunk-CYQXUAJC.js +169 -0
- package/dist/chunk-CYQXUAJC.js.map +1 -0
- package/dist/chunk-VVGBJOFH.js +68 -0
- package/dist/chunk-VVGBJOFH.js.map +1 -0
- package/dist/donut/index.d.mts +48 -0
- package/dist/donut/index.d.ts +48 -0
- package/dist/donut/index.js +125 -0
- package/dist/donut/index.js.map +1 -0
- package/dist/esm/bar/index.js +10 -6
- package/dist/esm/bar/index.js.map +1 -1
- package/dist/esm/chunk-AUJ3EWRH.js +68 -0
- package/dist/esm/chunk-AUJ3EWRH.js.map +1 -0
- package/dist/esm/{chunk-DKTW56NJ.js → chunk-LPQXJJNT.js} +93 -246
- package/dist/esm/chunk-LPQXJJNT.js.map +1 -0
- package/dist/esm/chunk-NAKJY5PA.js +150 -0
- package/dist/esm/chunk-NAKJY5PA.js.map +1 -0
- package/dist/esm/chunk-XMYGML25.js +169 -0
- package/dist/esm/chunk-XMYGML25.js.map +1 -0
- package/dist/esm/donut/index.js +125 -0
- package/dist/esm/donut/index.js.map +1 -0
- package/dist/esm/index.js +13 -157
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/line-area/index.js +11 -6
- package/dist/esm/line-area/index.js.map +1 -1
- package/dist/esm/sparkline/index.js +123 -0
- package/dist/esm/sparkline/index.js.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +55 -199
- package/dist/index.js.map +1 -1
- package/dist/line-area/index.d.mts +6 -3
- package/dist/line-area/index.d.ts +6 -3
- package/dist/line-area/index.js +13 -8
- package/dist/line-area/index.js.map +1 -1
- package/dist/sparkline/index.d.mts +75 -0
- package/dist/sparkline/index.d.ts +75 -0
- package/dist/sparkline/index.js +123 -0
- package/dist/sparkline/index.js.map +1 -0
- package/dist/sparkline.css +76 -0
- package/package.json +13 -2
- package/dist/chunk-EJYDQYLE.js.map +0 -1
- package/dist/esm/chunk-DKTW56NJ.js.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DONUT_CHART_HALO_SIZE,
|
|
3
|
+
DONUT_CHART_HEIGHT,
|
|
4
|
+
DONUT_CHART_WIDTH,
|
|
5
|
+
TIME_SERIES_CHART_HEIGHT,
|
|
6
|
+
VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT,
|
|
7
|
+
areaChartOptions,
|
|
8
|
+
baseChartOptions,
|
|
9
|
+
columnChartOptions,
|
|
10
|
+
donutChartOptions,
|
|
11
|
+
lineChartOptions,
|
|
12
|
+
timeSeriesChartOptions
|
|
13
|
+
} from "./chunk-XMYGML25.js";
|
|
1
14
|
import {
|
|
2
15
|
ChartLegend,
|
|
3
16
|
ChartLegendLabel,
|
|
@@ -215,163 +228,6 @@ var ChartXAnnotationMarkerPortal = memo3(
|
|
|
215
228
|
|
|
216
229
|
// src/hooks/useTimeSeriesChartOptions.ts
|
|
217
230
|
import { useState as useState2, useCallback, useMemo } from "react";
|
|
218
|
-
|
|
219
|
-
// src/constants/chartOptions.ts
|
|
220
|
-
import _ from "lodash";
|
|
221
|
-
var baseChartOptions = {
|
|
222
|
-
chart: {
|
|
223
|
-
animation: false,
|
|
224
|
-
styledMode: true
|
|
225
|
-
},
|
|
226
|
-
credits: {
|
|
227
|
-
enabled: false
|
|
228
|
-
},
|
|
229
|
-
exporting: {
|
|
230
|
-
enabled: false,
|
|
231
|
-
fallbackToExportServer: false
|
|
232
|
-
},
|
|
233
|
-
legend: {
|
|
234
|
-
enabled: false
|
|
235
|
-
},
|
|
236
|
-
title: {
|
|
237
|
-
text: void 0
|
|
238
|
-
},
|
|
239
|
-
tooltip: {
|
|
240
|
-
hideDelay: 0,
|
|
241
|
-
outside: true,
|
|
242
|
-
padding: 0,
|
|
243
|
-
shape: "rect",
|
|
244
|
-
shared: true,
|
|
245
|
-
useHTML: true
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
var TIME_SERIES_CHART_HEIGHT = 275;
|
|
249
|
-
var timeSeriesChartOptions = _.merge({}, baseChartOptions, {
|
|
250
|
-
annotations: [
|
|
251
|
-
{
|
|
252
|
-
draggable: "",
|
|
253
|
-
labelOptions: {
|
|
254
|
-
useHTML: true,
|
|
255
|
-
padding: 0
|
|
256
|
-
// removes "left" property padding created by highcharts so that label is centered
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
],
|
|
260
|
-
chart: {
|
|
261
|
-
// events.click is set at the component level because of the optional onClick prop
|
|
262
|
-
height: TIME_SERIES_CHART_HEIGHT,
|
|
263
|
-
spacing: [5, 1, 0, 2]
|
|
264
|
-
},
|
|
265
|
-
plotOptions: {
|
|
266
|
-
series: {
|
|
267
|
-
animation: false,
|
|
268
|
-
clip: false,
|
|
269
|
-
marker: {
|
|
270
|
-
enabled: false,
|
|
271
|
-
states: {
|
|
272
|
-
hover: {
|
|
273
|
-
enabled: false
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
xAxis: {
|
|
280
|
-
crosshair: {
|
|
281
|
-
zIndex: 3
|
|
282
|
-
},
|
|
283
|
-
minPadding: 0,
|
|
284
|
-
// must be handled dynamically instead of css
|
|
285
|
-
maxPadding: 0,
|
|
286
|
-
// must be handled dynamically instead of css
|
|
287
|
-
type: "datetime",
|
|
288
|
-
labels: {
|
|
289
|
-
useHTML: true
|
|
290
|
-
// formatter is set at the component level because of the required text locale prop
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
yAxis: {
|
|
294
|
-
labels: {
|
|
295
|
-
useHTML: true
|
|
296
|
-
// formatter is set at the component level because of the optional yAxisLabelFormatter prop
|
|
297
|
-
},
|
|
298
|
-
softMax: 0,
|
|
299
|
-
softMin: 0,
|
|
300
|
-
title: {
|
|
301
|
-
text: void 0
|
|
302
|
-
},
|
|
303
|
-
plotLines: [
|
|
304
|
-
/* Adds a custom plotLine at y=0 to represent the chart baseline.
|
|
305
|
-
This approach allows full control over the line's appearance (e.g., color, z-index),
|
|
306
|
-
unlike relying on the default xAxis line, which always renders at the bottom of the chart
|
|
307
|
-
even when y=0 appears elsewhere (e.g., with negative values).
|
|
308
|
-
*/
|
|
309
|
-
{
|
|
310
|
-
className: "y-axis-zero-line",
|
|
311
|
-
value: 0,
|
|
312
|
-
zIndex: 3
|
|
313
|
-
// ensures the line appears over the default y=0 line, which we can't seleect as specifically
|
|
314
|
-
}
|
|
315
|
-
]
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
var lineChartOptions = _.merge({}, timeSeriesChartOptions, {
|
|
319
|
-
// plotOptions.spline.events.click is set at the component level because of the optional onClick prop
|
|
320
|
-
});
|
|
321
|
-
var areaChartOptions = _.merge({}, timeSeriesChartOptions, {
|
|
322
|
-
plotOptions: {
|
|
323
|
-
areaspline: {
|
|
324
|
-
// events.click is set at the component level because of the optional onClick prop
|
|
325
|
-
stacking: "normal"
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
var columnChartOptions = _.merge({}, timeSeriesChartOptions, {
|
|
330
|
-
plotOptions: {
|
|
331
|
-
column: {
|
|
332
|
-
stacking: "normal",
|
|
333
|
-
pointPadding: 0.25,
|
|
334
|
-
groupPadding: 0.25,
|
|
335
|
-
borderRadius: 4
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
xAxis: {
|
|
339
|
-
crosshair: false
|
|
340
|
-
},
|
|
341
|
-
yAxis: {
|
|
342
|
-
plotLines: [
|
|
343
|
-
{
|
|
344
|
-
// For stacked column charts with visible borders (e.g., white for contrast),
|
|
345
|
-
// we raise the zIndex of the y=0 plotLine to ensure it remains visible
|
|
346
|
-
// and isn't visually covered by overlapping column borders.
|
|
347
|
-
zIndex: 5
|
|
348
|
-
}
|
|
349
|
-
]
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
var VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT = 10;
|
|
353
|
-
var DONUT_CHART_HALO_SIZE = 10;
|
|
354
|
-
var DONUT_CHART_HEIGHT = 250 + DONUT_CHART_HALO_SIZE * 2;
|
|
355
|
-
var DONUT_CHART_WIDTH = DONUT_CHART_HEIGHT;
|
|
356
|
-
var donutChartOptions = _.merge({}, baseChartOptions, {
|
|
357
|
-
chart: {
|
|
358
|
-
height: DONUT_CHART_HEIGHT,
|
|
359
|
-
spacing: [0, 0, 0, 0]
|
|
360
|
-
},
|
|
361
|
-
plotOptions: {
|
|
362
|
-
pie: {
|
|
363
|
-
animation: false,
|
|
364
|
-
borderRadius: 0,
|
|
365
|
-
// must be handled here instead of css because of path rendering
|
|
366
|
-
dataLabels: {
|
|
367
|
-
enabled: false
|
|
368
|
-
},
|
|
369
|
-
innerSize: "50%"
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
// src/hooks/useTimeSeriesChartOptions.ts
|
|
375
231
|
import { merge } from "lodash";
|
|
376
232
|
var useTimeSeriesChartOptions = ({
|
|
377
233
|
xAnnotations,
|