@sproutsocial/seeds-react-data-viz 0.16.0 → 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 +4 -2
- package/dist/bar/index.d.ts +4 -2
- package/dist/bar/index.js +14 -10
- package/dist/bar/index.js.map +1 -1
- package/dist/{axis-PJwu5Xmo.d.ts → chartBase-C-l7yYGx.d.ts} +6 -60
- package/dist/{axis-DXzufRRj.d.mts → chartBase-Cn_5CUJi.d.mts} +6 -60
- package/dist/{chunk-XVV7PYQE.js → chunk-2K7PFHIM.js} +101 -254
- 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/{chunk-EEVKTTT3.js → chunk-WEKDYQ4T.js} +1 -1
- package/dist/chunk-WEKDYQ4T.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 +11 -7
- 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-ZXXFRUVF.js → chunk-LPQXJJNT.js} +94 -247
- 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/{chunk-LC3HGWDD.js → chunk-Z4LOM4OZ.js} +1 -1
- package/dist/esm/chunk-Z4LOM4OZ.js.map +1 -0
- package/dist/esm/donut/index.js +125 -0
- package/dist/esm/donut/index.js.map +1 -0
- package/dist/esm/export/index.js.map +1 -1
- package/dist/esm/index.js +20 -164
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/line-area/index.js +12 -7
- 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/export/index.js.map +1 -1
- package/dist/index.d.mts +26 -23
- package/dist/index.d.ts +26 -23
- package/dist/index.js +113 -257
- package/dist/index.js.map +1 -1
- package/dist/line-area/index.d.mts +7 -4
- package/dist/line-area/index.d.ts +7 -4
- package/dist/line-area/index.js +15 -10
- 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/dist/{types-B7ILUQ6_.d.mts → types-DxrhdAdn.d.mts} +3 -3
- package/dist/{types-B7ILUQ6_.d.ts → types-DxrhdAdn.d.ts} +3 -3
- package/package.json +15 -3
- package/dist/chunk-EEVKTTT3.js.map +0 -1
- package/dist/chunk-XVV7PYQE.js.map +0 -1
- package/dist/esm/chunk-LC3HGWDD.js.map +0 -1
- package/dist/esm/chunk-ZXXFRUVF.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
var _chunkCYQXUAJCjs = require('./chunk-CYQXUAJC.js');
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
|
|
@@ -30,7 +31,19 @@
|
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
var _chunkWEKDYQ4Tjs = require('./chunk-WEKDYQ4T.js');
|
|
34
47
|
|
|
35
48
|
// src/components/AreaChart/AreaChart.tsx
|
|
36
49
|
var _react = require('react');
|
|
@@ -49,13 +62,13 @@ var getAreaChartLegendLabels = ({
|
|
|
49
62
|
data
|
|
50
63
|
}) => {
|
|
51
64
|
return data.map((series, index) => ({
|
|
52
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
53
|
-
color: _optionalChain([series, 'access',
|
|
65
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
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,
|
|
57
70
|
function AreaChartLegend2({ data }) {
|
|
58
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
71
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegend, { legendLabels: getAreaChartLegendLabels({ data }) });
|
|
59
72
|
}
|
|
60
73
|
);
|
|
61
74
|
|
|
@@ -88,7 +101,7 @@ var AreaChartTooltip = _react.memo.call(void 0,
|
|
|
88
101
|
return {
|
|
89
102
|
cells: [
|
|
90
103
|
{
|
|
91
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
104
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabel, { color, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { "aria-label": `${name}: `, children: name }) }) })
|
|
92
105
|
},
|
|
93
106
|
{
|
|
94
107
|
content: value === null && invalidNumberLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { children: invalidNumberLabel }) : numberFormat === "duration" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreactduration.Duration, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -136,16 +149,16 @@ var AreaChartTooltip = _react.memo.call(void 0,
|
|
|
136
149
|
isAppendedRow: true
|
|
137
150
|
}
|
|
138
151
|
] : [];
|
|
139
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
152
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltip, { children: [
|
|
140
153
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
154
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
142
155
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
143
|
-
|
|
156
|
+
_chunkWEKDYQ4Tjs.ChartTooltipTable,
|
|
144
157
|
{
|
|
145
158
|
rows: [...rows, ...appendedRows]
|
|
146
159
|
}
|
|
147
160
|
),
|
|
148
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
161
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
149
162
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
150
163
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
151
164
|
] }) : tooltipClickLabel }) : null
|
|
@@ -165,7 +178,7 @@ var ChartXAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
165
178
|
chartContainer
|
|
166
179
|
}) {
|
|
167
180
|
const annotationContainers = _react.useRef.call(void 0, {});
|
|
168
|
-
const [
|
|
181
|
+
const [, setRenderCount] = _react.useState.call(void 0, 0);
|
|
169
182
|
const forceRender = () => setRenderCount((prev) => prev + 1);
|
|
170
183
|
_react.useEffect.call(void 0, () => {
|
|
171
184
|
if (annotationContext.labels) {
|
|
@@ -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,10 +312,10 @@ 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
|
-
const tooltipId =
|
|
318
|
+
const tooltipId = _chunkWEKDYQ4Tjs.generateChartTooltipPortalId.call(void 0, this.index);
|
|
463
319
|
attachTooltipEventListeners(this.series, tooltipId);
|
|
464
320
|
}
|
|
465
321
|
}
|
|
@@ -538,7 +394,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
538
394
|
}
|
|
539
395
|
}
|
|
540
396
|
},
|
|
541
|
-
series:
|
|
397
|
+
series: _chunkWEKDYQ4Tjs.transformDataToSeries.call(void 0, { data }, seriesType),
|
|
542
398
|
time: { timezone },
|
|
543
399
|
tooltip: {
|
|
544
400
|
enabled: !disableTooltips
|
|
@@ -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,
|
|
@@ -586,7 +442,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
586
442
|
return yAxisLabelFormatter2 ? yAxisLabelFormatter2({
|
|
587
443
|
y: this.value,
|
|
588
444
|
yValues: this.axis.tickPositions
|
|
589
|
-
}) :
|
|
445
|
+
}) : _chunkWEKDYQ4Tjs.yAxisLabelFormatter.call(void 0, {
|
|
590
446
|
currency,
|
|
591
447
|
numberFormat,
|
|
592
448
|
numberLocale,
|
|
@@ -617,7 +473,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
617
473
|
]);
|
|
618
474
|
return { options, chart, callback };
|
|
619
475
|
};
|
|
620
|
-
var xAxisLabelFormatterDefault =
|
|
476
|
+
var xAxisLabelFormatterDefault = _chunkWEKDYQ4Tjs.xAxisLabelFormatter;
|
|
621
477
|
|
|
622
478
|
// src/components/AreaChart/AreaChart.tsx
|
|
623
479
|
|
|
@@ -625,7 +481,7 @@ var xAxisLabelFormatterDefault = _chunkEEVKTTT3js.xAxisLabelFormatter;
|
|
|
625
481
|
_accessibility2.default.call(void 0, _highcharts2.default);
|
|
626
482
|
_annotations2.default.call(void 0, _highcharts2.default);
|
|
627
483
|
var StyledBox = _styledcomponents2.default.call(void 0, _seedsreactbox.Box)`
|
|
628
|
-
${
|
|
484
|
+
${_chunkWEKDYQ4Tjs.areaChartStyles}
|
|
629
485
|
`;
|
|
630
486
|
var AreaChart = _react.memo.call(void 0, function AreaChart2(props) {
|
|
631
487
|
const { data } = props;
|
|
@@ -665,10 +521,10 @@ 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
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
527
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
672
528
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
673
529
|
StyledBox,
|
|
674
530
|
{
|
|
@@ -684,26 +540,26 @@ 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,
|
|
695
551
|
chart && !disableTooltips ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
696
|
-
|
|
552
|
+
_chunkWEKDYQ4Tjs.ChartTooltipPortal,
|
|
697
553
|
{
|
|
698
554
|
chart,
|
|
699
555
|
renderContent: (context) => {
|
|
700
|
-
const tooltipData =
|
|
556
|
+
const tooltipData = _chunkWEKDYQ4Tjs.transformTimeSeriesTooltipData.call(void 0, {
|
|
701
557
|
context,
|
|
702
558
|
data
|
|
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
|
{
|
|
@@ -739,8 +595,8 @@ var AreaChartWithData = _react.memo.call(void 0, function AreaChartWithData2({
|
|
|
739
595
|
|
|
740
596
|
|
|
741
597
|
var ChartXAnnotationDetails = _react.memo.call(void 0,
|
|
742
|
-
({ iconName, text })
|
|
743
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
598
|
+
function ChartXAnnotationDetails2({ iconName, text }) {
|
|
599
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipHeader, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
744
600
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: iconName, size: "mini", color: "icon.base" }),
|
|
745
601
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.body", fontSize: 200, children: text })
|
|
746
602
|
] }) });
|
|
@@ -753,7 +609,7 @@ var ChartXAnnotationDetails = _react.memo.call(void 0,
|
|
|
753
609
|
|
|
754
610
|
|
|
755
611
|
var ChartXAnnotationMarker = _react.memo.call(void 0,
|
|
756
|
-
({ iconName })
|
|
612
|
+
function ChartXAnnotationMarker2({ iconName }) {
|
|
757
613
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: 200, children: [
|
|
758
614
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
759
615
|
_seedsreactbox.Box,
|
|
@@ -789,13 +645,13 @@ var getDonutChartLegendLabels = ({
|
|
|
789
645
|
data
|
|
790
646
|
}) => {
|
|
791
647
|
return data.map((slice, index) => ({
|
|
792
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
793
|
-
color: _optionalChain([slice, 'access',
|
|
648
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: slice.icon, children: slice.name }),
|
|
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,
|
|
797
653
|
function DonutChartLegend2({ data }) {
|
|
798
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
654
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegend, { legendLabels: getDonutChartLegendLabels({ data }) });
|
|
799
655
|
}
|
|
800
656
|
);
|
|
801
657
|
|
|
@@ -825,7 +681,7 @@ var DonutChartTooltip = _react.memo.call(void 0,
|
|
|
825
681
|
{
|
|
826
682
|
cells: [
|
|
827
683
|
{
|
|
828
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
684
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabel, { color, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { "aria-label": `${name}: `, children: name }) }) })
|
|
829
685
|
},
|
|
830
686
|
{
|
|
831
687
|
content: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "inline-flex", alignItems: "center", gap: 350, children: [
|
|
@@ -854,9 +710,9 @@ var DonutChartTooltip = _react.memo.call(void 0,
|
|
|
854
710
|
]
|
|
855
711
|
}
|
|
856
712
|
];
|
|
857
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
858
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
859
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
713
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltip, { children: [
|
|
714
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTable, { rows }),
|
|
715
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
860
716
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
861
717
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
862
718
|
] }) : tooltipClickLabel }) : null
|
|
@@ -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
|
|
@@ -885,7 +741,7 @@ var transformDonutChartTooltipData = ({
|
|
|
885
741
|
|
|
886
742
|
_accessibility2.default.call(void 0, _highcharts2.default);
|
|
887
743
|
var StyledBox2 = _styledcomponents2.default.call(void 0, _seedsreactbox.Box)`
|
|
888
|
-
${
|
|
744
|
+
${_chunkWEKDYQ4Tjs.donutChartStyles}
|
|
889
745
|
`;
|
|
890
746
|
var DonutChart = _react.memo.call(void 0, function DonutChart2(props) {
|
|
891
747
|
const { data } = props;
|
|
@@ -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',
|
|
926
|
-
const tooltipId =
|
|
781
|
+
const allSlices = _nullishCoalesce(_optionalChain([this, 'access', _37 => _37.series, 'access', _38 => _38[0], 'optionalAccess', _39 => _39.data]), () => ( []));
|
|
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,10 +816,10 @@ 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
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
822
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
967
823
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
968
824
|
StyledBox2,
|
|
969
825
|
{
|
|
@@ -980,7 +836,7 @@ var DonutChartWithData = _react.memo.call(void 0,
|
|
|
980
836
|
}
|
|
981
837
|
),
|
|
982
838
|
chart && !disableTooltips ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
983
|
-
|
|
839
|
+
_chunkWEKDYQ4Tjs.ChartTooltipPortal,
|
|
984
840
|
{
|
|
985
841
|
chart,
|
|
986
842
|
renderContent: (context) => {
|
|
@@ -1036,11 +892,11 @@ 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
|
{
|
|
1043
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
899
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabel, { color, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon, children: name }) })
|
|
1044
900
|
},
|
|
1045
901
|
{
|
|
1046
902
|
content: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "inline-flex", alignItems: "center", gap: 350, children: [
|
|
@@ -1093,7 +949,7 @@ var DonutChartLegendTable = _react.memo.call(void 0,
|
|
|
1093
949
|
}
|
|
1094
950
|
];
|
|
1095
951
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1096
|
-
|
|
952
|
+
_chunkWEKDYQ4Tjs.ChartTable,
|
|
1097
953
|
{
|
|
1098
954
|
rows: [...rows, ...totalRow]
|
|
1099
955
|
}
|
|
@@ -1118,13 +974,13 @@ var getLineChartLegendLabels = ({
|
|
|
1118
974
|
data
|
|
1119
975
|
}) => {
|
|
1120
976
|
return data.map((series, index) => ({
|
|
1121
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1122
|
-
color: _optionalChain([series, 'access',
|
|
977
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
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,
|
|
1126
982
|
function LineChartLegend2({ data }) {
|
|
1127
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
983
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegend, { legendLabels: getLineChartLegendLabels({ data }) });
|
|
1128
984
|
}
|
|
1129
985
|
);
|
|
1130
986
|
|
|
@@ -1155,7 +1011,7 @@ var LineChartTooltip = _react.memo.call(void 0,
|
|
|
1155
1011
|
return {
|
|
1156
1012
|
cells: [
|
|
1157
1013
|
{
|
|
1158
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1014
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabel, { color, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { "aria-label": `${name}: `, children: name }) }) })
|
|
1159
1015
|
},
|
|
1160
1016
|
{
|
|
1161
1017
|
content: value === null && invalidNumberLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { children: invalidNumberLabel }) : numberFormat === "duration" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreactduration.Duration, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1173,11 +1029,11 @@ var LineChartTooltip = _react.memo.call(void 0,
|
|
|
1173
1029
|
]
|
|
1174
1030
|
};
|
|
1175
1031
|
});
|
|
1176
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1032
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltip, { children: [
|
|
1177
1033
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
1178
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1179
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1180
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1034
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
1035
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTable, { rows }),
|
|
1036
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
1181
1037
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
1182
1038
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
1183
1039
|
] }) : tooltipClickLabel }) : null
|
|
@@ -1191,7 +1047,7 @@ var LineChartTooltip = _react.memo.call(void 0,
|
|
|
1191
1047
|
_accessibility2.default.call(void 0, _highcharts2.default);
|
|
1192
1048
|
_annotations2.default.call(void 0, _highcharts2.default);
|
|
1193
1049
|
var StyledBox3 = _styledcomponents2.default.call(void 0, _seedsreactbox.Box)`
|
|
1194
|
-
${
|
|
1050
|
+
${_chunkWEKDYQ4Tjs.lineChartStyles}
|
|
1195
1051
|
`;
|
|
1196
1052
|
var LineChart = _react.memo.call(void 0, function LineChart2(props) {
|
|
1197
1053
|
const { data } = props;
|
|
@@ -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
|
{
|
|
@@ -1245,7 +1101,7 @@ var LineChartWithData = _react.memo.call(void 0, function LineChartWithData2({
|
|
|
1245
1101
|
}
|
|
1246
1102
|
);
|
|
1247
1103
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1248
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1104
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
1249
1105
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1250
1106
|
StyledBox3,
|
|
1251
1107
|
{
|
|
@@ -1262,25 +1118,25 @@ 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,
|
|
1273
1129
|
chart && !disableTooltips ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1274
|
-
|
|
1130
|
+
_chunkWEKDYQ4Tjs.ChartTooltipPortal,
|
|
1275
1131
|
{
|
|
1276
1132
|
chart,
|
|
1277
1133
|
renderContent: (context) => {
|
|
1278
|
-
const tooltipData =
|
|
1134
|
+
const tooltipData = _chunkWEKDYQ4Tjs.transformTimeSeriesTooltipData.call(void 0, {
|
|
1279
1135
|
context,
|
|
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
|
{
|
|
@@ -1324,13 +1180,13 @@ var getVerticalBarChartLegendLabels = ({
|
|
|
1324
1180
|
data
|
|
1325
1181
|
}) => {
|
|
1326
1182
|
return data.map((series, index) => ({
|
|
1327
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1328
|
-
color: _optionalChain([series, 'access',
|
|
1183
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
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,
|
|
1332
1188
|
function VerticalbarChartLegend({ data }) {
|
|
1333
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1189
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegend, { legendLabels: getVerticalBarChartLegendLabels({ data }) });
|
|
1334
1190
|
}
|
|
1335
1191
|
);
|
|
1336
1192
|
|
|
@@ -1361,7 +1217,7 @@ var VerticalBarChartTooltip = _react.memo.call(void 0,
|
|
|
1361
1217
|
return {
|
|
1362
1218
|
cells: [
|
|
1363
1219
|
{
|
|
1364
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1220
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabel, { color, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { "aria-label": `${name}: `, children: name }) }) })
|
|
1365
1221
|
},
|
|
1366
1222
|
{
|
|
1367
1223
|
content: value === null && invalidNumberLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { children: invalidNumberLabel }) : numberFormat === "duration" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreactduration.Duration, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1379,11 +1235,11 @@ var VerticalBarChartTooltip = _react.memo.call(void 0,
|
|
|
1379
1235
|
]
|
|
1380
1236
|
};
|
|
1381
1237
|
});
|
|
1382
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1238
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltip, { children: [
|
|
1383
1239
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
1384
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1386
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1240
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
1241
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTable, { rows }),
|
|
1242
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
1387
1243
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
1388
1244
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
1389
1245
|
] }) : tooltipClickLabel }) : null
|
|
@@ -1397,7 +1253,7 @@ var VerticalBarChartTooltip = _react.memo.call(void 0,
|
|
|
1397
1253
|
// src/components/VerticalBarChart/styles.ts
|
|
1398
1254
|
|
|
1399
1255
|
var verticalBarChartStyles = _styledcomponents.css`
|
|
1400
|
-
${
|
|
1256
|
+
${_chunkWEKDYQ4Tjs.timeSeriesChartStyles}
|
|
1401
1257
|
|
|
1402
1258
|
/*
|
|
1403
1259
|
When the chart container is hovered, reduce the opacity of all columns.
|
|
@@ -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;
|
|
@@ -1458,7 +1314,7 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1458
1314
|
xAnnotations,
|
|
1459
1315
|
xAxisLabelFormatter: xAxisLabelFormatter2
|
|
1460
1316
|
}) {
|
|
1461
|
-
const shouldUseTimeFormatter =
|
|
1317
|
+
const shouldUseTimeFormatter = _chunkWEKDYQ4Tjs.isHourlyTimeData.call(void 0, data) || _chunkWEKDYQ4Tjs.isCategoricalHourData.call(void 0, data);
|
|
1462
1318
|
const autoTimeXAxisLabelFormatter = ({
|
|
1463
1319
|
value,
|
|
1464
1320
|
timeFormat: timeFormat2
|
|
@@ -1490,8 +1346,8 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1490
1346
|
const numValue = typeof value === "string" ? Number(value) : value;
|
|
1491
1347
|
if (isNaN(numValue)) return "";
|
|
1492
1348
|
const date = new Date(numValue);
|
|
1493
|
-
|
|
1494
|
-
|
|
1349
|
+
const hour = date.getUTCHours();
|
|
1350
|
+
const displayHour = hour % 12 === 0 ? 12 : hour % 12;
|
|
1495
1351
|
if (hour === 0) return "<span>12</span><span>AM</span>";
|
|
1496
1352
|
if (hour === 12) return "<span>12</span><span>PM</span>";
|
|
1497
1353
|
return `<span>${displayHour}</span>`;
|
|
@@ -1511,12 +1367,12 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1511
1367
|
xAnnotations,
|
|
1512
1368
|
xAxisLabelFormatter: resolvedXAxisLabelFormatter
|
|
1513
1369
|
});
|
|
1514
|
-
const { colors
|
|
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
|
{
|
|
@@ -1525,7 +1381,7 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1525
1381
|
}
|
|
1526
1382
|
);
|
|
1527
1383
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1528
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1384
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
1529
1385
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1530
1386
|
StyledBox4,
|
|
1531
1387
|
{
|
|
@@ -1541,25 +1397,25 @@ 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,
|
|
1552
1408
|
chart ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1553
|
-
|
|
1409
|
+
_chunkWEKDYQ4Tjs.ChartTooltipPortal,
|
|
1554
1410
|
{
|
|
1555
1411
|
chart,
|
|
1556
1412
|
renderContent: (context) => {
|
|
1557
|
-
const tooltipData =
|
|
1413
|
+
const tooltipData = _chunkWEKDYQ4Tjs.transformTimeSeriesTooltipData.call(void 0, {
|
|
1558
1414
|
context,
|
|
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 =
|
|
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
|