@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/index.js
CHANGED
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
var _chunkCYQXUAJCjs = require('./chunk-CYQXUAJC.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
13
26
|
|
|
14
27
|
|
|
15
28
|
|
|
@@ -50,7 +63,7 @@ var getAreaChartLegendLabels = ({
|
|
|
50
63
|
}) => {
|
|
51
64
|
return data.map((series, index) => ({
|
|
52
65
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
53
|
-
color: _optionalChain([series, 'access',
|
|
66
|
+
color: _optionalChain([series, 'access', _ => _.styles, 'optionalAccess', _2 => _2.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
54
67
|
}));
|
|
55
68
|
};
|
|
56
69
|
var AreaChartLegend = _react.memo.call(void 0,
|
|
@@ -177,13 +190,13 @@ var ChartXAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
177
190
|
(annotation) => annotation.setAttribute("data-annotation-marker", "false")
|
|
178
191
|
);
|
|
179
192
|
annotationContext.labels.forEach((label) => {
|
|
180
|
-
const labelElement = _optionalChain([label, 'access',
|
|
193
|
+
const labelElement = _optionalChain([label, 'access', _3 => _3.graphic, 'optionalAccess', _4 => _4.div]);
|
|
181
194
|
if (labelElement) {
|
|
182
195
|
labelElement.querySelectorAll("div[data-annotation-marker]").forEach((component) => component.remove());
|
|
183
196
|
const annotationDiv = document.createElement("div");
|
|
184
197
|
annotationDiv.setAttribute("data-annotation-marker", "true");
|
|
185
198
|
labelElement.appendChild(annotationDiv);
|
|
186
|
-
const xValue = _optionalChain([label, 'access',
|
|
199
|
+
const xValue = _optionalChain([label, 'access', _5 => _5.options, 'optionalAccess', _6 => _6.point, 'optionalAccess', _7 => _7.x]);
|
|
187
200
|
newContainers[xValue] = annotationDiv;
|
|
188
201
|
}
|
|
189
202
|
});
|
|
@@ -206,7 +219,7 @@ var ChartXAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
206
219
|
}, [annotationContext.labels, xAnnotations, chartContainer]);
|
|
207
220
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: Object.entries(annotationContainers.current).map(
|
|
208
221
|
([xValue, container]) => {
|
|
209
|
-
const annotationComponent = _optionalChain([xAnnotations, 'optionalAccess',
|
|
222
|
+
const annotationComponent = _optionalChain([xAnnotations, 'optionalAccess', _8 => _8[Number(xValue)], 'optionalAccess', _9 => _9.marker]);
|
|
210
223
|
return annotationComponent ? _reactdom.createPortal.call(void 0, annotationComponent(), container) : null;
|
|
211
224
|
}
|
|
212
225
|
) });
|
|
@@ -215,164 +228,7 @@ var ChartXAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
215
228
|
|
|
216
229
|
// src/hooks/useTimeSeriesChartOptions.ts
|
|
217
230
|
|
|
218
|
-
|
|
219
|
-
// src/constants/chartOptions.ts
|
|
220
|
-
var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_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 = _lodash2.default.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 = _lodash2.default.merge({}, timeSeriesChartOptions, {
|
|
319
|
-
// plotOptions.spline.events.click is set at the component level because of the optional onClick prop
|
|
320
|
-
});
|
|
321
|
-
var areaChartOptions = _lodash2.default.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 = _lodash2.default.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 = _lodash2.default.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
|
+
var _lodash = require('lodash');
|
|
376
232
|
var useTimeSeriesChartOptions = ({
|
|
377
233
|
xAnnotations,
|
|
378
234
|
data,
|
|
@@ -396,7 +252,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
396
252
|
const handleFocus = (point) => point.series.chart.tooltip.refresh(point);
|
|
397
253
|
const handleBlur = (point) => point.series.chart.tooltip.hide(0);
|
|
398
254
|
series.flatMap((item) => item.data).forEach((point) => {
|
|
399
|
-
const pointElement = _optionalChain([point, 'optionalAccess',
|
|
255
|
+
const pointElement = _optionalChain([point, 'optionalAccess', _10 => _10.graphic, 'optionalAccess', _11 => _11.element]);
|
|
400
256
|
if (pointElement) {
|
|
401
257
|
pointElement.setAttribute("aria-describedby", tooltipId);
|
|
402
258
|
pointElement.addEventListener("focus", () => handleFocus(point));
|
|
@@ -423,20 +279,20 @@ var useTimeSeriesChartOptions = ({
|
|
|
423
279
|
const getBaseChartOptions = (type) => {
|
|
424
280
|
switch (type) {
|
|
425
281
|
case "areaspline":
|
|
426
|
-
return areaChartOptions;
|
|
282
|
+
return _chunkCYQXUAJCjs.areaChartOptions;
|
|
427
283
|
case "spline":
|
|
428
|
-
return lineChartOptions;
|
|
284
|
+
return _chunkCYQXUAJCjs.lineChartOptions;
|
|
429
285
|
case "column":
|
|
430
|
-
return columnChartOptions;
|
|
286
|
+
return _chunkCYQXUAJCjs.columnChartOptions;
|
|
431
287
|
default:
|
|
432
|
-
return lineChartOptions;
|
|
288
|
+
return _chunkCYQXUAJCjs.lineChartOptions;
|
|
433
289
|
}
|
|
434
290
|
};
|
|
435
291
|
const baseChartOptions2 = getBaseChartOptions(seriesType);
|
|
436
292
|
const hasCategoricalData = data.some(
|
|
437
293
|
(series) => series.points.some((point) => typeof point.x === "string")
|
|
438
294
|
);
|
|
439
|
-
const categories = hasCategoricalData ? _optionalChain([data, 'access',
|
|
295
|
+
const categories = hasCategoricalData ? _optionalChain([data, 'access', _12 => _12[0], 'optionalAccess', _13 => _13.points, 'access', _14 => _14.map, 'call', _15 => _15((point) => point.x)]) || [] : [];
|
|
440
296
|
const hasSparseTimelineData = !hasCategoricalData && seriesType === "column";
|
|
441
297
|
const options = _react.useMemo.call(void 0, () => {
|
|
442
298
|
return _lodash.merge.call(void 0, {}, baseChartOptions2, {
|
|
@@ -456,7 +312,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
456
312
|
marginTop: chartMarginTop,
|
|
457
313
|
events: {
|
|
458
314
|
click: onClick ? function() {
|
|
459
|
-
return onClick({ x: _optionalChain([this, 'optionalAccess',
|
|
315
|
+
return onClick({ x: _optionalChain([this, 'optionalAccess', _16 => _16.hoverPoint, 'optionalAccess', _17 => _17.x]) });
|
|
460
316
|
} : void 0,
|
|
461
317
|
load: function() {
|
|
462
318
|
const tooltipId = _chunkWEKDYQ4Tjs.generateChartTooltipPortalId.call(void 0, this.index);
|
|
@@ -550,7 +406,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
550
406
|
Number
|
|
551
407
|
);
|
|
552
408
|
const value = this.value;
|
|
553
|
-
const unitName = _optionalChain([this, 'access',
|
|
409
|
+
const unitName = _optionalChain([this, 'access', _18 => _18.tickPositionInfo, 'optionalAccess', _19 => _19.unitName]);
|
|
554
410
|
if (typeof xAxisLabelFormatter2 === "function") {
|
|
555
411
|
return xAxisLabelFormatter2({
|
|
556
412
|
textLocale,
|
|
@@ -665,7 +521,7 @@ var AreaChartWithData = _react.memo.call(void 0, function AreaChartWithData2({
|
|
|
665
521
|
xAnnotations
|
|
666
522
|
});
|
|
667
523
|
const colors = data.map(
|
|
668
|
-
(series, index) => _nullishCoalesce(_optionalChain([series, 'access',
|
|
524
|
+
(series, index) => _nullishCoalesce(_optionalChain([series, 'access', _20 => _20.styles, 'optionalAccess', _21 => _21.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]))
|
|
669
525
|
);
|
|
670
526
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
671
527
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
@@ -684,11 +540,11 @@ var AreaChartWithData = _react.memo.call(void 0, function AreaChartWithData2({
|
|
|
684
540
|
callback
|
|
685
541
|
}
|
|
686
542
|
),
|
|
687
|
-
chart && _optionalChain([chart, 'access',
|
|
543
|
+
chart && _optionalChain([chart, 'access', _22 => _22.annotations, 'optionalAccess', _23 => _23.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
688
544
|
ChartXAnnotationMarkerPortal,
|
|
689
545
|
{
|
|
690
546
|
xAnnotations,
|
|
691
|
-
annotationContext: _optionalChain([chart, 'access',
|
|
547
|
+
annotationContext: _optionalChain([chart, 'access', _24 => _24.annotations, 'optionalAccess', _25 => _25[0]]),
|
|
692
548
|
chartContainer: chart.container
|
|
693
549
|
}
|
|
694
550
|
) : null,
|
|
@@ -703,7 +559,7 @@ var AreaChartWithData = _react.memo.call(void 0, function AreaChartWithData2({
|
|
|
703
559
|
});
|
|
704
560
|
const x = context.x;
|
|
705
561
|
const total = context.total;
|
|
706
|
-
const xAnnotationDetails = _optionalChain([xAnnotations, 'optionalAccess',
|
|
562
|
+
const xAnnotationDetails = _optionalChain([xAnnotations, 'optionalAccess', _26 => _26[x], 'optionalAccess', _27 => _27.details]);
|
|
707
563
|
return tooltip ? tooltip({ data: tooltipData, total, x }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
708
564
|
AreaChartTooltip,
|
|
709
565
|
{
|
|
@@ -790,7 +646,7 @@ var getDonutChartLegendLabels = ({
|
|
|
790
646
|
}) => {
|
|
791
647
|
return data.map((slice, index) => ({
|
|
792
648
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: slice.icon, children: slice.name }),
|
|
793
|
-
color: _optionalChain([slice, 'access',
|
|
649
|
+
color: _optionalChain([slice, 'access', _28 => _28.styles, 'optionalAccess', _29 => _29.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
794
650
|
}));
|
|
795
651
|
};
|
|
796
652
|
var DonutChartLegend = _react.memo.call(void 0,
|
|
@@ -872,8 +728,8 @@ var transformDonutChartTooltipData = ({
|
|
|
872
728
|
}) => {
|
|
873
729
|
const colorIndex = context.colorIndex;
|
|
874
730
|
return {
|
|
875
|
-
color: _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'access',
|
|
876
|
-
..._optionalChain([data, 'access',
|
|
731
|
+
color: _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'access', _30 => _30[colorIndex], 'optionalAccess', _31 => _31.styles, 'optionalAccess', _32 => _32.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[colorIndex])), () => ( "")),
|
|
732
|
+
..._optionalChain([data, 'access', _33 => _33[colorIndex], 'optionalAccess', _34 => _34.icon]) ? { icon: _optionalChain([data, 'access', _35 => _35[colorIndex], 'optionalAccess', _36 => _36.icon]) } : {},
|
|
877
733
|
name: context.key,
|
|
878
734
|
percent: context.percentage,
|
|
879
735
|
value: context.y
|
|
@@ -905,7 +761,7 @@ var DonutChartWithData = _react.memo.call(void 0,
|
|
|
905
761
|
onClick,
|
|
906
762
|
tooltipClickLabel
|
|
907
763
|
}) {
|
|
908
|
-
const [options, setOptions] = _react.useState.call(void 0, donutChartOptions);
|
|
764
|
+
const [options, setOptions] = _react.useState.call(void 0, _chunkCYQXUAJCjs.donutChartOptions);
|
|
909
765
|
const [chart, setChart] = _react.useState.call(void 0, null);
|
|
910
766
|
const callback = _react.useCallback.call(void 0, (chartInstance) => {
|
|
911
767
|
setChart(chartInstance);
|
|
@@ -922,15 +778,15 @@ var DonutChartWithData = _react.memo.call(void 0,
|
|
|
922
778
|
chart: {
|
|
923
779
|
events: {
|
|
924
780
|
render: function() {
|
|
925
|
-
const allSlices = _nullishCoalesce(_optionalChain([this, 'access',
|
|
781
|
+
const allSlices = _nullishCoalesce(_optionalChain([this, 'access', _37 => _37.series, 'access', _38 => _38[0], 'optionalAccess', _39 => _39.data]), () => ( []));
|
|
926
782
|
const tooltipId = _chunkWEKDYQ4Tjs.generateChartTooltipPortalId.call(void 0, this.index);
|
|
927
783
|
allSlices.forEach((slice) => {
|
|
928
|
-
const sliceElement = _optionalChain([slice, 'optionalAccess',
|
|
929
|
-
_optionalChain([sliceElement, 'optionalAccess',
|
|
930
|
-
_optionalChain([sliceElement, 'optionalAccess',
|
|
784
|
+
const sliceElement = _optionalChain([slice, 'optionalAccess', _40 => _40.graphic, 'optionalAccess', _41 => _41.element]);
|
|
785
|
+
_optionalChain([sliceElement, 'optionalAccess', _42 => _42.setAttribute, 'call', _43 => _43("aria-describedby", tooltipId)]);
|
|
786
|
+
_optionalChain([sliceElement, 'optionalAccess', _44 => _44.addEventListener, 'call', _45 => _45("focus", () => {
|
|
931
787
|
slice.series.chart.tooltip.refresh(slice);
|
|
932
788
|
})]);
|
|
933
|
-
_optionalChain([sliceElement, 'optionalAccess',
|
|
789
|
+
_optionalChain([sliceElement, 'optionalAccess', _46 => _46.addEventListener, 'call', _47 => _47("blur", () => {
|
|
934
790
|
slice.series.chart.tooltip.hide(0);
|
|
935
791
|
})]);
|
|
936
792
|
});
|
|
@@ -960,7 +816,7 @@ var DonutChartWithData = _react.memo.call(void 0,
|
|
|
960
816
|
});
|
|
961
817
|
}, [data]);
|
|
962
818
|
const colors = data.map(
|
|
963
|
-
(series, index) => _nullishCoalesce(_nullishCoalesce(_optionalChain([series, 'access',
|
|
819
|
+
(series, index) => _nullishCoalesce(_nullishCoalesce(_optionalChain([series, 'access', _48 => _48.styles, 'optionalAccess', _49 => _49.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index])), () => ( ""))
|
|
964
820
|
);
|
|
965
821
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
966
822
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
@@ -1036,7 +892,7 @@ var DonutChartLegendTable = _react.memo.call(void 0,
|
|
|
1036
892
|
);
|
|
1037
893
|
const rows = data.map((dataPoint, index) => {
|
|
1038
894
|
const { name, icon, styles, value } = dataPoint;
|
|
1039
|
-
const color = _optionalChain([styles, 'optionalAccess',
|
|
895
|
+
const color = _optionalChain([styles, 'optionalAccess', _50 => _50.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index];
|
|
1040
896
|
return {
|
|
1041
897
|
cells: [
|
|
1042
898
|
{
|
|
@@ -1119,7 +975,7 @@ var getLineChartLegendLabels = ({
|
|
|
1119
975
|
}) => {
|
|
1120
976
|
return data.map((series, index) => ({
|
|
1121
977
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
1122
|
-
color: _optionalChain([series, 'access',
|
|
978
|
+
color: _optionalChain([series, 'access', _51 => _51.styles, 'optionalAccess', _52 => _52.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
1123
979
|
}));
|
|
1124
980
|
};
|
|
1125
981
|
var LineChartLegend = _react.memo.call(void 0,
|
|
@@ -1234,9 +1090,9 @@ var LineChartWithData = _react.memo.call(void 0, function LineChartWithData2({
|
|
|
1234
1090
|
const { colors, patterns } = data.reduce(
|
|
1235
1091
|
(acc, item, index) => {
|
|
1236
1092
|
acc.colors.push(
|
|
1237
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'access',
|
|
1093
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'access', _53 => _53.styles, 'optionalAccess', _54 => _54.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index])), () => ( ""))
|
|
1238
1094
|
);
|
|
1239
|
-
acc.patterns.push(_nullishCoalesce(_optionalChain([item, 'access',
|
|
1095
|
+
acc.patterns.push(_nullishCoalesce(_optionalChain([item, 'access', _55 => _55.styles, 'optionalAccess', _56 => _56.pattern]), () => ( "solid")));
|
|
1240
1096
|
return acc;
|
|
1241
1097
|
},
|
|
1242
1098
|
{
|
|
@@ -1262,11 +1118,11 @@ var LineChartWithData = _react.memo.call(void 0, function LineChartWithData2({
|
|
|
1262
1118
|
callback
|
|
1263
1119
|
}
|
|
1264
1120
|
),
|
|
1265
|
-
chart && _optionalChain([chart, 'access',
|
|
1121
|
+
chart && _optionalChain([chart, 'access', _57 => _57.annotations, 'optionalAccess', _58 => _58.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1266
1122
|
ChartXAnnotationMarkerPortal,
|
|
1267
1123
|
{
|
|
1268
1124
|
xAnnotations,
|
|
1269
|
-
annotationContext: _optionalChain([chart, 'access',
|
|
1125
|
+
annotationContext: _optionalChain([chart, 'access', _59 => _59.annotations, 'optionalAccess', _60 => _60[0]]),
|
|
1270
1126
|
chartContainer: chart.container
|
|
1271
1127
|
}
|
|
1272
1128
|
) : null,
|
|
@@ -1280,7 +1136,7 @@ var LineChartWithData = _react.memo.call(void 0, function LineChartWithData2({
|
|
|
1280
1136
|
data
|
|
1281
1137
|
});
|
|
1282
1138
|
const x = context.x;
|
|
1283
|
-
const xAnnotationDetails = _optionalChain([xAnnotations, 'optionalAccess',
|
|
1139
|
+
const xAnnotationDetails = _optionalChain([xAnnotations, 'optionalAccess', _61 => _61[x], 'optionalAccess', _62 => _62.details]);
|
|
1284
1140
|
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1285
1141
|
LineChartTooltip,
|
|
1286
1142
|
{
|
|
@@ -1325,7 +1181,7 @@ var getVerticalBarChartLegendLabels = ({
|
|
|
1325
1181
|
}) => {
|
|
1326
1182
|
return data.map((series, index) => ({
|
|
1327
1183
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
1328
|
-
color: _optionalChain([series, 'access',
|
|
1184
|
+
color: _optionalChain([series, 'access', _63 => _63.styles, 'optionalAccess', _64 => _64.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
1329
1185
|
}));
|
|
1330
1186
|
};
|
|
1331
1187
|
var VerticalBarChartLegend = _react.memo.call(void 0,
|
|
@@ -1423,7 +1279,7 @@ var StyledBox4 = _styledcomponents2.default.call(void 0, _seedsreactbox.Box)`
|
|
|
1423
1279
|
var VerticalBarChart = _react.memo.call(void 0,
|
|
1424
1280
|
function VerticalBarChart2(props) {
|
|
1425
1281
|
const { data, showSeriesLimitWarning = true } = props;
|
|
1426
|
-
const seriesLimit = _nullishCoalesce(props.seriesLimit, () => ( VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT));
|
|
1282
|
+
const seriesLimit = _nullishCoalesce(props.seriesLimit, () => ( _chunkCYQXUAJCjs.VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT));
|
|
1427
1283
|
const isSeriesLimitOverridden = props.seriesLimit !== void 0;
|
|
1428
1284
|
if (data.length === 0) {
|
|
1429
1285
|
return null;
|
|
@@ -1514,9 +1370,9 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1514
1370
|
const { colors } = data.reduce(
|
|
1515
1371
|
(acc, item, index) => {
|
|
1516
1372
|
acc.colors.push(
|
|
1517
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'access',
|
|
1373
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'access', _65 => _65.styles, 'optionalAccess', _66 => _66.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index])), () => ( ""))
|
|
1518
1374
|
);
|
|
1519
|
-
acc.patterns.push(_nullishCoalesce(_optionalChain([item, 'access',
|
|
1375
|
+
acc.patterns.push(_nullishCoalesce(_optionalChain([item, 'access', _67 => _67.styles, 'optionalAccess', _68 => _68.pattern]), () => ( "solid")));
|
|
1520
1376
|
return acc;
|
|
1521
1377
|
},
|
|
1522
1378
|
{
|
|
@@ -1541,11 +1397,11 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1541
1397
|
callback
|
|
1542
1398
|
}
|
|
1543
1399
|
),
|
|
1544
|
-
chart && _optionalChain([chart, 'access',
|
|
1400
|
+
chart && _optionalChain([chart, 'access', _69 => _69.annotations, 'optionalAccess', _70 => _70.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1545
1401
|
ChartXAnnotationMarkerPortal,
|
|
1546
1402
|
{
|
|
1547
1403
|
xAnnotations,
|
|
1548
|
-
annotationContext: _optionalChain([chart, 'access',
|
|
1404
|
+
annotationContext: _optionalChain([chart, 'access', _71 => _71.annotations, 'optionalAccess', _72 => _72[0]]),
|
|
1549
1405
|
chartContainer: chart.container
|
|
1550
1406
|
}
|
|
1551
1407
|
) : null,
|
|
@@ -1559,7 +1415,7 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1559
1415
|
data
|
|
1560
1416
|
});
|
|
1561
1417
|
const x = context.x;
|
|
1562
|
-
const xAnnotationDetails = typeof x === "number" ? _optionalChain([xAnnotations, 'optionalAccess',
|
|
1418
|
+
const xAnnotationDetails = typeof x === "number" ? _optionalChain([xAnnotations, 'optionalAccess', _73 => _73[x], 'optionalAccess', _74 => _74.details]) : void 0;
|
|
1563
1419
|
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1564
1420
|
VerticalBarChartTooltip,
|
|
1565
1421
|
{
|
|
@@ -1635,5 +1491,5 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1635
1491
|
|
|
1636
1492
|
|
|
1637
1493
|
|
|
1638
|
-
exports.AreaChart = AreaChart; exports.ChartLegend = _chunkWEKDYQ4Tjs.ChartLegend; exports.ChartLegendLabel = _chunkWEKDYQ4Tjs.ChartLegendLabel; exports.ChartTable = _chunkWEKDYQ4Tjs.ChartTable; exports.ChartTooltip = _chunkWEKDYQ4Tjs.ChartTooltip; exports.ChartTooltipFooter = _chunkWEKDYQ4Tjs.ChartTooltipFooter; exports.ChartTooltipHeader = _chunkWEKDYQ4Tjs.ChartTooltipHeader; exports.ChartTooltipPortal = _chunkWEKDYQ4Tjs.ChartTooltipPortal; exports.ChartTooltipTable = _chunkWEKDYQ4Tjs.ChartTooltipTable; exports.ChartTooltipTitle = _chunkWEKDYQ4Tjs.ChartTooltipTitle; exports.ChartXAnnotationDetails = ChartXAnnotationDetails; exports.ChartXAnnotationMarker = ChartXAnnotationMarker; exports.ColorBox = _chunkWEKDYQ4Tjs.ColorBox; exports.DONUT_CHART_HALO_SIZE = DONUT_CHART_HALO_SIZE; exports.DONUT_CHART_HEIGHT = DONUT_CHART_HEIGHT; exports.DONUT_CHART_WIDTH = DONUT_CHART_WIDTH; exports.DatavizColorBox = _chunkWEKDYQ4Tjs.DatavizColorBox; exports.DonutChart = DonutChart; exports.DonutChartLegendTable = DonutChartLegendTable; exports.GlobalChartStyleOverrides = _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides; exports.LineChart = LineChart; exports.NetworkColorBox = _chunkWEKDYQ4Tjs.NetworkColorBox; exports.TIME_SERIES_CHART_HEIGHT = TIME_SERIES_CHART_HEIGHT; exports.VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT = VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT; exports.VerticalBarChart = VerticalBarChart; exports.areaChartOptions = areaChartOptions; exports.areaChartStyles = _chunkWEKDYQ4Tjs.areaChartStyles; exports.baseChartOptions = baseChartOptions; exports.baseChartStyles = _chunkWEKDYQ4Tjs.baseChartStyles; exports.columnChartOptions = columnChartOptions; exports.donutChartOptions = donutChartOptions; exports.donutChartStyles = _chunkWEKDYQ4Tjs.donutChartStyles; exports.generateChartTooltipPortalId = _chunkWEKDYQ4Tjs.generateChartTooltipPortalId; exports.getDatavizColor = _chunkWEKDYQ4Tjs.getDatavizColor; exports.getDatavizColorWithAlpha = _chunkWEKDYQ4Tjs.getDatavizColorWithAlpha; exports.getDatavizOpacity = _chunkWEKDYQ4Tjs.getDatavizOpacity; exports.getStorybookCategoricalData = _chunkWEKDYQ4Tjs.getStorybookCategoricalData; exports.getStorybookSparseTimelineData = _chunkWEKDYQ4Tjs.getStorybookSparseTimelineData; exports.isCategoricalHourData = _chunkWEKDYQ4Tjs.isCategoricalHourData; exports.isHourlyTimeData = _chunkWEKDYQ4Tjs.isHourlyTimeData; exports.lineChartOptions = lineChartOptions; exports.lineChartStyles = _chunkWEKDYQ4Tjs.lineChartStyles; exports.timeSeriesChartOptions = timeSeriesChartOptions; exports.timeSeriesChartStyles = _chunkWEKDYQ4Tjs.timeSeriesChartStyles; exports.transformDataToSeries = _chunkWEKDYQ4Tjs.transformDataToSeries; exports.transformTimeSeriesTooltipData = _chunkWEKDYQ4Tjs.transformTimeSeriesTooltipData; exports.xAxisLabelFormatter = _chunkWEKDYQ4Tjs.xAxisLabelFormatter; exports.yAxisLabelFormatter = _chunkWEKDYQ4Tjs.yAxisLabelFormatter;
|
|
1494
|
+
exports.AreaChart = AreaChart; exports.ChartLegend = _chunkWEKDYQ4Tjs.ChartLegend; exports.ChartLegendLabel = _chunkWEKDYQ4Tjs.ChartLegendLabel; exports.ChartTable = _chunkWEKDYQ4Tjs.ChartTable; exports.ChartTooltip = _chunkWEKDYQ4Tjs.ChartTooltip; exports.ChartTooltipFooter = _chunkWEKDYQ4Tjs.ChartTooltipFooter; exports.ChartTooltipHeader = _chunkWEKDYQ4Tjs.ChartTooltipHeader; exports.ChartTooltipPortal = _chunkWEKDYQ4Tjs.ChartTooltipPortal; exports.ChartTooltipTable = _chunkWEKDYQ4Tjs.ChartTooltipTable; exports.ChartTooltipTitle = _chunkWEKDYQ4Tjs.ChartTooltipTitle; exports.ChartXAnnotationDetails = ChartXAnnotationDetails; exports.ChartXAnnotationMarker = ChartXAnnotationMarker; exports.ColorBox = _chunkWEKDYQ4Tjs.ColorBox; exports.DONUT_CHART_HALO_SIZE = _chunkCYQXUAJCjs.DONUT_CHART_HALO_SIZE; exports.DONUT_CHART_HEIGHT = _chunkCYQXUAJCjs.DONUT_CHART_HEIGHT; exports.DONUT_CHART_WIDTH = _chunkCYQXUAJCjs.DONUT_CHART_WIDTH; exports.DatavizColorBox = _chunkWEKDYQ4Tjs.DatavizColorBox; exports.DonutChart = DonutChart; exports.DonutChartLegendTable = DonutChartLegendTable; exports.GlobalChartStyleOverrides = _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides; exports.LineChart = LineChart; exports.NetworkColorBox = _chunkWEKDYQ4Tjs.NetworkColorBox; exports.TIME_SERIES_CHART_HEIGHT = _chunkCYQXUAJCjs.TIME_SERIES_CHART_HEIGHT; exports.VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT = _chunkCYQXUAJCjs.VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT; exports.VerticalBarChart = VerticalBarChart; exports.areaChartOptions = _chunkCYQXUAJCjs.areaChartOptions; exports.areaChartStyles = _chunkWEKDYQ4Tjs.areaChartStyles; exports.baseChartOptions = _chunkCYQXUAJCjs.baseChartOptions; exports.baseChartStyles = _chunkWEKDYQ4Tjs.baseChartStyles; exports.columnChartOptions = _chunkCYQXUAJCjs.columnChartOptions; exports.donutChartOptions = _chunkCYQXUAJCjs.donutChartOptions; exports.donutChartStyles = _chunkWEKDYQ4Tjs.donutChartStyles; exports.generateChartTooltipPortalId = _chunkWEKDYQ4Tjs.generateChartTooltipPortalId; exports.getDatavizColor = _chunkWEKDYQ4Tjs.getDatavizColor; exports.getDatavizColorWithAlpha = _chunkWEKDYQ4Tjs.getDatavizColorWithAlpha; exports.getDatavizOpacity = _chunkWEKDYQ4Tjs.getDatavizOpacity; exports.getStorybookCategoricalData = _chunkWEKDYQ4Tjs.getStorybookCategoricalData; exports.getStorybookSparseTimelineData = _chunkWEKDYQ4Tjs.getStorybookSparseTimelineData; exports.isCategoricalHourData = _chunkWEKDYQ4Tjs.isCategoricalHourData; exports.isHourlyTimeData = _chunkWEKDYQ4Tjs.isHourlyTimeData; exports.lineChartOptions = _chunkCYQXUAJCjs.lineChartOptions; exports.lineChartStyles = _chunkWEKDYQ4Tjs.lineChartStyles; exports.timeSeriesChartOptions = _chunkCYQXUAJCjs.timeSeriesChartOptions; exports.timeSeriesChartStyles = _chunkWEKDYQ4Tjs.timeSeriesChartStyles; exports.transformDataToSeries = _chunkWEKDYQ4Tjs.transformDataToSeries; exports.transformTimeSeriesTooltipData = _chunkWEKDYQ4Tjs.transformTimeSeriesTooltipData; exports.xAxisLabelFormatter = _chunkWEKDYQ4Tjs.xAxisLabelFormatter; exports.yAxisLabelFormatter = _chunkWEKDYQ4Tjs.yAxisLabelFormatter;
|
|
1639
1495
|
//# sourceMappingURL=index.js.map
|