@sproutsocial/seeds-react-data-viz 0.15.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{axis-PJwu5Xmo.d.ts → axis-BVPkC6iF.d.ts} +1 -1
- package/dist/{axis-DXzufRRj.d.mts → axis-BjucJt39.d.mts} +1 -1
- package/dist/bar/index.d.mts +16 -46
- package/dist/bar/index.d.ts +16 -46
- package/dist/bar/index.js +88 -71
- package/dist/bar/index.js.map +1 -1
- package/dist/{chunk-VSZSIN34.js → chunk-EJYDQYLE.js} +15 -15
- package/dist/chunk-EJYDQYLE.js.map +1 -0
- package/dist/{chunk-EEVKTTT3.js → chunk-WEKDYQ4T.js} +1 -1
- package/dist/chunk-WEKDYQ4T.js.map +1 -0
- package/dist/esm/bar/index.js +79 -62
- package/dist/esm/bar/index.js.map +1 -1
- package/dist/esm/{chunk-OAN5VC7M.js → chunk-DKTW56NJ.js} +3 -3
- package/dist/esm/chunk-DKTW56NJ.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/export/index.js.map +1 -1
- package/dist/esm/index.js +185 -21
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/line-area/index.js +2 -2
- package/dist/export/index.js.map +1 -1
- package/dist/index.d.mts +23 -23
- package/dist/index.d.ts +23 -23
- package/dist/index.js +278 -114
- package/dist/index.js.map +1 -1
- package/dist/line-area/index.d.mts +2 -2
- package/dist/line-area/index.d.ts +2 -2
- package/dist/line-area/index.js +10 -10
- 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 +3 -2
- package/dist/chunk-EEVKTTT3.js.map +0 -1
- package/dist/chunk-JXARPHQE.js +0 -193
- package/dist/chunk-JXARPHQE.js.map +0 -1
- package/dist/chunk-VSZSIN34.js.map +0 -1
- package/dist/esm/chunk-HQM3EIZW.js +0 -193
- package/dist/esm/chunk-HQM3EIZW.js.map +0 -1
- package/dist/esm/chunk-LC3HGWDD.js.map +0 -1
- package/dist/esm/chunk-OAN5VC7M.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var _chunkJXARPHQEjs = require('./chunk-JXARPHQE.js');
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
|
|
@@ -31,20 +30,7 @@ var _chunkJXARPHQEjs = require('./chunk-JXARPHQE.js');
|
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var _chunkEEVKTTT3js = require('./chunk-EEVKTTT3.js');
|
|
33
|
+
var _chunkWEKDYQ4Tjs = require('./chunk-WEKDYQ4T.js');
|
|
48
34
|
|
|
49
35
|
// src/components/AreaChart/AreaChart.tsx
|
|
50
36
|
var _react = require('react');
|
|
@@ -63,13 +49,13 @@ var getAreaChartLegendLabels = ({
|
|
|
63
49
|
data
|
|
64
50
|
}) => {
|
|
65
51
|
return data.map((series, index) => ({
|
|
66
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
67
|
-
color: _optionalChain([series, 'access',
|
|
52
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
53
|
+
color: _optionalChain([series, 'access', _2 => _2.styles, 'optionalAccess', _3 => _3.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
68
54
|
}));
|
|
69
55
|
};
|
|
70
56
|
var AreaChartLegend = _react.memo.call(void 0,
|
|
71
57
|
function AreaChartLegend2({ data }) {
|
|
72
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
58
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegend, { legendLabels: getAreaChartLegendLabels({ data }) });
|
|
73
59
|
}
|
|
74
60
|
);
|
|
75
61
|
|
|
@@ -102,7 +88,7 @@ var AreaChartTooltip = _react.memo.call(void 0,
|
|
|
102
88
|
return {
|
|
103
89
|
cells: [
|
|
104
90
|
{
|
|
105
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
91
|
+
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 }) }) })
|
|
106
92
|
},
|
|
107
93
|
{
|
|
108
94
|
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,
|
|
@@ -150,16 +136,16 @@ var AreaChartTooltip = _react.memo.call(void 0,
|
|
|
150
136
|
isAppendedRow: true
|
|
151
137
|
}
|
|
152
138
|
] : [];
|
|
153
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
139
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltip, { children: [
|
|
154
140
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
155
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
156
142
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
157
|
-
|
|
143
|
+
_chunkWEKDYQ4Tjs.ChartTooltipTable,
|
|
158
144
|
{
|
|
159
145
|
rows: [...rows, ...appendedRows]
|
|
160
146
|
}
|
|
161
147
|
),
|
|
162
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
148
|
+
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: [
|
|
163
149
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
164
150
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
165
151
|
] }) : tooltipClickLabel }) : null
|
|
@@ -179,7 +165,7 @@ var ChartXAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
179
165
|
chartContainer
|
|
180
166
|
}) {
|
|
181
167
|
const annotationContainers = _react.useRef.call(void 0, {});
|
|
182
|
-
const [
|
|
168
|
+
const [, setRenderCount] = _react.useState.call(void 0, 0);
|
|
183
169
|
const forceRender = () => setRenderCount((prev) => prev + 1);
|
|
184
170
|
_react.useEffect.call(void 0, () => {
|
|
185
171
|
if (annotationContext.labels) {
|
|
@@ -191,13 +177,13 @@ var ChartXAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
191
177
|
(annotation) => annotation.setAttribute("data-annotation-marker", "false")
|
|
192
178
|
);
|
|
193
179
|
annotationContext.labels.forEach((label) => {
|
|
194
|
-
const labelElement = _optionalChain([label, 'access',
|
|
180
|
+
const labelElement = _optionalChain([label, 'access', _4 => _4.graphic, 'optionalAccess', _5 => _5.div]);
|
|
195
181
|
if (labelElement) {
|
|
196
182
|
labelElement.querySelectorAll("div[data-annotation-marker]").forEach((component) => component.remove());
|
|
197
183
|
const annotationDiv = document.createElement("div");
|
|
198
184
|
annotationDiv.setAttribute("data-annotation-marker", "true");
|
|
199
185
|
labelElement.appendChild(annotationDiv);
|
|
200
|
-
const xValue = _optionalChain([label, 'access',
|
|
186
|
+
const xValue = _optionalChain([label, 'access', _6 => _6.options, 'optionalAccess', _7 => _7.point, 'optionalAccess', _8 => _8.x]);
|
|
201
187
|
newContainers[xValue] = annotationDiv;
|
|
202
188
|
}
|
|
203
189
|
});
|
|
@@ -220,7 +206,7 @@ var ChartXAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
220
206
|
}, [annotationContext.labels, xAnnotations, chartContainer]);
|
|
221
207
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: Object.entries(annotationContainers.current).map(
|
|
222
208
|
([xValue, container]) => {
|
|
223
|
-
const annotationComponent = _optionalChain([xAnnotations, 'optionalAccess',
|
|
209
|
+
const annotationComponent = _optionalChain([xAnnotations, 'optionalAccess', _9 => _9[Number(xValue)], 'optionalAccess', _10 => _10.marker]);
|
|
224
210
|
return annotationComponent ? _reactdom.createPortal.call(void 0, annotationComponent(), container) : null;
|
|
225
211
|
}
|
|
226
212
|
) });
|
|
@@ -229,7 +215,164 @@ var ChartXAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
229
215
|
|
|
230
216
|
// src/hooks/useTimeSeriesChartOptions.ts
|
|
231
217
|
|
|
232
|
-
|
|
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
|
+
|
|
233
376
|
var useTimeSeriesChartOptions = ({
|
|
234
377
|
xAnnotations,
|
|
235
378
|
data,
|
|
@@ -253,7 +396,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
253
396
|
const handleFocus = (point) => point.series.chart.tooltip.refresh(point);
|
|
254
397
|
const handleBlur = (point) => point.series.chart.tooltip.hide(0);
|
|
255
398
|
series.flatMap((item) => item.data).forEach((point) => {
|
|
256
|
-
const pointElement = _optionalChain([point, 'optionalAccess',
|
|
399
|
+
const pointElement = _optionalChain([point, 'optionalAccess', _11 => _11.graphic, 'optionalAccess', _12 => _12.element]);
|
|
257
400
|
if (pointElement) {
|
|
258
401
|
pointElement.setAttribute("aria-describedby", tooltipId);
|
|
259
402
|
pointElement.addEventListener("focus", () => handleFocus(point));
|
|
@@ -280,20 +423,20 @@ var useTimeSeriesChartOptions = ({
|
|
|
280
423
|
const getBaseChartOptions = (type) => {
|
|
281
424
|
switch (type) {
|
|
282
425
|
case "areaspline":
|
|
283
|
-
return
|
|
426
|
+
return areaChartOptions;
|
|
284
427
|
case "spline":
|
|
285
|
-
return
|
|
428
|
+
return lineChartOptions;
|
|
286
429
|
case "column":
|
|
287
|
-
return
|
|
430
|
+
return columnChartOptions;
|
|
288
431
|
default:
|
|
289
|
-
return
|
|
432
|
+
return lineChartOptions;
|
|
290
433
|
}
|
|
291
434
|
};
|
|
292
435
|
const baseChartOptions2 = getBaseChartOptions(seriesType);
|
|
293
436
|
const hasCategoricalData = data.some(
|
|
294
437
|
(series) => series.points.some((point) => typeof point.x === "string")
|
|
295
438
|
);
|
|
296
|
-
const categories = hasCategoricalData ? _optionalChain([data, 'access',
|
|
439
|
+
const categories = hasCategoricalData ? _optionalChain([data, 'access', _13 => _13[0], 'optionalAccess', _14 => _14.points, 'access', _15 => _15.map, 'call', _16 => _16((point) => point.x)]) || [] : [];
|
|
297
440
|
const hasSparseTimelineData = !hasCategoricalData && seriesType === "column";
|
|
298
441
|
const options = _react.useMemo.call(void 0, () => {
|
|
299
442
|
return _lodash.merge.call(void 0, {}, baseChartOptions2, {
|
|
@@ -313,10 +456,10 @@ var useTimeSeriesChartOptions = ({
|
|
|
313
456
|
marginTop: chartMarginTop,
|
|
314
457
|
events: {
|
|
315
458
|
click: onClick ? function() {
|
|
316
|
-
return onClick({ x: _optionalChain([this, 'optionalAccess',
|
|
459
|
+
return onClick({ x: _optionalChain([this, 'optionalAccess', _17 => _17.hoverPoint, 'optionalAccess', _18 => _18.x]) });
|
|
317
460
|
} : void 0,
|
|
318
461
|
load: function() {
|
|
319
|
-
const tooltipId =
|
|
462
|
+
const tooltipId = _chunkWEKDYQ4Tjs.generateChartTooltipPortalId.call(void 0, this.index);
|
|
320
463
|
attachTooltipEventListeners(this.series, tooltipId);
|
|
321
464
|
}
|
|
322
465
|
}
|
|
@@ -395,7 +538,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
395
538
|
}
|
|
396
539
|
}
|
|
397
540
|
},
|
|
398
|
-
series:
|
|
541
|
+
series: _chunkWEKDYQ4Tjs.transformDataToSeries.call(void 0, { data }, seriesType),
|
|
399
542
|
time: { timezone },
|
|
400
543
|
tooltip: {
|
|
401
544
|
enabled: !disableTooltips
|
|
@@ -407,7 +550,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
407
550
|
Number
|
|
408
551
|
);
|
|
409
552
|
const value = this.value;
|
|
410
|
-
const unitName = _optionalChain([this, 'access',
|
|
553
|
+
const unitName = _optionalChain([this, 'access', _19 => _19.tickPositionInfo, 'optionalAccess', _20 => _20.unitName]);
|
|
411
554
|
if (typeof xAxisLabelFormatter2 === "function") {
|
|
412
555
|
return xAxisLabelFormatter2({
|
|
413
556
|
textLocale,
|
|
@@ -443,7 +586,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
443
586
|
return yAxisLabelFormatter2 ? yAxisLabelFormatter2({
|
|
444
587
|
y: this.value,
|
|
445
588
|
yValues: this.axis.tickPositions
|
|
446
|
-
}) :
|
|
589
|
+
}) : _chunkWEKDYQ4Tjs.yAxisLabelFormatter.call(void 0, {
|
|
447
590
|
currency,
|
|
448
591
|
numberFormat,
|
|
449
592
|
numberLocale,
|
|
@@ -474,7 +617,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
474
617
|
]);
|
|
475
618
|
return { options, chart, callback };
|
|
476
619
|
};
|
|
477
|
-
var xAxisLabelFormatterDefault =
|
|
620
|
+
var xAxisLabelFormatterDefault = _chunkWEKDYQ4Tjs.xAxisLabelFormatter;
|
|
478
621
|
|
|
479
622
|
// src/components/AreaChart/AreaChart.tsx
|
|
480
623
|
|
|
@@ -482,7 +625,7 @@ var xAxisLabelFormatterDefault = _chunkEEVKTTT3js.xAxisLabelFormatter;
|
|
|
482
625
|
_accessibility2.default.call(void 0, _highcharts2.default);
|
|
483
626
|
_annotations2.default.call(void 0, _highcharts2.default);
|
|
484
627
|
var StyledBox = _styledcomponents2.default.call(void 0, _seedsreactbox.Box)`
|
|
485
|
-
${
|
|
628
|
+
${_chunkWEKDYQ4Tjs.areaChartStyles}
|
|
486
629
|
`;
|
|
487
630
|
var AreaChart = _react.memo.call(void 0, function AreaChart2(props) {
|
|
488
631
|
const { data } = props;
|
|
@@ -522,10 +665,10 @@ var AreaChartWithData = _react.memo.call(void 0, function AreaChartWithData2({
|
|
|
522
665
|
xAnnotations
|
|
523
666
|
});
|
|
524
667
|
const colors = data.map(
|
|
525
|
-
(series, index) => _nullishCoalesce(_optionalChain([series, 'access',
|
|
668
|
+
(series, index) => _nullishCoalesce(_optionalChain([series, 'access', _21 => _21.styles, 'optionalAccess', _22 => _22.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]))
|
|
526
669
|
);
|
|
527
670
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
528
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
671
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
529
672
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
530
673
|
StyledBox,
|
|
531
674
|
{
|
|
@@ -541,26 +684,26 @@ var AreaChartWithData = _react.memo.call(void 0, function AreaChartWithData2({
|
|
|
541
684
|
callback
|
|
542
685
|
}
|
|
543
686
|
),
|
|
544
|
-
chart && _optionalChain([chart, 'access',
|
|
687
|
+
chart && _optionalChain([chart, 'access', _23 => _23.annotations, 'optionalAccess', _24 => _24.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
545
688
|
ChartXAnnotationMarkerPortal,
|
|
546
689
|
{
|
|
547
690
|
xAnnotations,
|
|
548
|
-
annotationContext: _optionalChain([chart, 'access',
|
|
691
|
+
annotationContext: _optionalChain([chart, 'access', _25 => _25.annotations, 'optionalAccess', _26 => _26[0]]),
|
|
549
692
|
chartContainer: chart.container
|
|
550
693
|
}
|
|
551
694
|
) : null,
|
|
552
695
|
chart && !disableTooltips ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
553
|
-
|
|
696
|
+
_chunkWEKDYQ4Tjs.ChartTooltipPortal,
|
|
554
697
|
{
|
|
555
698
|
chart,
|
|
556
699
|
renderContent: (context) => {
|
|
557
|
-
const tooltipData =
|
|
700
|
+
const tooltipData = _chunkWEKDYQ4Tjs.transformTimeSeriesTooltipData.call(void 0, {
|
|
558
701
|
context,
|
|
559
702
|
data
|
|
560
703
|
});
|
|
561
704
|
const x = context.x;
|
|
562
705
|
const total = context.total;
|
|
563
|
-
const xAnnotationDetails = _optionalChain([xAnnotations, 'optionalAccess',
|
|
706
|
+
const xAnnotationDetails = _optionalChain([xAnnotations, 'optionalAccess', _27 => _27[x], 'optionalAccess', _28 => _28.details]);
|
|
564
707
|
return tooltip ? tooltip({ data: tooltipData, total, x }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
565
708
|
AreaChartTooltip,
|
|
566
709
|
{
|
|
@@ -596,8 +739,8 @@ var AreaChartWithData = _react.memo.call(void 0, function AreaChartWithData2({
|
|
|
596
739
|
|
|
597
740
|
|
|
598
741
|
var ChartXAnnotationDetails = _react.memo.call(void 0,
|
|
599
|
-
({ iconName, text })
|
|
600
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
742
|
+
function ChartXAnnotationDetails2({ iconName, text }) {
|
|
743
|
+
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: [
|
|
601
744
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: iconName, size: "mini", color: "icon.base" }),
|
|
602
745
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.body", fontSize: 200, children: text })
|
|
603
746
|
] }) });
|
|
@@ -610,7 +753,7 @@ var ChartXAnnotationDetails = _react.memo.call(void 0,
|
|
|
610
753
|
|
|
611
754
|
|
|
612
755
|
var ChartXAnnotationMarker = _react.memo.call(void 0,
|
|
613
|
-
({ iconName })
|
|
756
|
+
function ChartXAnnotationMarker2({ iconName }) {
|
|
614
757
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: 200, children: [
|
|
615
758
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
616
759
|
_seedsreactbox.Box,
|
|
@@ -646,13 +789,13 @@ var getDonutChartLegendLabels = ({
|
|
|
646
789
|
data
|
|
647
790
|
}) => {
|
|
648
791
|
return data.map((slice, index) => ({
|
|
649
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
650
|
-
color: _optionalChain([slice, 'access',
|
|
792
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: slice.icon, children: slice.name }),
|
|
793
|
+
color: _optionalChain([slice, 'access', _29 => _29.styles, 'optionalAccess', _30 => _30.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
651
794
|
}));
|
|
652
795
|
};
|
|
653
796
|
var DonutChartLegend = _react.memo.call(void 0,
|
|
654
797
|
function DonutChartLegend2({ data }) {
|
|
655
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
798
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegend, { legendLabels: getDonutChartLegendLabels({ data }) });
|
|
656
799
|
}
|
|
657
800
|
);
|
|
658
801
|
|
|
@@ -682,7 +825,7 @@ var DonutChartTooltip = _react.memo.call(void 0,
|
|
|
682
825
|
{
|
|
683
826
|
cells: [
|
|
684
827
|
{
|
|
685
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
828
|
+
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 }) }) })
|
|
686
829
|
},
|
|
687
830
|
{
|
|
688
831
|
content: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "inline-flex", alignItems: "center", gap: 350, children: [
|
|
@@ -711,9 +854,9 @@ var DonutChartTooltip = _react.memo.call(void 0,
|
|
|
711
854
|
]
|
|
712
855
|
}
|
|
713
856
|
];
|
|
714
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
715
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
716
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
857
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltip, { children: [
|
|
858
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTable, { rows }),
|
|
859
|
+
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: [
|
|
717
860
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
718
861
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
719
862
|
] }) : tooltipClickLabel }) : null
|
|
@@ -729,8 +872,8 @@ var transformDonutChartTooltipData = ({
|
|
|
729
872
|
}) => {
|
|
730
873
|
const colorIndex = context.colorIndex;
|
|
731
874
|
return {
|
|
732
|
-
color: _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'access',
|
|
733
|
-
..._optionalChain([data, 'access',
|
|
875
|
+
color: _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'access', _31 => _31[colorIndex], 'optionalAccess', _32 => _32.styles, 'optionalAccess', _33 => _33.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[colorIndex])), () => ( "")),
|
|
876
|
+
..._optionalChain([data, 'access', _34 => _34[colorIndex], 'optionalAccess', _35 => _35.icon]) ? { icon: _optionalChain([data, 'access', _36 => _36[colorIndex], 'optionalAccess', _37 => _37.icon]) } : {},
|
|
734
877
|
name: context.key,
|
|
735
878
|
percent: context.percentage,
|
|
736
879
|
value: context.y
|
|
@@ -742,7 +885,7 @@ var transformDonutChartTooltipData = ({
|
|
|
742
885
|
|
|
743
886
|
_accessibility2.default.call(void 0, _highcharts2.default);
|
|
744
887
|
var StyledBox2 = _styledcomponents2.default.call(void 0, _seedsreactbox.Box)`
|
|
745
|
-
${
|
|
888
|
+
${_chunkWEKDYQ4Tjs.donutChartStyles}
|
|
746
889
|
`;
|
|
747
890
|
var DonutChart = _react.memo.call(void 0, function DonutChart2(props) {
|
|
748
891
|
const { data } = props;
|
|
@@ -762,7 +905,7 @@ var DonutChartWithData = _react.memo.call(void 0,
|
|
|
762
905
|
onClick,
|
|
763
906
|
tooltipClickLabel
|
|
764
907
|
}) {
|
|
765
|
-
const [options, setOptions] = _react.useState.call(void 0,
|
|
908
|
+
const [options, setOptions] = _react.useState.call(void 0, donutChartOptions);
|
|
766
909
|
const [chart, setChart] = _react.useState.call(void 0, null);
|
|
767
910
|
const callback = _react.useCallback.call(void 0, (chartInstance) => {
|
|
768
911
|
setChart(chartInstance);
|
|
@@ -779,15 +922,15 @@ var DonutChartWithData = _react.memo.call(void 0,
|
|
|
779
922
|
chart: {
|
|
780
923
|
events: {
|
|
781
924
|
render: function() {
|
|
782
|
-
const allSlices = _nullishCoalesce(_optionalChain([this, 'access',
|
|
783
|
-
const tooltipId =
|
|
925
|
+
const allSlices = _nullishCoalesce(_optionalChain([this, 'access', _38 => _38.series, 'access', _39 => _39[0], 'optionalAccess', _40 => _40.data]), () => ( []));
|
|
926
|
+
const tooltipId = _chunkWEKDYQ4Tjs.generateChartTooltipPortalId.call(void 0, this.index);
|
|
784
927
|
allSlices.forEach((slice) => {
|
|
785
|
-
const sliceElement = _optionalChain([slice, 'optionalAccess',
|
|
786
|
-
_optionalChain([sliceElement, 'optionalAccess',
|
|
787
|
-
_optionalChain([sliceElement, 'optionalAccess',
|
|
928
|
+
const sliceElement = _optionalChain([slice, 'optionalAccess', _41 => _41.graphic, 'optionalAccess', _42 => _42.element]);
|
|
929
|
+
_optionalChain([sliceElement, 'optionalAccess', _43 => _43.setAttribute, 'call', _44 => _44("aria-describedby", tooltipId)]);
|
|
930
|
+
_optionalChain([sliceElement, 'optionalAccess', _45 => _45.addEventListener, 'call', _46 => _46("focus", () => {
|
|
788
931
|
slice.series.chart.tooltip.refresh(slice);
|
|
789
932
|
})]);
|
|
790
|
-
_optionalChain([sliceElement, 'optionalAccess',
|
|
933
|
+
_optionalChain([sliceElement, 'optionalAccess', _47 => _47.addEventListener, 'call', _48 => _48("blur", () => {
|
|
791
934
|
slice.series.chart.tooltip.hide(0);
|
|
792
935
|
})]);
|
|
793
936
|
});
|
|
@@ -817,10 +960,10 @@ var DonutChartWithData = _react.memo.call(void 0,
|
|
|
817
960
|
});
|
|
818
961
|
}, [data]);
|
|
819
962
|
const colors = data.map(
|
|
820
|
-
(series, index) => _nullishCoalesce(_nullishCoalesce(_optionalChain([series, 'access',
|
|
963
|
+
(series, index) => _nullishCoalesce(_nullishCoalesce(_optionalChain([series, 'access', _49 => _49.styles, 'optionalAccess', _50 => _50.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index])), () => ( ""))
|
|
821
964
|
);
|
|
822
965
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
823
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
966
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
824
967
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
825
968
|
StyledBox2,
|
|
826
969
|
{
|
|
@@ -837,7 +980,7 @@ var DonutChartWithData = _react.memo.call(void 0,
|
|
|
837
980
|
}
|
|
838
981
|
),
|
|
839
982
|
chart && !disableTooltips ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
840
|
-
|
|
983
|
+
_chunkWEKDYQ4Tjs.ChartTooltipPortal,
|
|
841
984
|
{
|
|
842
985
|
chart,
|
|
843
986
|
renderContent: (context) => {
|
|
@@ -893,11 +1036,11 @@ var DonutChartLegendTable = _react.memo.call(void 0,
|
|
|
893
1036
|
);
|
|
894
1037
|
const rows = data.map((dataPoint, index) => {
|
|
895
1038
|
const { name, icon, styles, value } = dataPoint;
|
|
896
|
-
const color = _optionalChain([styles, 'optionalAccess',
|
|
1039
|
+
const color = _optionalChain([styles, 'optionalAccess', _51 => _51.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index];
|
|
897
1040
|
return {
|
|
898
1041
|
cells: [
|
|
899
1042
|
{
|
|
900
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1043
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabel, { color, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon, children: name }) })
|
|
901
1044
|
},
|
|
902
1045
|
{
|
|
903
1046
|
content: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "inline-flex", alignItems: "center", gap: 350, children: [
|
|
@@ -950,7 +1093,7 @@ var DonutChartLegendTable = _react.memo.call(void 0,
|
|
|
950
1093
|
}
|
|
951
1094
|
];
|
|
952
1095
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
953
|
-
|
|
1096
|
+
_chunkWEKDYQ4Tjs.ChartTable,
|
|
954
1097
|
{
|
|
955
1098
|
rows: [...rows, ...totalRow]
|
|
956
1099
|
}
|
|
@@ -975,13 +1118,13 @@ var getLineChartLegendLabels = ({
|
|
|
975
1118
|
data
|
|
976
1119
|
}) => {
|
|
977
1120
|
return data.map((series, index) => ({
|
|
978
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
979
|
-
color: _optionalChain([series, 'access',
|
|
1121
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
1122
|
+
color: _optionalChain([series, 'access', _52 => _52.styles, 'optionalAccess', _53 => _53.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
980
1123
|
}));
|
|
981
1124
|
};
|
|
982
1125
|
var LineChartLegend = _react.memo.call(void 0,
|
|
983
1126
|
function LineChartLegend2({ data }) {
|
|
984
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1127
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegend, { legendLabels: getLineChartLegendLabels({ data }) });
|
|
985
1128
|
}
|
|
986
1129
|
);
|
|
987
1130
|
|
|
@@ -1012,7 +1155,7 @@ var LineChartTooltip = _react.memo.call(void 0,
|
|
|
1012
1155
|
return {
|
|
1013
1156
|
cells: [
|
|
1014
1157
|
{
|
|
1015
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1158
|
+
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 }) }) })
|
|
1016
1159
|
},
|
|
1017
1160
|
{
|
|
1018
1161
|
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,
|
|
@@ -1030,11 +1173,11 @@ var LineChartTooltip = _react.memo.call(void 0,
|
|
|
1030
1173
|
]
|
|
1031
1174
|
};
|
|
1032
1175
|
});
|
|
1033
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1176
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltip, { children: [
|
|
1034
1177
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
1035
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1036
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1037
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1178
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
1179
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTable, { rows }),
|
|
1180
|
+
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: [
|
|
1038
1181
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
1039
1182
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
1040
1183
|
] }) : tooltipClickLabel }) : null
|
|
@@ -1048,7 +1191,7 @@ var LineChartTooltip = _react.memo.call(void 0,
|
|
|
1048
1191
|
_accessibility2.default.call(void 0, _highcharts2.default);
|
|
1049
1192
|
_annotations2.default.call(void 0, _highcharts2.default);
|
|
1050
1193
|
var StyledBox3 = _styledcomponents2.default.call(void 0, _seedsreactbox.Box)`
|
|
1051
|
-
${
|
|
1194
|
+
${_chunkWEKDYQ4Tjs.lineChartStyles}
|
|
1052
1195
|
`;
|
|
1053
1196
|
var LineChart = _react.memo.call(void 0, function LineChart2(props) {
|
|
1054
1197
|
const { data } = props;
|
|
@@ -1091,9 +1234,9 @@ var LineChartWithData = _react.memo.call(void 0, function LineChartWithData2({
|
|
|
1091
1234
|
const { colors, patterns } = data.reduce(
|
|
1092
1235
|
(acc, item, index) => {
|
|
1093
1236
|
acc.colors.push(
|
|
1094
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'access',
|
|
1237
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'access', _54 => _54.styles, 'optionalAccess', _55 => _55.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index])), () => ( ""))
|
|
1095
1238
|
);
|
|
1096
|
-
acc.patterns.push(_nullishCoalesce(_optionalChain([item, 'access',
|
|
1239
|
+
acc.patterns.push(_nullishCoalesce(_optionalChain([item, 'access', _56 => _56.styles, 'optionalAccess', _57 => _57.pattern]), () => ( "solid")));
|
|
1097
1240
|
return acc;
|
|
1098
1241
|
},
|
|
1099
1242
|
{
|
|
@@ -1102,7 +1245,7 @@ var LineChartWithData = _react.memo.call(void 0, function LineChartWithData2({
|
|
|
1102
1245
|
}
|
|
1103
1246
|
);
|
|
1104
1247
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1105
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1248
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
1106
1249
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1107
1250
|
StyledBox3,
|
|
1108
1251
|
{
|
|
@@ -1119,25 +1262,25 @@ var LineChartWithData = _react.memo.call(void 0, function LineChartWithData2({
|
|
|
1119
1262
|
callback
|
|
1120
1263
|
}
|
|
1121
1264
|
),
|
|
1122
|
-
chart && _optionalChain([chart, 'access',
|
|
1265
|
+
chart && _optionalChain([chart, 'access', _58 => _58.annotations, 'optionalAccess', _59 => _59.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1123
1266
|
ChartXAnnotationMarkerPortal,
|
|
1124
1267
|
{
|
|
1125
1268
|
xAnnotations,
|
|
1126
|
-
annotationContext: _optionalChain([chart, 'access',
|
|
1269
|
+
annotationContext: _optionalChain([chart, 'access', _60 => _60.annotations, 'optionalAccess', _61 => _61[0]]),
|
|
1127
1270
|
chartContainer: chart.container
|
|
1128
1271
|
}
|
|
1129
1272
|
) : null,
|
|
1130
1273
|
chart && !disableTooltips ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1131
|
-
|
|
1274
|
+
_chunkWEKDYQ4Tjs.ChartTooltipPortal,
|
|
1132
1275
|
{
|
|
1133
1276
|
chart,
|
|
1134
1277
|
renderContent: (context) => {
|
|
1135
|
-
const tooltipData =
|
|
1278
|
+
const tooltipData = _chunkWEKDYQ4Tjs.transformTimeSeriesTooltipData.call(void 0, {
|
|
1136
1279
|
context,
|
|
1137
1280
|
data
|
|
1138
1281
|
});
|
|
1139
1282
|
const x = context.x;
|
|
1140
|
-
const xAnnotationDetails = _optionalChain([xAnnotations, 'optionalAccess',
|
|
1283
|
+
const xAnnotationDetails = _optionalChain([xAnnotations, 'optionalAccess', _62 => _62[x], 'optionalAccess', _63 => _63.details]);
|
|
1141
1284
|
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1142
1285
|
LineChartTooltip,
|
|
1143
1286
|
{
|
|
@@ -1181,13 +1324,13 @@ var getVerticalBarChartLegendLabels = ({
|
|
|
1181
1324
|
data
|
|
1182
1325
|
}) => {
|
|
1183
1326
|
return data.map((series, index) => ({
|
|
1184
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1185
|
-
color: _optionalChain([series, 'access',
|
|
1327
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
1328
|
+
color: _optionalChain([series, 'access', _64 => _64.styles, 'optionalAccess', _65 => _65.color]) || _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
1186
1329
|
}));
|
|
1187
1330
|
};
|
|
1188
1331
|
var VerticalBarChartLegend = _react.memo.call(void 0,
|
|
1189
1332
|
function VerticalbarChartLegend({ data }) {
|
|
1190
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1333
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartLegend, { legendLabels: getVerticalBarChartLegendLabels({ data }) });
|
|
1191
1334
|
}
|
|
1192
1335
|
);
|
|
1193
1336
|
|
|
@@ -1218,7 +1361,7 @@ var VerticalBarChartTooltip = _react.memo.call(void 0,
|
|
|
1218
1361
|
return {
|
|
1219
1362
|
cells: [
|
|
1220
1363
|
{
|
|
1221
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1364
|
+
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 }) }) })
|
|
1222
1365
|
},
|
|
1223
1366
|
{
|
|
1224
1367
|
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,
|
|
@@ -1236,11 +1379,11 @@ var VerticalBarChartTooltip = _react.memo.call(void 0,
|
|
|
1236
1379
|
]
|
|
1237
1380
|
};
|
|
1238
1381
|
});
|
|
1239
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1382
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltip, { children: [
|
|
1240
1383
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
1241
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1242
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1243
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1384
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
1385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.ChartTooltipTable, { rows }),
|
|
1386
|
+
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: [
|
|
1244
1387
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
1245
1388
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
1246
1389
|
] }) : tooltipClickLabel }) : null
|
|
@@ -1251,15 +1394,36 @@ var VerticalBarChartTooltip = _react.memo.call(void 0,
|
|
|
1251
1394
|
// src/components/VerticalBarChart/VerticalBarChart.tsx
|
|
1252
1395
|
|
|
1253
1396
|
|
|
1397
|
+
// src/components/VerticalBarChart/styles.ts
|
|
1398
|
+
|
|
1399
|
+
var verticalBarChartStyles = _styledcomponents.css`
|
|
1400
|
+
${_chunkWEKDYQ4Tjs.timeSeriesChartStyles}
|
|
1401
|
+
|
|
1402
|
+
/*
|
|
1403
|
+
When the chart container is hovered, reduce the opacity of all columns.
|
|
1404
|
+
Then, for the column that is being hovered, restore its opacity.
|
|
1405
|
+
This gives the effect of fading out the non-hovered columns.
|
|
1406
|
+
*/
|
|
1407
|
+
.highcharts-container:hover .highcharts-point {
|
|
1408
|
+
fill-opacity: 0.3;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
.highcharts-point.column-hover {
|
|
1412
|
+
fill-opacity: 1 !important;
|
|
1413
|
+
}
|
|
1414
|
+
`;
|
|
1415
|
+
|
|
1416
|
+
// src/components/VerticalBarChart/VerticalBarChart.tsx
|
|
1417
|
+
|
|
1254
1418
|
_accessibility2.default.call(void 0, _highcharts2.default);
|
|
1255
1419
|
_annotations2.default.call(void 0, _highcharts2.default);
|
|
1256
1420
|
var StyledBox4 = _styledcomponents2.default.call(void 0, _seedsreactbox.Box)`
|
|
1257
|
-
${
|
|
1421
|
+
${verticalBarChartStyles}
|
|
1258
1422
|
`;
|
|
1259
1423
|
var VerticalBarChart = _react.memo.call(void 0,
|
|
1260
1424
|
function VerticalBarChart2(props) {
|
|
1261
1425
|
const { data, showSeriesLimitWarning = true } = props;
|
|
1262
|
-
const seriesLimit = _nullishCoalesce(props.seriesLimit, () => (
|
|
1426
|
+
const seriesLimit = _nullishCoalesce(props.seriesLimit, () => ( VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT));
|
|
1263
1427
|
const isSeriesLimitOverridden = props.seriesLimit !== void 0;
|
|
1264
1428
|
if (data.length === 0) {
|
|
1265
1429
|
return null;
|
|
@@ -1294,7 +1458,7 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1294
1458
|
xAnnotations,
|
|
1295
1459
|
xAxisLabelFormatter: xAxisLabelFormatter2
|
|
1296
1460
|
}) {
|
|
1297
|
-
const shouldUseTimeFormatter =
|
|
1461
|
+
const shouldUseTimeFormatter = _chunkWEKDYQ4Tjs.isHourlyTimeData.call(void 0, data) || _chunkWEKDYQ4Tjs.isCategoricalHourData.call(void 0, data);
|
|
1298
1462
|
const autoTimeXAxisLabelFormatter = ({
|
|
1299
1463
|
value,
|
|
1300
1464
|
timeFormat: timeFormat2
|
|
@@ -1326,8 +1490,8 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1326
1490
|
const numValue = typeof value === "string" ? Number(value) : value;
|
|
1327
1491
|
if (isNaN(numValue)) return "";
|
|
1328
1492
|
const date = new Date(numValue);
|
|
1329
|
-
|
|
1330
|
-
|
|
1493
|
+
const hour = date.getUTCHours();
|
|
1494
|
+
const displayHour = hour % 12 === 0 ? 12 : hour % 12;
|
|
1331
1495
|
if (hour === 0) return "<span>12</span><span>AM</span>";
|
|
1332
1496
|
if (hour === 12) return "<span>12</span><span>PM</span>";
|
|
1333
1497
|
return `<span>${displayHour}</span>`;
|
|
@@ -1347,12 +1511,12 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1347
1511
|
xAnnotations,
|
|
1348
1512
|
xAxisLabelFormatter: resolvedXAxisLabelFormatter
|
|
1349
1513
|
});
|
|
1350
|
-
const { colors
|
|
1514
|
+
const { colors } = data.reduce(
|
|
1351
1515
|
(acc, item, index) => {
|
|
1352
1516
|
acc.colors.push(
|
|
1353
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'access',
|
|
1517
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'access', _66 => _66.styles, 'optionalAccess', _67 => _67.color]), () => ( _seedsreacttheme.theme.colors.DATAVIZ_COLORS_LIST[index])), () => ( ""))
|
|
1354
1518
|
);
|
|
1355
|
-
acc.patterns.push(_nullishCoalesce(_optionalChain([item, 'access',
|
|
1519
|
+
acc.patterns.push(_nullishCoalesce(_optionalChain([item, 'access', _68 => _68.styles, 'optionalAccess', _69 => _69.pattern]), () => ( "solid")));
|
|
1356
1520
|
return acc;
|
|
1357
1521
|
},
|
|
1358
1522
|
{
|
|
@@ -1361,7 +1525,7 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1361
1525
|
}
|
|
1362
1526
|
);
|
|
1363
1527
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1364
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1528
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWEKDYQ4Tjs.GlobalChartStyleOverrides, {}),
|
|
1365
1529
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1366
1530
|
StyledBox4,
|
|
1367
1531
|
{
|
|
@@ -1377,25 +1541,25 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1377
1541
|
callback
|
|
1378
1542
|
}
|
|
1379
1543
|
),
|
|
1380
|
-
chart && _optionalChain([chart, 'access',
|
|
1544
|
+
chart && _optionalChain([chart, 'access', _70 => _70.annotations, 'optionalAccess', _71 => _71.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1381
1545
|
ChartXAnnotationMarkerPortal,
|
|
1382
1546
|
{
|
|
1383
1547
|
xAnnotations,
|
|
1384
|
-
annotationContext: _optionalChain([chart, 'access',
|
|
1548
|
+
annotationContext: _optionalChain([chart, 'access', _72 => _72.annotations, 'optionalAccess', _73 => _73[0]]),
|
|
1385
1549
|
chartContainer: chart.container
|
|
1386
1550
|
}
|
|
1387
1551
|
) : null,
|
|
1388
1552
|
chart ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1389
|
-
|
|
1553
|
+
_chunkWEKDYQ4Tjs.ChartTooltipPortal,
|
|
1390
1554
|
{
|
|
1391
1555
|
chart,
|
|
1392
1556
|
renderContent: (context) => {
|
|
1393
|
-
const tooltipData =
|
|
1557
|
+
const tooltipData = _chunkWEKDYQ4Tjs.transformTimeSeriesTooltipData.call(void 0, {
|
|
1394
1558
|
context,
|
|
1395
1559
|
data
|
|
1396
1560
|
});
|
|
1397
1561
|
const x = context.x;
|
|
1398
|
-
const xAnnotationDetails = typeof x === "number" ? _optionalChain([xAnnotations, 'optionalAccess',
|
|
1562
|
+
const xAnnotationDetails = typeof x === "number" ? _optionalChain([xAnnotations, 'optionalAccess', _74 => _74[x], 'optionalAccess', _75 => _75.details]) : void 0;
|
|
1399
1563
|
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1400
1564
|
VerticalBarChartTooltip,
|
|
1401
1565
|
{
|
|
@@ -1471,5 +1635,5 @@ var VerticalBarChartWithData = _react.memo.call(void 0,
|
|
|
1471
1635
|
|
|
1472
1636
|
|
|
1473
1637
|
|
|
1474
|
-
exports.AreaChart = AreaChart; exports.ChartLegend =
|
|
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;
|
|
1475
1639
|
//# sourceMappingURL=index.js.map
|