@sproutsocial/seeds-react-data-viz 0.7.31 → 0.14.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/bar/index.d.mts +208 -0
- package/dist/bar/index.d.ts +208 -0
- package/dist/bar/index.js +929 -0
- package/dist/bar/index.js.map +1 -0
- package/dist/chartExport-CKYpuhik.d.mts +28 -0
- package/dist/chartExport-CKYpuhik.d.ts +28 -0
- package/dist/chunk-VFBZ7FNK.js +1154 -0
- package/dist/chunk-VFBZ7FNK.js.map +1 -0
- package/dist/esm/bar/index.js +929 -0
- package/dist/esm/bar/index.js.map +1 -0
- package/dist/esm/chunk-CDBW4SOR.js +1154 -0
- package/dist/esm/chunk-CDBW4SOR.js.map +1 -0
- package/dist/esm/export/index.js +41 -0
- package/dist/esm/export/index.js.map +1 -0
- package/dist/esm/index.js +260 -1315
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pdfExportLibs-NWLZH5KL.js +10 -0
- package/dist/esm/pdfExportLibs-NWLZH5KL.js.map +1 -0
- package/dist/export/index.d.mts +25 -0
- package/dist/export/index.d.ts +25 -0
- package/dist/export/index.js +41 -0
- package/dist/export/index.js.map +1 -0
- package/dist/index.d.mts +30 -93
- package/dist/index.d.ts +30 -93
- package/dist/index.js +405 -1544
- package/dist/index.js.map +1 -1
- package/dist/pdfExportLibs-BZR2D3RA.js +10 -0
- package/dist/pdfExportLibs-BZR2D3RA.js.map +1 -0
- package/dist/types-B7ILUQ6_.d.mts +99 -0
- package/dist/types-B7ILUQ6_.d.ts +99 -0
- package/package.json +32 -11
package/dist/esm/index.js
CHANGED
|
@@ -1,398 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChartLegend,
|
|
3
|
+
ChartLegendLabel,
|
|
4
|
+
ChartLegendLabelContentWithIcon,
|
|
5
|
+
ChartTable,
|
|
6
|
+
ChartTooltip,
|
|
7
|
+
ChartTooltipFooter,
|
|
8
|
+
ChartTooltipHeader,
|
|
9
|
+
ChartTooltipPortal,
|
|
10
|
+
ChartTooltipTable,
|
|
11
|
+
ChartTooltipTitle,
|
|
12
|
+
ColorBox,
|
|
13
|
+
DONUT_CHART_HALO_SIZE,
|
|
14
|
+
DONUT_CHART_HEIGHT,
|
|
15
|
+
DONUT_CHART_WIDTH,
|
|
16
|
+
DatavizColorBox,
|
|
17
|
+
GlobalChartStyleOverrides,
|
|
18
|
+
NetworkColorBox,
|
|
19
|
+
TIME_SERIES_CHART_HEIGHT,
|
|
20
|
+
VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT,
|
|
21
|
+
areaChartOptions,
|
|
22
|
+
areaChartStyles,
|
|
23
|
+
baseChartOptions,
|
|
24
|
+
baseChartStyles,
|
|
25
|
+
columnChartOptions,
|
|
26
|
+
donutChartOptions,
|
|
27
|
+
donutChartStyles,
|
|
28
|
+
generateChartTooltipPortalId,
|
|
29
|
+
getDatavizColor,
|
|
30
|
+
getDatavizColorWithAlpha,
|
|
31
|
+
getDatavizOpacity,
|
|
32
|
+
getStorybookCategoricalData,
|
|
33
|
+
getStorybookSparseTimelineData,
|
|
34
|
+
isCategoricalHourData,
|
|
35
|
+
isHourlyTimeData,
|
|
36
|
+
lineChartOptions,
|
|
37
|
+
lineChartStyles,
|
|
38
|
+
timeSeriesChartOptions,
|
|
39
|
+
timeSeriesChartStyles,
|
|
40
|
+
transformDataToSeries,
|
|
41
|
+
transformTimeSeriesTooltipData,
|
|
42
|
+
verticalBarChartStyles,
|
|
43
|
+
xAxisLabelFormatter,
|
|
44
|
+
yAxisLabelFormatter
|
|
45
|
+
} from "./chunk-CDBW4SOR.js";
|
|
46
|
+
|
|
1
47
|
// src/components/AreaChart/AreaChart.tsx
|
|
2
|
-
import { memo as
|
|
48
|
+
import { memo as memo4 } from "react";
|
|
3
49
|
import Highcharts from "highcharts";
|
|
4
50
|
import { HighchartsReact } from "highcharts-react-official";
|
|
5
51
|
import highchartsAccessibility from "highcharts/modules/accessibility";
|
|
6
52
|
import highchartsAnnotations from "highcharts/modules/annotations";
|
|
7
|
-
import
|
|
8
|
-
import { Box as
|
|
53
|
+
import styled from "styled-components";
|
|
54
|
+
import { Box as Box2 } from "@sproutsocial/seeds-react-box";
|
|
9
55
|
|
|
10
56
|
// src/components/AreaChart/components/AreaChartLegend.tsx
|
|
11
|
-
import { memo as memo4 } from "react";
|
|
12
|
-
import { theme as theme4 } from "@sproutsocial/seeds-react-theme";
|
|
13
|
-
|
|
14
|
-
// src/components/ChartLegend/ChartLegend.tsx
|
|
15
|
-
import { memo as memo2 } from "react";
|
|
16
|
-
import { Box as Box3 } from "@sproutsocial/seeds-react-box";
|
|
17
|
-
import { theme as theme3 } from "@sproutsocial/seeds-react-theme";
|
|
18
|
-
|
|
19
|
-
// src/components/ChartLegend/components/ChartLegendLabel.tsx
|
|
20
|
-
import styled2 from "styled-components";
|
|
21
57
|
import { memo } from "react";
|
|
22
|
-
import { Box as Box2 } from "@sproutsocial/seeds-react-box";
|
|
23
|
-
import { Text } from "@sproutsocial/seeds-react-text";
|
|
24
|
-
|
|
25
|
-
// src/components/ColorBox/ColorBox.tsx
|
|
26
|
-
import { css } from "styled-components";
|
|
27
|
-
import { Box } from "@sproutsocial/seeds-react-box";
|
|
28
|
-
|
|
29
|
-
// ../seeds-react-theme-provider/dist/index.mjs
|
|
30
|
-
import "react";
|
|
31
|
-
import { ThemeProvider as BaseThemeProvider } from "styled-components";
|
|
32
58
|
import { theme } from "@sproutsocial/seeds-react-theme";
|
|
33
59
|
import { jsx } from "react/jsx-runtime";
|
|
34
|
-
|
|
35
|
-
// src/components/ColorBox/ColorBox.tsx
|
|
36
|
-
import "@sproutsocial/seeds-react-theme";
|
|
37
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
38
|
-
var ColorBox = ({
|
|
39
|
-
display = "inline-block",
|
|
40
|
-
height = "16px",
|
|
41
|
-
width = "16px",
|
|
42
|
-
minWidth = width,
|
|
43
|
-
borderRadius = "400",
|
|
44
|
-
...props
|
|
45
|
-
}) => {
|
|
46
|
-
return /* @__PURE__ */ jsx2(
|
|
47
|
-
Box,
|
|
48
|
-
{
|
|
49
|
-
...props,
|
|
50
|
-
display,
|
|
51
|
-
height,
|
|
52
|
-
width,
|
|
53
|
-
minWidth,
|
|
54
|
-
borderRadius,
|
|
55
|
-
css: css`
|
|
56
|
-
cursor: ${(props2) => props2?.onClick ? "pointer" : "default"};
|
|
57
|
-
`
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// src/components/ColorBox/DatavizColorBox.tsx
|
|
63
|
-
import styled from "styled-components";
|
|
64
|
-
import { theme as theme2 } from "@sproutsocial/seeds-react-theme";
|
|
65
|
-
var DatavizColorBox = styled(ColorBox).attrs(
|
|
66
|
-
({ colorIndex }) => ({
|
|
67
|
-
style: {
|
|
68
|
-
background: getDatavizColor(colorIndex),
|
|
69
|
-
opacity: getDatavizOpacity(colorIndex)
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
)``;
|
|
73
|
-
var getDatavizColor = (colorIndex) => theme2.colors.DATAVIZ_COLORS_LIST[colorIndex % theme2.colors.DATAVIZ_COLORS_LIST.length] || "";
|
|
74
|
-
var getDatavizOpacity = (colorIndex) => {
|
|
75
|
-
const opacitySteps = [1, 0.6, 0.4, 0.2];
|
|
76
|
-
const opacityStep = Math.floor(colorIndex / theme2.colors.DATAVIZ_COLORS_LIST.length) % opacitySteps.length;
|
|
77
|
-
return opacitySteps[opacityStep];
|
|
78
|
-
};
|
|
79
|
-
var getDatavizColorWithAlpha = (colorIndex) => {
|
|
80
|
-
const color = getDatavizColor(colorIndex);
|
|
81
|
-
const opacity = getDatavizOpacity(colorIndex);
|
|
82
|
-
if (opacity < 0 || opacity > 1) {
|
|
83
|
-
return color;
|
|
84
|
-
}
|
|
85
|
-
return `${color}${Math.floor(opacity * 255).toString(16).padStart(2, "0")}`;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// src/components/ColorBox/NetworkColorBox.tsx
|
|
89
|
-
import NETWORK_COLORS from "@sproutsocial/seeds-networkcolor";
|
|
90
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
91
|
-
var NetworkColorBox = ({
|
|
92
|
-
networkColor,
|
|
93
|
-
...props
|
|
94
|
-
}) => {
|
|
95
|
-
return /* @__PURE__ */ jsx3(ColorBox, { ...props, bg: NETWORK_COLORS[networkColor] });
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// src/components/ChartLegend/components/ChartLegendLabel.tsx
|
|
99
|
-
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
100
|
-
var StyledBox = styled2(Box2)`
|
|
101
|
-
list-style: none;
|
|
102
|
-
display: flex;
|
|
103
|
-
align-items: center;
|
|
104
|
-
gap: ${({ theme: theme16 }) => theme16.space[300]};
|
|
105
|
-
`;
|
|
106
|
-
var ChartLegendLabel = memo(
|
|
107
|
-
function ChartLegendLabel2({
|
|
108
|
-
children,
|
|
109
|
-
color = "#CCC",
|
|
110
|
-
containerBoxProps = {}
|
|
111
|
-
}) {
|
|
112
|
-
return /* @__PURE__ */ jsxs(StyledBox, { ...containerBoxProps, children: [
|
|
113
|
-
/* @__PURE__ */ jsx4(ColorBox, { bg: color }),
|
|
114
|
-
/* @__PURE__ */ jsx4(Text, { as: "div", fontSize: 200, color: "text.subtext", children })
|
|
115
|
-
] });
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
// src/components/ChartLegend/ChartLegend.tsx
|
|
120
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
121
|
-
var ChartLegend = memo2(function ChartLegend2({
|
|
122
|
-
legendLabels,
|
|
123
|
-
containerBoxProps = {},
|
|
124
|
-
stacked = false
|
|
125
|
-
}) {
|
|
126
|
-
return /* @__PURE__ */ jsx5(
|
|
127
|
-
Box3,
|
|
128
|
-
{
|
|
129
|
-
as: "ul",
|
|
130
|
-
"aria-hidden": "true",
|
|
131
|
-
display: "flex",
|
|
132
|
-
justifyContent: "center",
|
|
133
|
-
flexDirection: stacked ? "column" : "row",
|
|
134
|
-
flexWrap: "wrap",
|
|
135
|
-
columnGap: 450,
|
|
136
|
-
rowGap: 200,
|
|
137
|
-
m: 0,
|
|
138
|
-
p: 0,
|
|
139
|
-
...containerBoxProps,
|
|
140
|
-
children: legendLabels.map(({ color, content }, index) => /* @__PURE__ */ jsx5(
|
|
141
|
-
ChartLegendLabel,
|
|
142
|
-
{
|
|
143
|
-
color: color || theme3.colors.DATAVIZ_COLORS_LIST[index],
|
|
144
|
-
containerBoxProps: { as: "li" },
|
|
145
|
-
children: content
|
|
146
|
-
},
|
|
147
|
-
`chart-legend-label-${index}`
|
|
148
|
-
))
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
// src/components/ChartLegend/components/ChartLegendLabelContentWithIcon.tsx
|
|
154
|
-
import { memo as memo3 } from "react";
|
|
155
|
-
import { Box as Box4 } from "@sproutsocial/seeds-react-box";
|
|
156
|
-
import { jsxs as jsxs2 } from "react/jsx-runtime";
|
|
157
|
-
var ChartLegendLabelContentWithIcon = memo3(
|
|
158
|
-
function ChartLegendLabelContentWithIcon2({
|
|
159
|
-
children,
|
|
160
|
-
icon
|
|
161
|
-
}) {
|
|
162
|
-
return icon ? /* @__PURE__ */ jsxs2(Box4, { display: "flex", alignItems: "center", gap: 200, children: [
|
|
163
|
-
icon,
|
|
164
|
-
children
|
|
165
|
-
] }) : children;
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
// src/components/AreaChart/components/AreaChartLegend.tsx
|
|
170
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
171
60
|
var getAreaChartLegendLabels = ({
|
|
172
61
|
data
|
|
173
62
|
}) => {
|
|
174
63
|
return data.map((series, index) => ({
|
|
175
|
-
content: /* @__PURE__ */
|
|
176
|
-
color: series.styles?.color ||
|
|
64
|
+
content: /* @__PURE__ */ jsx(ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
65
|
+
color: series.styles?.color || theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
177
66
|
}));
|
|
178
67
|
};
|
|
179
|
-
var AreaChartLegend =
|
|
68
|
+
var AreaChartLegend = memo(
|
|
180
69
|
function AreaChartLegend2({ data }) {
|
|
181
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ jsx(ChartLegend, { legendLabels: getAreaChartLegendLabels({ data }) });
|
|
182
71
|
}
|
|
183
72
|
);
|
|
184
73
|
|
|
185
74
|
// src/components/AreaChart/components/AreaChartTooltip.tsx
|
|
186
|
-
import { memo as
|
|
187
|
-
import { Box
|
|
75
|
+
import { memo as memo2 } from "react";
|
|
76
|
+
import { Box } from "@sproutsocial/seeds-react-box";
|
|
188
77
|
import { Duration } from "@sproutsocial/seeds-react-duration";
|
|
189
78
|
import { Icon } from "@sproutsocial/seeds-react-icon";
|
|
190
79
|
import { Numeral } from "@sproutsocial/seeds-react-numeral";
|
|
191
|
-
import { Text
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
import { memo as memo5 } from "react";
|
|
195
|
-
import styled3 from "styled-components";
|
|
196
|
-
import { Box as Box5 } from "@sproutsocial/seeds-react-box";
|
|
197
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
198
|
-
var StyledBox2 = styled3(Box5)`
|
|
199
|
-
.Icon,
|
|
200
|
-
.logo {
|
|
201
|
-
stroke: none;
|
|
202
|
-
}
|
|
203
|
-
`;
|
|
204
|
-
var ChartTooltip = memo5(function ChartTooltip2({
|
|
205
|
-
children
|
|
206
|
-
}) {
|
|
207
|
-
return /* @__PURE__ */ jsx7(
|
|
208
|
-
StyledBox2,
|
|
209
|
-
{
|
|
210
|
-
bg: "container.background.base",
|
|
211
|
-
boxShadow: "medium",
|
|
212
|
-
border: 500,
|
|
213
|
-
borderColor: "container.border.base",
|
|
214
|
-
borderRadius: 500,
|
|
215
|
-
p: 400,
|
|
216
|
-
minWidth: 285,
|
|
217
|
-
children: /* @__PURE__ */ jsx7(Box5, { display: "flex", flexDirection: "column", gap: 350, children })
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
// src/components/ChartTooltip/components/ChartTooltipFooter.tsx
|
|
223
|
-
import { memo as memo6 } from "react";
|
|
224
|
-
import { Box as Box6 } from "@sproutsocial/seeds-react-box";
|
|
225
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
226
|
-
var ChartTooltipFooter = memo6(
|
|
227
|
-
function ChartTooltipFooter2({ children }) {
|
|
228
|
-
return /* @__PURE__ */ jsx8(
|
|
229
|
-
Box6,
|
|
230
|
-
{
|
|
231
|
-
borderTop: 500,
|
|
232
|
-
borderColor: "container.border.base",
|
|
233
|
-
mx: -400,
|
|
234
|
-
mb: -200,
|
|
235
|
-
px: 400,
|
|
236
|
-
pt: 350,
|
|
237
|
-
children
|
|
238
|
-
}
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
);
|
|
242
|
-
|
|
243
|
-
// src/components/ChartTooltip/components/ChartTooltipHeader.tsx
|
|
244
|
-
import { memo as memo7 } from "react";
|
|
245
|
-
import { Box as Box7 } from "@sproutsocial/seeds-react-box";
|
|
246
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
247
|
-
var ChartTooltipHeader = memo7(
|
|
248
|
-
function ChartTooltipHeader2({ children }) {
|
|
249
|
-
return /* @__PURE__ */ jsx9(
|
|
250
|
-
Box7,
|
|
251
|
-
{
|
|
252
|
-
borderBottom: 500,
|
|
253
|
-
borderColor: "container.border.base",
|
|
254
|
-
mx: -400,
|
|
255
|
-
mt: -200,
|
|
256
|
-
px: 400,
|
|
257
|
-
pb: 350,
|
|
258
|
-
children
|
|
259
|
-
}
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
);
|
|
263
|
-
|
|
264
|
-
// src/components/ChartTooltip/components/ChartTooltipPortal.tsx
|
|
265
|
-
import { memo as memo8, useState, useRef, useEffect } from "react";
|
|
266
|
-
import { createPortal } from "react-dom";
|
|
267
|
-
var generateChartTooltipPortalId = (chartId) => `highcharts-custom-tooltip-${chartId}`;
|
|
268
|
-
var ChartTooltipPortal = memo8(
|
|
269
|
-
function ChartTooltipPortal2({
|
|
270
|
-
chart,
|
|
271
|
-
renderContent
|
|
272
|
-
}) {
|
|
273
|
-
const isInitialized = useRef(false);
|
|
274
|
-
const [node, setNode] = useState(null);
|
|
275
|
-
const [context, setContext] = useState(null);
|
|
276
|
-
useEffect(() => {
|
|
277
|
-
const formatter = function() {
|
|
278
|
-
if (!isInitialized.current) {
|
|
279
|
-
isInitialized.current = true;
|
|
280
|
-
chart.tooltip.refresh.apply(chart.tooltip, [this.point]);
|
|
281
|
-
chart.tooltip.hide(0);
|
|
282
|
-
}
|
|
283
|
-
setContext(this);
|
|
284
|
-
return `<div id="${generateChartTooltipPortalId(
|
|
285
|
-
chart.index
|
|
286
|
-
)}" role='tooltip'></div>`;
|
|
287
|
-
};
|
|
288
|
-
chart.update({ tooltip: { formatter } });
|
|
289
|
-
}, [chart]);
|
|
290
|
-
useEffect(() => {
|
|
291
|
-
if (context?.series?.chart?.tooltip) {
|
|
292
|
-
const tooltip = context.series.chart.tooltip;
|
|
293
|
-
const textElement = tooltip.label.text.element;
|
|
294
|
-
tooltip.label.box.attr({
|
|
295
|
-
height: textElement.offsetHeight,
|
|
296
|
-
width: textElement.offsetWidth
|
|
297
|
-
});
|
|
298
|
-
setNode(
|
|
299
|
-
document.getElementById(generateChartTooltipPortalId(chart.index))
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
}, [context, chart.index]);
|
|
303
|
-
return node && context ? createPortal(renderContent(context), node) : null;
|
|
304
|
-
}
|
|
305
|
-
);
|
|
306
|
-
|
|
307
|
-
// src/components/ChartTooltip/components/ChartTooltipTable.tsx
|
|
308
|
-
import { memo as memo10 } from "react";
|
|
309
|
-
|
|
310
|
-
// src/components/ChartTable/ChartTable.tsx
|
|
311
|
-
import { memo as memo9 } from "react";
|
|
312
|
-
import styled4 from "styled-components";
|
|
313
|
-
import { Text as Text2 } from "@sproutsocial/seeds-react-text";
|
|
314
|
-
import { Table as SeedsTable } from "@sproutsocial/seeds-react-table";
|
|
315
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
316
|
-
var StyledSeedsTable = styled4(SeedsTable)`
|
|
317
|
-
tbody tr:last-child {
|
|
318
|
-
border-bottom: none;
|
|
319
|
-
}
|
|
320
|
-
tr:last-child td,
|
|
321
|
-
tr:last-child th {
|
|
322
|
-
padding-bottom: 0;
|
|
323
|
-
}
|
|
324
|
-
tr:first-child td,
|
|
325
|
-
tr:first-child th {
|
|
326
|
-
padding-top: 0;
|
|
327
|
-
}
|
|
328
|
-
tr th {
|
|
329
|
-
padding-left: 0;
|
|
330
|
-
}
|
|
331
|
-
tr td:last-child {
|
|
332
|
-
padding-right: 0;
|
|
333
|
-
}
|
|
334
|
-
`;
|
|
335
|
-
var StyledSeedsTableRow = styled4(SeedsTable.TableRow)`
|
|
336
|
-
${({ $isAppendedRow, theme: theme16 }) => $isAppendedRow ? `border-top: 2px solid ${theme16.colors.container.border.base}` : ""}
|
|
337
|
-
`;
|
|
338
|
-
var ChartTable = memo9(function ChartTable2({
|
|
339
|
-
rows
|
|
340
|
-
}) {
|
|
341
|
-
if (!rows || rows.length === 0) {
|
|
342
|
-
return null;
|
|
343
|
-
}
|
|
344
|
-
return /* @__PURE__ */ jsx10(StyledSeedsTable, { children: /* @__PURE__ */ jsx10(SeedsTable.TableBody, { children: rows.map(({ cells, isAppendedRow }, rowIndex) => {
|
|
345
|
-
if (!cells || cells.length === 0) {
|
|
346
|
-
return null;
|
|
347
|
-
}
|
|
348
|
-
return /* @__PURE__ */ jsx10(
|
|
349
|
-
StyledSeedsTableRow,
|
|
350
|
-
{
|
|
351
|
-
$isAppendedRow: isAppendedRow,
|
|
352
|
-
children: cells.map(
|
|
353
|
-
({ content, align = "left", colSpan = 1 }, cellIndex) => {
|
|
354
|
-
const uniqueIdentifier = `chart-tooltip-table-cell-${cellIndex}`;
|
|
355
|
-
return /* @__PURE__ */ jsx10(
|
|
356
|
-
SeedsTable.Cell,
|
|
357
|
-
{
|
|
358
|
-
id: uniqueIdentifier,
|
|
359
|
-
scope: cellIndex === 0 ? "row" : void 0,
|
|
360
|
-
align,
|
|
361
|
-
colSpan,
|
|
362
|
-
py: 200,
|
|
363
|
-
children: /* @__PURE__ */ jsx10(Text2.SmallBodyCopy, { as: "div", children: content })
|
|
364
|
-
},
|
|
365
|
-
uniqueIdentifier
|
|
366
|
-
);
|
|
367
|
-
}
|
|
368
|
-
)
|
|
369
|
-
},
|
|
370
|
-
`chart-tooltip-table-row-${rowIndex}`
|
|
371
|
-
);
|
|
372
|
-
}) }) });
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
// src/components/ChartTooltip/components/ChartTooltipTable.tsx
|
|
376
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
377
|
-
var ChartTooltipTable = memo10(
|
|
378
|
-
function ChartTooltipTable2({ rows }) {
|
|
379
|
-
return /* @__PURE__ */ jsx11(ChartTable, { rows });
|
|
380
|
-
}
|
|
381
|
-
);
|
|
382
|
-
|
|
383
|
-
// src/components/ChartTooltip/components/ChartTooltipTitle.tsx
|
|
384
|
-
import { memo as memo11 } from "react";
|
|
385
|
-
import { Text as Text3 } from "@sproutsocial/seeds-react-text";
|
|
386
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
387
|
-
var ChartTooltipTitle = memo11(
|
|
388
|
-
function ChartTooltipTitle2({ children }) {
|
|
389
|
-
return /* @__PURE__ */ jsx12(Text3.SmallSubHeadline, { as: "p", children });
|
|
390
|
-
}
|
|
391
|
-
);
|
|
392
|
-
|
|
393
|
-
// src/components/AreaChart/components/AreaChartTooltip.tsx
|
|
394
|
-
import { jsx as jsx13, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
395
|
-
var AreaChartTooltip = memo12(
|
|
80
|
+
import { Text } from "@sproutsocial/seeds-react-text";
|
|
81
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
82
|
+
var AreaChartTooltip = memo2(
|
|
396
83
|
function AreaChartTooltip2({
|
|
397
84
|
data,
|
|
398
85
|
invalidNumberLabel,
|
|
@@ -413,10 +100,10 @@ var AreaChartTooltip = memo12(
|
|
|
413
100
|
return {
|
|
414
101
|
cells: [
|
|
415
102
|
{
|
|
416
|
-
content: /* @__PURE__ */
|
|
103
|
+
content: /* @__PURE__ */ jsx2(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx2(ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ jsx2(Text, { "aria-label": `${name}: `, children: name }) }) })
|
|
417
104
|
},
|
|
418
105
|
{
|
|
419
|
-
content: value === null && invalidNumberLabel ? /* @__PURE__ */
|
|
106
|
+
content: value === null && invalidNumberLabel ? /* @__PURE__ */ jsx2(Text, { children: invalidNumberLabel }) : numberFormat === "duration" ? /* @__PURE__ */ jsx2(Duration, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx2(
|
|
420
107
|
Numeral,
|
|
421
108
|
{
|
|
422
109
|
abbreviate: false,
|
|
@@ -435,8 +122,8 @@ var AreaChartTooltip = memo12(
|
|
|
435
122
|
{
|
|
436
123
|
cells: [
|
|
437
124
|
{
|
|
438
|
-
content: /* @__PURE__ */
|
|
439
|
-
|
|
125
|
+
content: /* @__PURE__ */ jsx2(
|
|
126
|
+
Text,
|
|
440
127
|
{
|
|
441
128
|
fontWeight: "semibold",
|
|
442
129
|
"aria-label": `${tooltipTotalLabel}: `,
|
|
@@ -445,7 +132,7 @@ var AreaChartTooltip = memo12(
|
|
|
445
132
|
)
|
|
446
133
|
},
|
|
447
134
|
{
|
|
448
|
-
content: /* @__PURE__ */
|
|
135
|
+
content: /* @__PURE__ */ jsx2(Text, { fontWeight: "bold", children: total === null && invalidNumberLabel ? invalidNumberLabel : numberFormat === "duration" ? /* @__PURE__ */ jsx2(Duration, { locale: textLocale, milliseconds: total }) : /* @__PURE__ */ jsx2(
|
|
449
136
|
Numeral,
|
|
450
137
|
{
|
|
451
138
|
abbreviate: false,
|
|
@@ -461,40 +148,41 @@ var AreaChartTooltip = memo12(
|
|
|
461
148
|
isAppendedRow: true
|
|
462
149
|
}
|
|
463
150
|
] : [];
|
|
464
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ jsxs(ChartTooltip, { children: [
|
|
465
152
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ jsx2(ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
154
|
+
/* @__PURE__ */ jsx2(
|
|
468
155
|
ChartTooltipTable,
|
|
469
156
|
{
|
|
470
157
|
rows: [...rows, ...appendedRows]
|
|
471
158
|
}
|
|
472
159
|
),
|
|
473
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
160
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ jsx2(ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
161
|
+
/* @__PURE__ */ jsx2(Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
162
|
+
/* @__PURE__ */ jsx2(Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
476
163
|
] }) : tooltipClickLabel }) : null
|
|
477
164
|
] });
|
|
478
165
|
}
|
|
479
166
|
);
|
|
480
167
|
|
|
481
168
|
// src/components/ChartXAnnotationMarker/components/ChartXAnnotationMarkerPortal.tsx
|
|
482
|
-
import { memo as
|
|
483
|
-
import { createPortal
|
|
169
|
+
import { memo as memo3, useEffect, useState, useRef } from "react";
|
|
170
|
+
import { createPortal } from "react-dom";
|
|
484
171
|
import "highcharts";
|
|
485
|
-
import { Fragment, jsx as
|
|
486
|
-
var ChartXAnnotationMarkerPortal =
|
|
172
|
+
import { Fragment, jsx as jsx3 } from "react/jsx-runtime";
|
|
173
|
+
var ChartXAnnotationMarkerPortal = memo3(
|
|
487
174
|
function ChartXAnnotationMarkerPortal2({
|
|
488
175
|
xAnnotations,
|
|
489
|
-
annotationContext
|
|
176
|
+
annotationContext,
|
|
177
|
+
chartContainer
|
|
490
178
|
}) {
|
|
491
|
-
const annotationContainers =
|
|
492
|
-
const [renderCount, setRenderCount] =
|
|
179
|
+
const annotationContainers = useRef({});
|
|
180
|
+
const [renderCount, setRenderCount] = useState(0);
|
|
493
181
|
const forceRender = () => setRenderCount((prev) => prev + 1);
|
|
494
|
-
|
|
182
|
+
useEffect(() => {
|
|
495
183
|
if (annotationContext.labels) {
|
|
496
184
|
const newContainers = {};
|
|
497
|
-
const existingAnnotationContainers =
|
|
185
|
+
const existingAnnotationContainers = chartContainer.querySelectorAll(
|
|
498
186
|
"div[data-annotation-marker='true']"
|
|
499
187
|
);
|
|
500
188
|
existingAnnotationContainers.forEach(
|
|
@@ -514,7 +202,7 @@ var ChartXAnnotationMarkerPortal = memo13(
|
|
|
514
202
|
annotationContainers.current = newContainers;
|
|
515
203
|
forceRender();
|
|
516
204
|
requestAnimationFrame(() => {
|
|
517
|
-
|
|
205
|
+
chartContainer.querySelectorAll("div.highcharts-annotation").forEach((annotationDiv) => {
|
|
518
206
|
const reactAnnotations = annotationDiv.querySelectorAll(
|
|
519
207
|
"div[data-annotation-marker]"
|
|
520
208
|
);
|
|
@@ -527,569 +215,18 @@ var ChartXAnnotationMarkerPortal = memo13(
|
|
|
527
215
|
});
|
|
528
216
|
});
|
|
529
217
|
}
|
|
530
|
-
}, [annotationContext.labels, xAnnotations]);
|
|
531
|
-
return /* @__PURE__ */
|
|
218
|
+
}, [annotationContext.labels, xAnnotations, chartContainer]);
|
|
219
|
+
return /* @__PURE__ */ jsx3(Fragment, { children: Object.entries(annotationContainers.current).map(
|
|
532
220
|
([xValue, container]) => {
|
|
533
221
|
const annotationComponent = xAnnotations?.[Number(xValue)]?.marker;
|
|
534
|
-
return annotationComponent ?
|
|
222
|
+
return annotationComponent ? createPortal(annotationComponent(), container) : null;
|
|
535
223
|
}
|
|
536
224
|
) });
|
|
537
225
|
}
|
|
538
226
|
);
|
|
539
227
|
|
|
540
|
-
// src/helpers/transformDataToSeries.ts
|
|
541
|
-
var transformDataToSeries = ({
|
|
542
|
-
data
|
|
543
|
-
}, type) => {
|
|
544
|
-
const hasCategoricalData = data.some(
|
|
545
|
-
(series) => series.points.some((point) => typeof point.x === "string")
|
|
546
|
-
);
|
|
547
|
-
return data.map((dataItem, dataIndex) => {
|
|
548
|
-
const points = dataItem.points || [];
|
|
549
|
-
const dataPoints = points.map((point, pointsIndex) => {
|
|
550
|
-
let enableMarker = false;
|
|
551
|
-
const isFirstPoint = pointsIndex === 0;
|
|
552
|
-
const isLastPoint = pointsIndex === points.length - 1;
|
|
553
|
-
const previousY = isFirstPoint ? null : points[pointsIndex - 1].y;
|
|
554
|
-
const nextY = isLastPoint ? null : points[pointsIndex + 1].y;
|
|
555
|
-
if (isFirstPoint && nextY === null) {
|
|
556
|
-
enableMarker = true;
|
|
557
|
-
} else if (isLastPoint && previousY === null) {
|
|
558
|
-
enableMarker = true;
|
|
559
|
-
} else if (previousY === null && nextY === null) {
|
|
560
|
-
enableMarker = true;
|
|
561
|
-
}
|
|
562
|
-
return {
|
|
563
|
-
x: hasCategoricalData ? pointsIndex : point.x,
|
|
564
|
-
y: point.y,
|
|
565
|
-
marker: {
|
|
566
|
-
enabled: enableMarker ? enableMarker : void 0,
|
|
567
|
-
symbol: enableMarker ? "circle" : void 0
|
|
568
|
-
},
|
|
569
|
-
// For categorical data, store the original category name
|
|
570
|
-
...hasCategoricalData && { name: point.x }
|
|
571
|
-
};
|
|
572
|
-
});
|
|
573
|
-
return {
|
|
574
|
-
colorIndex: dataIndex,
|
|
575
|
-
data: dataPoints,
|
|
576
|
-
name: dataItem.name,
|
|
577
|
-
type
|
|
578
|
-
};
|
|
579
|
-
});
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
// src/helpers/transformTimeSeriesTooltipData.ts
|
|
583
|
-
import { theme as theme5 } from "@sproutsocial/seeds-react-theme";
|
|
584
|
-
var transformTimeSeriesTooltipData = ({
|
|
585
|
-
context,
|
|
586
|
-
data
|
|
587
|
-
}) => {
|
|
588
|
-
return (context.series.chart.series || []).map((series, index) => {
|
|
589
|
-
const pointIndex = context.point.index;
|
|
590
|
-
const y = series?.points?.[pointIndex]?.y;
|
|
591
|
-
return {
|
|
592
|
-
color: data[index]?.styles?.color || theme5.colors.DATAVIZ_COLORS_LIST[index],
|
|
593
|
-
...data[index]?.icon ? { icon: data[index]?.icon } : {},
|
|
594
|
-
name: series.name,
|
|
595
|
-
value: typeof y === "number" ? y : null
|
|
596
|
-
};
|
|
597
|
-
});
|
|
598
|
-
};
|
|
599
|
-
|
|
600
|
-
// src/helpers/yAxisLabelFormatter.ts
|
|
601
|
-
import { formatDuration } from "@sproutsocial/seeds-react-duration";
|
|
602
|
-
import { formatNumeral } from "@sproutsocial/seeds-react-numeral";
|
|
603
|
-
var yAxisLabelFormatter = ({
|
|
604
|
-
numberLocale,
|
|
605
|
-
textLocale,
|
|
606
|
-
tickPositions,
|
|
607
|
-
value,
|
|
608
|
-
currency = "USD",
|
|
609
|
-
numberFormat = "decimal"
|
|
610
|
-
}) => {
|
|
611
|
-
const numberValue = Number(value);
|
|
612
|
-
if (numberValue === 0) {
|
|
613
|
-
return formatNumeral({
|
|
614
|
-
locale: numberLocale,
|
|
615
|
-
number: numberValue
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
if (numberFormat === "duration") {
|
|
619
|
-
return formatDuration({
|
|
620
|
-
display: "narrow",
|
|
621
|
-
locale: textLocale,
|
|
622
|
-
milliseconds: numberValue
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
const maxValue = tickPositions && tickPositions.length > 0 ? tickPositions[tickPositions.length - 1] : void 0;
|
|
626
|
-
const abbreviate = typeof maxValue === "number" && maxValue > 9999 ? 1e3 : true;
|
|
627
|
-
return formatNumeral({
|
|
628
|
-
abbreviate,
|
|
629
|
-
currency,
|
|
630
|
-
format: numberFormat,
|
|
631
|
-
locale: numberLocale,
|
|
632
|
-
number: numberValue
|
|
633
|
-
});
|
|
634
|
-
};
|
|
635
|
-
|
|
636
|
-
// src/helpers/xAxisLabelFormatter.ts
|
|
637
|
-
var getDatePartsInTimezone = (date, timezone) => {
|
|
638
|
-
const formatter = new Intl.DateTimeFormat("en-US", {
|
|
639
|
-
year: "numeric",
|
|
640
|
-
month: "numeric",
|
|
641
|
-
day: "numeric",
|
|
642
|
-
timeZone: timezone
|
|
643
|
-
});
|
|
644
|
-
const parts = formatter.formatToParts(date);
|
|
645
|
-
return {
|
|
646
|
-
day: parseInt(parts.find((p) => p.type === "day")?.value ?? "0", 10),
|
|
647
|
-
month: parseInt(parts.find((p) => p.type === "month")?.value ?? "0", 10),
|
|
648
|
-
year: parseInt(parts.find((p) => p.type === "year")?.value ?? "0", 10)
|
|
649
|
-
};
|
|
650
|
-
};
|
|
651
|
-
var xAxisLabelFormatter = ({
|
|
652
|
-
textLocale,
|
|
653
|
-
tickPositions = [],
|
|
654
|
-
unitName,
|
|
655
|
-
value,
|
|
656
|
-
// optional
|
|
657
|
-
timeFormat = "12",
|
|
658
|
-
timezone = "UTC"
|
|
659
|
-
}) => {
|
|
660
|
-
if (typeof value === "string") {
|
|
661
|
-
return `<span>${value}</span>`;
|
|
662
|
-
}
|
|
663
|
-
const tickIndex = tickPositions.indexOf(value);
|
|
664
|
-
const isFirst = tickIndex === 0;
|
|
665
|
-
const previousValue = tickPositions[tickIndex - 1];
|
|
666
|
-
const valueDate = new Date(value);
|
|
667
|
-
const valueParts = getDatePartsInTimezone(valueDate, timezone);
|
|
668
|
-
const previousValueDate = previousValue ? new Date(previousValue) : void 0;
|
|
669
|
-
const previousValueParts = previousValueDate ? getDatePartsInTimezone(previousValueDate, timezone) : void 0;
|
|
670
|
-
let firstPartOptions = {};
|
|
671
|
-
let secondPartOptions = {};
|
|
672
|
-
switch (unitName) {
|
|
673
|
-
case "hour":
|
|
674
|
-
firstPartOptions = timeFormat === "24" ? { hour: "numeric", minute: "numeric", hour12: false } : { hour: "numeric" };
|
|
675
|
-
if (isFirst || valueParts.day !== previousValueParts?.day) {
|
|
676
|
-
secondPartOptions = { day: "numeric", month: "short" };
|
|
677
|
-
}
|
|
678
|
-
break;
|
|
679
|
-
case "day":
|
|
680
|
-
case "week":
|
|
681
|
-
firstPartOptions = { day: "numeric" };
|
|
682
|
-
if (isFirst || valueParts.month !== previousValueParts?.month) {
|
|
683
|
-
secondPartOptions = { month: "short" };
|
|
684
|
-
}
|
|
685
|
-
break;
|
|
686
|
-
case "month":
|
|
687
|
-
firstPartOptions = { month: "short" };
|
|
688
|
-
if (isFirst || valueParts.year !== previousValueParts?.year) {
|
|
689
|
-
secondPartOptions = { year: "numeric" };
|
|
690
|
-
}
|
|
691
|
-
break;
|
|
692
|
-
case "year":
|
|
693
|
-
firstPartOptions = { year: "numeric" };
|
|
694
|
-
break;
|
|
695
|
-
default:
|
|
696
|
-
firstPartOptions = {};
|
|
697
|
-
break;
|
|
698
|
-
}
|
|
699
|
-
const firstPart = new Intl.DateTimeFormat(textLocale, {
|
|
700
|
-
...firstPartOptions,
|
|
701
|
-
timeZone: timezone
|
|
702
|
-
}).format(valueDate);
|
|
703
|
-
const secondPart = Object.keys(secondPartOptions).length > 0 ? new Intl.DateTimeFormat(textLocale, {
|
|
704
|
-
...secondPartOptions,
|
|
705
|
-
timeZone: timezone
|
|
706
|
-
}).format(valueDate) : void 0;
|
|
707
|
-
return `<span>${firstPart}</span>${secondPart ? `<span>${secondPart}</span>` : ""}`;
|
|
708
|
-
};
|
|
709
|
-
|
|
710
|
-
// src/helpers/isHourlyTimeData.ts
|
|
711
|
-
function isHourlyTimeData(data) {
|
|
712
|
-
if (!data.length) return false;
|
|
713
|
-
const xVals = data.flatMap((series) => series.points.map((p) => p.x));
|
|
714
|
-
if (!xVals.length) return false;
|
|
715
|
-
if (xVals.some((x) => typeof x === "string")) return false;
|
|
716
|
-
const dates = xVals.map((x) => {
|
|
717
|
-
const d = new Date(x);
|
|
718
|
-
return `${d.getUTCFullYear()}-${d.getUTCMonth()}-${d.getUTCDate()}`;
|
|
719
|
-
});
|
|
720
|
-
const uniqueDates = new Set(dates);
|
|
721
|
-
if (uniqueDates.size !== 1) return false;
|
|
722
|
-
return xVals.every((x) => {
|
|
723
|
-
const d = new Date(x);
|
|
724
|
-
const hour = d.getUTCHours();
|
|
725
|
-
const minutes = d.getUTCMinutes();
|
|
726
|
-
const seconds = d.getUTCSeconds();
|
|
727
|
-
return hour >= 0 && hour <= 23 && minutes === 0 && seconds === 0;
|
|
728
|
-
});
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
// src/helpers/isCategoricalHourData.ts
|
|
732
|
-
function isCategoricalHourData(data) {
|
|
733
|
-
if (!data.length) return false;
|
|
734
|
-
const xVals = data.flatMap((series) => series.points.map((p) => p.x));
|
|
735
|
-
if (!xVals.length) return false;
|
|
736
|
-
if (xVals.some((x) => typeof x !== "string")) return false;
|
|
737
|
-
const hour12Pattern = /^\d{1,2} (AM|PM)$/;
|
|
738
|
-
const hour24Pattern = /^([01]?\d|2[0-3]):([0-5]\d)$/;
|
|
739
|
-
const stringValues = xVals;
|
|
740
|
-
const allMatch12Hour = stringValues.every((x) => hour12Pattern.test(x));
|
|
741
|
-
const allMatch24Hour = stringValues.every((x) => hour24Pattern.test(x));
|
|
742
|
-
return allMatch12Hour || allMatch24Hour;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
// src/helpers/getStorybookRandomColor.ts
|
|
746
|
-
var getStorybookRandomColor = () => {
|
|
747
|
-
const letters = "0123456789ABCDEF";
|
|
748
|
-
let color = "#";
|
|
749
|
-
for (let i = 0; i < 6; i++) {
|
|
750
|
-
color += letters[Math.floor(Math.random() * 16)];
|
|
751
|
-
}
|
|
752
|
-
return color;
|
|
753
|
-
};
|
|
754
|
-
|
|
755
|
-
// src/helpers/getStorybookCategoricalData.ts
|
|
756
|
-
var getStorybookCategoricalData = ({
|
|
757
|
-
showNulls,
|
|
758
|
-
showNegativeValues,
|
|
759
|
-
numberOfSeries,
|
|
760
|
-
yAxisMax,
|
|
761
|
-
showCustomColors,
|
|
762
|
-
showDashedLines,
|
|
763
|
-
categoryType
|
|
764
|
-
}) => {
|
|
765
|
-
const categoryOptions = {
|
|
766
|
-
hours: [
|
|
767
|
-
"12 AM",
|
|
768
|
-
"1 AM",
|
|
769
|
-
"2 AM",
|
|
770
|
-
"3 AM",
|
|
771
|
-
"4 AM",
|
|
772
|
-
"5 AM",
|
|
773
|
-
"6 AM",
|
|
774
|
-
"7 AM",
|
|
775
|
-
"8 AM",
|
|
776
|
-
"9 AM",
|
|
777
|
-
"10 AM",
|
|
778
|
-
"11 AM",
|
|
779
|
-
"12 PM",
|
|
780
|
-
"1 PM",
|
|
781
|
-
"2 PM",
|
|
782
|
-
"3 PM",
|
|
783
|
-
"4 PM",
|
|
784
|
-
"5 PM",
|
|
785
|
-
"6 PM",
|
|
786
|
-
"7 PM",
|
|
787
|
-
"8 PM",
|
|
788
|
-
"9 PM",
|
|
789
|
-
"10 PM",
|
|
790
|
-
"11 PM"
|
|
791
|
-
],
|
|
792
|
-
hours24: [
|
|
793
|
-
"00:00",
|
|
794
|
-
"01:00",
|
|
795
|
-
"02:00",
|
|
796
|
-
"03:00",
|
|
797
|
-
"04:00",
|
|
798
|
-
"05:00",
|
|
799
|
-
"06:00",
|
|
800
|
-
"07:00",
|
|
801
|
-
"08:00",
|
|
802
|
-
"09:00",
|
|
803
|
-
"10:00",
|
|
804
|
-
"11:00",
|
|
805
|
-
"12:00",
|
|
806
|
-
"13:00",
|
|
807
|
-
"14:00",
|
|
808
|
-
"15:00",
|
|
809
|
-
"16:00",
|
|
810
|
-
"17:00",
|
|
811
|
-
"18:00",
|
|
812
|
-
"19:00",
|
|
813
|
-
"20:00",
|
|
814
|
-
"21:00",
|
|
815
|
-
"22:00",
|
|
816
|
-
"23:00"
|
|
817
|
-
],
|
|
818
|
-
days: [
|
|
819
|
-
"Monday",
|
|
820
|
-
"Tuesday",
|
|
821
|
-
"Wednesday",
|
|
822
|
-
"Thursday",
|
|
823
|
-
"Friday",
|
|
824
|
-
"Saturday",
|
|
825
|
-
"Sunday"
|
|
826
|
-
],
|
|
827
|
-
months: [
|
|
828
|
-
"January",
|
|
829
|
-
"February",
|
|
830
|
-
"March",
|
|
831
|
-
"April",
|
|
832
|
-
"May",
|
|
833
|
-
"June",
|
|
834
|
-
"July",
|
|
835
|
-
"August",
|
|
836
|
-
"September",
|
|
837
|
-
"October",
|
|
838
|
-
"November",
|
|
839
|
-
"December"
|
|
840
|
-
],
|
|
841
|
-
custom: [
|
|
842
|
-
"Category A",
|
|
843
|
-
"Category B",
|
|
844
|
-
"Category C",
|
|
845
|
-
"Category D",
|
|
846
|
-
"Category E"
|
|
847
|
-
]
|
|
848
|
-
};
|
|
849
|
-
const categories = categoryOptions[categoryType];
|
|
850
|
-
const numberOfPoints = categories.length;
|
|
851
|
-
return [...Array(numberOfSeries).keys()].map((seriesIndex) => {
|
|
852
|
-
let nullsArray = [];
|
|
853
|
-
if (showNulls) {
|
|
854
|
-
const nullsArrayLength = Math.floor(numberOfPoints / 5);
|
|
855
|
-
nullsArray = [...Array(nullsArrayLength)].map(
|
|
856
|
-
() => Math.floor(Math.random() * numberOfPoints)
|
|
857
|
-
);
|
|
858
|
-
}
|
|
859
|
-
return {
|
|
860
|
-
points: categories.map((category, pointIndex) => {
|
|
861
|
-
const showNull = nullsArray && nullsArray.length > 0 ? nullsArray.includes(pointIndex) : false;
|
|
862
|
-
const randomValue = Math.random();
|
|
863
|
-
const positiveOrNegativeYAxisMax = showNegativeValues ? randomValue < 0.5 ? -yAxisMax : yAxisMax : yAxisMax;
|
|
864
|
-
return {
|
|
865
|
-
x: category,
|
|
866
|
-
y: showNull ? null : Math.floor(randomValue * positiveOrNegativeYAxisMax)
|
|
867
|
-
};
|
|
868
|
-
}),
|
|
869
|
-
name: `Series ${seriesIndex + 1}`,
|
|
870
|
-
styles: {
|
|
871
|
-
color: showCustomColors ? getStorybookRandomColor() : void 0,
|
|
872
|
-
pattern: showDashedLines ? "dashed" : "solid"
|
|
873
|
-
}
|
|
874
|
-
};
|
|
875
|
-
});
|
|
876
|
-
};
|
|
877
|
-
|
|
878
|
-
// src/helpers/getStorybookSparseTimelineData.ts
|
|
879
|
-
var getStorybookSparseTimelineData = ({
|
|
880
|
-
showNulls,
|
|
881
|
-
showNegativeValues,
|
|
882
|
-
numberOfSeries,
|
|
883
|
-
yAxisMax,
|
|
884
|
-
showCustomColors,
|
|
885
|
-
showDashedLines,
|
|
886
|
-
numberOfPoints = 5,
|
|
887
|
-
timeSpanHours = 24
|
|
888
|
-
}) => {
|
|
889
|
-
const seriesNames = [
|
|
890
|
-
"Posts Published",
|
|
891
|
-
"Comments",
|
|
892
|
-
"Likes",
|
|
893
|
-
"Shares",
|
|
894
|
-
"Clicks",
|
|
895
|
-
"Views",
|
|
896
|
-
"Saves",
|
|
897
|
-
"Reposts",
|
|
898
|
-
"Mentions",
|
|
899
|
-
"Reactions"
|
|
900
|
-
];
|
|
901
|
-
const baseDate = /* @__PURE__ */ new Date("2024-01-01T00:00:00Z");
|
|
902
|
-
const timeSpanMs = timeSpanHours * 60 * 60 * 1e3;
|
|
903
|
-
return [...Array(numberOfSeries).keys()].map((seriesIndex) => {
|
|
904
|
-
let nullsArray = [];
|
|
905
|
-
if (showNulls) {
|
|
906
|
-
const nullsArrayLength = Math.floor(numberOfPoints / 5);
|
|
907
|
-
nullsArray = [...Array(nullsArrayLength)].map(
|
|
908
|
-
() => Math.floor(Math.random() * numberOfPoints)
|
|
909
|
-
);
|
|
910
|
-
}
|
|
911
|
-
const timestamps = [...Array(numberOfPoints)].map(() => {
|
|
912
|
-
const randomOffset = Math.random() * timeSpanMs;
|
|
913
|
-
return baseDate.getTime() + randomOffset;
|
|
914
|
-
}).sort((a, b) => a - b);
|
|
915
|
-
return {
|
|
916
|
-
points: timestamps.map((timestamp, pointIndex) => {
|
|
917
|
-
const showNull = nullsArray && nullsArray.length > 0 ? nullsArray.includes(pointIndex) : false;
|
|
918
|
-
const randomValue = Math.random();
|
|
919
|
-
const positiveOrNegativeYAxisMax = showNegativeValues ? randomValue < 0.5 ? -yAxisMax : yAxisMax : yAxisMax;
|
|
920
|
-
return {
|
|
921
|
-
x: timestamp,
|
|
922
|
-
y: showNull ? null : Math.floor(randomValue * positiveOrNegativeYAxisMax)
|
|
923
|
-
};
|
|
924
|
-
}),
|
|
925
|
-
name: seriesNames[seriesIndex] || `Series ${seriesIndex + 1}`,
|
|
926
|
-
styles: {
|
|
927
|
-
color: showCustomColors ? getStorybookRandomColor() : void 0,
|
|
928
|
-
pattern: showDashedLines ? "dashed" : "solid"
|
|
929
|
-
}
|
|
930
|
-
};
|
|
931
|
-
});
|
|
932
|
-
};
|
|
933
|
-
|
|
934
|
-
// src/hooks/useTimeSeriesChartOptions.ts
|
|
935
|
-
import { useState as useState3, useCallback, useMemo } from "react";
|
|
936
|
-
|
|
937
|
-
// src/constants/chartOptions.ts
|
|
938
|
-
import _ from "lodash";
|
|
939
|
-
var baseChartOptions = {
|
|
940
|
-
chart: {
|
|
941
|
-
animation: false,
|
|
942
|
-
styledMode: true
|
|
943
|
-
},
|
|
944
|
-
credits: {
|
|
945
|
-
enabled: false
|
|
946
|
-
},
|
|
947
|
-
exporting: {
|
|
948
|
-
enabled: false,
|
|
949
|
-
fallbackToExportServer: false
|
|
950
|
-
},
|
|
951
|
-
legend: {
|
|
952
|
-
enabled: false
|
|
953
|
-
},
|
|
954
|
-
title: {
|
|
955
|
-
text: void 0
|
|
956
|
-
},
|
|
957
|
-
tooltip: {
|
|
958
|
-
hideDelay: 0,
|
|
959
|
-
outside: true,
|
|
960
|
-
padding: 0,
|
|
961
|
-
shape: "rect",
|
|
962
|
-
shared: true,
|
|
963
|
-
useHTML: true
|
|
964
|
-
}
|
|
965
|
-
};
|
|
966
|
-
var TIME_SERIES_CHART_HEIGHT = 275;
|
|
967
|
-
var timeSeriesChartOptions = _.merge({}, baseChartOptions, {
|
|
968
|
-
annotations: [
|
|
969
|
-
{
|
|
970
|
-
draggable: "",
|
|
971
|
-
labelOptions: {
|
|
972
|
-
useHTML: true,
|
|
973
|
-
padding: 0
|
|
974
|
-
// removes "left" property padding created by highcharts so that label is centered
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
],
|
|
978
|
-
chart: {
|
|
979
|
-
// events.click is set at the component level because of the optional onClick prop
|
|
980
|
-
height: TIME_SERIES_CHART_HEIGHT,
|
|
981
|
-
spacing: [5, 1, 0, 2]
|
|
982
|
-
},
|
|
983
|
-
plotOptions: {
|
|
984
|
-
series: {
|
|
985
|
-
animation: false,
|
|
986
|
-
clip: false,
|
|
987
|
-
marker: {
|
|
988
|
-
enabled: false,
|
|
989
|
-
states: {
|
|
990
|
-
hover: {
|
|
991
|
-
enabled: false
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
},
|
|
997
|
-
xAxis: {
|
|
998
|
-
crosshair: {
|
|
999
|
-
zIndex: 3
|
|
1000
|
-
},
|
|
1001
|
-
minPadding: 0,
|
|
1002
|
-
// must be handled dynamically instead of css
|
|
1003
|
-
maxPadding: 0,
|
|
1004
|
-
// must be handled dynamically instead of css
|
|
1005
|
-
type: "datetime",
|
|
1006
|
-
labels: {
|
|
1007
|
-
useHTML: true
|
|
1008
|
-
// formatter is set at the component level because of the required text locale prop
|
|
1009
|
-
}
|
|
1010
|
-
},
|
|
1011
|
-
yAxis: {
|
|
1012
|
-
labels: {
|
|
1013
|
-
useHTML: true
|
|
1014
|
-
// formatter is set at the component level because of the optional yAxisLabelFormatter prop
|
|
1015
|
-
},
|
|
1016
|
-
softMax: 0,
|
|
1017
|
-
softMin: 0,
|
|
1018
|
-
title: {
|
|
1019
|
-
text: void 0
|
|
1020
|
-
},
|
|
1021
|
-
plotLines: [
|
|
1022
|
-
/* Adds a custom plotLine at y=0 to represent the chart baseline.
|
|
1023
|
-
This approach allows full control over the line's appearance (e.g., color, z-index),
|
|
1024
|
-
unlike relying on the default xAxis line, which always renders at the bottom of the chart
|
|
1025
|
-
even when y=0 appears elsewhere (e.g., with negative values).
|
|
1026
|
-
*/
|
|
1027
|
-
{
|
|
1028
|
-
className: "y-axis-zero-line",
|
|
1029
|
-
value: 0,
|
|
1030
|
-
zIndex: 3
|
|
1031
|
-
// ensures the line appears over the default y=0 line, which we can't seleect as specifically
|
|
1032
|
-
}
|
|
1033
|
-
]
|
|
1034
|
-
}
|
|
1035
|
-
});
|
|
1036
|
-
var lineChartOptions = _.merge({}, timeSeriesChartOptions, {
|
|
1037
|
-
// plotOptions.spline.events.click is set at the component level because of the optional onClick prop
|
|
1038
|
-
});
|
|
1039
|
-
var areaChartOptions = _.merge({}, timeSeriesChartOptions, {
|
|
1040
|
-
plotOptions: {
|
|
1041
|
-
areaspline: {
|
|
1042
|
-
// events.click is set at the component level because of the optional onClick prop
|
|
1043
|
-
stacking: "normal"
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
});
|
|
1047
|
-
var columnChartOptions = _.merge({}, timeSeriesChartOptions, {
|
|
1048
|
-
plotOptions: {
|
|
1049
|
-
column: {
|
|
1050
|
-
stacking: "normal",
|
|
1051
|
-
pointPadding: 0.25,
|
|
1052
|
-
groupPadding: 0.25,
|
|
1053
|
-
borderRadius: 4
|
|
1054
|
-
}
|
|
1055
|
-
},
|
|
1056
|
-
xAxis: {
|
|
1057
|
-
crosshair: false
|
|
1058
|
-
},
|
|
1059
|
-
yAxis: {
|
|
1060
|
-
plotLines: [
|
|
1061
|
-
{
|
|
1062
|
-
// For stacked column charts with visible borders (e.g., white for contrast),
|
|
1063
|
-
// we raise the zIndex of the y=0 plotLine to ensure it remains visible
|
|
1064
|
-
// and isn't visually covered by overlapping column borders.
|
|
1065
|
-
zIndex: 5
|
|
1066
|
-
}
|
|
1067
|
-
]
|
|
1068
|
-
}
|
|
1069
|
-
});
|
|
1070
|
-
var VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT = 10;
|
|
1071
|
-
var DONUT_CHART_HALO_SIZE = 10;
|
|
1072
|
-
var DONUT_CHART_HEIGHT = 250 + DONUT_CHART_HALO_SIZE * 2;
|
|
1073
|
-
var DONUT_CHART_WIDTH = DONUT_CHART_HEIGHT;
|
|
1074
|
-
var donutChartOptions = _.merge({}, baseChartOptions, {
|
|
1075
|
-
chart: {
|
|
1076
|
-
height: DONUT_CHART_HEIGHT,
|
|
1077
|
-
spacing: [0, 0, 0, 0]
|
|
1078
|
-
},
|
|
1079
|
-
plotOptions: {
|
|
1080
|
-
pie: {
|
|
1081
|
-
animation: false,
|
|
1082
|
-
borderRadius: 0,
|
|
1083
|
-
// must be handled here instead of css because of path rendering
|
|
1084
|
-
dataLabels: {
|
|
1085
|
-
enabled: false
|
|
1086
|
-
},
|
|
1087
|
-
innerSize: "50%"
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
|
-
|
|
1092
228
|
// src/hooks/useTimeSeriesChartOptions.ts
|
|
229
|
+
import { useState as useState2, useCallback, useMemo } from "react";
|
|
1093
230
|
import { merge } from "lodash";
|
|
1094
231
|
var useTimeSeriesChartOptions = ({
|
|
1095
232
|
xAnnotations,
|
|
@@ -1106,7 +243,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
1106
243
|
timezone = "UTC",
|
|
1107
244
|
xAxisLabelFormatter: xAxisLabelFormatter2
|
|
1108
245
|
}) => {
|
|
1109
|
-
const [chart, setChart] =
|
|
246
|
+
const [chart, setChart] = useState2(null);
|
|
1110
247
|
const callback = useCallback((chartInstance) => {
|
|
1111
248
|
setChart(chartInstance);
|
|
1112
249
|
}, []);
|
|
@@ -1337,193 +474,19 @@ var useTimeSeriesChartOptions = ({
|
|
|
1337
474
|
};
|
|
1338
475
|
var xAxisLabelFormatterDefault = xAxisLabelFormatter;
|
|
1339
476
|
|
|
1340
|
-
// src/styles/chartStyles.ts
|
|
1341
|
-
import { css as css2, createGlobalStyle } from "styled-components";
|
|
1342
|
-
import { theme as theme6 } from "@sproutsocial/seeds-react-theme";
|
|
1343
|
-
import "highcharts/css/highcharts.css";
|
|
1344
|
-
var GlobalChartStyleOverrides = createGlobalStyle`
|
|
1345
|
-
// USAGE NOTE:
|
|
1346
|
-
// Put general styles in baseChartStyles instead when possible to avoid excessive global styling.
|
|
1347
|
-
// This global component is only for styles that can't override highcharts defaults when scoped.
|
|
1348
|
-
|
|
1349
|
-
.highcharts-tooltip-container {
|
|
1350
|
-
z-index: 7 !important;
|
|
1351
|
-
}
|
|
1352
|
-
.highcharts-tooltip-box {
|
|
1353
|
-
fill: transparent !important;
|
|
1354
|
-
}
|
|
1355
|
-
`;
|
|
1356
|
-
var baseChartStyles = css2`
|
|
1357
|
-
--highcharts-background-color: ${({ theme: theme16 }) => theme16.colors.container.background.base};
|
|
1358
|
-
|
|
1359
|
-
// set color variables and map to each series
|
|
1360
|
-
${({ $colors }) => $colors.map((color, index) => {
|
|
1361
|
-
const chartColor = color || theme6.colors.DATAVIZ_COLORS_LIST[index];
|
|
1362
|
-
return `
|
|
1363
|
-
// map colors to custom assigned colors or fallback to default data viz color rotation
|
|
1364
|
-
--highcharts-color-${index}: ${chartColor};
|
|
1365
|
-
|
|
1366
|
-
// highcharts already accounts for 10 series, but if we have more, we need to add them
|
|
1367
|
-
.highcharts-color-${index} {
|
|
1368
|
-
color: var(--highcharts-color-${index});
|
|
1369
|
-
stroke: var(--highcharts-color-${index});
|
|
1370
|
-
fill: var(--highcharts-color-${index});
|
|
1371
|
-
}`;
|
|
1372
|
-
}).join("\n")}
|
|
1373
|
-
|
|
1374
|
-
// set overall chart background color
|
|
1375
|
-
.highcharts-background {
|
|
1376
|
-
fill: ${({ theme: theme16 }) => theme16.colors.container.background.base};
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
g.highcharts-annotation-label {
|
|
1380
|
-
display: none;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
div.highcharts-annotation-label {
|
|
1384
|
-
top: 0 !important;
|
|
1385
|
-
transform: translateX(-50%); // centers the label on the targeted axis point
|
|
1386
|
-
pointer-events: none; // prevents tooltip hover from being interrupted by this element since it renders after on the dom
|
|
1387
|
-
}
|
|
1388
|
-
`;
|
|
1389
|
-
var timeSeriesChartStyles = css2`
|
|
1390
|
-
${baseChartStyles}
|
|
1391
|
-
|
|
1392
|
-
// vertical crosshair styles
|
|
1393
|
-
.highcharts-crosshair {
|
|
1394
|
-
stroke: ${({ theme: theme16 }) => theme16.colors.container.border.decorative.neutral};
|
|
1395
|
-
stroke-width: 1;
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
// axis and gridline styles
|
|
1399
|
-
.highcharts-grid-line {
|
|
1400
|
-
stroke: ${({ theme: theme16 }) => theme16.colors.container.border.base};
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
.highcharts-axis-line {
|
|
1404
|
-
stroke: ${({ theme: theme16 }) => theme16.colors.container.border.base};
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
.highcharts-tick {
|
|
1408
|
-
stroke: none;
|
|
1409
|
-
}
|
|
1410
|
-
.highcharts-xaxis-labels,
|
|
1411
|
-
.highcharts-yaxis-labels {
|
|
1412
|
-
> span {
|
|
1413
|
-
font-family: ${({ theme: theme16 }) => theme16.fontFamily};
|
|
1414
|
-
${({ theme: theme16 }) => theme16.typography[100]};
|
|
1415
|
-
font-weight: ${({ theme: theme16 }) => theme16.fontWeights.normal};
|
|
1416
|
-
color: ${({ theme: theme16 }) => theme16.colors.text.subtext};
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
.highcharts-xaxis-labels {
|
|
1420
|
-
> span {
|
|
1421
|
-
display: flex;
|
|
1422
|
-
flex-direction: column;
|
|
1423
|
-
align-items: center;
|
|
1424
|
-
> span:nth-of-type(2) {
|
|
1425
|
-
font-weight: ${({ theme: theme16 }) => theme16.fontWeights.semibold};
|
|
1426
|
-
}
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
// we don't want to drop the opacity when another item is hovered
|
|
1431
|
-
.highcharts-series-inactive {
|
|
1432
|
-
opacity: 1;
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
// apply cursor pointer when click functionality is turned on
|
|
1436
|
-
${({ $hasOnClick }) => $hasOnClick && `
|
|
1437
|
-
.highcharts-series,
|
|
1438
|
-
.highcharts-point {
|
|
1439
|
-
cursor: pointer;
|
|
1440
|
-
}
|
|
1441
|
-
.highcharts-plot-background,
|
|
1442
|
-
.highcharts-crosshair,
|
|
1443
|
-
.highcharts-grid-line {
|
|
1444
|
-
fill: transparent;
|
|
1445
|
-
cursor: pointer;
|
|
1446
|
-
}`}
|
|
1447
|
-
|
|
1448
|
-
path.highcharts-plot-line.y-axis-zero-line {
|
|
1449
|
-
stroke: ${({ theme: theme16 }) => theme16.colors.container.border.decorative.neutral};
|
|
1450
|
-
}
|
|
1451
|
-
`;
|
|
1452
|
-
var lineChartStyles = css2`
|
|
1453
|
-
${timeSeriesChartStyles}
|
|
1454
|
-
|
|
1455
|
-
// set the line stroke
|
|
1456
|
-
.highcharts-graph {
|
|
1457
|
-
stroke-width: 3;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
// dashed line styles
|
|
1461
|
-
${({ $patterns }) => $patterns.map((pattern, index) => {
|
|
1462
|
-
return pattern === "dashed" ? `
|
|
1463
|
-
// highcharts already accounts for 10 series, but if we have more, we need to add them
|
|
1464
|
-
.highcharts-series-${index} {
|
|
1465
|
-
stroke-dasharray: 2, 8;
|
|
1466
|
-
}` : "";
|
|
1467
|
-
})}
|
|
1468
|
-
`;
|
|
1469
|
-
var areaChartStyles = css2`
|
|
1470
|
-
${timeSeriesChartStyles}
|
|
1471
|
-
|
|
1472
|
-
// don't need to show a stroke for the line part of each area
|
|
1473
|
-
.highcharts-graph {
|
|
1474
|
-
stroke-width: 0;
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
// fill areas to full opacity
|
|
1478
|
-
.highcharts-area {
|
|
1479
|
-
fill-opacity: 1;
|
|
1480
|
-
}
|
|
1481
|
-
`;
|
|
1482
|
-
var donutChartStyles = css2`
|
|
1483
|
-
${baseChartStyles}
|
|
1484
|
-
|
|
1485
|
-
// remove 250ms fade in/out when hovering over different donut chart slices
|
|
1486
|
-
.highcharts-point {
|
|
1487
|
-
transition: opacity 0s;
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1490
|
-
// remove stroke on donut slices
|
|
1491
|
-
.highcharts-pie-series .highcharts-point {
|
|
1492
|
-
stroke: none;
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
// don't reduce opacity when hovering
|
|
1496
|
-
.highcharts-point-hover {
|
|
1497
|
-
fill-opacity: none;
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
// apply cursor pointer when click functionality is turned on
|
|
1501
|
-
${({ $hasOnClick }) => $hasOnClick && `
|
|
1502
|
-
.highcharts-series,
|
|
1503
|
-
.highcharts-point {
|
|
1504
|
-
cursor: pointer;
|
|
1505
|
-
}
|
|
1506
|
-
.highcharts-plot-background,
|
|
1507
|
-
.highcharts-crosshair,
|
|
1508
|
-
.highcharts-grid-line {
|
|
1509
|
-
fill: transparent;
|
|
1510
|
-
cursor: pointer;
|
|
1511
|
-
}`}
|
|
1512
|
-
`;
|
|
1513
|
-
|
|
1514
477
|
// src/components/AreaChart/AreaChart.tsx
|
|
1515
|
-
import { theme as
|
|
1516
|
-
import { Fragment as Fragment2, jsx as
|
|
478
|
+
import { theme as theme2 } from "@sproutsocial/seeds-react-theme";
|
|
479
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1517
480
|
highchartsAccessibility(Highcharts);
|
|
1518
481
|
highchartsAnnotations(Highcharts);
|
|
1519
|
-
var
|
|
482
|
+
var StyledBox = styled(Box2)`
|
|
1520
483
|
${areaChartStyles}
|
|
1521
484
|
`;
|
|
1522
|
-
var AreaChart =
|
|
485
|
+
var AreaChart = memo4(function AreaChart2(props) {
|
|
1523
486
|
const { data } = props;
|
|
1524
|
-
return data.length === 0 ? null : /* @__PURE__ */
|
|
487
|
+
return data.length === 0 ? null : /* @__PURE__ */ jsx4(AreaChartWithData, { ...props });
|
|
1525
488
|
});
|
|
1526
|
-
var AreaChartWithData =
|
|
489
|
+
var AreaChartWithData = memo4(function AreaChartWithData2({
|
|
1527
490
|
data,
|
|
1528
491
|
invalidNumberLabel,
|
|
1529
492
|
numberLocale = "en-us",
|
|
@@ -1557,18 +520,18 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1557
520
|
xAnnotations
|
|
1558
521
|
});
|
|
1559
522
|
const colors = data.map(
|
|
1560
|
-
(series, index) => series.styles?.color ??
|
|
523
|
+
(series, index) => series.styles?.color ?? theme2.colors.DATAVIZ_COLORS_LIST[index]
|
|
1561
524
|
);
|
|
1562
|
-
return /* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
|
|
525
|
+
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
526
|
+
/* @__PURE__ */ jsx4(GlobalChartStyleOverrides, {}),
|
|
527
|
+
/* @__PURE__ */ jsxs2(
|
|
528
|
+
StyledBox,
|
|
1566
529
|
{
|
|
1567
530
|
$colors: colors,
|
|
1568
531
|
$hasOnClick: Boolean(onClick),
|
|
1569
532
|
bg: "container.background.base",
|
|
1570
533
|
children: [
|
|
1571
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ jsx4(
|
|
1572
535
|
HighchartsReact,
|
|
1573
536
|
{
|
|
1574
537
|
highcharts: Highcharts,
|
|
@@ -1576,14 +539,15 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1576
539
|
callback
|
|
1577
540
|
}
|
|
1578
541
|
),
|
|
1579
|
-
chart && chart.annotations?.length ? /* @__PURE__ */
|
|
542
|
+
chart && chart.annotations?.length ? /* @__PURE__ */ jsx4(
|
|
1580
543
|
ChartXAnnotationMarkerPortal,
|
|
1581
544
|
{
|
|
1582
545
|
xAnnotations,
|
|
1583
|
-
annotationContext: chart.annotations?.[0]
|
|
546
|
+
annotationContext: chart.annotations?.[0],
|
|
547
|
+
chartContainer: chart.container
|
|
1584
548
|
}
|
|
1585
549
|
) : null,
|
|
1586
|
-
chart && !disableTooltips ? /* @__PURE__ */
|
|
550
|
+
chart && !disableTooltips ? /* @__PURE__ */ jsx4(
|
|
1587
551
|
ChartTooltipPortal,
|
|
1588
552
|
{
|
|
1589
553
|
chart,
|
|
@@ -1595,7 +559,7 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1595
559
|
const x = context.x;
|
|
1596
560
|
const total = context.total;
|
|
1597
561
|
const xAnnotationDetails = xAnnotations?.[x]?.details;
|
|
1598
|
-
return tooltip ? tooltip({ data: tooltipData, total, x }) : /* @__PURE__ */
|
|
562
|
+
return tooltip ? tooltip({ data: tooltipData, total, x }) : /* @__PURE__ */ jsx4(
|
|
1599
563
|
AreaChartTooltip,
|
|
1600
564
|
{
|
|
1601
565
|
currency,
|
|
@@ -1616,7 +580,7 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1616
580
|
}
|
|
1617
581
|
}
|
|
1618
582
|
) : null,
|
|
1619
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ jsx4(Box2, { mt: 350, children: /* @__PURE__ */ jsx4(AreaChartLegend, { data }) })
|
|
1620
584
|
]
|
|
1621
585
|
}
|
|
1622
586
|
)
|
|
@@ -1624,30 +588,30 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1624
588
|
});
|
|
1625
589
|
|
|
1626
590
|
// src/components/ChartXAnnotationDetails/ChartXAnnotationDetails.tsx
|
|
1627
|
-
import { memo as
|
|
1628
|
-
import { Box as
|
|
591
|
+
import { memo as memo5 } from "react";
|
|
592
|
+
import { Box as Box3 } from "@sproutsocial/seeds-react-box";
|
|
1629
593
|
import { Icon as Icon2 } from "@sproutsocial/seeds-react-icon";
|
|
1630
|
-
import { Text as
|
|
1631
|
-
import { jsx as
|
|
1632
|
-
var ChartXAnnotationDetails =
|
|
594
|
+
import { Text as Text2 } from "@sproutsocial/seeds-react-text";
|
|
595
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
596
|
+
var ChartXAnnotationDetails = memo5(
|
|
1633
597
|
({ iconName, text }) => {
|
|
1634
|
-
return /* @__PURE__ */
|
|
1635
|
-
/* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ jsx5(ChartTooltipHeader, { children: /* @__PURE__ */ jsxs3(Box3, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
599
|
+
/* @__PURE__ */ jsx5(Icon2, { name: iconName, size: "mini", color: "icon.base" }),
|
|
600
|
+
/* @__PURE__ */ jsx5(Text2, { color: "text.body", fontSize: 200, children: text })
|
|
1637
601
|
] }) });
|
|
1638
602
|
}
|
|
1639
603
|
);
|
|
1640
604
|
|
|
1641
605
|
// src/components/ChartXAnnotationMarker/ChartXAnnotationMarker.tsx
|
|
1642
|
-
import { memo as
|
|
1643
|
-
import { Box as
|
|
606
|
+
import { memo as memo6 } from "react";
|
|
607
|
+
import { Box as Box4 } from "@sproutsocial/seeds-react-box";
|
|
1644
608
|
import { Icon as Icon3 } from "@sproutsocial/seeds-react-icon";
|
|
1645
|
-
import { jsx as
|
|
1646
|
-
var ChartXAnnotationMarker =
|
|
609
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
610
|
+
var ChartXAnnotationMarker = memo6(
|
|
1647
611
|
({ iconName }) => {
|
|
1648
|
-
return /* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
|
|
612
|
+
return /* @__PURE__ */ jsxs4(Box4, { display: "flex", flexDirection: "column", alignItems: "center", gap: 200, children: [
|
|
613
|
+
/* @__PURE__ */ jsx6(
|
|
614
|
+
Box4,
|
|
1651
615
|
{
|
|
1652
616
|
display: "flex",
|
|
1653
617
|
alignItems: "center",
|
|
@@ -1656,49 +620,49 @@ var ChartXAnnotationMarker = memo16(
|
|
|
1656
620
|
height: "20px",
|
|
1657
621
|
bg: "icon.base",
|
|
1658
622
|
borderRadius: "50%",
|
|
1659
|
-
children: /* @__PURE__ */
|
|
623
|
+
children: /* @__PURE__ */ jsx6(Icon3, { name: iconName, size: "mini", color: "icon.inverse" })
|
|
1660
624
|
}
|
|
1661
625
|
),
|
|
1662
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ jsx6(Box4, { height: `199px`, width: "0.5px", bg: "neutral.200" })
|
|
1663
627
|
] });
|
|
1664
628
|
}
|
|
1665
629
|
);
|
|
1666
630
|
|
|
1667
631
|
// src/components/DonutChart/DonutChart.tsx
|
|
1668
|
-
import { memo as
|
|
632
|
+
import { memo as memo9, useState as useState3, useEffect as useEffect2, useCallback as useCallback2 } from "react";
|
|
1669
633
|
import Highcharts2 from "highcharts";
|
|
1670
634
|
import { HighchartsReact as HighchartsReact2 } from "highcharts-react-official";
|
|
1671
635
|
import highchartsAccessibility2 from "highcharts/modules/accessibility";
|
|
1672
|
-
import
|
|
1673
|
-
import { Box as
|
|
636
|
+
import styled2 from "styled-components";
|
|
637
|
+
import { Box as Box6 } from "@sproutsocial/seeds-react-box";
|
|
1674
638
|
|
|
1675
639
|
// src/components/DonutChart/components/DonutChartLegend.tsx
|
|
1676
|
-
import { memo as
|
|
1677
|
-
import { theme as
|
|
1678
|
-
import { jsx as
|
|
640
|
+
import { memo as memo7 } from "react";
|
|
641
|
+
import { theme as theme3 } from "@sproutsocial/seeds-react-theme";
|
|
642
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1679
643
|
var getDonutChartLegendLabels = ({
|
|
1680
644
|
data
|
|
1681
645
|
}) => {
|
|
1682
646
|
return data.map((slice, index) => ({
|
|
1683
|
-
content: /* @__PURE__ */
|
|
1684
|
-
color: slice.styles?.color ||
|
|
647
|
+
content: /* @__PURE__ */ jsx7(ChartLegendLabelContentWithIcon, { icon: slice.icon, children: slice.name }),
|
|
648
|
+
color: slice.styles?.color || theme3.colors.DATAVIZ_COLORS_LIST[index]
|
|
1685
649
|
}));
|
|
1686
650
|
};
|
|
1687
|
-
var DonutChartLegend =
|
|
651
|
+
var DonutChartLegend = memo7(
|
|
1688
652
|
function DonutChartLegend2({ data }) {
|
|
1689
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ jsx7(ChartLegend, { legendLabels: getDonutChartLegendLabels({ data }) });
|
|
1690
654
|
}
|
|
1691
655
|
);
|
|
1692
656
|
|
|
1693
657
|
// src/components/DonutChart/components/DonutChartTooltip.tsx
|
|
1694
|
-
import { memo as
|
|
1695
|
-
import { Box as
|
|
658
|
+
import { memo as memo8 } from "react";
|
|
659
|
+
import { Box as Box5 } from "@sproutsocial/seeds-react-box";
|
|
1696
660
|
import { Duration as Duration2 } from "@sproutsocial/seeds-react-duration";
|
|
1697
661
|
import { Icon as Icon4 } from "@sproutsocial/seeds-react-icon";
|
|
1698
662
|
import { Numeral as Numeral2 } from "@sproutsocial/seeds-react-numeral";
|
|
1699
|
-
import { Text as
|
|
1700
|
-
import { jsx as
|
|
1701
|
-
var DonutChartTooltip =
|
|
663
|
+
import { Text as Text3 } from "@sproutsocial/seeds-react-text";
|
|
664
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
665
|
+
var DonutChartTooltip = memo8(
|
|
1702
666
|
function DonutChartTooltip2({
|
|
1703
667
|
color,
|
|
1704
668
|
name,
|
|
@@ -1716,11 +680,11 @@ var DonutChartTooltip = memo18(
|
|
|
1716
680
|
{
|
|
1717
681
|
cells: [
|
|
1718
682
|
{
|
|
1719
|
-
content: /* @__PURE__ */
|
|
683
|
+
content: /* @__PURE__ */ jsx8(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx8(ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ jsx8(Text3, { "aria-label": `${name}: `, children: name }) }) })
|
|
1720
684
|
},
|
|
1721
685
|
{
|
|
1722
|
-
content: /* @__PURE__ */
|
|
1723
|
-
/* @__PURE__ */
|
|
686
|
+
content: /* @__PURE__ */ jsxs5(Box5, { display: "inline-flex", alignItems: "center", gap: 350, children: [
|
|
687
|
+
/* @__PURE__ */ jsx8(
|
|
1724
688
|
Numeral2,
|
|
1725
689
|
{
|
|
1726
690
|
number: percent,
|
|
@@ -1729,7 +693,7 @@ var DonutChartTooltip = memo18(
|
|
|
1729
693
|
locale: numberLocale
|
|
1730
694
|
}
|
|
1731
695
|
),
|
|
1732
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ jsx8(Text3, { fontWeight: "semibold", children: numberFormat === "duration" ? /* @__PURE__ */ jsx8(Duration2, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx8(
|
|
1733
697
|
Numeral2,
|
|
1734
698
|
{
|
|
1735
699
|
abbreviate: false,
|
|
@@ -1745,25 +709,25 @@ var DonutChartTooltip = memo18(
|
|
|
1745
709
|
]
|
|
1746
710
|
}
|
|
1747
711
|
];
|
|
1748
|
-
return /* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1750
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */
|
|
1751
|
-
/* @__PURE__ */
|
|
1752
|
-
/* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ jsxs5(ChartTooltip, { children: [
|
|
713
|
+
/* @__PURE__ */ jsx8(ChartTooltipTable, { rows }),
|
|
714
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ jsx8(ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ jsxs5(Box5, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
715
|
+
/* @__PURE__ */ jsx8(Icon4, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
716
|
+
/* @__PURE__ */ jsx8(Text3, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
1753
717
|
] }) : tooltipClickLabel }) : null
|
|
1754
718
|
] });
|
|
1755
719
|
}
|
|
1756
720
|
);
|
|
1757
721
|
|
|
1758
722
|
// src/components/DonutChart/helpers/transformDonutChartTooltipData.ts
|
|
1759
|
-
import { theme as
|
|
723
|
+
import { theme as theme4 } from "@sproutsocial/seeds-react-theme";
|
|
1760
724
|
var transformDonutChartTooltipData = ({
|
|
1761
725
|
context,
|
|
1762
726
|
data
|
|
1763
727
|
}) => {
|
|
1764
728
|
const colorIndex = context.colorIndex;
|
|
1765
729
|
return {
|
|
1766
|
-
color: data[colorIndex]?.styles?.color ??
|
|
730
|
+
color: data[colorIndex]?.styles?.color ?? theme4.colors.DATAVIZ_COLORS_LIST[colorIndex] ?? "",
|
|
1767
731
|
...data[colorIndex]?.icon ? { icon: data[colorIndex]?.icon } : {},
|
|
1768
732
|
name: context.key,
|
|
1769
733
|
percent: context.percentage,
|
|
@@ -1772,17 +736,17 @@ var transformDonutChartTooltipData = ({
|
|
|
1772
736
|
};
|
|
1773
737
|
|
|
1774
738
|
// src/components/DonutChart/DonutChart.tsx
|
|
1775
|
-
import { theme as
|
|
1776
|
-
import { Fragment as Fragment3, jsx as
|
|
739
|
+
import { theme as theme5 } from "@sproutsocial/seeds-react-theme";
|
|
740
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1777
741
|
highchartsAccessibility2(Highcharts2);
|
|
1778
|
-
var
|
|
742
|
+
var StyledBox2 = styled2(Box6)`
|
|
1779
743
|
${donutChartStyles}
|
|
1780
744
|
`;
|
|
1781
|
-
var DonutChart =
|
|
745
|
+
var DonutChart = memo9(function DonutChart2(props) {
|
|
1782
746
|
const { data } = props;
|
|
1783
|
-
return data.length === 0 ? null : /* @__PURE__ */
|
|
747
|
+
return data.length === 0 ? null : /* @__PURE__ */ jsx9(DonutChartWithData, { ...props });
|
|
1784
748
|
});
|
|
1785
|
-
var DonutChartWithData =
|
|
749
|
+
var DonutChartWithData = memo9(
|
|
1786
750
|
function DonutChartWithData2({
|
|
1787
751
|
data,
|
|
1788
752
|
numberLocale = "en-us",
|
|
@@ -1796,12 +760,12 @@ var DonutChartWithData = memo19(
|
|
|
1796
760
|
onClick,
|
|
1797
761
|
tooltipClickLabel
|
|
1798
762
|
}) {
|
|
1799
|
-
const [options, setOptions] =
|
|
1800
|
-
const [chart, setChart] =
|
|
763
|
+
const [options, setOptions] = useState3(donutChartOptions);
|
|
764
|
+
const [chart, setChart] = useState3(null);
|
|
1801
765
|
const callback = useCallback2((chartInstance) => {
|
|
1802
766
|
setChart(chartInstance);
|
|
1803
767
|
}, []);
|
|
1804
|
-
|
|
768
|
+
useEffect2(() => {
|
|
1805
769
|
setOptions({
|
|
1806
770
|
accessibility: {
|
|
1807
771
|
point: {
|
|
@@ -1851,18 +815,18 @@ var DonutChartWithData = memo19(
|
|
|
1851
815
|
});
|
|
1852
816
|
}, [data]);
|
|
1853
817
|
const colors = data.map(
|
|
1854
|
-
(series, index) => series.styles?.color ??
|
|
818
|
+
(series, index) => series.styles?.color ?? theme5.colors.DATAVIZ_COLORS_LIST[index] ?? ""
|
|
1855
819
|
);
|
|
1856
|
-
return /* @__PURE__ */
|
|
1857
|
-
/* @__PURE__ */
|
|
1858
|
-
/* @__PURE__ */
|
|
1859
|
-
|
|
820
|
+
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
821
|
+
/* @__PURE__ */ jsx9(GlobalChartStyleOverrides, {}),
|
|
822
|
+
/* @__PURE__ */ jsxs6(
|
|
823
|
+
StyledBox2,
|
|
1860
824
|
{
|
|
1861
825
|
$colors: colors,
|
|
1862
826
|
$hasOnClick: Boolean(onClick),
|
|
1863
827
|
bg: "container.background.base",
|
|
1864
828
|
children: [
|
|
1865
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ jsx9(
|
|
1866
830
|
HighchartsReact2,
|
|
1867
831
|
{
|
|
1868
832
|
highcharts: Highcharts2,
|
|
@@ -1870,13 +834,13 @@ var DonutChartWithData = memo19(
|
|
|
1870
834
|
callback
|
|
1871
835
|
}
|
|
1872
836
|
),
|
|
1873
|
-
chart && !disableTooltips ? /* @__PURE__ */
|
|
837
|
+
chart && !disableTooltips ? /* @__PURE__ */ jsx9(
|
|
1874
838
|
ChartTooltipPortal,
|
|
1875
839
|
{
|
|
1876
840
|
chart,
|
|
1877
841
|
renderContent: (context) => {
|
|
1878
842
|
const { color, icon, name, percent, value } = transformDonutChartTooltipData({ context, data });
|
|
1879
|
-
return tooltip ? tooltip({ color, icon, name, percent, value }) : /* @__PURE__ */
|
|
843
|
+
return tooltip ? tooltip({ color, icon, name, percent, value }) : /* @__PURE__ */ jsx9(
|
|
1880
844
|
DonutChartTooltip,
|
|
1881
845
|
{
|
|
1882
846
|
color,
|
|
@@ -1895,7 +859,7 @@ var DonutChartWithData = memo19(
|
|
|
1895
859
|
}
|
|
1896
860
|
}
|
|
1897
861
|
) : null,
|
|
1898
|
-
hideLegend ? null : /* @__PURE__ */
|
|
862
|
+
hideLegend ? null : /* @__PURE__ */ jsx9(Box6, { mt: 350, children: /* @__PURE__ */ jsx9(DonutChartLegend, { data }) })
|
|
1899
863
|
]
|
|
1900
864
|
}
|
|
1901
865
|
)
|
|
@@ -1904,14 +868,14 @@ var DonutChartWithData = memo19(
|
|
|
1904
868
|
);
|
|
1905
869
|
|
|
1906
870
|
// src/components/DonutChart/components/DonutChartLegendTable.tsx
|
|
1907
|
-
import { memo as
|
|
1908
|
-
import { Box as
|
|
871
|
+
import { memo as memo10 } from "react";
|
|
872
|
+
import { Box as Box7 } from "@sproutsocial/seeds-react-box";
|
|
1909
873
|
import { Duration as Duration3 } from "@sproutsocial/seeds-react-duration";
|
|
1910
874
|
import { Numeral as Numeral3 } from "@sproutsocial/seeds-react-numeral";
|
|
1911
|
-
import { Text as
|
|
1912
|
-
import { theme as
|
|
1913
|
-
import { jsx as
|
|
1914
|
-
var DonutChartLegendTable =
|
|
875
|
+
import { Text as Text4 } from "@sproutsocial/seeds-react-text";
|
|
876
|
+
import { theme as theme6 } from "@sproutsocial/seeds-react-theme";
|
|
877
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
878
|
+
var DonutChartLegendTable = memo10(
|
|
1915
879
|
function DonutChartLegendTable2({
|
|
1916
880
|
data,
|
|
1917
881
|
numberLocale = "en-us",
|
|
@@ -1927,15 +891,15 @@ var DonutChartLegendTable = memo20(
|
|
|
1927
891
|
);
|
|
1928
892
|
const rows = data.map((dataPoint, index) => {
|
|
1929
893
|
const { name, icon, styles, value } = dataPoint;
|
|
1930
|
-
const color = styles?.color ||
|
|
894
|
+
const color = styles?.color || theme6.colors.DATAVIZ_COLORS_LIST[index];
|
|
1931
895
|
return {
|
|
1932
896
|
cells: [
|
|
1933
897
|
{
|
|
1934
|
-
content: /* @__PURE__ */
|
|
898
|
+
content: /* @__PURE__ */ jsx10(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx10(ChartLegendLabelContentWithIcon, { icon, children: name }) })
|
|
1935
899
|
},
|
|
1936
900
|
{
|
|
1937
|
-
content: /* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
901
|
+
content: /* @__PURE__ */ jsxs7(Box7, { display: "inline-flex", alignItems: "center", gap: 350, children: [
|
|
902
|
+
/* @__PURE__ */ jsx10(Text4, { color: "text.body", children: /* @__PURE__ */ jsx10(
|
|
1939
903
|
Numeral3,
|
|
1940
904
|
{
|
|
1941
905
|
abbreviate: false,
|
|
@@ -1944,7 +908,7 @@ var DonutChartLegendTable = memo20(
|
|
|
1944
908
|
number: value / total * 100
|
|
1945
909
|
}
|
|
1946
910
|
) }),
|
|
1947
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ jsx10(Text4, { color: "text.body", fontWeight: "semibold", children: numberFormat === "duration" ? /* @__PURE__ */ jsx10(Duration3, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx10(
|
|
1948
912
|
Numeral3,
|
|
1949
913
|
{
|
|
1950
914
|
abbreviate: false,
|
|
@@ -1964,10 +928,10 @@ var DonutChartLegendTable = memo20(
|
|
|
1964
928
|
{
|
|
1965
929
|
cells: [
|
|
1966
930
|
{
|
|
1967
|
-
content: /* @__PURE__ */
|
|
931
|
+
content: /* @__PURE__ */ jsx10(Text4, { fontWeight: "semibold", color: "text.headline", children: totalLabel })
|
|
1968
932
|
},
|
|
1969
933
|
{
|
|
1970
|
-
content: /* @__PURE__ */
|
|
934
|
+
content: /* @__PURE__ */ jsx10(Text4, { color: "text.body", fontWeight: "bold", children: numberFormat === "duration" ? /* @__PURE__ */ jsx10(Duration3, { locale: textLocale, milliseconds: total }) : /* @__PURE__ */ jsx10(
|
|
1971
935
|
Numeral3,
|
|
1972
936
|
{
|
|
1973
937
|
abbreviate: false,
|
|
@@ -1983,7 +947,7 @@ var DonutChartLegendTable = memo20(
|
|
|
1983
947
|
isAppendedRow: true
|
|
1984
948
|
}
|
|
1985
949
|
];
|
|
1986
|
-
return /* @__PURE__ */
|
|
950
|
+
return /* @__PURE__ */ jsx10(
|
|
1987
951
|
ChartTable,
|
|
1988
952
|
{
|
|
1989
953
|
rows: [...rows, ...totalRow]
|
|
@@ -1993,41 +957,41 @@ var DonutChartLegendTable = memo20(
|
|
|
1993
957
|
);
|
|
1994
958
|
|
|
1995
959
|
// src/components/LineChart/LineChart.tsx
|
|
1996
|
-
import { memo as
|
|
960
|
+
import { memo as memo13 } from "react";
|
|
1997
961
|
import Highcharts3 from "highcharts";
|
|
1998
962
|
import { HighchartsReact as HighchartsReact3 } from "highcharts-react-official";
|
|
1999
963
|
import highchartsAccessibility3 from "highcharts/modules/accessibility";
|
|
2000
964
|
import highchartsAnnotations2 from "highcharts/modules/annotations";
|
|
2001
|
-
import
|
|
2002
|
-
import { Box as
|
|
965
|
+
import styled3 from "styled-components";
|
|
966
|
+
import { Box as Box9 } from "@sproutsocial/seeds-react-box";
|
|
2003
967
|
|
|
2004
968
|
// src/components/LineChart/components/LineChartLegend.tsx
|
|
2005
|
-
import { memo as
|
|
2006
|
-
import { theme as
|
|
2007
|
-
import { jsx as
|
|
969
|
+
import { memo as memo11 } from "react";
|
|
970
|
+
import { theme as theme7 } from "@sproutsocial/seeds-react-theme";
|
|
971
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2008
972
|
var getLineChartLegendLabels = ({
|
|
2009
973
|
data
|
|
2010
974
|
}) => {
|
|
2011
975
|
return data.map((series, index) => ({
|
|
2012
|
-
content: /* @__PURE__ */
|
|
2013
|
-
color: series.styles?.color ||
|
|
976
|
+
content: /* @__PURE__ */ jsx11(ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
977
|
+
color: series.styles?.color || theme7.colors.DATAVIZ_COLORS_LIST[index]
|
|
2014
978
|
}));
|
|
2015
979
|
};
|
|
2016
|
-
var LineChartLegend =
|
|
980
|
+
var LineChartLegend = memo11(
|
|
2017
981
|
function LineChartLegend2({ data }) {
|
|
2018
|
-
return /* @__PURE__ */
|
|
982
|
+
return /* @__PURE__ */ jsx11(ChartLegend, { legendLabels: getLineChartLegendLabels({ data }) });
|
|
2019
983
|
}
|
|
2020
984
|
);
|
|
2021
985
|
|
|
2022
986
|
// src/components/LineChart/components/LineChartTooltip.tsx
|
|
2023
|
-
import { memo as
|
|
2024
|
-
import { Box as
|
|
987
|
+
import { memo as memo12 } from "react";
|
|
988
|
+
import { Box as Box8 } from "@sproutsocial/seeds-react-box";
|
|
2025
989
|
import { Duration as Duration4 } from "@sproutsocial/seeds-react-duration";
|
|
2026
990
|
import { Icon as Icon5 } from "@sproutsocial/seeds-react-icon";
|
|
2027
991
|
import { Numeral as Numeral4 } from "@sproutsocial/seeds-react-numeral";
|
|
2028
|
-
import { Text as
|
|
2029
|
-
import { jsx as
|
|
2030
|
-
var LineChartTooltip =
|
|
992
|
+
import { Text as Text5 } from "@sproutsocial/seeds-react-text";
|
|
993
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
994
|
+
var LineChartTooltip = memo12(
|
|
2031
995
|
function LineChartTooltip2({
|
|
2032
996
|
data,
|
|
2033
997
|
invalidNumberLabel,
|
|
@@ -2046,10 +1010,10 @@ var LineChartTooltip = memo22(
|
|
|
2046
1010
|
return {
|
|
2047
1011
|
cells: [
|
|
2048
1012
|
{
|
|
2049
|
-
content: /* @__PURE__ */
|
|
1013
|
+
content: /* @__PURE__ */ jsx12(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx12(ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ jsx12(Text5, { "aria-label": `${name}: `, children: name }) }) })
|
|
2050
1014
|
},
|
|
2051
1015
|
{
|
|
2052
|
-
content: value === null && invalidNumberLabel ? /* @__PURE__ */
|
|
1016
|
+
content: value === null && invalidNumberLabel ? /* @__PURE__ */ jsx12(Text5, { children: invalidNumberLabel }) : numberFormat === "duration" ? /* @__PURE__ */ jsx12(Duration4, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx12(
|
|
2053
1017
|
Numeral4,
|
|
2054
1018
|
{
|
|
2055
1019
|
abbreviate: false,
|
|
@@ -2064,31 +1028,31 @@ var LineChartTooltip = memo22(
|
|
|
2064
1028
|
]
|
|
2065
1029
|
};
|
|
2066
1030
|
});
|
|
2067
|
-
return /* @__PURE__ */
|
|
1031
|
+
return /* @__PURE__ */ jsxs8(ChartTooltip, { children: [
|
|
2068
1032
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
/* @__PURE__ */
|
|
2071
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */
|
|
2072
|
-
/* @__PURE__ */
|
|
2073
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ jsx12(ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
1034
|
+
/* @__PURE__ */ jsx12(ChartTooltipTable, { rows }),
|
|
1035
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ jsx12(ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ jsxs8(Box8, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
1036
|
+
/* @__PURE__ */ jsx12(Icon5, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
1037
|
+
/* @__PURE__ */ jsx12(Text5, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
2074
1038
|
] }) : tooltipClickLabel }) : null
|
|
2075
1039
|
] });
|
|
2076
1040
|
}
|
|
2077
1041
|
);
|
|
2078
1042
|
|
|
2079
1043
|
// src/components/LineChart/LineChart.tsx
|
|
2080
|
-
import { theme as
|
|
2081
|
-
import { Fragment as Fragment4, jsx as
|
|
1044
|
+
import { theme as theme8 } from "@sproutsocial/seeds-react-theme";
|
|
1045
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2082
1046
|
highchartsAccessibility3(Highcharts3);
|
|
2083
1047
|
highchartsAnnotations2(Highcharts3);
|
|
2084
|
-
var
|
|
1048
|
+
var StyledBox3 = styled3(Box9)`
|
|
2085
1049
|
${lineChartStyles}
|
|
2086
1050
|
`;
|
|
2087
|
-
var LineChart =
|
|
1051
|
+
var LineChart = memo13(function LineChart2(props) {
|
|
2088
1052
|
const { data } = props;
|
|
2089
|
-
return data.length === 0 ? null : /* @__PURE__ */
|
|
1053
|
+
return data.length === 0 ? null : /* @__PURE__ */ jsx13(LineChartWithData, { ...props });
|
|
2090
1054
|
});
|
|
2091
|
-
var LineChartWithData =
|
|
1055
|
+
var LineChartWithData = memo13(function LineChartWithData2({
|
|
2092
1056
|
data,
|
|
2093
1057
|
invalidNumberLabel,
|
|
2094
1058
|
numberLocale = "en-us",
|
|
@@ -2125,7 +1089,7 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2125
1089
|
const { colors, patterns } = data.reduce(
|
|
2126
1090
|
(acc, item, index) => {
|
|
2127
1091
|
acc.colors.push(
|
|
2128
|
-
item.styles?.color ??
|
|
1092
|
+
item.styles?.color ?? theme8.colors.DATAVIZ_COLORS_LIST[index] ?? ""
|
|
2129
1093
|
);
|
|
2130
1094
|
acc.patterns.push(item.styles?.pattern ?? "solid");
|
|
2131
1095
|
return acc;
|
|
@@ -2135,17 +1099,17 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2135
1099
|
patterns: []
|
|
2136
1100
|
}
|
|
2137
1101
|
);
|
|
2138
|
-
return /* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
|
|
1102
|
+
return /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
1103
|
+
/* @__PURE__ */ jsx13(GlobalChartStyleOverrides, {}),
|
|
1104
|
+
/* @__PURE__ */ jsxs9(
|
|
1105
|
+
StyledBox3,
|
|
2142
1106
|
{
|
|
2143
1107
|
$colors: colors,
|
|
2144
1108
|
$patterns: patterns,
|
|
2145
1109
|
$hasOnClick: Boolean(onClick),
|
|
2146
1110
|
bg: "container.background.base",
|
|
2147
1111
|
children: [
|
|
2148
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ jsx13(
|
|
2149
1113
|
HighchartsReact3,
|
|
2150
1114
|
{
|
|
2151
1115
|
highcharts: Highcharts3,
|
|
@@ -2153,14 +1117,15 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2153
1117
|
callback
|
|
2154
1118
|
}
|
|
2155
1119
|
),
|
|
2156
|
-
chart && chart.annotations?.length ? /* @__PURE__ */
|
|
1120
|
+
chart && chart.annotations?.length ? /* @__PURE__ */ jsx13(
|
|
2157
1121
|
ChartXAnnotationMarkerPortal,
|
|
2158
1122
|
{
|
|
2159
1123
|
xAnnotations,
|
|
2160
|
-
annotationContext: chart.annotations?.[0]
|
|
1124
|
+
annotationContext: chart.annotations?.[0],
|
|
1125
|
+
chartContainer: chart.container
|
|
2161
1126
|
}
|
|
2162
1127
|
) : null,
|
|
2163
|
-
chart && !disableTooltips ? /* @__PURE__ */
|
|
1128
|
+
chart && !disableTooltips ? /* @__PURE__ */ jsx13(
|
|
2164
1129
|
ChartTooltipPortal,
|
|
2165
1130
|
{
|
|
2166
1131
|
chart,
|
|
@@ -2171,7 +1136,7 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2171
1136
|
});
|
|
2172
1137
|
const x = context.x;
|
|
2173
1138
|
const xAnnotationDetails = xAnnotations?.[x]?.details;
|
|
2174
|
-
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */
|
|
1139
|
+
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */ jsx13(
|
|
2175
1140
|
LineChartTooltip,
|
|
2176
1141
|
{
|
|
2177
1142
|
currency,
|
|
@@ -2190,7 +1155,7 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2190
1155
|
}
|
|
2191
1156
|
}
|
|
2192
1157
|
) : null,
|
|
2193
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ jsx13(Box9, { mt: 350, children: /* @__PURE__ */ jsx13(LineChartLegend, { data }) })
|
|
2194
1159
|
]
|
|
2195
1160
|
}
|
|
2196
1161
|
)
|
|
@@ -2198,41 +1163,41 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2198
1163
|
});
|
|
2199
1164
|
|
|
2200
1165
|
// src/components/VerticalBarChart/VerticalBarChart.tsx
|
|
2201
|
-
import { memo as
|
|
1166
|
+
import { memo as memo16 } from "react";
|
|
2202
1167
|
import Highcharts4 from "highcharts";
|
|
2203
1168
|
import { HighchartsReact as HighchartsReact4 } from "highcharts-react-official";
|
|
2204
1169
|
import highchartsAccessibility4 from "highcharts/modules/accessibility";
|
|
2205
1170
|
import highchartsAnnotations3 from "highcharts/modules/annotations";
|
|
2206
|
-
import
|
|
2207
|
-
import { Box as
|
|
1171
|
+
import styled4 from "styled-components";
|
|
1172
|
+
import { Box as Box11 } from "@sproutsocial/seeds-react-box";
|
|
2208
1173
|
|
|
2209
1174
|
// src/components/VerticalBarChart/components/VerticalBarChartLegend.tsx
|
|
2210
|
-
import { memo as
|
|
2211
|
-
import { theme as
|
|
2212
|
-
import { jsx as
|
|
1175
|
+
import { memo as memo14 } from "react";
|
|
1176
|
+
import { theme as theme9 } from "@sproutsocial/seeds-react-theme";
|
|
1177
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2213
1178
|
var getVerticalBarChartLegendLabels = ({
|
|
2214
1179
|
data
|
|
2215
1180
|
}) => {
|
|
2216
1181
|
return data.map((series, index) => ({
|
|
2217
|
-
content: /* @__PURE__ */
|
|
2218
|
-
color: series.styles?.color ||
|
|
1182
|
+
content: /* @__PURE__ */ jsx14(ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
1183
|
+
color: series.styles?.color || theme9.colors.DATAVIZ_COLORS_LIST[index]
|
|
2219
1184
|
}));
|
|
2220
1185
|
};
|
|
2221
|
-
var VerticalBarChartLegend =
|
|
1186
|
+
var VerticalBarChartLegend = memo14(
|
|
2222
1187
|
function VerticalbarChartLegend({ data }) {
|
|
2223
|
-
return /* @__PURE__ */
|
|
1188
|
+
return /* @__PURE__ */ jsx14(ChartLegend, { legendLabels: getVerticalBarChartLegendLabels({ data }) });
|
|
2224
1189
|
}
|
|
2225
1190
|
);
|
|
2226
1191
|
|
|
2227
1192
|
// src/components/VerticalBarChart/components/VerticalBarChartTooltip.tsx
|
|
2228
|
-
import { memo as
|
|
2229
|
-
import { Box as
|
|
1193
|
+
import { memo as memo15 } from "react";
|
|
1194
|
+
import { Box as Box10 } from "@sproutsocial/seeds-react-box";
|
|
2230
1195
|
import { Duration as Duration5 } from "@sproutsocial/seeds-react-duration";
|
|
2231
1196
|
import { Icon as Icon6 } from "@sproutsocial/seeds-react-icon";
|
|
2232
1197
|
import { Numeral as Numeral5 } from "@sproutsocial/seeds-react-numeral";
|
|
2233
|
-
import { Text as
|
|
2234
|
-
import { jsx as
|
|
2235
|
-
var VerticalBarChartTooltip =
|
|
1198
|
+
import { Text as Text6 } from "@sproutsocial/seeds-react-text";
|
|
1199
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1200
|
+
var VerticalBarChartTooltip = memo15(
|
|
2236
1201
|
function VerticalBarChartTooltip2({
|
|
2237
1202
|
data,
|
|
2238
1203
|
invalidNumberLabel,
|
|
@@ -2251,10 +1216,10 @@ var VerticalBarChartTooltip = memo25(
|
|
|
2251
1216
|
return {
|
|
2252
1217
|
cells: [
|
|
2253
1218
|
{
|
|
2254
|
-
content: /* @__PURE__ */
|
|
1219
|
+
content: /* @__PURE__ */ jsx15(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx15(ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ jsx15(Text6, { "aria-label": `${name}: `, children: name }) }) })
|
|
2255
1220
|
},
|
|
2256
1221
|
{
|
|
2257
|
-
content: value === null && invalidNumberLabel ? /* @__PURE__ */
|
|
1222
|
+
content: value === null && invalidNumberLabel ? /* @__PURE__ */ jsx15(Text6, { children: invalidNumberLabel }) : numberFormat === "duration" ? /* @__PURE__ */ jsx15(Duration5, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx15(
|
|
2258
1223
|
Numeral5,
|
|
2259
1224
|
{
|
|
2260
1225
|
abbreviate: false,
|
|
@@ -2269,48 +1234,27 @@ var VerticalBarChartTooltip = memo25(
|
|
|
2269
1234
|
]
|
|
2270
1235
|
};
|
|
2271
1236
|
});
|
|
2272
|
-
return /* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ jsxs10(ChartTooltip, { children: [
|
|
2273
1238
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2276
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */
|
|
2277
|
-
/* @__PURE__ */
|
|
2278
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ jsx15(ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
1240
|
+
/* @__PURE__ */ jsx15(ChartTooltipTable, { rows }),
|
|
1241
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ jsx15(ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ jsxs10(Box10, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
1242
|
+
/* @__PURE__ */ jsx15(Icon6, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
1243
|
+
/* @__PURE__ */ jsx15(Text6, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
2279
1244
|
] }) : tooltipClickLabel }) : null
|
|
2280
1245
|
] });
|
|
2281
1246
|
}
|
|
2282
1247
|
);
|
|
2283
1248
|
|
|
2284
1249
|
// src/components/VerticalBarChart/VerticalBarChart.tsx
|
|
2285
|
-
import { theme as
|
|
2286
|
-
|
|
2287
|
-
// src/components/VerticalBarChart/styles.ts
|
|
2288
|
-
import { css as css3 } from "styled-components";
|
|
2289
|
-
var verticalBarChartStyles = css3`
|
|
2290
|
-
${timeSeriesChartStyles}
|
|
2291
|
-
|
|
2292
|
-
/*
|
|
2293
|
-
When the chart container is hovered, reduce the opacity of all columns.
|
|
2294
|
-
Then, for the column that is being hovered, restore its opacity.
|
|
2295
|
-
This gives the effect of fading out the non-hovered columns.
|
|
2296
|
-
*/
|
|
2297
|
-
.highcharts-container:hover .highcharts-point {
|
|
2298
|
-
fill-opacity: 0.3;
|
|
2299
|
-
}
|
|
2300
|
-
|
|
2301
|
-
.highcharts-point.column-hover {
|
|
2302
|
-
fill-opacity: 1 !important;
|
|
2303
|
-
}
|
|
2304
|
-
`;
|
|
2305
|
-
|
|
2306
|
-
// src/components/VerticalBarChart/VerticalBarChart.tsx
|
|
2307
|
-
import { Fragment as Fragment5, jsx as jsx27, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1250
|
+
import { theme as theme10 } from "@sproutsocial/seeds-react-theme";
|
|
1251
|
+
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2308
1252
|
highchartsAccessibility4(Highcharts4);
|
|
2309
1253
|
highchartsAnnotations3(Highcharts4);
|
|
2310
|
-
var
|
|
1254
|
+
var StyledBox4 = styled4(Box11)`
|
|
2311
1255
|
${verticalBarChartStyles}
|
|
2312
1256
|
`;
|
|
2313
|
-
var VerticalBarChart =
|
|
1257
|
+
var VerticalBarChart = memo16(
|
|
2314
1258
|
function VerticalBarChart2(props) {
|
|
2315
1259
|
const { data, showSeriesLimitWarning = true } = props;
|
|
2316
1260
|
const seriesLimit = props.seriesLimit ?? VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT;
|
|
@@ -2327,10 +1271,10 @@ var VerticalBarChart = memo26(
|
|
|
2327
1271
|
}
|
|
2328
1272
|
chartData = data.slice(0, seriesLimit);
|
|
2329
1273
|
}
|
|
2330
|
-
return /* @__PURE__ */
|
|
1274
|
+
return /* @__PURE__ */ jsx16(VerticalBarChartWithData, { ...props, data: chartData });
|
|
2331
1275
|
}
|
|
2332
1276
|
);
|
|
2333
|
-
var VerticalBarChartWithData =
|
|
1277
|
+
var VerticalBarChartWithData = memo16(
|
|
2334
1278
|
function VerticalBarChartWithData2({
|
|
2335
1279
|
data,
|
|
2336
1280
|
invalidNumberLabel,
|
|
@@ -2404,7 +1348,7 @@ var VerticalBarChartWithData = memo26(
|
|
|
2404
1348
|
const { colors, patterns } = data.reduce(
|
|
2405
1349
|
(acc, item, index) => {
|
|
2406
1350
|
acc.colors.push(
|
|
2407
|
-
item.styles?.color ??
|
|
1351
|
+
item.styles?.color ?? theme10.colors.DATAVIZ_COLORS_LIST[index] ?? ""
|
|
2408
1352
|
);
|
|
2409
1353
|
acc.patterns.push(item.styles?.pattern ?? "solid");
|
|
2410
1354
|
return acc;
|
|
@@ -2414,16 +1358,16 @@ var VerticalBarChartWithData = memo26(
|
|
|
2414
1358
|
patterns: []
|
|
2415
1359
|
}
|
|
2416
1360
|
);
|
|
2417
|
-
return /* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */
|
|
2419
|
-
/* @__PURE__ */
|
|
2420
|
-
|
|
1361
|
+
return /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
1362
|
+
/* @__PURE__ */ jsx16(GlobalChartStyleOverrides, {}),
|
|
1363
|
+
/* @__PURE__ */ jsxs11(
|
|
1364
|
+
StyledBox4,
|
|
2421
1365
|
{
|
|
2422
1366
|
$colors: colors,
|
|
2423
1367
|
$hasOnClick: Boolean(onClick),
|
|
2424
1368
|
bg: "container.background.base",
|
|
2425
1369
|
children: [
|
|
2426
|
-
/* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ jsx16(
|
|
2427
1371
|
HighchartsReact4,
|
|
2428
1372
|
{
|
|
2429
1373
|
highcharts: Highcharts4,
|
|
@@ -2431,14 +1375,15 @@ var VerticalBarChartWithData = memo26(
|
|
|
2431
1375
|
callback
|
|
2432
1376
|
}
|
|
2433
1377
|
),
|
|
2434
|
-
chart && chart.annotations?.length ? /* @__PURE__ */
|
|
1378
|
+
chart && chart.annotations?.length ? /* @__PURE__ */ jsx16(
|
|
2435
1379
|
ChartXAnnotationMarkerPortal,
|
|
2436
1380
|
{
|
|
2437
1381
|
xAnnotations,
|
|
2438
|
-
annotationContext: chart.annotations?.[0]
|
|
1382
|
+
annotationContext: chart.annotations?.[0],
|
|
1383
|
+
chartContainer: chart.container
|
|
2439
1384
|
}
|
|
2440
1385
|
) : null,
|
|
2441
|
-
chart ? /* @__PURE__ */
|
|
1386
|
+
chart ? /* @__PURE__ */ jsx16(
|
|
2442
1387
|
ChartTooltipPortal,
|
|
2443
1388
|
{
|
|
2444
1389
|
chart,
|
|
@@ -2449,7 +1394,7 @@ var VerticalBarChartWithData = memo26(
|
|
|
2449
1394
|
});
|
|
2450
1395
|
const x = context.x;
|
|
2451
1396
|
const xAnnotationDetails = typeof x === "number" ? xAnnotations?.[x]?.details : void 0;
|
|
2452
|
-
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */
|
|
1397
|
+
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */ jsx16(
|
|
2453
1398
|
VerticalBarChartTooltip,
|
|
2454
1399
|
{
|
|
2455
1400
|
currency,
|
|
@@ -2468,7 +1413,7 @@ var VerticalBarChartWithData = memo26(
|
|
|
2468
1413
|
}
|
|
2469
1414
|
}
|
|
2470
1415
|
) : null,
|
|
2471
|
-
/* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ jsx16(Box11, { mt: 350, children: /* @__PURE__ */ jsx16(VerticalBarChartLegend, { data }) })
|
|
2472
1417
|
]
|
|
2473
1418
|
}
|
|
2474
1419
|
)
|