@sproutsocial/seeds-react-data-viz 0.7.32 → 0.15.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/axis-DXzufRRj.d.mts +116 -0
- package/dist/axis-PJwu5Xmo.d.ts +116 -0
- package/dist/bar/index.d.mts +98 -0
- package/dist/bar/index.d.ts +98 -0
- package/dist/bar/index.js +186 -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-EEVKTTT3.js +968 -0
- package/dist/chunk-EEVKTTT3.js.map +1 -0
- package/dist/chunk-JXARPHQE.js +193 -0
- package/dist/chunk-JXARPHQE.js.map +1 -0
- package/dist/chunk-VSZSIN34.js +796 -0
- package/dist/chunk-VSZSIN34.js.map +1 -0
- package/dist/esm/bar/index.js +186 -0
- package/dist/esm/bar/index.js.map +1 -0
- package/dist/esm/chunk-HQM3EIZW.js +193 -0
- package/dist/esm/chunk-HQM3EIZW.js.map +1 -0
- package/dist/esm/chunk-LC3HGWDD.js +968 -0
- package/dist/esm/chunk-LC3HGWDD.js.map +1 -0
- package/dist/esm/chunk-OAN5VC7M.js +796 -0
- package/dist/esm/chunk-OAN5VC7M.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 +262 -1315
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/line-area/index.js +151 -0
- package/dist/esm/line-area/index.js.map +1 -0
- 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 +56 -93
- package/dist/index.d.ts +56 -93
- package/dist/index.js +407 -1544
- package/dist/index.js.map +1 -1
- package/dist/line-area/index.d.mts +83 -0
- package/dist/line-area/index.d.ts +83 -0
- package/dist/line-area/index.js +151 -0
- package/dist/line-area/index.js.map +1 -0
- 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 +37 -11
package/dist/esm/index.js
CHANGED
|
@@ -1,398 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DONUT_CHART_HALO_SIZE,
|
|
3
|
+
DONUT_CHART_HEIGHT,
|
|
4
|
+
DONUT_CHART_WIDTH,
|
|
5
|
+
TIME_SERIES_CHART_HEIGHT,
|
|
6
|
+
VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT,
|
|
7
|
+
areaChartOptions,
|
|
8
|
+
baseChartOptions,
|
|
9
|
+
columnChartOptions,
|
|
10
|
+
donutChartOptions,
|
|
11
|
+
lineChartOptions,
|
|
12
|
+
timeSeriesChartOptions,
|
|
13
|
+
verticalBarChartStyles
|
|
14
|
+
} from "./chunk-HQM3EIZW.js";
|
|
15
|
+
import {
|
|
16
|
+
ChartLegend,
|
|
17
|
+
ChartLegendLabel,
|
|
18
|
+
ChartLegendLabelContentWithIcon,
|
|
19
|
+
ChartTable,
|
|
20
|
+
ChartTooltip,
|
|
21
|
+
ChartTooltipFooter,
|
|
22
|
+
ChartTooltipHeader,
|
|
23
|
+
ChartTooltipPortal,
|
|
24
|
+
ChartTooltipTable,
|
|
25
|
+
ChartTooltipTitle,
|
|
26
|
+
ColorBox,
|
|
27
|
+
DatavizColorBox,
|
|
28
|
+
GlobalChartStyleOverrides,
|
|
29
|
+
NetworkColorBox,
|
|
30
|
+
areaChartStyles,
|
|
31
|
+
baseChartStyles,
|
|
32
|
+
donutChartStyles,
|
|
33
|
+
generateChartTooltipPortalId,
|
|
34
|
+
getDatavizColor,
|
|
35
|
+
getDatavizColorWithAlpha,
|
|
36
|
+
getDatavizOpacity,
|
|
37
|
+
getStorybookCategoricalData,
|
|
38
|
+
getStorybookSparseTimelineData,
|
|
39
|
+
isCategoricalHourData,
|
|
40
|
+
isHourlyTimeData,
|
|
41
|
+
lineChartStyles,
|
|
42
|
+
timeSeriesChartStyles,
|
|
43
|
+
transformDataToSeries,
|
|
44
|
+
transformTimeSeriesTooltipData,
|
|
45
|
+
xAxisLabelFormatter,
|
|
46
|
+
yAxisLabelFormatter
|
|
47
|
+
} from "./chunk-LC3HGWDD.js";
|
|
48
|
+
|
|
1
49
|
// src/components/AreaChart/AreaChart.tsx
|
|
2
|
-
import { memo as
|
|
50
|
+
import { memo as memo4 } from "react";
|
|
3
51
|
import Highcharts from "highcharts";
|
|
4
52
|
import { HighchartsReact } from "highcharts-react-official";
|
|
5
53
|
import highchartsAccessibility from "highcharts/modules/accessibility";
|
|
6
54
|
import highchartsAnnotations from "highcharts/modules/annotations";
|
|
7
|
-
import
|
|
8
|
-
import { Box as
|
|
55
|
+
import styled from "styled-components";
|
|
56
|
+
import { Box as Box2 } from "@sproutsocial/seeds-react-box";
|
|
9
57
|
|
|
10
58
|
// 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
59
|
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
60
|
import { theme } from "@sproutsocial/seeds-react-theme";
|
|
33
61
|
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
62
|
var getAreaChartLegendLabels = ({
|
|
172
63
|
data
|
|
173
64
|
}) => {
|
|
174
65
|
return data.map((series, index) => ({
|
|
175
|
-
content: /* @__PURE__ */
|
|
176
|
-
color: series.styles?.color ||
|
|
66
|
+
content: /* @__PURE__ */ jsx(ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
67
|
+
color: series.styles?.color || theme.colors.DATAVIZ_COLORS_LIST[index]
|
|
177
68
|
}));
|
|
178
69
|
};
|
|
179
|
-
var AreaChartLegend =
|
|
70
|
+
var AreaChartLegend = memo(
|
|
180
71
|
function AreaChartLegend2({ data }) {
|
|
181
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ jsx(ChartLegend, { legendLabels: getAreaChartLegendLabels({ data }) });
|
|
182
73
|
}
|
|
183
74
|
);
|
|
184
75
|
|
|
185
76
|
// src/components/AreaChart/components/AreaChartTooltip.tsx
|
|
186
|
-
import { memo as
|
|
187
|
-
import { Box
|
|
77
|
+
import { memo as memo2 } from "react";
|
|
78
|
+
import { Box } from "@sproutsocial/seeds-react-box";
|
|
188
79
|
import { Duration } from "@sproutsocial/seeds-react-duration";
|
|
189
80
|
import { Icon } from "@sproutsocial/seeds-react-icon";
|
|
190
81
|
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(
|
|
82
|
+
import { Text } from "@sproutsocial/seeds-react-text";
|
|
83
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
84
|
+
var AreaChartTooltip = memo2(
|
|
396
85
|
function AreaChartTooltip2({
|
|
397
86
|
data,
|
|
398
87
|
invalidNumberLabel,
|
|
@@ -413,10 +102,10 @@ var AreaChartTooltip = memo12(
|
|
|
413
102
|
return {
|
|
414
103
|
cells: [
|
|
415
104
|
{
|
|
416
|
-
content: /* @__PURE__ */
|
|
105
|
+
content: /* @__PURE__ */ jsx2(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx2(ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ jsx2(Text, { "aria-label": `${name}: `, children: name }) }) })
|
|
417
106
|
},
|
|
418
107
|
{
|
|
419
|
-
content: value === null && invalidNumberLabel ? /* @__PURE__ */
|
|
108
|
+
content: value === null && invalidNumberLabel ? /* @__PURE__ */ jsx2(Text, { children: invalidNumberLabel }) : numberFormat === "duration" ? /* @__PURE__ */ jsx2(Duration, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx2(
|
|
420
109
|
Numeral,
|
|
421
110
|
{
|
|
422
111
|
abbreviate: false,
|
|
@@ -435,8 +124,8 @@ var AreaChartTooltip = memo12(
|
|
|
435
124
|
{
|
|
436
125
|
cells: [
|
|
437
126
|
{
|
|
438
|
-
content: /* @__PURE__ */
|
|
439
|
-
|
|
127
|
+
content: /* @__PURE__ */ jsx2(
|
|
128
|
+
Text,
|
|
440
129
|
{
|
|
441
130
|
fontWeight: "semibold",
|
|
442
131
|
"aria-label": `${tooltipTotalLabel}: `,
|
|
@@ -445,7 +134,7 @@ var AreaChartTooltip = memo12(
|
|
|
445
134
|
)
|
|
446
135
|
},
|
|
447
136
|
{
|
|
448
|
-
content: /* @__PURE__ */
|
|
137
|
+
content: /* @__PURE__ */ jsx2(Text, { fontWeight: "bold", children: total === null && invalidNumberLabel ? invalidNumberLabel : numberFormat === "duration" ? /* @__PURE__ */ jsx2(Duration, { locale: textLocale, milliseconds: total }) : /* @__PURE__ */ jsx2(
|
|
449
138
|
Numeral,
|
|
450
139
|
{
|
|
451
140
|
abbreviate: false,
|
|
@@ -461,40 +150,41 @@ var AreaChartTooltip = memo12(
|
|
|
461
150
|
isAppendedRow: true
|
|
462
151
|
}
|
|
463
152
|
] : [];
|
|
464
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ jsxs(ChartTooltip, { children: [
|
|
465
154
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ jsx2(ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
156
|
+
/* @__PURE__ */ jsx2(
|
|
468
157
|
ChartTooltipTable,
|
|
469
158
|
{
|
|
470
159
|
rows: [...rows, ...appendedRows]
|
|
471
160
|
}
|
|
472
161
|
),
|
|
473
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
162
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ jsx2(ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
163
|
+
/* @__PURE__ */ jsx2(Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
164
|
+
/* @__PURE__ */ jsx2(Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
476
165
|
] }) : tooltipClickLabel }) : null
|
|
477
166
|
] });
|
|
478
167
|
}
|
|
479
168
|
);
|
|
480
169
|
|
|
481
170
|
// src/components/ChartXAnnotationMarker/components/ChartXAnnotationMarkerPortal.tsx
|
|
482
|
-
import { memo as
|
|
483
|
-
import { createPortal
|
|
171
|
+
import { memo as memo3, useEffect, useState, useRef } from "react";
|
|
172
|
+
import { createPortal } from "react-dom";
|
|
484
173
|
import "highcharts";
|
|
485
|
-
import { Fragment, jsx as
|
|
486
|
-
var ChartXAnnotationMarkerPortal =
|
|
174
|
+
import { Fragment, jsx as jsx3 } from "react/jsx-runtime";
|
|
175
|
+
var ChartXAnnotationMarkerPortal = memo3(
|
|
487
176
|
function ChartXAnnotationMarkerPortal2({
|
|
488
177
|
xAnnotations,
|
|
489
|
-
annotationContext
|
|
178
|
+
annotationContext,
|
|
179
|
+
chartContainer
|
|
490
180
|
}) {
|
|
491
|
-
const annotationContainers =
|
|
492
|
-
const [renderCount, setRenderCount] =
|
|
181
|
+
const annotationContainers = useRef({});
|
|
182
|
+
const [renderCount, setRenderCount] = useState(0);
|
|
493
183
|
const forceRender = () => setRenderCount((prev) => prev + 1);
|
|
494
|
-
|
|
184
|
+
useEffect(() => {
|
|
495
185
|
if (annotationContext.labels) {
|
|
496
186
|
const newContainers = {};
|
|
497
|
-
const existingAnnotationContainers =
|
|
187
|
+
const existingAnnotationContainers = chartContainer.querySelectorAll(
|
|
498
188
|
"div[data-annotation-marker='true']"
|
|
499
189
|
);
|
|
500
190
|
existingAnnotationContainers.forEach(
|
|
@@ -514,7 +204,7 @@ var ChartXAnnotationMarkerPortal = memo13(
|
|
|
514
204
|
annotationContainers.current = newContainers;
|
|
515
205
|
forceRender();
|
|
516
206
|
requestAnimationFrame(() => {
|
|
517
|
-
|
|
207
|
+
chartContainer.querySelectorAll("div.highcharts-annotation").forEach((annotationDiv) => {
|
|
518
208
|
const reactAnnotations = annotationDiv.querySelectorAll(
|
|
519
209
|
"div[data-annotation-marker]"
|
|
520
210
|
);
|
|
@@ -527,569 +217,18 @@ var ChartXAnnotationMarkerPortal = memo13(
|
|
|
527
217
|
});
|
|
528
218
|
});
|
|
529
219
|
}
|
|
530
|
-
}, [annotationContext.labels, xAnnotations]);
|
|
531
|
-
return /* @__PURE__ */
|
|
220
|
+
}, [annotationContext.labels, xAnnotations, chartContainer]);
|
|
221
|
+
return /* @__PURE__ */ jsx3(Fragment, { children: Object.entries(annotationContainers.current).map(
|
|
532
222
|
([xValue, container]) => {
|
|
533
223
|
const annotationComponent = xAnnotations?.[Number(xValue)]?.marker;
|
|
534
|
-
return annotationComponent ?
|
|
224
|
+
return annotationComponent ? createPortal(annotationComponent(), container) : null;
|
|
535
225
|
}
|
|
536
226
|
) });
|
|
537
227
|
}
|
|
538
228
|
);
|
|
539
229
|
|
|
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
230
|
// src/hooks/useTimeSeriesChartOptions.ts
|
|
231
|
+
import { useState as useState2, useCallback, useMemo } from "react";
|
|
1093
232
|
import { merge } from "lodash";
|
|
1094
233
|
var useTimeSeriesChartOptions = ({
|
|
1095
234
|
xAnnotations,
|
|
@@ -1106,7 +245,7 @@ var useTimeSeriesChartOptions = ({
|
|
|
1106
245
|
timezone = "UTC",
|
|
1107
246
|
xAxisLabelFormatter: xAxisLabelFormatter2
|
|
1108
247
|
}) => {
|
|
1109
|
-
const [chart, setChart] =
|
|
248
|
+
const [chart, setChart] = useState2(null);
|
|
1110
249
|
const callback = useCallback((chartInstance) => {
|
|
1111
250
|
setChart(chartInstance);
|
|
1112
251
|
}, []);
|
|
@@ -1337,193 +476,19 @@ var useTimeSeriesChartOptions = ({
|
|
|
1337
476
|
};
|
|
1338
477
|
var xAxisLabelFormatterDefault = xAxisLabelFormatter;
|
|
1339
478
|
|
|
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
479
|
// src/components/AreaChart/AreaChart.tsx
|
|
1515
|
-
import { theme as
|
|
1516
|
-
import { Fragment as Fragment2, jsx as
|
|
480
|
+
import { theme as theme2 } from "@sproutsocial/seeds-react-theme";
|
|
481
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1517
482
|
highchartsAccessibility(Highcharts);
|
|
1518
483
|
highchartsAnnotations(Highcharts);
|
|
1519
|
-
var
|
|
484
|
+
var StyledBox = styled(Box2)`
|
|
1520
485
|
${areaChartStyles}
|
|
1521
486
|
`;
|
|
1522
|
-
var AreaChart =
|
|
487
|
+
var AreaChart = memo4(function AreaChart2(props) {
|
|
1523
488
|
const { data } = props;
|
|
1524
|
-
return data.length === 0 ? null : /* @__PURE__ */
|
|
489
|
+
return data.length === 0 ? null : /* @__PURE__ */ jsx4(AreaChartWithData, { ...props });
|
|
1525
490
|
});
|
|
1526
|
-
var AreaChartWithData =
|
|
491
|
+
var AreaChartWithData = memo4(function AreaChartWithData2({
|
|
1527
492
|
data,
|
|
1528
493
|
invalidNumberLabel,
|
|
1529
494
|
numberLocale = "en-us",
|
|
@@ -1557,18 +522,18 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1557
522
|
xAnnotations
|
|
1558
523
|
});
|
|
1559
524
|
const colors = data.map(
|
|
1560
|
-
(series, index) => series.styles?.color ??
|
|
525
|
+
(series, index) => series.styles?.color ?? theme2.colors.DATAVIZ_COLORS_LIST[index]
|
|
1561
526
|
);
|
|
1562
|
-
return /* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
|
|
527
|
+
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
528
|
+
/* @__PURE__ */ jsx4(GlobalChartStyleOverrides, {}),
|
|
529
|
+
/* @__PURE__ */ jsxs2(
|
|
530
|
+
StyledBox,
|
|
1566
531
|
{
|
|
1567
532
|
$colors: colors,
|
|
1568
533
|
$hasOnClick: Boolean(onClick),
|
|
1569
534
|
bg: "container.background.base",
|
|
1570
535
|
children: [
|
|
1571
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ jsx4(
|
|
1572
537
|
HighchartsReact,
|
|
1573
538
|
{
|
|
1574
539
|
highcharts: Highcharts,
|
|
@@ -1576,14 +541,15 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1576
541
|
callback
|
|
1577
542
|
}
|
|
1578
543
|
),
|
|
1579
|
-
chart && chart.annotations?.length ? /* @__PURE__ */
|
|
544
|
+
chart && chart.annotations?.length ? /* @__PURE__ */ jsx4(
|
|
1580
545
|
ChartXAnnotationMarkerPortal,
|
|
1581
546
|
{
|
|
1582
547
|
xAnnotations,
|
|
1583
|
-
annotationContext: chart.annotations?.[0]
|
|
548
|
+
annotationContext: chart.annotations?.[0],
|
|
549
|
+
chartContainer: chart.container
|
|
1584
550
|
}
|
|
1585
551
|
) : null,
|
|
1586
|
-
chart && !disableTooltips ? /* @__PURE__ */
|
|
552
|
+
chart && !disableTooltips ? /* @__PURE__ */ jsx4(
|
|
1587
553
|
ChartTooltipPortal,
|
|
1588
554
|
{
|
|
1589
555
|
chart,
|
|
@@ -1595,7 +561,7 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1595
561
|
const x = context.x;
|
|
1596
562
|
const total = context.total;
|
|
1597
563
|
const xAnnotationDetails = xAnnotations?.[x]?.details;
|
|
1598
|
-
return tooltip ? tooltip({ data: tooltipData, total, x }) : /* @__PURE__ */
|
|
564
|
+
return tooltip ? tooltip({ data: tooltipData, total, x }) : /* @__PURE__ */ jsx4(
|
|
1599
565
|
AreaChartTooltip,
|
|
1600
566
|
{
|
|
1601
567
|
currency,
|
|
@@ -1616,7 +582,7 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1616
582
|
}
|
|
1617
583
|
}
|
|
1618
584
|
) : null,
|
|
1619
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ jsx4(Box2, { mt: 350, children: /* @__PURE__ */ jsx4(AreaChartLegend, { data }) })
|
|
1620
586
|
]
|
|
1621
587
|
}
|
|
1622
588
|
)
|
|
@@ -1624,30 +590,30 @@ var AreaChartWithData = memo14(function AreaChartWithData2({
|
|
|
1624
590
|
});
|
|
1625
591
|
|
|
1626
592
|
// src/components/ChartXAnnotationDetails/ChartXAnnotationDetails.tsx
|
|
1627
|
-
import { memo as
|
|
1628
|
-
import { Box as
|
|
593
|
+
import { memo as memo5 } from "react";
|
|
594
|
+
import { Box as Box3 } from "@sproutsocial/seeds-react-box";
|
|
1629
595
|
import { Icon as Icon2 } from "@sproutsocial/seeds-react-icon";
|
|
1630
|
-
import { Text as
|
|
1631
|
-
import { jsx as
|
|
1632
|
-
var ChartXAnnotationDetails =
|
|
596
|
+
import { Text as Text2 } from "@sproutsocial/seeds-react-text";
|
|
597
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
598
|
+
var ChartXAnnotationDetails = memo5(
|
|
1633
599
|
({ iconName, text }) => {
|
|
1634
|
-
return /* @__PURE__ */
|
|
1635
|
-
/* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */
|
|
600
|
+
return /* @__PURE__ */ jsx5(ChartTooltipHeader, { children: /* @__PURE__ */ jsxs3(Box3, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
601
|
+
/* @__PURE__ */ jsx5(Icon2, { name: iconName, size: "mini", color: "icon.base" }),
|
|
602
|
+
/* @__PURE__ */ jsx5(Text2, { color: "text.body", fontSize: 200, children: text })
|
|
1637
603
|
] }) });
|
|
1638
604
|
}
|
|
1639
605
|
);
|
|
1640
606
|
|
|
1641
607
|
// src/components/ChartXAnnotationMarker/ChartXAnnotationMarker.tsx
|
|
1642
|
-
import { memo as
|
|
1643
|
-
import { Box as
|
|
608
|
+
import { memo as memo6 } from "react";
|
|
609
|
+
import { Box as Box4 } from "@sproutsocial/seeds-react-box";
|
|
1644
610
|
import { Icon as Icon3 } from "@sproutsocial/seeds-react-icon";
|
|
1645
|
-
import { jsx as
|
|
1646
|
-
var ChartXAnnotationMarker =
|
|
611
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
612
|
+
var ChartXAnnotationMarker = memo6(
|
|
1647
613
|
({ iconName }) => {
|
|
1648
|
-
return /* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
|
|
614
|
+
return /* @__PURE__ */ jsxs4(Box4, { display: "flex", flexDirection: "column", alignItems: "center", gap: 200, children: [
|
|
615
|
+
/* @__PURE__ */ jsx6(
|
|
616
|
+
Box4,
|
|
1651
617
|
{
|
|
1652
618
|
display: "flex",
|
|
1653
619
|
alignItems: "center",
|
|
@@ -1656,49 +622,49 @@ var ChartXAnnotationMarker = memo16(
|
|
|
1656
622
|
height: "20px",
|
|
1657
623
|
bg: "icon.base",
|
|
1658
624
|
borderRadius: "50%",
|
|
1659
|
-
children: /* @__PURE__ */
|
|
625
|
+
children: /* @__PURE__ */ jsx6(Icon3, { name: iconName, size: "mini", color: "icon.inverse" })
|
|
1660
626
|
}
|
|
1661
627
|
),
|
|
1662
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ jsx6(Box4, { height: `199px`, width: "0.5px", bg: "neutral.200" })
|
|
1663
629
|
] });
|
|
1664
630
|
}
|
|
1665
631
|
);
|
|
1666
632
|
|
|
1667
633
|
// src/components/DonutChart/DonutChart.tsx
|
|
1668
|
-
import { memo as
|
|
634
|
+
import { memo as memo9, useState as useState3, useEffect as useEffect2, useCallback as useCallback2 } from "react";
|
|
1669
635
|
import Highcharts2 from "highcharts";
|
|
1670
636
|
import { HighchartsReact as HighchartsReact2 } from "highcharts-react-official";
|
|
1671
637
|
import highchartsAccessibility2 from "highcharts/modules/accessibility";
|
|
1672
|
-
import
|
|
1673
|
-
import { Box as
|
|
638
|
+
import styled2 from "styled-components";
|
|
639
|
+
import { Box as Box6 } from "@sproutsocial/seeds-react-box";
|
|
1674
640
|
|
|
1675
641
|
// src/components/DonutChart/components/DonutChartLegend.tsx
|
|
1676
|
-
import { memo as
|
|
1677
|
-
import { theme as
|
|
1678
|
-
import { jsx as
|
|
642
|
+
import { memo as memo7 } from "react";
|
|
643
|
+
import { theme as theme3 } from "@sproutsocial/seeds-react-theme";
|
|
644
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1679
645
|
var getDonutChartLegendLabels = ({
|
|
1680
646
|
data
|
|
1681
647
|
}) => {
|
|
1682
648
|
return data.map((slice, index) => ({
|
|
1683
|
-
content: /* @__PURE__ */
|
|
1684
|
-
color: slice.styles?.color ||
|
|
649
|
+
content: /* @__PURE__ */ jsx7(ChartLegendLabelContentWithIcon, { icon: slice.icon, children: slice.name }),
|
|
650
|
+
color: slice.styles?.color || theme3.colors.DATAVIZ_COLORS_LIST[index]
|
|
1685
651
|
}));
|
|
1686
652
|
};
|
|
1687
|
-
var DonutChartLegend =
|
|
653
|
+
var DonutChartLegend = memo7(
|
|
1688
654
|
function DonutChartLegend2({ data }) {
|
|
1689
|
-
return /* @__PURE__ */
|
|
655
|
+
return /* @__PURE__ */ jsx7(ChartLegend, { legendLabels: getDonutChartLegendLabels({ data }) });
|
|
1690
656
|
}
|
|
1691
657
|
);
|
|
1692
658
|
|
|
1693
659
|
// src/components/DonutChart/components/DonutChartTooltip.tsx
|
|
1694
|
-
import { memo as
|
|
1695
|
-
import { Box as
|
|
660
|
+
import { memo as memo8 } from "react";
|
|
661
|
+
import { Box as Box5 } from "@sproutsocial/seeds-react-box";
|
|
1696
662
|
import { Duration as Duration2 } from "@sproutsocial/seeds-react-duration";
|
|
1697
663
|
import { Icon as Icon4 } from "@sproutsocial/seeds-react-icon";
|
|
1698
664
|
import { Numeral as Numeral2 } from "@sproutsocial/seeds-react-numeral";
|
|
1699
|
-
import { Text as
|
|
1700
|
-
import { jsx as
|
|
1701
|
-
var DonutChartTooltip =
|
|
665
|
+
import { Text as Text3 } from "@sproutsocial/seeds-react-text";
|
|
666
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
667
|
+
var DonutChartTooltip = memo8(
|
|
1702
668
|
function DonutChartTooltip2({
|
|
1703
669
|
color,
|
|
1704
670
|
name,
|
|
@@ -1716,11 +682,11 @@ var DonutChartTooltip = memo18(
|
|
|
1716
682
|
{
|
|
1717
683
|
cells: [
|
|
1718
684
|
{
|
|
1719
|
-
content: /* @__PURE__ */
|
|
685
|
+
content: /* @__PURE__ */ jsx8(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx8(ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ jsx8(Text3, { "aria-label": `${name}: `, children: name }) }) })
|
|
1720
686
|
},
|
|
1721
687
|
{
|
|
1722
|
-
content: /* @__PURE__ */
|
|
1723
|
-
/* @__PURE__ */
|
|
688
|
+
content: /* @__PURE__ */ jsxs5(Box5, { display: "inline-flex", alignItems: "center", gap: 350, children: [
|
|
689
|
+
/* @__PURE__ */ jsx8(
|
|
1724
690
|
Numeral2,
|
|
1725
691
|
{
|
|
1726
692
|
number: percent,
|
|
@@ -1729,7 +695,7 @@ var DonutChartTooltip = memo18(
|
|
|
1729
695
|
locale: numberLocale
|
|
1730
696
|
}
|
|
1731
697
|
),
|
|
1732
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ jsx8(Text3, { fontWeight: "semibold", children: numberFormat === "duration" ? /* @__PURE__ */ jsx8(Duration2, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx8(
|
|
1733
699
|
Numeral2,
|
|
1734
700
|
{
|
|
1735
701
|
abbreviate: false,
|
|
@@ -1745,25 +711,25 @@ var DonutChartTooltip = memo18(
|
|
|
1745
711
|
]
|
|
1746
712
|
}
|
|
1747
713
|
];
|
|
1748
|
-
return /* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1750
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */
|
|
1751
|
-
/* @__PURE__ */
|
|
1752
|
-
/* @__PURE__ */
|
|
714
|
+
return /* @__PURE__ */ jsxs5(ChartTooltip, { children: [
|
|
715
|
+
/* @__PURE__ */ jsx8(ChartTooltipTable, { rows }),
|
|
716
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ jsx8(ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ jsxs5(Box5, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
717
|
+
/* @__PURE__ */ jsx8(Icon4, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
718
|
+
/* @__PURE__ */ jsx8(Text3, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
1753
719
|
] }) : tooltipClickLabel }) : null
|
|
1754
720
|
] });
|
|
1755
721
|
}
|
|
1756
722
|
);
|
|
1757
723
|
|
|
1758
724
|
// src/components/DonutChart/helpers/transformDonutChartTooltipData.ts
|
|
1759
|
-
import { theme as
|
|
725
|
+
import { theme as theme4 } from "@sproutsocial/seeds-react-theme";
|
|
1760
726
|
var transformDonutChartTooltipData = ({
|
|
1761
727
|
context,
|
|
1762
728
|
data
|
|
1763
729
|
}) => {
|
|
1764
730
|
const colorIndex = context.colorIndex;
|
|
1765
731
|
return {
|
|
1766
|
-
color: data[colorIndex]?.styles?.color ??
|
|
732
|
+
color: data[colorIndex]?.styles?.color ?? theme4.colors.DATAVIZ_COLORS_LIST[colorIndex] ?? "",
|
|
1767
733
|
...data[colorIndex]?.icon ? { icon: data[colorIndex]?.icon } : {},
|
|
1768
734
|
name: context.key,
|
|
1769
735
|
percent: context.percentage,
|
|
@@ -1772,17 +738,17 @@ var transformDonutChartTooltipData = ({
|
|
|
1772
738
|
};
|
|
1773
739
|
|
|
1774
740
|
// src/components/DonutChart/DonutChart.tsx
|
|
1775
|
-
import { theme as
|
|
1776
|
-
import { Fragment as Fragment3, jsx as
|
|
741
|
+
import { theme as theme5 } from "@sproutsocial/seeds-react-theme";
|
|
742
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1777
743
|
highchartsAccessibility2(Highcharts2);
|
|
1778
|
-
var
|
|
744
|
+
var StyledBox2 = styled2(Box6)`
|
|
1779
745
|
${donutChartStyles}
|
|
1780
746
|
`;
|
|
1781
|
-
var DonutChart =
|
|
747
|
+
var DonutChart = memo9(function DonutChart2(props) {
|
|
1782
748
|
const { data } = props;
|
|
1783
|
-
return data.length === 0 ? null : /* @__PURE__ */
|
|
749
|
+
return data.length === 0 ? null : /* @__PURE__ */ jsx9(DonutChartWithData, { ...props });
|
|
1784
750
|
});
|
|
1785
|
-
var DonutChartWithData =
|
|
751
|
+
var DonutChartWithData = memo9(
|
|
1786
752
|
function DonutChartWithData2({
|
|
1787
753
|
data,
|
|
1788
754
|
numberLocale = "en-us",
|
|
@@ -1796,12 +762,12 @@ var DonutChartWithData = memo19(
|
|
|
1796
762
|
onClick,
|
|
1797
763
|
tooltipClickLabel
|
|
1798
764
|
}) {
|
|
1799
|
-
const [options, setOptions] =
|
|
1800
|
-
const [chart, setChart] =
|
|
765
|
+
const [options, setOptions] = useState3(donutChartOptions);
|
|
766
|
+
const [chart, setChart] = useState3(null);
|
|
1801
767
|
const callback = useCallback2((chartInstance) => {
|
|
1802
768
|
setChart(chartInstance);
|
|
1803
769
|
}, []);
|
|
1804
|
-
|
|
770
|
+
useEffect2(() => {
|
|
1805
771
|
setOptions({
|
|
1806
772
|
accessibility: {
|
|
1807
773
|
point: {
|
|
@@ -1851,18 +817,18 @@ var DonutChartWithData = memo19(
|
|
|
1851
817
|
});
|
|
1852
818
|
}, [data]);
|
|
1853
819
|
const colors = data.map(
|
|
1854
|
-
(series, index) => series.styles?.color ??
|
|
820
|
+
(series, index) => series.styles?.color ?? theme5.colors.DATAVIZ_COLORS_LIST[index] ?? ""
|
|
1855
821
|
);
|
|
1856
|
-
return /* @__PURE__ */
|
|
1857
|
-
/* @__PURE__ */
|
|
1858
|
-
/* @__PURE__ */
|
|
1859
|
-
|
|
822
|
+
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
823
|
+
/* @__PURE__ */ jsx9(GlobalChartStyleOverrides, {}),
|
|
824
|
+
/* @__PURE__ */ jsxs6(
|
|
825
|
+
StyledBox2,
|
|
1860
826
|
{
|
|
1861
827
|
$colors: colors,
|
|
1862
828
|
$hasOnClick: Boolean(onClick),
|
|
1863
829
|
bg: "container.background.base",
|
|
1864
830
|
children: [
|
|
1865
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ jsx9(
|
|
1866
832
|
HighchartsReact2,
|
|
1867
833
|
{
|
|
1868
834
|
highcharts: Highcharts2,
|
|
@@ -1870,13 +836,13 @@ var DonutChartWithData = memo19(
|
|
|
1870
836
|
callback
|
|
1871
837
|
}
|
|
1872
838
|
),
|
|
1873
|
-
chart && !disableTooltips ? /* @__PURE__ */
|
|
839
|
+
chart && !disableTooltips ? /* @__PURE__ */ jsx9(
|
|
1874
840
|
ChartTooltipPortal,
|
|
1875
841
|
{
|
|
1876
842
|
chart,
|
|
1877
843
|
renderContent: (context) => {
|
|
1878
844
|
const { color, icon, name, percent, value } = transformDonutChartTooltipData({ context, data });
|
|
1879
|
-
return tooltip ? tooltip({ color, icon, name, percent, value }) : /* @__PURE__ */
|
|
845
|
+
return tooltip ? tooltip({ color, icon, name, percent, value }) : /* @__PURE__ */ jsx9(
|
|
1880
846
|
DonutChartTooltip,
|
|
1881
847
|
{
|
|
1882
848
|
color,
|
|
@@ -1895,7 +861,7 @@ var DonutChartWithData = memo19(
|
|
|
1895
861
|
}
|
|
1896
862
|
}
|
|
1897
863
|
) : null,
|
|
1898
|
-
hideLegend ? null : /* @__PURE__ */
|
|
864
|
+
hideLegend ? null : /* @__PURE__ */ jsx9(Box6, { mt: 350, children: /* @__PURE__ */ jsx9(DonutChartLegend, { data }) })
|
|
1899
865
|
]
|
|
1900
866
|
}
|
|
1901
867
|
)
|
|
@@ -1904,14 +870,14 @@ var DonutChartWithData = memo19(
|
|
|
1904
870
|
);
|
|
1905
871
|
|
|
1906
872
|
// src/components/DonutChart/components/DonutChartLegendTable.tsx
|
|
1907
|
-
import { memo as
|
|
1908
|
-
import { Box as
|
|
873
|
+
import { memo as memo10 } from "react";
|
|
874
|
+
import { Box as Box7 } from "@sproutsocial/seeds-react-box";
|
|
1909
875
|
import { Duration as Duration3 } from "@sproutsocial/seeds-react-duration";
|
|
1910
876
|
import { Numeral as Numeral3 } from "@sproutsocial/seeds-react-numeral";
|
|
1911
|
-
import { Text as
|
|
1912
|
-
import { theme as
|
|
1913
|
-
import { jsx as
|
|
1914
|
-
var DonutChartLegendTable =
|
|
877
|
+
import { Text as Text4 } from "@sproutsocial/seeds-react-text";
|
|
878
|
+
import { theme as theme6 } from "@sproutsocial/seeds-react-theme";
|
|
879
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
880
|
+
var DonutChartLegendTable = memo10(
|
|
1915
881
|
function DonutChartLegendTable2({
|
|
1916
882
|
data,
|
|
1917
883
|
numberLocale = "en-us",
|
|
@@ -1927,15 +893,15 @@ var DonutChartLegendTable = memo20(
|
|
|
1927
893
|
);
|
|
1928
894
|
const rows = data.map((dataPoint, index) => {
|
|
1929
895
|
const { name, icon, styles, value } = dataPoint;
|
|
1930
|
-
const color = styles?.color ||
|
|
896
|
+
const color = styles?.color || theme6.colors.DATAVIZ_COLORS_LIST[index];
|
|
1931
897
|
return {
|
|
1932
898
|
cells: [
|
|
1933
899
|
{
|
|
1934
|
-
content: /* @__PURE__ */
|
|
900
|
+
content: /* @__PURE__ */ jsx10(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx10(ChartLegendLabelContentWithIcon, { icon, children: name }) })
|
|
1935
901
|
},
|
|
1936
902
|
{
|
|
1937
|
-
content: /* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
903
|
+
content: /* @__PURE__ */ jsxs7(Box7, { display: "inline-flex", alignItems: "center", gap: 350, children: [
|
|
904
|
+
/* @__PURE__ */ jsx10(Text4, { color: "text.body", children: /* @__PURE__ */ jsx10(
|
|
1939
905
|
Numeral3,
|
|
1940
906
|
{
|
|
1941
907
|
abbreviate: false,
|
|
@@ -1944,7 +910,7 @@ var DonutChartLegendTable = memo20(
|
|
|
1944
910
|
number: value / total * 100
|
|
1945
911
|
}
|
|
1946
912
|
) }),
|
|
1947
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ jsx10(Text4, { color: "text.body", fontWeight: "semibold", children: numberFormat === "duration" ? /* @__PURE__ */ jsx10(Duration3, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx10(
|
|
1948
914
|
Numeral3,
|
|
1949
915
|
{
|
|
1950
916
|
abbreviate: false,
|
|
@@ -1964,10 +930,10 @@ var DonutChartLegendTable = memo20(
|
|
|
1964
930
|
{
|
|
1965
931
|
cells: [
|
|
1966
932
|
{
|
|
1967
|
-
content: /* @__PURE__ */
|
|
933
|
+
content: /* @__PURE__ */ jsx10(Text4, { fontWeight: "semibold", color: "text.headline", children: totalLabel })
|
|
1968
934
|
},
|
|
1969
935
|
{
|
|
1970
|
-
content: /* @__PURE__ */
|
|
936
|
+
content: /* @__PURE__ */ jsx10(Text4, { color: "text.body", fontWeight: "bold", children: numberFormat === "duration" ? /* @__PURE__ */ jsx10(Duration3, { locale: textLocale, milliseconds: total }) : /* @__PURE__ */ jsx10(
|
|
1971
937
|
Numeral3,
|
|
1972
938
|
{
|
|
1973
939
|
abbreviate: false,
|
|
@@ -1983,7 +949,7 @@ var DonutChartLegendTable = memo20(
|
|
|
1983
949
|
isAppendedRow: true
|
|
1984
950
|
}
|
|
1985
951
|
];
|
|
1986
|
-
return /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ jsx10(
|
|
1987
953
|
ChartTable,
|
|
1988
954
|
{
|
|
1989
955
|
rows: [...rows, ...totalRow]
|
|
@@ -1993,41 +959,41 @@ var DonutChartLegendTable = memo20(
|
|
|
1993
959
|
);
|
|
1994
960
|
|
|
1995
961
|
// src/components/LineChart/LineChart.tsx
|
|
1996
|
-
import { memo as
|
|
962
|
+
import { memo as memo13 } from "react";
|
|
1997
963
|
import Highcharts3 from "highcharts";
|
|
1998
964
|
import { HighchartsReact as HighchartsReact3 } from "highcharts-react-official";
|
|
1999
965
|
import highchartsAccessibility3 from "highcharts/modules/accessibility";
|
|
2000
966
|
import highchartsAnnotations2 from "highcharts/modules/annotations";
|
|
2001
|
-
import
|
|
2002
|
-
import { Box as
|
|
967
|
+
import styled3 from "styled-components";
|
|
968
|
+
import { Box as Box9 } from "@sproutsocial/seeds-react-box";
|
|
2003
969
|
|
|
2004
970
|
// src/components/LineChart/components/LineChartLegend.tsx
|
|
2005
|
-
import { memo as
|
|
2006
|
-
import { theme as
|
|
2007
|
-
import { jsx as
|
|
971
|
+
import { memo as memo11 } from "react";
|
|
972
|
+
import { theme as theme7 } from "@sproutsocial/seeds-react-theme";
|
|
973
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2008
974
|
var getLineChartLegendLabels = ({
|
|
2009
975
|
data
|
|
2010
976
|
}) => {
|
|
2011
977
|
return data.map((series, index) => ({
|
|
2012
|
-
content: /* @__PURE__ */
|
|
2013
|
-
color: series.styles?.color ||
|
|
978
|
+
content: /* @__PURE__ */ jsx11(ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
979
|
+
color: series.styles?.color || theme7.colors.DATAVIZ_COLORS_LIST[index]
|
|
2014
980
|
}));
|
|
2015
981
|
};
|
|
2016
|
-
var LineChartLegend =
|
|
982
|
+
var LineChartLegend = memo11(
|
|
2017
983
|
function LineChartLegend2({ data }) {
|
|
2018
|
-
return /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ jsx11(ChartLegend, { legendLabels: getLineChartLegendLabels({ data }) });
|
|
2019
985
|
}
|
|
2020
986
|
);
|
|
2021
987
|
|
|
2022
988
|
// src/components/LineChart/components/LineChartTooltip.tsx
|
|
2023
|
-
import { memo as
|
|
2024
|
-
import { Box as
|
|
989
|
+
import { memo as memo12 } from "react";
|
|
990
|
+
import { Box as Box8 } from "@sproutsocial/seeds-react-box";
|
|
2025
991
|
import { Duration as Duration4 } from "@sproutsocial/seeds-react-duration";
|
|
2026
992
|
import { Icon as Icon5 } from "@sproutsocial/seeds-react-icon";
|
|
2027
993
|
import { Numeral as Numeral4 } from "@sproutsocial/seeds-react-numeral";
|
|
2028
|
-
import { Text as
|
|
2029
|
-
import { jsx as
|
|
2030
|
-
var LineChartTooltip =
|
|
994
|
+
import { Text as Text5 } from "@sproutsocial/seeds-react-text";
|
|
995
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
996
|
+
var LineChartTooltip = memo12(
|
|
2031
997
|
function LineChartTooltip2({
|
|
2032
998
|
data,
|
|
2033
999
|
invalidNumberLabel,
|
|
@@ -2046,10 +1012,10 @@ var LineChartTooltip = memo22(
|
|
|
2046
1012
|
return {
|
|
2047
1013
|
cells: [
|
|
2048
1014
|
{
|
|
2049
|
-
content: /* @__PURE__ */
|
|
1015
|
+
content: /* @__PURE__ */ jsx12(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx12(ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ jsx12(Text5, { "aria-label": `${name}: `, children: name }) }) })
|
|
2050
1016
|
},
|
|
2051
1017
|
{
|
|
2052
|
-
content: value === null && invalidNumberLabel ? /* @__PURE__ */
|
|
1018
|
+
content: value === null && invalidNumberLabel ? /* @__PURE__ */ jsx12(Text5, { children: invalidNumberLabel }) : numberFormat === "duration" ? /* @__PURE__ */ jsx12(Duration4, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx12(
|
|
2053
1019
|
Numeral4,
|
|
2054
1020
|
{
|
|
2055
1021
|
abbreviate: false,
|
|
@@ -2064,31 +1030,31 @@ var LineChartTooltip = memo22(
|
|
|
2064
1030
|
]
|
|
2065
1031
|
};
|
|
2066
1032
|
});
|
|
2067
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ jsxs8(ChartTooltip, { children: [
|
|
2068
1034
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
/* @__PURE__ */
|
|
2071
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */
|
|
2072
|
-
/* @__PURE__ */
|
|
2073
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ jsx12(ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
1036
|
+
/* @__PURE__ */ jsx12(ChartTooltipTable, { rows }),
|
|
1037
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ jsx12(ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ jsxs8(Box8, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
1038
|
+
/* @__PURE__ */ jsx12(Icon5, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
1039
|
+
/* @__PURE__ */ jsx12(Text5, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
2074
1040
|
] }) : tooltipClickLabel }) : null
|
|
2075
1041
|
] });
|
|
2076
1042
|
}
|
|
2077
1043
|
);
|
|
2078
1044
|
|
|
2079
1045
|
// src/components/LineChart/LineChart.tsx
|
|
2080
|
-
import { theme as
|
|
2081
|
-
import { Fragment as Fragment4, jsx as
|
|
1046
|
+
import { theme as theme8 } from "@sproutsocial/seeds-react-theme";
|
|
1047
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2082
1048
|
highchartsAccessibility3(Highcharts3);
|
|
2083
1049
|
highchartsAnnotations2(Highcharts3);
|
|
2084
|
-
var
|
|
1050
|
+
var StyledBox3 = styled3(Box9)`
|
|
2085
1051
|
${lineChartStyles}
|
|
2086
1052
|
`;
|
|
2087
|
-
var LineChart =
|
|
1053
|
+
var LineChart = memo13(function LineChart2(props) {
|
|
2088
1054
|
const { data } = props;
|
|
2089
|
-
return data.length === 0 ? null : /* @__PURE__ */
|
|
1055
|
+
return data.length === 0 ? null : /* @__PURE__ */ jsx13(LineChartWithData, { ...props });
|
|
2090
1056
|
});
|
|
2091
|
-
var LineChartWithData =
|
|
1057
|
+
var LineChartWithData = memo13(function LineChartWithData2({
|
|
2092
1058
|
data,
|
|
2093
1059
|
invalidNumberLabel,
|
|
2094
1060
|
numberLocale = "en-us",
|
|
@@ -2125,7 +1091,7 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2125
1091
|
const { colors, patterns } = data.reduce(
|
|
2126
1092
|
(acc, item, index) => {
|
|
2127
1093
|
acc.colors.push(
|
|
2128
|
-
item.styles?.color ??
|
|
1094
|
+
item.styles?.color ?? theme8.colors.DATAVIZ_COLORS_LIST[index] ?? ""
|
|
2129
1095
|
);
|
|
2130
1096
|
acc.patterns.push(item.styles?.pattern ?? "solid");
|
|
2131
1097
|
return acc;
|
|
@@ -2135,17 +1101,17 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2135
1101
|
patterns: []
|
|
2136
1102
|
}
|
|
2137
1103
|
);
|
|
2138
|
-
return /* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
|
|
1104
|
+
return /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
1105
|
+
/* @__PURE__ */ jsx13(GlobalChartStyleOverrides, {}),
|
|
1106
|
+
/* @__PURE__ */ jsxs9(
|
|
1107
|
+
StyledBox3,
|
|
2142
1108
|
{
|
|
2143
1109
|
$colors: colors,
|
|
2144
1110
|
$patterns: patterns,
|
|
2145
1111
|
$hasOnClick: Boolean(onClick),
|
|
2146
1112
|
bg: "container.background.base",
|
|
2147
1113
|
children: [
|
|
2148
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ jsx13(
|
|
2149
1115
|
HighchartsReact3,
|
|
2150
1116
|
{
|
|
2151
1117
|
highcharts: Highcharts3,
|
|
@@ -2153,14 +1119,15 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2153
1119
|
callback
|
|
2154
1120
|
}
|
|
2155
1121
|
),
|
|
2156
|
-
chart && chart.annotations?.length ? /* @__PURE__ */
|
|
1122
|
+
chart && chart.annotations?.length ? /* @__PURE__ */ jsx13(
|
|
2157
1123
|
ChartXAnnotationMarkerPortal,
|
|
2158
1124
|
{
|
|
2159
1125
|
xAnnotations,
|
|
2160
|
-
annotationContext: chart.annotations?.[0]
|
|
1126
|
+
annotationContext: chart.annotations?.[0],
|
|
1127
|
+
chartContainer: chart.container
|
|
2161
1128
|
}
|
|
2162
1129
|
) : null,
|
|
2163
|
-
chart && !disableTooltips ? /* @__PURE__ */
|
|
1130
|
+
chart && !disableTooltips ? /* @__PURE__ */ jsx13(
|
|
2164
1131
|
ChartTooltipPortal,
|
|
2165
1132
|
{
|
|
2166
1133
|
chart,
|
|
@@ -2171,7 +1138,7 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2171
1138
|
});
|
|
2172
1139
|
const x = context.x;
|
|
2173
1140
|
const xAnnotationDetails = xAnnotations?.[x]?.details;
|
|
2174
|
-
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */
|
|
1141
|
+
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */ jsx13(
|
|
2175
1142
|
LineChartTooltip,
|
|
2176
1143
|
{
|
|
2177
1144
|
currency,
|
|
@@ -2190,7 +1157,7 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2190
1157
|
}
|
|
2191
1158
|
}
|
|
2192
1159
|
) : null,
|
|
2193
|
-
/* @__PURE__ */
|
|
1160
|
+
/* @__PURE__ */ jsx13(Box9, { mt: 350, children: /* @__PURE__ */ jsx13(LineChartLegend, { data }) })
|
|
2194
1161
|
]
|
|
2195
1162
|
}
|
|
2196
1163
|
)
|
|
@@ -2198,41 +1165,41 @@ var LineChartWithData = memo23(function LineChartWithData2({
|
|
|
2198
1165
|
});
|
|
2199
1166
|
|
|
2200
1167
|
// src/components/VerticalBarChart/VerticalBarChart.tsx
|
|
2201
|
-
import { memo as
|
|
1168
|
+
import { memo as memo16 } from "react";
|
|
2202
1169
|
import Highcharts4 from "highcharts";
|
|
2203
1170
|
import { HighchartsReact as HighchartsReact4 } from "highcharts-react-official";
|
|
2204
1171
|
import highchartsAccessibility4 from "highcharts/modules/accessibility";
|
|
2205
1172
|
import highchartsAnnotations3 from "highcharts/modules/annotations";
|
|
2206
|
-
import
|
|
2207
|
-
import { Box as
|
|
1173
|
+
import styled4 from "styled-components";
|
|
1174
|
+
import { Box as Box11 } from "@sproutsocial/seeds-react-box";
|
|
2208
1175
|
|
|
2209
1176
|
// src/components/VerticalBarChart/components/VerticalBarChartLegend.tsx
|
|
2210
|
-
import { memo as
|
|
2211
|
-
import { theme as
|
|
2212
|
-
import { jsx as
|
|
1177
|
+
import { memo as memo14 } from "react";
|
|
1178
|
+
import { theme as theme9 } from "@sproutsocial/seeds-react-theme";
|
|
1179
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2213
1180
|
var getVerticalBarChartLegendLabels = ({
|
|
2214
1181
|
data
|
|
2215
1182
|
}) => {
|
|
2216
1183
|
return data.map((series, index) => ({
|
|
2217
|
-
content: /* @__PURE__ */
|
|
2218
|
-
color: series.styles?.color ||
|
|
1184
|
+
content: /* @__PURE__ */ jsx14(ChartLegendLabelContentWithIcon, { icon: series.icon, children: series.name }),
|
|
1185
|
+
color: series.styles?.color || theme9.colors.DATAVIZ_COLORS_LIST[index]
|
|
2219
1186
|
}));
|
|
2220
1187
|
};
|
|
2221
|
-
var VerticalBarChartLegend =
|
|
1188
|
+
var VerticalBarChartLegend = memo14(
|
|
2222
1189
|
function VerticalbarChartLegend({ data }) {
|
|
2223
|
-
return /* @__PURE__ */
|
|
1190
|
+
return /* @__PURE__ */ jsx14(ChartLegend, { legendLabels: getVerticalBarChartLegendLabels({ data }) });
|
|
2224
1191
|
}
|
|
2225
1192
|
);
|
|
2226
1193
|
|
|
2227
1194
|
// src/components/VerticalBarChart/components/VerticalBarChartTooltip.tsx
|
|
2228
|
-
import { memo as
|
|
2229
|
-
import { Box as
|
|
1195
|
+
import { memo as memo15 } from "react";
|
|
1196
|
+
import { Box as Box10 } from "@sproutsocial/seeds-react-box";
|
|
2230
1197
|
import { Duration as Duration5 } from "@sproutsocial/seeds-react-duration";
|
|
2231
1198
|
import { Icon as Icon6 } from "@sproutsocial/seeds-react-icon";
|
|
2232
1199
|
import { Numeral as Numeral5 } from "@sproutsocial/seeds-react-numeral";
|
|
2233
|
-
import { Text as
|
|
2234
|
-
import { jsx as
|
|
2235
|
-
var VerticalBarChartTooltip =
|
|
1200
|
+
import { Text as Text6 } from "@sproutsocial/seeds-react-text";
|
|
1201
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1202
|
+
var VerticalBarChartTooltip = memo15(
|
|
2236
1203
|
function VerticalBarChartTooltip2({
|
|
2237
1204
|
data,
|
|
2238
1205
|
invalidNumberLabel,
|
|
@@ -2251,10 +1218,10 @@ var VerticalBarChartTooltip = memo25(
|
|
|
2251
1218
|
return {
|
|
2252
1219
|
cells: [
|
|
2253
1220
|
{
|
|
2254
|
-
content: /* @__PURE__ */
|
|
1221
|
+
content: /* @__PURE__ */ jsx15(ChartLegendLabel, { color, children: /* @__PURE__ */ jsx15(ChartLegendLabelContentWithIcon, { icon, children: /* @__PURE__ */ jsx15(Text6, { "aria-label": `${name}: `, children: name }) }) })
|
|
2255
1222
|
},
|
|
2256
1223
|
{
|
|
2257
|
-
content: value === null && invalidNumberLabel ? /* @__PURE__ */
|
|
1224
|
+
content: value === null && invalidNumberLabel ? /* @__PURE__ */ jsx15(Text6, { children: invalidNumberLabel }) : numberFormat === "duration" ? /* @__PURE__ */ jsx15(Duration5, { locale: textLocale, milliseconds: value }) : /* @__PURE__ */ jsx15(
|
|
2258
1225
|
Numeral5,
|
|
2259
1226
|
{
|
|
2260
1227
|
abbreviate: false,
|
|
@@ -2269,48 +1236,27 @@ var VerticalBarChartTooltip = memo25(
|
|
|
2269
1236
|
]
|
|
2270
1237
|
};
|
|
2271
1238
|
});
|
|
2272
|
-
return /* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ jsxs10(ChartTooltip, { children: [
|
|
2273
1240
|
xAnnotationDetails ? xAnnotationDetails() : void 0,
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2276
|
-
onClick && tooltipClickLabel ? /* @__PURE__ */
|
|
2277
|
-
/* @__PURE__ */
|
|
2278
|
-
/* @__PURE__ */
|
|
1241
|
+
/* @__PURE__ */ jsx15(ChartTooltipTitle, { children: tooltipDateFormatter({ x }) }),
|
|
1242
|
+
/* @__PURE__ */ jsx15(ChartTooltipTable, { rows }),
|
|
1243
|
+
onClick && tooltipClickLabel ? /* @__PURE__ */ jsx15(ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ jsxs10(Box10, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
1244
|
+
/* @__PURE__ */ jsx15(Icon6, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
1245
|
+
/* @__PURE__ */ jsx15(Text6, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
2279
1246
|
] }) : tooltipClickLabel }) : null
|
|
2280
1247
|
] });
|
|
2281
1248
|
}
|
|
2282
1249
|
);
|
|
2283
1250
|
|
|
2284
1251
|
// 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";
|
|
1252
|
+
import { theme as theme10 } from "@sproutsocial/seeds-react-theme";
|
|
1253
|
+
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2308
1254
|
highchartsAccessibility4(Highcharts4);
|
|
2309
1255
|
highchartsAnnotations3(Highcharts4);
|
|
2310
|
-
var
|
|
1256
|
+
var StyledBox4 = styled4(Box11)`
|
|
2311
1257
|
${verticalBarChartStyles}
|
|
2312
1258
|
`;
|
|
2313
|
-
var VerticalBarChart =
|
|
1259
|
+
var VerticalBarChart = memo16(
|
|
2314
1260
|
function VerticalBarChart2(props) {
|
|
2315
1261
|
const { data, showSeriesLimitWarning = true } = props;
|
|
2316
1262
|
const seriesLimit = props.seriesLimit ?? VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT;
|
|
@@ -2327,10 +1273,10 @@ var VerticalBarChart = memo26(
|
|
|
2327
1273
|
}
|
|
2328
1274
|
chartData = data.slice(0, seriesLimit);
|
|
2329
1275
|
}
|
|
2330
|
-
return /* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ jsx16(VerticalBarChartWithData, { ...props, data: chartData });
|
|
2331
1277
|
}
|
|
2332
1278
|
);
|
|
2333
|
-
var VerticalBarChartWithData =
|
|
1279
|
+
var VerticalBarChartWithData = memo16(
|
|
2334
1280
|
function VerticalBarChartWithData2({
|
|
2335
1281
|
data,
|
|
2336
1282
|
invalidNumberLabel,
|
|
@@ -2404,7 +1350,7 @@ var VerticalBarChartWithData = memo26(
|
|
|
2404
1350
|
const { colors, patterns } = data.reduce(
|
|
2405
1351
|
(acc, item, index) => {
|
|
2406
1352
|
acc.colors.push(
|
|
2407
|
-
item.styles?.color ??
|
|
1353
|
+
item.styles?.color ?? theme10.colors.DATAVIZ_COLORS_LIST[index] ?? ""
|
|
2408
1354
|
);
|
|
2409
1355
|
acc.patterns.push(item.styles?.pattern ?? "solid");
|
|
2410
1356
|
return acc;
|
|
@@ -2414,16 +1360,16 @@ var VerticalBarChartWithData = memo26(
|
|
|
2414
1360
|
patterns: []
|
|
2415
1361
|
}
|
|
2416
1362
|
);
|
|
2417
|
-
return /* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */
|
|
2419
|
-
/* @__PURE__ */
|
|
2420
|
-
|
|
1363
|
+
return /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
1364
|
+
/* @__PURE__ */ jsx16(GlobalChartStyleOverrides, {}),
|
|
1365
|
+
/* @__PURE__ */ jsxs11(
|
|
1366
|
+
StyledBox4,
|
|
2421
1367
|
{
|
|
2422
1368
|
$colors: colors,
|
|
2423
1369
|
$hasOnClick: Boolean(onClick),
|
|
2424
1370
|
bg: "container.background.base",
|
|
2425
1371
|
children: [
|
|
2426
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ jsx16(
|
|
2427
1373
|
HighchartsReact4,
|
|
2428
1374
|
{
|
|
2429
1375
|
highcharts: Highcharts4,
|
|
@@ -2431,14 +1377,15 @@ var VerticalBarChartWithData = memo26(
|
|
|
2431
1377
|
callback
|
|
2432
1378
|
}
|
|
2433
1379
|
),
|
|
2434
|
-
chart && chart.annotations?.length ? /* @__PURE__ */
|
|
1380
|
+
chart && chart.annotations?.length ? /* @__PURE__ */ jsx16(
|
|
2435
1381
|
ChartXAnnotationMarkerPortal,
|
|
2436
1382
|
{
|
|
2437
1383
|
xAnnotations,
|
|
2438
|
-
annotationContext: chart.annotations?.[0]
|
|
1384
|
+
annotationContext: chart.annotations?.[0],
|
|
1385
|
+
chartContainer: chart.container
|
|
2439
1386
|
}
|
|
2440
1387
|
) : null,
|
|
2441
|
-
chart ? /* @__PURE__ */
|
|
1388
|
+
chart ? /* @__PURE__ */ jsx16(
|
|
2442
1389
|
ChartTooltipPortal,
|
|
2443
1390
|
{
|
|
2444
1391
|
chart,
|
|
@@ -2449,7 +1396,7 @@ var VerticalBarChartWithData = memo26(
|
|
|
2449
1396
|
});
|
|
2450
1397
|
const x = context.x;
|
|
2451
1398
|
const xAnnotationDetails = typeof x === "number" ? xAnnotations?.[x]?.details : void 0;
|
|
2452
|
-
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */
|
|
1399
|
+
return tooltip ? tooltip({ data: tooltipData, x }) : /* @__PURE__ */ jsx16(
|
|
2453
1400
|
VerticalBarChartTooltip,
|
|
2454
1401
|
{
|
|
2455
1402
|
currency,
|
|
@@ -2468,7 +1415,7 @@ var VerticalBarChartWithData = memo26(
|
|
|
2468
1415
|
}
|
|
2469
1416
|
}
|
|
2470
1417
|
) : null,
|
|
2471
|
-
/* @__PURE__ */
|
|
1418
|
+
/* @__PURE__ */ jsx16(Box11, { mt: 350, children: /* @__PURE__ */ jsx16(VerticalBarChartLegend, { data }) })
|
|
2472
1419
|
]
|
|
2473
1420
|
}
|
|
2474
1421
|
)
|