@sproutsocial/seeds-react-data-viz 0.24.5 → 0.25.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.js +12 -13
- package/dist/bar/index.js.map +1 -1
- package/dist/bubble/index.d.mts +1 -1
- package/dist/bubble/index.d.ts +1 -1
- package/dist/bubble/index.js +9 -10
- package/dist/bubble/index.js.map +1 -1
- package/dist/{chartOptions-DHzoGRdG.d.mts → chartOptions-D6MzNjbB.d.mts} +3 -1
- package/dist/{chartOptions-DHzoGRdG.d.ts → chartOptions-D6MzNjbB.d.ts} +3 -1
- package/dist/charts.css +80 -0
- package/dist/{chunk-LKUL4EFZ.js → chunk-2A3KLUIF.js} +3 -3
- package/dist/{chunk-LKUL4EFZ.js.map → chunk-2A3KLUIF.js.map} +1 -1
- package/dist/{chunk-GHZHRFE6.js → chunk-CWKFNAXF.js} +3 -3
- package/dist/{chunk-GHZHRFE6.js.map → chunk-CWKFNAXF.js.map} +1 -1
- package/dist/{chunk-W57R2V23.js → chunk-LWDHU4QK.js} +183 -7
- package/dist/chunk-LWDHU4QK.js.map +1 -0
- package/dist/{chunk-5JQXDK23.js → chunk-TNZNBMSZ.js} +292 -73
- package/dist/chunk-TNZNBMSZ.js.map +1 -0
- package/dist/donut/index.js +6 -7
- package/dist/donut/index.js.map +1 -1
- package/dist/esm/bar/index.js +6 -7
- package/dist/esm/bar/index.js.map +1 -1
- package/dist/esm/bubble/index.js +6 -7
- package/dist/esm/bubble/index.js.map +1 -1
- package/dist/esm/{chunk-AUU3KROF.js → chunk-AJGRGRI6.js} +2 -2
- package/dist/esm/{chunk-DF5PVRXT.js → chunk-CIG5NERD.js} +2 -2
- package/dist/esm/{chunk-EWAD675C.js → chunk-V63L6753.js} +257 -38
- package/dist/esm/chunk-V63L6753.js.map +1 -0
- package/dist/esm/{chunk-32QLJDP2.js → chunk-VCTZWYEM.js} +177 -1
- package/dist/esm/chunk-VCTZWYEM.js.map +1 -0
- package/dist/esm/donut/index.js +4 -5
- package/dist/esm/donut/index.js.map +1 -1
- package/dist/esm/index.js +15 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/line-area/index.js +6 -7
- package/dist/esm/line-area/index.js.map +1 -1
- package/dist/esm/sparkline/index.js +3 -3
- package/dist/esm/wordcloud/index.js +82 -0
- package/dist/esm/wordcloud/index.js.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +54 -54
- package/dist/index.js.map +1 -1
- package/dist/line-area/index.js +12 -13
- package/dist/line-area/index.js.map +1 -1
- package/dist/sparkline/index.js +7 -7
- package/dist/wordcloud/index.d.mts +62 -0
- package/dist/wordcloud/index.d.ts +62 -0
- package/dist/wordcloud/index.js +82 -0
- package/dist/wordcloud/index.js.map +1 -0
- package/dist/wordcloud.css +79 -0
- package/package.json +10 -3
- package/dist/chunk-33Y5FZTT.js +0 -177
- package/dist/chunk-33Y5FZTT.js.map +0 -1
- package/dist/chunk-5JQXDK23.js.map +0 -1
- package/dist/chunk-W57R2V23.js.map +0 -1
- package/dist/esm/chunk-32QLJDP2.js.map +0 -1
- package/dist/esm/chunk-EWAD675C.js.map +0 -1
- package/dist/esm/chunk-XRZJACCB.js +0 -177
- package/dist/esm/chunk-XRZJACCB.js.map +0 -1
- /package/dist/esm/{chunk-AUU3KROF.js.map → chunk-AJGRGRI6.js.map} +0 -0
- /package/dist/esm/{chunk-DF5PVRXT.js.map → chunk-CIG5NERD.js.map} +0 -0
|
@@ -9,7 +9,251 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
var _chunkLWDHU4QKjs = require('./chunk-LWDHU4QK.js');
|
|
14
|
+
|
|
15
|
+
// src/charts/shared/baseChartOptions.ts
|
|
16
|
+
function buildBaseChartOptions({
|
|
17
|
+
type,
|
|
18
|
+
description,
|
|
19
|
+
svgContainerLabel,
|
|
20
|
+
point,
|
|
21
|
+
reserveTopMargin = false,
|
|
22
|
+
timezone
|
|
23
|
+
}) {
|
|
24
|
+
return {
|
|
25
|
+
chart: {
|
|
26
|
+
type,
|
|
27
|
+
styledMode: true,
|
|
28
|
+
animation: false,
|
|
29
|
+
...reserveTopMargin ? { marginTop: 24 } : {}
|
|
30
|
+
},
|
|
31
|
+
accessibility: { description, svgContainerLabel, point },
|
|
32
|
+
title: { text: "" },
|
|
33
|
+
credits: { enabled: false },
|
|
34
|
+
legend: { enabled: false },
|
|
35
|
+
tooltip: {
|
|
36
|
+
enabled: true,
|
|
37
|
+
outside: true,
|
|
38
|
+
padding: 0,
|
|
39
|
+
shape: "rect",
|
|
40
|
+
shared: true,
|
|
41
|
+
hideDelay: 0
|
|
42
|
+
},
|
|
43
|
+
// Chart-global in Highcharts; only meaningful for datetime axes, so it's
|
|
44
|
+
// present only when a timezone was resolved (omitted for category axes).
|
|
45
|
+
...timezone ? { time: { timezone } } : {}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/charts/wordcloud/adapter.ts
|
|
50
|
+
var DEFAULT_OPACITY_RANGE = [0.6, 1];
|
|
51
|
+
var WORD_CLOUD_MIN_FONT_SIZE = 13;
|
|
52
|
+
var WORD_CLOUD_MAXIMUM_MAX_FONT_SIZE = 50;
|
|
53
|
+
var WORD_CLOUD_MINIMUM_MAX_FONT_SIZE = 24;
|
|
54
|
+
var WORD_CLOUD_MAX_FONT_SIZE_WIDTH_DIVISOR = 15;
|
|
55
|
+
function deriveMaxFontSize(width) {
|
|
56
|
+
if (!width) return WORD_CLOUD_MAXIMUM_MAX_FONT_SIZE;
|
|
57
|
+
const derived = Math.floor(width / WORD_CLOUD_MAX_FONT_SIZE_WIDTH_DIVISOR);
|
|
58
|
+
return Math.min(
|
|
59
|
+
Math.max(derived, WORD_CLOUD_MINIMUM_MAX_FONT_SIZE),
|
|
60
|
+
WORD_CLOUD_MAXIMUM_MAX_FONT_SIZE
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
var WORD_CLOUD_MAXIMUM_WORD_COUNT = 100;
|
|
64
|
+
var WORD_CLOUD_MINIMUM_WORD_COUNT = 40;
|
|
65
|
+
var WORD_CLOUD_WORD_COUNT_WIDTH_DIVISOR = 9;
|
|
66
|
+
function deriveMaxWordCount(width) {
|
|
67
|
+
if (!width) return WORD_CLOUD_MAXIMUM_WORD_COUNT;
|
|
68
|
+
const derived = Math.floor(width / WORD_CLOUD_WORD_COUNT_WIDTH_DIVISOR);
|
|
69
|
+
return Math.min(
|
|
70
|
+
Math.max(derived, WORD_CLOUD_MINIMUM_WORD_COUNT),
|
|
71
|
+
WORD_CLOUD_MAXIMUM_WORD_COUNT
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
var WORD_CLOUD_MAXIMUM_WORD_PADDING = 4;
|
|
75
|
+
var WORD_CLOUD_MINIMUM_WORD_PADDING = 1;
|
|
76
|
+
var WORD_CLOUD_WORD_PADDING_WIDTH_DIVISOR = 150;
|
|
77
|
+
function deriveWordPadding(width) {
|
|
78
|
+
if (!width) return WORD_CLOUD_MAXIMUM_WORD_PADDING;
|
|
79
|
+
const derived = Math.floor(width / WORD_CLOUD_WORD_PADDING_WIDTH_DIVISOR);
|
|
80
|
+
return Math.min(
|
|
81
|
+
Math.max(derived, WORD_CLOUD_MINIMUM_WORD_PADDING),
|
|
82
|
+
WORD_CLOUD_MAXIMUM_WORD_PADDING
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
var wordCloudAspectArchimedeanSpiral = (attempt, { field }) => {
|
|
86
|
+
const maxDelta = field.width * field.width + field.height * field.height;
|
|
87
|
+
if (attempt > 1e4) return false;
|
|
88
|
+
const t = attempt * 0.8;
|
|
89
|
+
const result = {
|
|
90
|
+
x: field.ratioX * t * Math.cos(t),
|
|
91
|
+
y: field.ratioY * t * Math.sin(t)
|
|
92
|
+
};
|
|
93
|
+
if (!(Math.min(Math.abs(result.x), Math.abs(result.y)) < maxDelta)) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
};
|
|
98
|
+
var wordCloudPaddingPlacementStrategy = (point) => {
|
|
99
|
+
const wordPadding = _nullishCoalesce(point.series.options.wordPadding, () => ( 0));
|
|
100
|
+
point.dimensions = {
|
|
101
|
+
width: point.dimensions.width + wordPadding * 2,
|
|
102
|
+
height: point.dimensions.height + wordPadding * 2
|
|
103
|
+
};
|
|
104
|
+
return { x: 0, y: 0, rotation: false };
|
|
105
|
+
};
|
|
106
|
+
var EMOJI_ONLY_TERM_REGEX = /^(?:\p{Extended_Pictographic}|\p{Regional_Indicator}|\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}|\u200D|\uFE0F)+$/u;
|
|
107
|
+
function isEmojiOnlyTerm(name) {
|
|
108
|
+
return EMOJI_ONLY_TERM_REGEX.test(name);
|
|
109
|
+
}
|
|
110
|
+
function resolveGroupColorIndex(groupId, groups) {
|
|
111
|
+
if (!groups || groups.length === 0 || groupId == null) return 0;
|
|
112
|
+
const index = groups.findIndex((group) => group.id === groupId);
|
|
113
|
+
return index === -1 ? 0 : index;
|
|
114
|
+
}
|
|
115
|
+
function normalizeWeight(weight, min, max) {
|
|
116
|
+
return max === min ? 1 : (weight - min) / (max - min);
|
|
117
|
+
}
|
|
118
|
+
function compressWeight(weight) {
|
|
119
|
+
return Math.log(Math.max(weight, 1));
|
|
120
|
+
}
|
|
121
|
+
function resolvePointOpacity({
|
|
122
|
+
weight,
|
|
123
|
+
min,
|
|
124
|
+
max,
|
|
125
|
+
hasGroups,
|
|
126
|
+
isEmojiOnly,
|
|
127
|
+
opacityRange
|
|
128
|
+
}) {
|
|
129
|
+
if (hasGroups) return 1;
|
|
130
|
+
const [rangeMin, rangeMax] = opacityRange;
|
|
131
|
+
if (isEmojiOnly) return rangeMax;
|
|
132
|
+
const t = normalizeWeight(weight, min, max);
|
|
133
|
+
return rangeMin + t * (rangeMax - rangeMin);
|
|
134
|
+
}
|
|
135
|
+
function transformWordCloudDataToPoints(data, groups, opacityRange, maxWordCount = WORD_CLOUD_MAXIMUM_WORD_COUNT) {
|
|
136
|
+
const capped = [...data].sort((a, b) => b.weight - a.weight).slice(0, maxWordCount);
|
|
137
|
+
const hasGroups = Boolean(groups && groups.length > 0);
|
|
138
|
+
const compressedWeights = capped.map((point) => compressWeight(point.weight));
|
|
139
|
+
const min = Math.min(...compressedWeights);
|
|
140
|
+
const max = Math.max(...compressedWeights);
|
|
141
|
+
return capped.map((point, i) => {
|
|
142
|
+
const colorIndex = resolveGroupColorIndex(point.groupId, groups);
|
|
143
|
+
const weight = compressedWeights[i];
|
|
144
|
+
return {
|
|
145
|
+
name: point.name,
|
|
146
|
+
weight,
|
|
147
|
+
colorIndex,
|
|
148
|
+
opacity: resolvePointOpacity({
|
|
149
|
+
weight,
|
|
150
|
+
min,
|
|
151
|
+
max,
|
|
152
|
+
hasGroups,
|
|
153
|
+
isEmojiOnly: isEmojiOnlyTerm(point.name),
|
|
154
|
+
opacityRange
|
|
155
|
+
}),
|
|
156
|
+
className: `seeds-wordcloud-word--group-${colorIndex}`,
|
|
157
|
+
custom: { groupId: point.groupId, rawWeight: point.weight }
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function transformWordCloudClickData(event) {
|
|
162
|
+
const base = {
|
|
163
|
+
name: event.point.name,
|
|
164
|
+
weight: _nullishCoalesce(_optionalChain([event, 'access', _ => _.point, 'access', _2 => _2.custom, 'optionalAccess', _3 => _3.rawWeight]), () => ( event.point.weight)),
|
|
165
|
+
groupId: _optionalChain([event, 'access', _4 => _4.point, 'access', _5 => _5.custom, 'optionalAccess', _6 => _6.groupId]),
|
|
166
|
+
pointIndex: event.point.index
|
|
167
|
+
};
|
|
168
|
+
const isClickEvent = event.type === "click";
|
|
169
|
+
if (!isClickEvent && event.target) {
|
|
170
|
+
const rect = event.target.getBoundingClientRect();
|
|
171
|
+
return { ...base, pageX: rect.x, pageY: rect.y };
|
|
172
|
+
}
|
|
173
|
+
return { ...base, pageX: _nullishCoalesce(event.pageX, () => ( 0)), pageY: _nullishCoalesce(event.pageY, () => ( 0)) };
|
|
174
|
+
}
|
|
175
|
+
function buildWordCloudOptions(props, containerWidth) {
|
|
176
|
+
const opacityRange = _nullishCoalesce(props.opacityRange, () => ( DEFAULT_OPACITY_RANGE));
|
|
177
|
+
const points = transformWordCloudDataToPoints(
|
|
178
|
+
props.data,
|
|
179
|
+
props.groups,
|
|
180
|
+
opacityRange,
|
|
181
|
+
deriveMaxWordCount(_nullishCoalesce(containerWidth, () => ( 0)))
|
|
182
|
+
);
|
|
183
|
+
const base = buildBaseChartOptions({
|
|
184
|
+
type: "wordcloud",
|
|
185
|
+
description: props.description
|
|
186
|
+
});
|
|
187
|
+
return {
|
|
188
|
+
...base,
|
|
189
|
+
chart: {
|
|
190
|
+
...base.chart,
|
|
191
|
+
type: "wordcloud",
|
|
192
|
+
height: _nullishCoalesce(props.height, () => ( _chunkLWDHU4QKjs.WORD_CLOUD_CHART_HEIGHT))
|
|
193
|
+
},
|
|
194
|
+
// `ChartRenderer`'s default-tooltip routing only recognizes "pie" and
|
|
195
|
+
// "packedbubble" as single-point (non-cartesian) series types
|
|
196
|
+
// (chartBase.tsx); an unrecognized type like "wordcloud" falls through to
|
|
197
|
+
// the time-series branch, which reads `context.x` as a timestamp and
|
|
198
|
+
// renders a bogus epoch-date title. Disabled entirely rather than adding
|
|
199
|
+
// a wordcloud branch to shared code — the word's size/opacity already
|
|
200
|
+
// communicates weight.
|
|
201
|
+
tooltip: { ...base.tooltip, enabled: false },
|
|
202
|
+
plotOptions: {
|
|
203
|
+
// `series.animation: false` matches the sibling-adapter convention, but
|
|
204
|
+
// the wordcloud series overrides it back to `true`: Highcharts 11.4.8's
|
|
205
|
+
// WordcloudSeries.drawPoints() only builds `animatableAttribs` inside an
|
|
206
|
+
// `if (animation)` branch (wordcloud.src.js ~line 1243). With animation
|
|
207
|
+
// off, any point that was previously placed but fails to re-place on a
|
|
208
|
+
// later redraw hits `DPU.draw()`'s point-removal path with
|
|
209
|
+
// `animatableAttribs: undefined`, and `Object.keys(undefined)` throws.
|
|
210
|
+
// A component's routine post-mount `chart.update()` triggers exactly
|
|
211
|
+
// this, so it surfaces on a plain mount, not just on resize.
|
|
212
|
+
series: { animation: false },
|
|
213
|
+
wordcloud: {
|
|
214
|
+
animation: true,
|
|
215
|
+
// Hover dim (layer 3). Off by default for column-derived series
|
|
216
|
+
// (wordcloud's base class) — pie is the only series type that
|
|
217
|
+
// defaults this to `true`. Without it, Highcharts never adds
|
|
218
|
+
// `.highcharts-point-inactive` to the other words on hover.
|
|
219
|
+
inactiveOtherPoints: true,
|
|
220
|
+
minFontSize: _nullishCoalesce(props.minFontSize, () => ( WORD_CLOUD_MIN_FONT_SIZE)),
|
|
221
|
+
// An explicit prop wins; otherwise derived from the measured
|
|
222
|
+
// container width (`WordCloud.tsx`'s `useMeasure` call). Must stay a
|
|
223
|
+
// number — see `WORD_CLOUD_MAXIMUM_MAX_FONT_SIZE`'s doc comment for
|
|
224
|
+
// why `undefined` breaks sizing.
|
|
225
|
+
maxFontSize: _nullishCoalesce(props.maxFontSize, () => ( deriveMaxFontSize(_nullishCoalesce(containerWidth, () => ( 0))))),
|
|
226
|
+
// Pinned horizontal — Highcharts' default tilts words vertical
|
|
227
|
+
// (`{from: 0, to: 90}`).
|
|
228
|
+
rotation: { from: 0, to: 0, orientations: 1 },
|
|
229
|
+
// `seedsAspectArchimedean` (a pure function above, registered onto
|
|
230
|
+
// Highcharts in chartBase.tsx) — Highcharts' own `archimedean` traces
|
|
231
|
+
// a true circle with no aspect term, so it can't grow into a wide
|
|
232
|
+
// container.
|
|
233
|
+
spiral: "seedsAspectArchimedean",
|
|
234
|
+
// `seedsWordPadding` (a pure function above, registered onto
|
|
235
|
+
// Highcharts in chartBase.tsx) approximates word spacing, which
|
|
236
|
+
// Highcharts' wordcloud module has no native option for; it reads
|
|
237
|
+
// `wordPadding` off this same resolved options object. An explicit
|
|
238
|
+
// prop wins; otherwise derived from the measured container width
|
|
239
|
+
// (`deriveWordPadding`) — see its doc comment for why a fixed
|
|
240
|
+
// padding disproportionately shrinks text on a narrow container.
|
|
241
|
+
placementStrategy: "seedsWordPadding",
|
|
242
|
+
wordPadding: _nullishCoalesce(props.wordPadding, () => ( deriveWordPadding(_nullishCoalesce(containerWidth, () => ( 0))))),
|
|
243
|
+
point: {
|
|
244
|
+
events: {
|
|
245
|
+
click: props.onClick ? (event) => {
|
|
246
|
+
_optionalChain([event, 'access', _7 => _7.stopPropagation, 'optionalCall', _8 => _8()]);
|
|
247
|
+
if (event.type !== "click" && !event.target) return;
|
|
248
|
+
props.onClick(transformWordCloudClickData(event));
|
|
249
|
+
} : void 0
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
series: points.length > 0 ? [{ type: "wordcloud", name: "Word Cloud", data: points }] : []
|
|
255
|
+
};
|
|
256
|
+
}
|
|
13
257
|
|
|
14
258
|
// src/charts/shared/chartBase.tsx
|
|
15
259
|
var _highcharts = require('highcharts'); var _highcharts2 = _interopRequireDefault(_highcharts);
|
|
@@ -20,6 +264,7 @@ var _exporting = require('highcharts/modules/exporting'); var _exporting2 = _int
|
|
|
20
264
|
var _offlineexporting = require('highcharts/modules/offline-exporting'); var _offlineexporting2 = _interopRequireDefault(_offlineexporting);
|
|
21
265
|
var _exportdata = require('highcharts/modules/export-data'); var _exportdata2 = _interopRequireDefault(_exportdata);
|
|
22
266
|
var _highchartsmore = require('highcharts/highcharts-more'); var _highchartsmore2 = _interopRequireDefault(_highchartsmore);
|
|
267
|
+
var _wordcloud = require('highcharts/modules/wordcloud'); var _wordcloud2 = _interopRequireDefault(_wordcloud);
|
|
23
268
|
|
|
24
269
|
|
|
25
270
|
|
|
@@ -84,7 +329,7 @@ var ChartAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
84
329
|
(annotation) => annotation.setAttribute(MARKER_ATTR, "false")
|
|
85
330
|
);
|
|
86
331
|
annotationContext.labels.forEach((label) => {
|
|
87
|
-
const labelElement = _optionalChain([label, 'access',
|
|
332
|
+
const labelElement = _optionalChain([label, 'access', _9 => _9.graphic, 'optionalAccess', _10 => _10.div]);
|
|
88
333
|
if (!labelElement) return;
|
|
89
334
|
let annotationDiv = labelElement.querySelector(
|
|
90
335
|
`div[${MARKER_ATTR}]`
|
|
@@ -94,7 +339,7 @@ var ChartAnnotationMarkerPortal = _react.memo.call(void 0,
|
|
|
94
339
|
labelElement.appendChild(annotationDiv);
|
|
95
340
|
}
|
|
96
341
|
annotationDiv.setAttribute(MARKER_ATTR, "true");
|
|
97
|
-
const xValue = _optionalChain([label, 'access',
|
|
342
|
+
const xValue = _optionalChain([label, 'access', _11 => _11.options, 'optionalAccess', _12 => _12.point, 'optionalAccess', _13 => _13.x]);
|
|
98
343
|
newContainers[xValue] = annotationDiv;
|
|
99
344
|
});
|
|
100
345
|
annotationContainers.current = newContainers;
|
|
@@ -161,9 +406,9 @@ var getDatePartsInTimezone = (date, timezone) => {
|
|
|
161
406
|
});
|
|
162
407
|
const parts = formatter.formatToParts(date);
|
|
163
408
|
return {
|
|
164
|
-
day: parseInt(_nullishCoalesce(_optionalChain([parts, 'access',
|
|
165
|
-
month: parseInt(_nullishCoalesce(_optionalChain([parts, 'access',
|
|
166
|
-
year: parseInt(_nullishCoalesce(_optionalChain([parts, 'access',
|
|
409
|
+
day: parseInt(_nullishCoalesce(_optionalChain([parts, 'access', _14 => _14.find, 'call', _15 => _15((p) => p.type === "day"), 'optionalAccess', _16 => _16.value]), () => ( "0")), 10),
|
|
410
|
+
month: parseInt(_nullishCoalesce(_optionalChain([parts, 'access', _17 => _17.find, 'call', _18 => _18((p) => p.type === "month"), 'optionalAccess', _19 => _19.value]), () => ( "0")), 10),
|
|
411
|
+
year: parseInt(_nullishCoalesce(_optionalChain([parts, 'access', _20 => _20.find, 'call', _21 => _21((p) => p.type === "year"), 'optionalAccess', _22 => _22.value]), () => ( "0")), 10)
|
|
167
412
|
};
|
|
168
413
|
};
|
|
169
414
|
var deriveGranularity = (tickPositions) => {
|
|
@@ -222,20 +467,20 @@ function datetimeFormatter({
|
|
|
222
467
|
switch (granularity) {
|
|
223
468
|
case "hour":
|
|
224
469
|
firstPartOptions = timeFormat === "24" ? { hour: "numeric", minute: "numeric", hour12: false } : { hour: "numeric" };
|
|
225
|
-
if (isFirst || valueParts.day !== _optionalChain([previousValueParts, 'optionalAccess',
|
|
470
|
+
if (isFirst || valueParts.day !== _optionalChain([previousValueParts, 'optionalAccess', _23 => _23.day])) {
|
|
226
471
|
secondPartOptions = { day: "numeric", month: "short" };
|
|
227
472
|
}
|
|
228
473
|
break;
|
|
229
474
|
case "day":
|
|
230
475
|
case "week":
|
|
231
476
|
firstPartOptions = { day: "numeric" };
|
|
232
|
-
if (isFirst || valueParts.month !== _optionalChain([previousValueParts, 'optionalAccess',
|
|
477
|
+
if (isFirst || valueParts.month !== _optionalChain([previousValueParts, 'optionalAccess', _24 => _24.month])) {
|
|
233
478
|
secondPartOptions = { month: "short" };
|
|
234
479
|
}
|
|
235
480
|
break;
|
|
236
481
|
case "month":
|
|
237
482
|
firstPartOptions = { month: "short" };
|
|
238
|
-
if (isFirst || valueParts.year !== _optionalChain([previousValueParts, 'optionalAccess',
|
|
483
|
+
if (isFirst || valueParts.year !== _optionalChain([previousValueParts, 'optionalAccess', _25 => _25.year])) {
|
|
239
484
|
secondPartOptions = { year: "numeric" };
|
|
240
485
|
}
|
|
241
486
|
break;
|
|
@@ -380,11 +625,11 @@ function AnnotationHeader({
|
|
|
380
625
|
const hasIconOrTitle = Boolean(icon || title);
|
|
381
626
|
if (!hasIconOrTitle && !description) return null;
|
|
382
627
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
383
|
-
hasIconOrTitle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
628
|
+
hasIconOrTitle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLWDHU4QKjs.ChartTooltipHeader, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
384
629
|
icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: icon, size: "mini", color: "icon.base" }) : null,
|
|
385
630
|
title ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.body", fontSize: 200, children: title }) : null
|
|
386
631
|
] }) }) : null,
|
|
387
|
-
description ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
632
|
+
description ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLWDHU4QKjs.ChartTooltipHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { fontSize: 200, color: "text.subtext", children: description }) }) : null
|
|
388
633
|
] });
|
|
389
634
|
}
|
|
390
635
|
function DefaultChartTooltip({
|
|
@@ -405,7 +650,7 @@ function DefaultChartTooltip({
|
|
|
405
650
|
const rows = data.map((d) => {
|
|
406
651
|
const formattedValue = d.value == null ? _nullishCoalesce(invalidNumberLabel, () => ( "\u2014")) : valueFormatter({ ...valueFormat, value: d.value, abbreviate: false });
|
|
407
652
|
const nameCell = {
|
|
408
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
653
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLWDHU4QKjs.ChartLegendLabel, { color: d.color, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChartLabelWithIcon, { icon: d.icon, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { "aria-label": `${d.name}: `, children: d.name }) }) })
|
|
409
654
|
};
|
|
410
655
|
return {
|
|
411
656
|
cells: [
|
|
@@ -444,7 +689,7 @@ function DefaultChartTooltip({
|
|
|
444
689
|
]
|
|
445
690
|
}
|
|
446
691
|
] : [];
|
|
447
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
692
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLWDHU4QKjs.ChartTooltip, { children: [
|
|
448
693
|
annotation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
449
694
|
AnnotationHeader,
|
|
450
695
|
{
|
|
@@ -453,7 +698,7 @@ function DefaultChartTooltip({
|
|
|
453
698
|
description: annotation.description
|
|
454
699
|
}
|
|
455
700
|
) : null,
|
|
456
|
-
hideTitle ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
701
|
+
hideTitle ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLWDHU4QKjs.ChartTooltipTitle, { children: formatTitle({
|
|
457
702
|
position,
|
|
458
703
|
timezone,
|
|
459
704
|
timeFormat,
|
|
@@ -461,12 +706,12 @@ function DefaultChartTooltip({
|
|
|
461
706
|
textLocale
|
|
462
707
|
}) }),
|
|
463
708
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
464
|
-
|
|
709
|
+
_chunkLWDHU4QKjs.ChartTooltipTable,
|
|
465
710
|
{
|
|
466
711
|
rows: [...rows, ...totalRow]
|
|
467
712
|
}
|
|
468
713
|
),
|
|
469
|
-
hasOnClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
714
|
+
hasOnClick && tooltipClickLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLWDHU4QKjs.ChartTooltipFooter, { children: typeof tooltipClickLabel === "string" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _seedsreactbox.Box, { display: "flex", alignItems: "center", gap: 300, children: [
|
|
470
715
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacticon.Icon, { name: "hand-pointer-clicking-outline", color: "icon.base" }),
|
|
471
716
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _seedsreacttext.Text, { color: "text.subtext", fontSize: 200, children: tooltipClickLabel })
|
|
472
717
|
] }) : tooltipClickLabel }) : null
|
|
@@ -484,7 +729,7 @@ var SeriesLegend = _react.memo.call(void 0, function SeriesLegend2({
|
|
|
484
729
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChartLabelWithIcon, { icon: item.icon, children: item.name }),
|
|
485
730
|
color: item.color
|
|
486
731
|
}));
|
|
487
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
732
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLWDHU4QKjs.ChartLegend, { legendLabels: labels });
|
|
488
733
|
});
|
|
489
734
|
|
|
490
735
|
// src/charts/shared/chartExport.ts
|
|
@@ -505,6 +750,10 @@ _exporting2.default.call(void 0, _highcharts2.default);
|
|
|
505
750
|
_offlineexporting2.default.call(void 0, _highcharts2.default);
|
|
506
751
|
_exportdata2.default.call(void 0, _highcharts2.default);
|
|
507
752
|
_highchartsmore2.default.call(void 0, _highcharts2.default);
|
|
753
|
+
_wordcloud2.default.call(void 0, _highcharts2.default);
|
|
754
|
+
var wordcloudSeriesPrototype = _highcharts2.default.seriesTypes.wordcloud.prototype;
|
|
755
|
+
wordcloudSeriesPrototype.spirals.seedsAspectArchimedean = wordCloudAspectArchimedeanSpiral;
|
|
756
|
+
wordcloudSeriesPrototype.placementStrategy.seedsWordPadding = wordCloudPaddingPlacementStrategy;
|
|
508
757
|
function isChartStacked(options) {
|
|
509
758
|
const plotOptions = options.plotOptions;
|
|
510
759
|
if (!plotOptions) return false;
|
|
@@ -564,7 +813,7 @@ function buildExportChartOptions({
|
|
|
564
813
|
colors,
|
|
565
814
|
exportTitle: rawTitle
|
|
566
815
|
}) {
|
|
567
|
-
const exportTitle = _optionalChain([rawTitle, 'optionalAccess',
|
|
816
|
+
const exportTitle = _optionalChain([rawTitle, 'optionalAccess', _26 => _26.trim, 'call', _27 => _27()]);
|
|
568
817
|
const axisOptions = {
|
|
569
818
|
lineColor: theme.colors.container.border.base,
|
|
570
819
|
gridLineColor: theme.colors.container.border.base,
|
|
@@ -636,7 +885,7 @@ function buildExportChartOptions({
|
|
|
636
885
|
};
|
|
637
886
|
}
|
|
638
887
|
function createChartExportHandle(chart, getExportChartOptions) {
|
|
639
|
-
const resolveName = (filename) => _nullishCoalesce(filename, () => ( defaultFilename(_optionalChain([chart, 'access',
|
|
888
|
+
const resolveName = (filename) => _nullishCoalesce(filename, () => ( defaultFilename(_optionalChain([chart, 'access', _28 => _28.options, 'access', _29 => _29.chart, 'optionalAccess', _30 => _30.type]), /* @__PURE__ */ new Date())));
|
|
640
889
|
const exportImage = async (type, filename) => {
|
|
641
890
|
chart.exportChartLocal(
|
|
642
891
|
{ type, filename: resolveName(filename) },
|
|
@@ -686,7 +935,7 @@ function ChartRenderer({
|
|
|
686
935
|
const exportThemeRef = _react.useRef.call(void 0, { theme, colors, exportTitle });
|
|
687
936
|
exportThemeRef.current = { theme, colors, exportTitle };
|
|
688
937
|
const captureChart = _react.useCallback.call(void 0, (chartInstance) => {
|
|
689
|
-
const forExport = _optionalChain([chartInstance, 'access',
|
|
938
|
+
const forExport = _optionalChain([chartInstance, 'access', _31 => _31.options, 'access', _32 => _32.chart, 'optionalAccess', _33 => _33.forExport]);
|
|
690
939
|
if (!forExport) {
|
|
691
940
|
setChart(chartInstance);
|
|
692
941
|
setPlotHeight(chartInstance.plotHeight);
|
|
@@ -696,7 +945,7 @@ function ChartRenderer({
|
|
|
696
945
|
onReadyRef.current = onReady;
|
|
697
946
|
_react.useEffect.call(void 0, () => {
|
|
698
947
|
if (!chart) return;
|
|
699
|
-
_optionalChain([onReadyRef, 'access',
|
|
948
|
+
_optionalChain([onReadyRef, 'access', _34 => _34.current, 'optionalCall', _35 => _35(
|
|
700
949
|
createChartExportHandle(
|
|
701
950
|
chart,
|
|
702
951
|
() => buildExportChartOptions(exportThemeRef.current)
|
|
@@ -712,18 +961,18 @@ function ChartRenderer({
|
|
|
712
961
|
return () => unbind();
|
|
713
962
|
}, [chart]);
|
|
714
963
|
const highchartsOptions = _react.useMemo.call(void 0, () => {
|
|
715
|
-
const pointDescriptionFormatter = _optionalChain([options, 'access',
|
|
716
|
-
const svgContainerLabel = _optionalChain([options, 'access',
|
|
717
|
-
const packedBubbleDataLabelFormatter = _optionalChain([options, 'access',
|
|
964
|
+
const pointDescriptionFormatter = _optionalChain([options, 'access', _36 => _36.accessibility, 'optionalAccess', _37 => _37.point, 'optionalAccess', _38 => _38.descriptionFormatter]);
|
|
965
|
+
const svgContainerLabel = _optionalChain([options, 'access', _39 => _39.accessibility, 'optionalAccess', _40 => _40.svgContainerLabel]);
|
|
966
|
+
const packedBubbleDataLabelFormatter = _optionalChain([options, 'access', _41 => _41.plotOptions, 'optionalAccess', _42 => _42.packedbubble, 'optionalAccess', _43 => _43.dataLabels, 'optionalAccess', _44 => _44.formatter]);
|
|
718
967
|
return {
|
|
719
968
|
...options,
|
|
720
969
|
...packedBubbleDataLabelFormatter ? {
|
|
721
970
|
plotOptions: {
|
|
722
971
|
...options.plotOptions,
|
|
723
972
|
packedbubble: {
|
|
724
|
-
..._optionalChain([options, 'access',
|
|
973
|
+
..._optionalChain([options, 'access', _45 => _45.plotOptions, 'optionalAccess', _46 => _46.packedbubble]),
|
|
725
974
|
dataLabels: {
|
|
726
|
-
..._optionalChain([options, 'access',
|
|
975
|
+
..._optionalChain([options, 'access', _47 => _47.plotOptions, 'optionalAccess', _48 => _48.packedbubble, 'optionalAccess', _49 => _49.dataLabels]),
|
|
727
976
|
formatter() {
|
|
728
977
|
const bubblePoint = this.point;
|
|
729
978
|
return packedBubbleDataLabelFormatter.call({
|
|
@@ -733,7 +982,7 @@ function ChartRenderer({
|
|
|
733
982
|
index: bubblePoint.index,
|
|
734
983
|
series: { index: bubblePoint.series.index }
|
|
735
984
|
},
|
|
736
|
-
radius: _nullishCoalesce(_optionalChain([bubblePoint, 'access',
|
|
985
|
+
radius: _nullishCoalesce(_optionalChain([bubblePoint, 'access', _50 => _50.marker, 'optionalAccess', _51 => _51.radius]), () => ( 0))
|
|
737
986
|
});
|
|
738
987
|
}
|
|
739
988
|
}
|
|
@@ -741,7 +990,7 @@ function ChartRenderer({
|
|
|
741
990
|
}
|
|
742
991
|
} : {},
|
|
743
992
|
accessibility: {
|
|
744
|
-
description: _optionalChain([options, 'access',
|
|
993
|
+
description: _optionalChain([options, 'access', _52 => _52.accessibility, 'optionalAccess', _53 => _53.description]),
|
|
745
994
|
...pointDescriptionFormatter ? {
|
|
746
995
|
point: {
|
|
747
996
|
descriptionFormatter: (point) => {
|
|
@@ -768,9 +1017,9 @@ function ChartRenderer({
|
|
|
768
1017
|
}, [options]);
|
|
769
1018
|
if (series.length === 0) return null;
|
|
770
1019
|
const chartWithAnnotations = chart;
|
|
771
|
-
const hasRenderedAnnotations = !!_optionalChain([chartWithAnnotations, 'optionalAccess',
|
|
1020
|
+
const hasRenderedAnnotations = !!_optionalChain([chartWithAnnotations, 'optionalAccess', _54 => _54.annotations, 'optionalAccess', _55 => _55.length]) && !!_optionalChain([annotationLookup, 'optionalAccess', _56 => _56.size]) && plotHeight > 0;
|
|
772
1021
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
773
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1022
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLWDHU4QKjs.GlobalChartStyleOverrides, {}),
|
|
774
1023
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
775
1024
|
_highchartsreactofficial.HighchartsReact,
|
|
776
1025
|
{
|
|
@@ -789,12 +1038,12 @@ function ChartRenderer({
|
|
|
789
1038
|
}
|
|
790
1039
|
) : null,
|
|
791
1040
|
chart ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
792
|
-
|
|
1041
|
+
_chunkLWDHU4QKjs.ChartTooltipPortal,
|
|
793
1042
|
{
|
|
794
1043
|
chart,
|
|
795
1044
|
renderContent: (context) => {
|
|
796
1045
|
const ctx = context;
|
|
797
|
-
const isPackedBubble = !ctx.points && _optionalChain([ctx, 'access',
|
|
1046
|
+
const isPackedBubble = !ctx.points && _optionalChain([ctx, 'access', _57 => _57.series, 'optionalAccess', _58 => _58.type]) === "packedbubble";
|
|
798
1047
|
const isPie = !ctx.points && !isPackedBubble;
|
|
799
1048
|
const data = isPackedBubble ? (
|
|
800
1049
|
// Mirrors v1's `transformBubbleChartTooltipData`: color comes from
|
|
@@ -804,7 +1053,7 @@ function ChartRenderer({
|
|
|
804
1053
|
color: _nullishCoalesce((ctx.colorIndex !== void 0 ? colors[ctx.colorIndex] : void 0), () => ( "")),
|
|
805
1054
|
name: _nullishCoalesce(ctx.key, () => ( ctx.point.name)),
|
|
806
1055
|
value: ctx.point.y,
|
|
807
|
-
seriesIndex: _optionalChain([ctx, 'access',
|
|
1056
|
+
seriesIndex: _optionalChain([ctx, 'access', _59 => _59.series, 'optionalAccess', _60 => _60.index]),
|
|
808
1057
|
pointIndex: ctx.point.index
|
|
809
1058
|
}
|
|
810
1059
|
]
|
|
@@ -815,12 +1064,12 @@ function ChartRenderer({
|
|
|
815
1064
|
value: ctx.point.y,
|
|
816
1065
|
percent: ctx.point.percentage,
|
|
817
1066
|
// Icon indexed by the hovered slice — same source the legend reads.
|
|
818
|
-
icon: _optionalChain([series, 'access',
|
|
1067
|
+
icon: _optionalChain([series, 'access', _61 => _61[ctx.point.index], 'optionalAccess', _62 => _62.icon])
|
|
819
1068
|
}
|
|
820
1069
|
] : (
|
|
821
1070
|
// Drop v1's `readonly` wrapper (v2 is mutable); icon is forwarded
|
|
822
1071
|
// from `series[]` by index below since the helper doesn't carry it.
|
|
823
|
-
|
|
1072
|
+
_chunkLWDHU4QKjs.transformTimeSeriesTooltipData.call(void 0, {
|
|
824
1073
|
context,
|
|
825
1074
|
data: series.map((s, i) => ({
|
|
826
1075
|
name: s.name,
|
|
@@ -831,12 +1080,12 @@ function ChartRenderer({
|
|
|
831
1080
|
color: row.color,
|
|
832
1081
|
name: row.name,
|
|
833
1082
|
value: row.value,
|
|
834
|
-
icon: _optionalChain([series, 'access',
|
|
1083
|
+
icon: _optionalChain([series, 'access', _63 => _63[i], 'optionalAccess', _64 => _64.icon])
|
|
835
1084
|
}))
|
|
836
1085
|
);
|
|
837
1086
|
const position = isPie || isPackedBubble ? _nullishCoalesce(ctx.key, () => ( ctx.point.name)) : context.x;
|
|
838
|
-
const tickPositions = _optionalChain([ctx, 'access',
|
|
839
|
-
const resolved = _optionalChain([annotationLookup, 'optionalAccess',
|
|
1087
|
+
const tickPositions = _optionalChain([ctx, 'access', _65 => _65.points, 'optionalAccess', _66 => _66[0], 'optionalAccess', _67 => _67.series, 'optionalAccess', _68 => _68.xAxis, 'optionalAccess', _69 => _69.tickPositions]);
|
|
1088
|
+
const resolved = _optionalChain([annotationLookup, 'optionalAccess', _70 => _70.get, 'call', _71 => _71(context.point.x)]);
|
|
840
1089
|
const annotation = resolved ? {
|
|
841
1090
|
icon: resolved.icon,
|
|
842
1091
|
color: resolved.color,
|
|
@@ -872,39 +1121,6 @@ function ChartRenderer({
|
|
|
872
1121
|
] });
|
|
873
1122
|
}
|
|
874
1123
|
|
|
875
|
-
// src/charts/shared/baseChartOptions.ts
|
|
876
|
-
function buildBaseChartOptions({
|
|
877
|
-
type,
|
|
878
|
-
description,
|
|
879
|
-
svgContainerLabel,
|
|
880
|
-
point,
|
|
881
|
-
reserveTopMargin = false,
|
|
882
|
-
timezone
|
|
883
|
-
}) {
|
|
884
|
-
return {
|
|
885
|
-
chart: {
|
|
886
|
-
type,
|
|
887
|
-
styledMode: true,
|
|
888
|
-
animation: false,
|
|
889
|
-
...reserveTopMargin ? { marginTop: 24 } : {}
|
|
890
|
-
},
|
|
891
|
-
accessibility: { description, svgContainerLabel, point },
|
|
892
|
-
title: { text: "" },
|
|
893
|
-
credits: { enabled: false },
|
|
894
|
-
legend: { enabled: false },
|
|
895
|
-
tooltip: {
|
|
896
|
-
enabled: true,
|
|
897
|
-
outside: true,
|
|
898
|
-
padding: 0,
|
|
899
|
-
shape: "rect",
|
|
900
|
-
shared: true,
|
|
901
|
-
hideDelay: 0
|
|
902
|
-
},
|
|
903
|
-
// Chart-global in Highcharts; only meaningful for datetime axes, so it's
|
|
904
|
-
// present only when a timezone was resolved (omitted for category axes).
|
|
905
|
-
...timezone ? { time: { timezone } } : {}
|
|
906
|
-
};
|
|
907
|
-
}
|
|
908
1124
|
|
|
909
1125
|
|
|
910
1126
|
|
|
@@ -912,5 +1128,8 @@ function buildBaseChartOptions({
|
|
|
912
1128
|
|
|
913
1129
|
|
|
914
1130
|
|
|
915
|
-
|
|
916
|
-
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
exports.datetimeFormatter = datetimeFormatter; exports.valueFormatter = valueFormatter; exports.buildBaseChartOptions = buildBaseChartOptions; exports.deriveMaxFontSize = deriveMaxFontSize; exports.deriveMaxWordCount = deriveMaxWordCount; exports.deriveWordPadding = deriveWordPadding; exports.buildWordCloudOptions = buildWordCloudOptions; exports.useSeedsChartSetup = useSeedsChartSetup; exports.ChartRenderer = ChartRenderer;
|
|
1135
|
+
//# sourceMappingURL=chunk-TNZNBMSZ.js.map
|