@adecore/charts 0.41.1 → 0.42.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/Root.d.ts +3 -1
- package/dist/Root.js +410 -339
- package/dist/annotations.js +210 -85
- package/dist/axes.d.ts +3 -2
- package/dist/axes.js +541 -74
- package/dist/band.d.ts +2 -0
- package/dist/band.js +10 -0
- package/dist/context.d.ts +3 -0
- package/dist/cursor.d.ts +1 -1
- package/dist/cursor.js +5 -4
- package/dist/locales/en.d.ts +1 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/nl.d.ts +1 -0
- package/dist/locales/nl.js +1 -0
- package/dist/overlays.js +204 -132
- package/dist/series.d.ts +4 -4
- package/dist/series.js +329 -195
- package/dist/store.d.ts +2 -0
- package/dist/store.js +2 -1
- package/package.json +3 -3
- package/src/Root.tsx +137 -44
- package/src/annotations.tsx +31 -4
- package/src/axes.tsx +182 -6
- package/src/band.ts +13 -0
- package/src/context.ts +9 -0
- package/src/cursor.ts +12 -4
- package/src/locales/en.ts +1 -0
- package/src/locales/nl.ts +1 -0
- package/src/overlays.tsx +51 -1
- package/src/series.tsx +144 -28
- package/src/store.ts +5 -1
package/dist/Root.js
CHANGED
|
@@ -4,7 +4,7 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { useContentSize } from '@adecore/ui';
|
|
6
6
|
import { formatNumber, formatRounded } from '@adecore/ui/format';
|
|
7
|
-
import { readValue, warnMissingKey, xOf } from './access.js';
|
|
7
|
+
import { readValue, warnMissingKey, warnOnce, xOf } from './access.js';
|
|
8
8
|
import { LABEL_GAP as X_AXIS_GAP } from "./axes.js";
|
|
9
9
|
import { bandLayout, GROUP_GAP } from './band.js';
|
|
10
10
|
import { seriesColor } from './color.js';
|
|
@@ -23,6 +23,13 @@ const Y_TICK_SPACING = 40;
|
|
|
23
23
|
const POINT_REACH = 16;
|
|
24
24
|
/* One row of value labels over the tallest column; labels pushed up a row further need a larger `margin.top`. */
|
|
25
25
|
const VALUE_LABEL_ROOM = 24;
|
|
26
|
+
const ROW_HEIGHT = 32;
|
|
27
|
+
/* Ticks under a horizontal plot stand apart by the width of a label, which takes more room than its line beside a plot. */
|
|
28
|
+
const VALUE_TICK_SPACING = 80;
|
|
29
|
+
/* The line of the values under a horizontal plot, and the room a rule label takes above it. */
|
|
30
|
+
const VALUE_AXIS_LINE = 16;
|
|
31
|
+
const RULE_LABEL_ROOM = 20;
|
|
32
|
+
const NO_ENTRIES = new Map();
|
|
26
33
|
const defaultValue = value => Number.isInteger(value) ? formatNumber(value) : formatRounded(value, 2);
|
|
27
34
|
/* The box of a chart: owns the data, the scales, the cursor and the keyboard; each part inside draws one layer. */
|
|
28
35
|
export function ChartRoot(t0) {
|
|
@@ -40,19 +47,21 @@ export function ChartRoot(t0) {
|
|
|
40
47
|
yScale: t3,
|
|
41
48
|
y: t4,
|
|
42
49
|
label,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
orientation: t5,
|
|
51
|
+
rowHeight: t6,
|
|
52
|
+
height: t7,
|
|
53
|
+
grow: t8,
|
|
54
|
+
margin: t9,
|
|
55
|
+
surface: t10,
|
|
47
56
|
activeX,
|
|
48
57
|
onActiveXChange,
|
|
49
58
|
group,
|
|
50
59
|
groupLabel,
|
|
51
|
-
groupGap:
|
|
52
|
-
minBucketWidth:
|
|
60
|
+
groupGap: t11,
|
|
61
|
+
minBucketWidth: t12,
|
|
53
62
|
selected,
|
|
54
|
-
interactive:
|
|
55
|
-
cursor:
|
|
63
|
+
interactive: t13,
|
|
64
|
+
cursor: t14,
|
|
56
65
|
onActivate,
|
|
57
66
|
dimmed,
|
|
58
67
|
children,
|
|
@@ -63,25 +72,27 @@ export function ChartRoot(t0) {
|
|
|
63
72
|
const rows = t2 === undefined ? "buckets" : t2;
|
|
64
73
|
const yScale = t3 === undefined ? "linear" : t3;
|
|
65
74
|
const y = t4 === undefined ? {} : t4;
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
const
|
|
75
|
+
const orientation = t5 === undefined ? "vertical" : t5;
|
|
76
|
+
const rowHeight = t6 === undefined ? ROW_HEIGHT : t6;
|
|
77
|
+
const leastHeight = t7 === undefined ? 200 : t7;
|
|
78
|
+
const grow = t8 === undefined ? false : t8;
|
|
79
|
+
const margin = t9 === undefined ? {} : t9;
|
|
80
|
+
const surface = t10 === undefined ? "base" : t10;
|
|
81
|
+
const groupGap = t11 === undefined ? GROUP_GAP : t11;
|
|
82
|
+
const minBucketWidth = t12 === undefined ? 0 : t12;
|
|
83
|
+
const interactive = t13 === undefined ? true : t13;
|
|
84
|
+
const cursor = t14 === undefined ? "full" : t14;
|
|
74
85
|
const {
|
|
75
86
|
t
|
|
76
87
|
} = useTranslation("charts");
|
|
77
88
|
const id = useId();
|
|
78
89
|
const [store] = useState(createChartStore);
|
|
79
|
-
const
|
|
90
|
+
const allSeries = useSyncExternalStore(store.subscribe, store.series, store.series);
|
|
80
91
|
const axes = useSyncExternalStore(store.subscribe, store.axes, store.axes);
|
|
81
92
|
const xAxes = useSyncExternalStore(store.subscribe, store.xAxes, store.xAxes);
|
|
82
93
|
const yAxes = useSyncExternalStore(store.subscribe, store.yAxes, store.yAxes);
|
|
83
|
-
const
|
|
84
|
-
const
|
|
94
|
+
const allMarkers = useSyncExternalStore(store.subscribe, store.markers, store.markers);
|
|
95
|
+
const allBands = useSyncExternalStore(store.subscribe, store.bands, store.bands);
|
|
85
96
|
const rules = useSyncExternalStore(store.subscribe, store.rules, store.rules);
|
|
86
97
|
const formats = useSyncExternalStore(store.subscribe, store.formats, store.formats);
|
|
87
98
|
const chartGroup = useContext(GroupContext);
|
|
@@ -95,46 +106,86 @@ export function ChartRoot(t0) {
|
|
|
95
106
|
const [leftSlot, setLeftSlot] = useState(null);
|
|
96
107
|
const [rightSlot, setRightSlot] = useState(null);
|
|
97
108
|
const [rulesSlot, setRulesSlot] = useState(null);
|
|
109
|
+
const [rowsSlot, setRowsSlot] = useState(null);
|
|
98
110
|
const [scroll, setScroll] = useState(0);
|
|
99
111
|
const [announce, setAnnounce] = useState(false);
|
|
100
112
|
const [measure, size] = useContentSize();
|
|
101
113
|
const [measureGroups, groupsSize] = useContentSize();
|
|
102
|
-
const
|
|
114
|
+
const boxHeight = grow ? Math.max(leastHeight, size.height - groupsSize.height) : leastHeight;
|
|
103
115
|
const scroller = useRef(null);
|
|
104
116
|
const points = rows === "points";
|
|
105
117
|
const band = xScale === "band" && !points;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
118
|
+
const horizontal = orientation === "horizontal" && band;
|
|
119
|
+
const series = horizontal ? new Map([...allSeries].filter(_temp)) : allSeries;
|
|
120
|
+
const markers = horizontal ? NO_ENTRIES : allMarkers;
|
|
121
|
+
const bands = horizontal ? NO_ENTRIES : allBands;
|
|
122
|
+
const dropped = horizontal && (series.size < allSeries.size || allMarkers.size > 0 || allBands.size > 0);
|
|
123
|
+
let t15;
|
|
124
|
+
let t16;
|
|
125
|
+
if ($[0] !== band || $[1] !== dropped || $[2] !== orientation) {
|
|
126
|
+
t15 = () => {
|
|
127
|
+
if (orientation === "horizontal" && !band) {
|
|
128
|
+
warnOnce("Chart.Root: `orientation=\"horizontal\"` takes the buckets of a band scale; this chart stays vertical.");
|
|
129
|
+
}
|
|
130
|
+
if (dropped) {
|
|
131
|
+
warnOnce("Chart.Root: a horizontal chart draws `Chart.Bar` only; its lines, areas, points, markers and bands are left out.");
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
t16 = [orientation, band, dropped];
|
|
135
|
+
$[0] = band;
|
|
136
|
+
$[1] = dropped;
|
|
137
|
+
$[2] = orientation;
|
|
138
|
+
$[3] = t15;
|
|
139
|
+
$[4] = t16;
|
|
140
|
+
} else {
|
|
141
|
+
t15 = $[3];
|
|
142
|
+
t16 = $[4];
|
|
143
|
+
}
|
|
144
|
+
useEffect(t15, t16);
|
|
145
|
+
let t17;
|
|
146
|
+
if ($[5] !== x) {
|
|
147
|
+
t17 = (row, index) => {
|
|
109
148
|
const value = readValue(x, row, index);
|
|
110
149
|
return value === null || value === undefined ? Number.NaN : xOf(value);
|
|
111
150
|
};
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
151
|
+
$[5] = x;
|
|
152
|
+
$[6] = t17;
|
|
114
153
|
} else {
|
|
115
|
-
|
|
154
|
+
t17 = $[6];
|
|
116
155
|
}
|
|
117
|
-
const xs = data.map(
|
|
156
|
+
const xs = data.map(t17);
|
|
118
157
|
const keys = points ? data.map((row_0, index_0) => rowKey === undefined ? String(index_0) : String(readValue(rowKey, row_0, index_0))) : null;
|
|
119
158
|
const rowLabels = rowLabel !== undefined ? data.map((row_1, index_1) => String(readValue(rowLabel, row_1, index_1))) : null;
|
|
120
159
|
const groupKeys = (band || points) && group !== undefined ? data.map((row_2, index_2) => String(readValue(group, row_2, index_2))) : null;
|
|
121
160
|
const groupLabels = groupKeys === null ? null : groupLabel === undefined ? groupKeys : data.map((row_3, index_3) => String(readValue(groupLabel, row_3, index_3)));
|
|
122
161
|
const leftY = yAxes.get("left");
|
|
123
162
|
const rightY = yAxes.get("right");
|
|
124
|
-
const [leftAxis, rightAxis] = useAlignedAxes(chartGroup?.widths ?? null, leftY?.width ?? 0, rightY?.width ?? 0);
|
|
163
|
+
const [leftAxis, rightAxis] = useAlignedAxes(chartGroup?.widths ?? null, horizontal ? axes.start ?? 0 : leftY?.width ?? 0, horizontal ? 0 : rightY?.width ?? 0);
|
|
125
164
|
const room = Math.max(0, size.width - leftAxis - rightAxis);
|
|
126
165
|
const bucketStep = xScale === "time" && !points ? stepProp ?? bucketStepOf(xs) : 0;
|
|
127
166
|
const inset = band || bucketStep > 0 ? 0 : INSET;
|
|
128
167
|
const marginLeft = margin.left ?? inset;
|
|
129
168
|
const marginRight = margin.right ?? inset;
|
|
130
|
-
const layout = band ? bandLayout(xs.length, groupKeys, Math.max(0, room - marginLeft - marginRight), minBucketWidth, groupGap) : null;
|
|
131
|
-
const width = layout === null ? room : Math.max(room, Math.ceil(layout.width + marginLeft + marginRight));
|
|
169
|
+
const layout = horizontal ? bandLayout(xs.length, groupKeys, 0, rowHeight, groupGap) : band ? bandLayout(xs.length, groupKeys, Math.max(0, room - marginLeft - marginRight), minBucketWidth, groupGap) : null;
|
|
170
|
+
const width = layout === null || horizontal ? room : Math.max(room, Math.ceil(layout.width + marginLeft + marginRight));
|
|
132
171
|
const scrolls = layout !== null && width > room;
|
|
133
172
|
const overhang = scrolls ? leftAxis : 0;
|
|
134
173
|
const xRows = [...xAxes.values()];
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
|
|
174
|
+
const valueRoom = horizontal ? Math.max(0, ...[...series.values()].map(_temp2)) : 0;
|
|
175
|
+
const titleRoom = leftY?.top ?? rightY?.top ?? 0;
|
|
176
|
+
let top;
|
|
177
|
+
let bottom;
|
|
178
|
+
let height;
|
|
179
|
+
if (horizontal) {
|
|
180
|
+
top = Math.max(margin.top ?? 8, titleRoom + (rules.size > 0 ? RULE_LABEL_ROOM : 0));
|
|
181
|
+
bottom = top + (xs.length === 0 ? 2 * rowHeight : layout.width);
|
|
182
|
+
height = bottom + (margin.bottom ?? 0) + (yAxes.size > 0 ? X_AXIS_GAP + VALUE_AXIS_LINE : 0);
|
|
183
|
+
} else {
|
|
184
|
+
height = boxHeight;
|
|
185
|
+
bottom = height - (xRows.length === 0 ? margin.bottom ?? 0 : (margin.bottom ?? 4) + X_AXIS_GAP + xRows.reduce(_temp3, 0));
|
|
186
|
+
top = Math.max(margin.top ?? 8, leftY?.top ?? 0, rightY?.top ?? 0, [...series.values()].some(_temp4) ? VALUE_LABEL_ROOM : 0);
|
|
187
|
+
}
|
|
188
|
+
const right = width - marginRight - (axes.end ?? 0) - valueRoom;
|
|
138
189
|
const plot = {
|
|
139
190
|
left: marginLeft,
|
|
140
191
|
top,
|
|
@@ -143,33 +194,34 @@ export function ChartRoot(t0) {
|
|
|
143
194
|
width: Math.max(0, right - marginLeft),
|
|
144
195
|
height: Math.max(0, bottom - top)
|
|
145
196
|
};
|
|
197
|
+
const valueRange = horizontal ? [plot.left, plot.right] : [plot.bottom, plot.top];
|
|
146
198
|
const continuousKind = xScale === "band" ? "linear" : xScale;
|
|
147
199
|
const continuous = band ? null : points ? pointXScale(continuousKind, xs, [plot.left, plot.right], xOptions) : continuousXScale(continuousKind, xs, [plot.left, plot.right], bucketStep, xOptions);
|
|
148
|
-
const stackInput = [...series].map(
|
|
200
|
+
const stackInput = [...series].map(_temp5);
|
|
149
201
|
const stacked = stackSeries(stackInput, xs.length);
|
|
150
|
-
const ruleValues = [...rules.values()].map(
|
|
202
|
+
const ruleValues = [...rules.values()].map(_temp6);
|
|
151
203
|
const yOptions = ruleValues.length === 0 ? y : {
|
|
152
204
|
...y,
|
|
153
205
|
include: [...(y.include ?? []), ...ruleValues]
|
|
154
206
|
};
|
|
155
|
-
const scaleY = yScaleOf(yScale, extentOf(stacked.values(), yScale, !points), yOptions,
|
|
207
|
+
const scaleY = yScaleOf(yScale, extentOf(stacked.values(), yScale, !points), yOptions, valueRange, leftY?.ticks ?? rightY?.ticks ?? (horizontal ? tickCount(plot.width, VALUE_TICK_SPACING) : tickCount(plot.height, Y_TICK_SPACING)), !points);
|
|
156
208
|
const yStep = scaleY.ticks.length > 1 ? scaleY.ticks[1] - scaleY.ticks[0] : 1;
|
|
157
209
|
const pixelOfY = value_0 => {
|
|
158
210
|
const pixel = scaleY.at(value_0);
|
|
159
|
-
return pixel === null ? null : Math.min(
|
|
211
|
+
return pixel === null ? null : Math.min(Math.max(...valueRange), Math.max(Math.min(...valueRange), pixel));
|
|
160
212
|
};
|
|
161
213
|
const colors = new Map();
|
|
162
214
|
let next = 0;
|
|
163
|
-
for (const [seriesId_0,
|
|
164
|
-
colors.set(seriesId_0,
|
|
215
|
+
for (const [seriesId_0, entry_3] of series) {
|
|
216
|
+
colors.set(seriesId_0, entry_3.color ?? seriesColor(next++));
|
|
165
217
|
}
|
|
166
218
|
const slots = new Map();
|
|
167
219
|
const members = new Map();
|
|
168
|
-
for (const [seriesId_1,
|
|
169
|
-
if (
|
|
170
|
-
const ids = members.get(
|
|
220
|
+
for (const [seriesId_1, entry_4] of series) {
|
|
221
|
+
if (entry_4.kind === "bar") {
|
|
222
|
+
const ids = members.get(entry_4.bars ?? "");
|
|
171
223
|
if (ids === undefined) {
|
|
172
|
-
members.set(
|
|
224
|
+
members.set(entry_4.bars ?? "", [seriesId_1]);
|
|
173
225
|
} else {
|
|
174
226
|
ids.push(seriesId_1);
|
|
175
227
|
}
|
|
@@ -185,7 +237,7 @@ export function ChartRoot(t0) {
|
|
|
185
237
|
count: ids_0.length
|
|
186
238
|
}));
|
|
187
239
|
}
|
|
188
|
-
const placing = points ? [...series.values()].find(
|
|
240
|
+
const placing = points ? [...series.values()].find(_temp7) : undefined;
|
|
189
241
|
const pointGroups = [];
|
|
190
242
|
const groupIndexes = [];
|
|
191
243
|
if (points) {
|
|
@@ -220,25 +272,26 @@ export function ChartRoot(t0) {
|
|
|
220
272
|
});
|
|
221
273
|
return [left, pixel_0];
|
|
222
274
|
});
|
|
223
|
-
const readable = [...series].filter((
|
|
224
|
-
const [,
|
|
225
|
-
return !points || all.findIndex(
|
|
226
|
-
const [, other] =
|
|
227
|
-
return other.label ===
|
|
275
|
+
const readable = [...series].filter((t18, index_7, all) => {
|
|
276
|
+
const [, entry_6] = t18;
|
|
277
|
+
return !points || all.findIndex(t19 => {
|
|
278
|
+
const [, other] = t19;
|
|
279
|
+
return other.label === entry_6.label;
|
|
228
280
|
}) === index_7;
|
|
229
281
|
});
|
|
230
282
|
const groupColorOf = index_8 => seriesColor(groupIndexes[index_8] ?? 0);
|
|
231
283
|
const pointColor = index_9 => placing?.rowColors?.[index_9] ?? placing?.color ?? groupColorOf(index_9);
|
|
284
|
+
const bucketStart = horizontal ? plot.top : plot.left;
|
|
232
285
|
const centerOf = index_10 => {
|
|
233
286
|
if (layout !== null) {
|
|
234
|
-
return
|
|
287
|
+
return bucketStart + (layout.lefts[index_10] ?? 0) + layout.bucket / 2;
|
|
235
288
|
}
|
|
236
289
|
return continuous.at(xs[index_10] + bucketStep / 2);
|
|
237
290
|
};
|
|
238
291
|
const bucketAt = index_11 => {
|
|
239
292
|
if (layout !== null) {
|
|
240
293
|
return {
|
|
241
|
-
left:
|
|
294
|
+
left: bucketStart + (layout.lefts[index_11] ?? 0),
|
|
242
295
|
width: layout.bucket
|
|
243
296
|
};
|
|
244
297
|
}
|
|
@@ -259,7 +312,7 @@ export function ChartRoot(t0) {
|
|
|
259
312
|
return typeof value_2 === "number" ? continuous.at(value_2) : null;
|
|
260
313
|
};
|
|
261
314
|
const span = continuous === null ? 0 : continuous.domain[1] - continuous.domain[0];
|
|
262
|
-
const rowFormats = xRows.flatMap(
|
|
315
|
+
const rowFormats = xRows.flatMap(_temp8).toReversed();
|
|
263
316
|
const formatX = value_3 => {
|
|
264
317
|
if (rowFormats.length > 0) {
|
|
265
318
|
return rowFormats.map(format_0 => format_0(value_3)).join(", ");
|
|
@@ -328,9 +381,9 @@ export function ChartRoot(t0) {
|
|
|
328
381
|
const keyIndex = indexAt(keyX);
|
|
329
382
|
const from_0 = keyIndex >= 0 ? keyIndex : activeIndex;
|
|
330
383
|
const ownsCursor = controlled || sharedCursor === null || sharedCursor.owner === id;
|
|
331
|
-
let
|
|
332
|
-
if ($[
|
|
333
|
-
|
|
384
|
+
let t20;
|
|
385
|
+
if ($[7] !== controlled || $[8] !== id || $[9] !== onActiveXChange || $[10] !== sharedCursor) {
|
|
386
|
+
t20 = value_5 => {
|
|
334
387
|
if (!controlled) {
|
|
335
388
|
if (sharedCursor !== null) {
|
|
336
389
|
sharedCursor.setX(value_5, id);
|
|
@@ -340,45 +393,45 @@ export function ChartRoot(t0) {
|
|
|
340
393
|
}
|
|
341
394
|
onActiveXChange?.(value_5);
|
|
342
395
|
};
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
396
|
+
$[7] = controlled;
|
|
397
|
+
$[8] = id;
|
|
398
|
+
$[9] = onActiveXChange;
|
|
399
|
+
$[10] = sharedCursor;
|
|
400
|
+
$[11] = t20;
|
|
348
401
|
} else {
|
|
349
|
-
|
|
402
|
+
t20 = $[11];
|
|
350
403
|
}
|
|
351
|
-
const setActiveX =
|
|
352
|
-
let
|
|
353
|
-
if ($[
|
|
354
|
-
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
404
|
+
const setActiveX = t20;
|
|
405
|
+
let t21;
|
|
406
|
+
if ($[12] !== selected) {
|
|
407
|
+
t21 = new Set((selected ?? []).map(String));
|
|
408
|
+
$[12] = selected;
|
|
409
|
+
$[13] = t21;
|
|
357
410
|
} else {
|
|
358
|
-
|
|
411
|
+
t21 = $[13];
|
|
359
412
|
}
|
|
360
|
-
const picked =
|
|
361
|
-
let
|
|
362
|
-
if ($[
|
|
363
|
-
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
413
|
+
const picked = t21;
|
|
414
|
+
let t22;
|
|
415
|
+
if ($[14] !== picked) {
|
|
416
|
+
t22 = key_0 => picked.has(String(key_0));
|
|
417
|
+
$[14] = picked;
|
|
418
|
+
$[15] = t22;
|
|
366
419
|
} else {
|
|
367
|
-
|
|
420
|
+
t22 = $[15];
|
|
368
421
|
}
|
|
369
|
-
const selectedRows = (keys ?? xs).map(
|
|
370
|
-
let
|
|
371
|
-
if ($[
|
|
372
|
-
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
422
|
+
const selectedRows = (keys ?? xs).map(t22);
|
|
423
|
+
let t23;
|
|
424
|
+
if ($[16] !== dimmed) {
|
|
425
|
+
t23 = (row_6, index_16) => dimmed?.(row_6, index_16) ?? false;
|
|
426
|
+
$[16] = dimmed;
|
|
427
|
+
$[17] = t23;
|
|
375
428
|
} else {
|
|
376
|
-
|
|
429
|
+
t23 = $[17];
|
|
377
430
|
}
|
|
378
|
-
const dimmedRows = data.map(
|
|
379
|
-
const dimmedGroups = new Set(pointGroups.filter(run => run.indexes.every(index_17 => dimmedRows[index_17])).map(
|
|
431
|
+
const dimmedRows = data.map(t23);
|
|
432
|
+
const dimmedGroups = new Set(pointGroups.filter(run => run.indexes.every(index_17 => dimmedRows[index_17])).map(_temp9));
|
|
380
433
|
const anyPicked = selectedRows.some(Boolean);
|
|
381
|
-
const columnDim = [...series.values()].find(
|
|
434
|
+
const columnDim = [...series.values()].find(_temp0)?.dimOpacity ?? null;
|
|
382
435
|
const labelFocus = xs.map((__1, index_18) => {
|
|
383
436
|
if (index_18 === activeIndex || selectedRows[index_18]) {
|
|
384
437
|
return "strong";
|
|
@@ -386,34 +439,34 @@ export function ChartRoot(t0) {
|
|
|
386
439
|
return dimmedRows[index_18] || anyPicked ? "dim" : null;
|
|
387
440
|
});
|
|
388
441
|
const describe = index_19 => {
|
|
389
|
-
const parts = (points ? [groupLabels?.[index_19], rowLabels?.[index_19], xValueOf(index_19)] : [groupLabels?.[index_19], rowLabels?.[index_19] ?? xValueOf(index_19)]).filter(
|
|
390
|
-
for (const [,
|
|
391
|
-
const value_6 =
|
|
442
|
+
const parts = (points ? [groupLabels?.[index_19], rowLabels?.[index_19], xValueOf(index_19)] : [groupLabels?.[index_19], rowLabels?.[index_19] ?? xValueOf(index_19)]).filter(_temp1);
|
|
443
|
+
for (const [, entry_8] of readable) {
|
|
444
|
+
const value_6 = entry_8.values[index_19];
|
|
392
445
|
if (value_6 !== null && value_6 !== undefined) {
|
|
393
|
-
parts.push(`${
|
|
446
|
+
parts.push(`${entry_8.label} ${formatY(value_6)}`);
|
|
394
447
|
}
|
|
395
448
|
}
|
|
396
|
-
return [...parts, ...notesAt(index_19).map(
|
|
449
|
+
return [...parts, ...notesAt(index_19).map(_temp10)].join(", ");
|
|
397
450
|
};
|
|
398
|
-
let
|
|
399
|
-
let
|
|
400
|
-
if ($[
|
|
401
|
-
|
|
451
|
+
let t24;
|
|
452
|
+
let t25;
|
|
453
|
+
if ($[18] !== data || $[19] !== x) {
|
|
454
|
+
t24 = () => {
|
|
402
455
|
warnMissingKey(x, data, "Chart.Root");
|
|
403
456
|
};
|
|
404
|
-
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
457
|
+
t25 = [x, data];
|
|
458
|
+
$[18] = data;
|
|
459
|
+
$[19] = x;
|
|
460
|
+
$[20] = t24;
|
|
461
|
+
$[21] = t25;
|
|
409
462
|
} else {
|
|
410
|
-
|
|
411
|
-
|
|
463
|
+
t24 = $[20];
|
|
464
|
+
t25 = $[21];
|
|
412
465
|
}
|
|
413
|
-
useEffect(
|
|
466
|
+
useEffect(t24, t25);
|
|
414
467
|
const indexAtPointer = e => {
|
|
415
468
|
const box = e.currentTarget.getBoundingClientRect();
|
|
416
|
-
const pixel_1 = e.clientX - box.left;
|
|
469
|
+
const pixel_1 = horizontal ? e.clientY - box.top : e.clientX - box.left;
|
|
417
470
|
if (points) {
|
|
418
471
|
return nearestPoint(placed, pixel_1, e.clientY - box.top, POINT_REACH);
|
|
419
472
|
}
|
|
@@ -446,29 +499,29 @@ export function ChartRoot(t0) {
|
|
|
446
499
|
}
|
|
447
500
|
};
|
|
448
501
|
const pressable = interactive && onActivate !== undefined && (layout !== null || points);
|
|
449
|
-
let
|
|
450
|
-
if ($[
|
|
451
|
-
|
|
502
|
+
let t26;
|
|
503
|
+
if ($[22] !== data || $[23] !== onActivate || $[24] !== pressable) {
|
|
504
|
+
t26 = index_24 => {
|
|
452
505
|
if (pressable && index_24 >= 0) {
|
|
453
506
|
onActivate(data[index_24], index_24);
|
|
454
507
|
}
|
|
455
508
|
};
|
|
456
|
-
$[
|
|
457
|
-
$[
|
|
458
|
-
$[
|
|
459
|
-
$[
|
|
509
|
+
$[22] = data;
|
|
510
|
+
$[23] = onActivate;
|
|
511
|
+
$[24] = pressable;
|
|
512
|
+
$[25] = t26;
|
|
460
513
|
} else {
|
|
461
|
-
|
|
514
|
+
t26 = $[25];
|
|
462
515
|
}
|
|
463
|
-
const activate =
|
|
516
|
+
const activate = t26;
|
|
464
517
|
const onKeyDown = e_1 => {
|
|
465
518
|
if (pressable && from_0 >= 0 && (e_1.key === "Enter" || e_1.key === " ")) {
|
|
466
519
|
e_1.preventDefault();
|
|
467
520
|
activate(from_0);
|
|
468
521
|
return;
|
|
469
522
|
}
|
|
470
|
-
const groupStarts = layout?.groups.map(
|
|
471
|
-
const target = keys === null ? moveIndex(e_1.key, from_0, xs.length, groupStarts) : movePoint(pointGroups.map(run_2 => run_2.indexes.filter(index_25 => positions[index_25] !== null)), from_0, e_1.key);
|
|
523
|
+
const groupStarts = layout?.groups.map(_temp11) ?? [];
|
|
524
|
+
const target = keys === null ? moveIndex(e_1.key, from_0, xs.length, groupStarts, horizontal ? "rows" : "columns") : movePoint(pointGroups.map(run_2 => run_2.indexes.filter(index_25 => positions[index_25] !== null)), from_0, e_1.key);
|
|
472
525
|
if (target === undefined) {
|
|
473
526
|
return;
|
|
474
527
|
}
|
|
@@ -503,6 +556,8 @@ export function ChartRoot(t0) {
|
|
|
503
556
|
width,
|
|
504
557
|
band: layout,
|
|
505
558
|
continuous,
|
|
559
|
+
horizontal,
|
|
560
|
+
valueRoom,
|
|
506
561
|
y: scaleY,
|
|
507
562
|
yStep,
|
|
508
563
|
series,
|
|
@@ -526,7 +581,8 @@ export function ChartRoot(t0) {
|
|
|
526
581
|
groups: groupsSlot,
|
|
527
582
|
left: leftSlot,
|
|
528
583
|
right: rightSlot,
|
|
529
|
-
rules: rulesSlot
|
|
584
|
+
rules: rulesSlot,
|
|
585
|
+
rows: rowsSlot
|
|
530
586
|
},
|
|
531
587
|
scroll,
|
|
532
588
|
box: size.width,
|
|
@@ -557,273 +613,281 @@ export function ChartRoot(t0) {
|
|
|
557
613
|
halo: surface === "raised" ? "var(--surface-raised)" : "var(--surface)"
|
|
558
614
|
};
|
|
559
615
|
const ruleText = rules.size === 0 ? null : `${[...rules.values()].map(rule_0 => `${rule_0.label} ${formatY(rule_0.value)}`).join(", ")}.`;
|
|
560
|
-
let
|
|
561
|
-
if ($[
|
|
562
|
-
|
|
563
|
-
$[
|
|
564
|
-
$[
|
|
565
|
-
$[
|
|
566
|
-
|
|
567
|
-
t23 = $[23];
|
|
568
|
-
}
|
|
569
|
-
const t24 = layout !== null && layout.groups.length > 0 ? t("keyboard.groups") : null;
|
|
570
|
-
let t25;
|
|
571
|
-
if ($[24] !== pressable || $[25] !== t) {
|
|
572
|
-
t25 = pressable ? t("keyboard.activate") : null;
|
|
573
|
-
$[24] = pressable;
|
|
574
|
-
$[25] = t;
|
|
575
|
-
$[26] = t25;
|
|
576
|
-
} else {
|
|
577
|
-
t25 = $[26];
|
|
578
|
-
}
|
|
579
|
-
let t26;
|
|
580
|
-
if ($[27] !== ruleText || $[28] !== t23 || $[29] !== t24 || $[30] !== t25) {
|
|
581
|
-
t26 = [ruleText, t23, t24, t25].filter(Boolean);
|
|
582
|
-
$[27] = ruleText;
|
|
583
|
-
$[28] = t23;
|
|
584
|
-
$[29] = t24;
|
|
585
|
-
$[30] = t25;
|
|
586
|
-
$[31] = t26;
|
|
616
|
+
let t27;
|
|
617
|
+
if ($[26] !== horizontal || $[27] !== points || $[28] !== t) {
|
|
618
|
+
t27 = points ? t("keyboard.points") : horizontal ? t("keyboard.rows") : t("keyboard.move");
|
|
619
|
+
$[26] = horizontal;
|
|
620
|
+
$[27] = points;
|
|
621
|
+
$[28] = t;
|
|
622
|
+
$[29] = t27;
|
|
587
623
|
} else {
|
|
588
|
-
|
|
589
|
-
}
|
|
590
|
-
const hint = t26.join(" ");
|
|
591
|
-
const highlighted = layout === null ? [] : xs.flatMap((__3, index_26) => cursor === "full" && index_26 === activeIndex || selectedRows[index_26] ? [index_26] : []);
|
|
592
|
-
const t27 = grow && "h-full min-h-0";
|
|
593
|
-
let t28;
|
|
594
|
-
if ($[32] !== className || $[33] !== t27) {
|
|
595
|
-
t28 = clsx("flex min-w-0 flex-col gap-3", t27, className);
|
|
596
|
-
$[32] = className;
|
|
597
|
-
$[33] = t27;
|
|
598
|
-
$[34] = t28;
|
|
599
|
-
} else {
|
|
600
|
-
t28 = $[34];
|
|
624
|
+
t27 = $[29];
|
|
601
625
|
}
|
|
626
|
+
const t28 = layout !== null && layout.groups.length > 0 ? t("keyboard.groups") : null;
|
|
602
627
|
let t29;
|
|
603
|
-
if ($[
|
|
604
|
-
t29 =
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
$[35] = t29;
|
|
628
|
+
if ($[30] !== pressable || $[31] !== t) {
|
|
629
|
+
t29 = pressable ? t("keyboard.activate") : null;
|
|
630
|
+
$[30] = pressable;
|
|
631
|
+
$[31] = t;
|
|
632
|
+
$[32] = t29;
|
|
609
633
|
} else {
|
|
610
|
-
t29 = $[
|
|
634
|
+
t29 = $[32];
|
|
611
635
|
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
$[
|
|
617
|
-
$[
|
|
636
|
+
let t30;
|
|
637
|
+
if ($[33] !== ruleText || $[34] !== t27 || $[35] !== t28 || $[36] !== t29) {
|
|
638
|
+
t30 = [ruleText, t27, t28, t29].filter(Boolean);
|
|
639
|
+
$[33] = ruleText;
|
|
640
|
+
$[34] = t27;
|
|
641
|
+
$[35] = t28;
|
|
642
|
+
$[36] = t29;
|
|
643
|
+
$[37] = t30;
|
|
618
644
|
} else {
|
|
619
|
-
|
|
645
|
+
t30 = $[37];
|
|
620
646
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
647
|
+
const hint = t30.join(" ");
|
|
648
|
+
const highlighted = layout === null ? [] : xs.flatMap((__3, index_26) => cursor === "full" && index_26 === activeIndex || selectedRows[index_26] ? [index_26] : []);
|
|
649
|
+
const bucketBox = (index_27, pressing) => {
|
|
650
|
+
const start = Math.round(bucketStart + (layout?.lefts[index_27] ?? 0));
|
|
651
|
+
const size_0 = Math.max(1, Math.round(layout?.bucket ?? 0));
|
|
652
|
+
if (horizontal) {
|
|
653
|
+
return pressing ? {
|
|
654
|
+
x: 0,
|
|
655
|
+
y: start,
|
|
656
|
+
width,
|
|
657
|
+
height: size_0
|
|
658
|
+
} : {
|
|
659
|
+
x: plot.left,
|
|
660
|
+
y: start,
|
|
661
|
+
width: Math.max(0, plot.right + valueRoom - plot.left),
|
|
662
|
+
height: size_0
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
return {
|
|
666
|
+
x: start,
|
|
667
|
+
y: plot.top,
|
|
668
|
+
width: size_0,
|
|
669
|
+
height: pressing ? height - plot.top : plot.height
|
|
625
670
|
};
|
|
626
|
-
|
|
671
|
+
};
|
|
672
|
+
let t31;
|
|
673
|
+
if ($[38] !== keyX || $[39] !== setActiveX) {
|
|
674
|
+
t31 = () => setActiveX(keyX);
|
|
675
|
+
$[38] = keyX;
|
|
676
|
+
$[39] = setActiveX;
|
|
677
|
+
$[40] = t31;
|
|
627
678
|
} else {
|
|
628
|
-
|
|
679
|
+
t31 = $[40];
|
|
629
680
|
}
|
|
681
|
+
const pointer = {
|
|
682
|
+
onPointerMove,
|
|
683
|
+
onPointerLeave: t31,
|
|
684
|
+
onClick: pressable ? e_2 => activate(indexAtPointer(e_2)) : undefined
|
|
685
|
+
};
|
|
686
|
+
const t32 = grow && "h-full min-h-0";
|
|
630
687
|
let t33;
|
|
631
|
-
if ($[
|
|
632
|
-
t33 =
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
$[39] = t33;
|
|
688
|
+
if ($[41] !== className || $[42] !== t32) {
|
|
689
|
+
t33 = clsx("flex min-w-0 flex-col gap-3", t32, className);
|
|
690
|
+
$[41] = className;
|
|
691
|
+
$[42] = t32;
|
|
692
|
+
$[43] = t33;
|
|
637
693
|
} else {
|
|
638
|
-
t33 = $[
|
|
694
|
+
t33 = $[43];
|
|
639
695
|
}
|
|
640
696
|
let t34;
|
|
641
|
-
if ($[
|
|
642
|
-
t34 = /*#__PURE__*/_jsx("
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
"aria-hidden": true,
|
|
646
|
-
className: "shrink-0 overflow-visible",
|
|
647
|
-
children: t33
|
|
697
|
+
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
698
|
+
t34 = /*#__PURE__*/_jsx("div", {
|
|
699
|
+
ref: setLegendSlot,
|
|
700
|
+
className: "empty:hidden"
|
|
648
701
|
});
|
|
649
|
-
$[
|
|
650
|
-
$[41] = leftAxis;
|
|
651
|
-
$[42] = t34;
|
|
652
|
-
} else {
|
|
653
|
-
t34 = $[42];
|
|
654
|
-
}
|
|
655
|
-
const t35 = scrolls ? "overflow-x-auto overflow-y-hidden overscroll-x-contain" : "overflow-visible";
|
|
656
|
-
let t36;
|
|
657
|
-
if ($[43] !== t35) {
|
|
658
|
-
t36 = clsx("min-w-0 flex-1", t35);
|
|
659
|
-
$[43] = t35;
|
|
660
|
-
$[44] = t36;
|
|
702
|
+
$[44] = t34;
|
|
661
703
|
} else {
|
|
662
|
-
|
|
704
|
+
t34 = $[44];
|
|
663
705
|
}
|
|
706
|
+
const t35 = grow && !horizontal && "min-h-0 flex-1";
|
|
707
|
+
const t36 = horizontal && pressable && "cursor-pointer";
|
|
664
708
|
let t37;
|
|
665
|
-
if ($[45] !==
|
|
666
|
-
t37 =
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
clipPath: scroll > 0 ? `inset(0 0 0 ${overhang}px)` : undefined
|
|
670
|
-
} : undefined;
|
|
671
|
-
$[45] = overhang;
|
|
672
|
-
$[46] = scroll;
|
|
709
|
+
if ($[45] !== t35 || $[46] !== t36) {
|
|
710
|
+
t37 = clsx("focus-ring-within relative flex rounded-md", t35, t36);
|
|
711
|
+
$[45] = t35;
|
|
712
|
+
$[46] = t36;
|
|
673
713
|
$[47] = t37;
|
|
674
714
|
} else {
|
|
675
715
|
t37 = $[47];
|
|
676
716
|
}
|
|
677
717
|
let t38;
|
|
678
718
|
if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
|
|
679
|
-
t38 =
|
|
719
|
+
t38 = {
|
|
720
|
+
outlineOffset: 4
|
|
721
|
+
};
|
|
680
722
|
$[48] = t38;
|
|
681
723
|
} else {
|
|
682
724
|
t38 = $[48];
|
|
683
725
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
$[
|
|
689
|
-
$[
|
|
726
|
+
const t39 = scrolls ? "overflow-x-auto overflow-y-hidden overscroll-x-contain" : "overflow-visible";
|
|
727
|
+
let t40;
|
|
728
|
+
if ($[49] !== t39) {
|
|
729
|
+
t40 = clsx("min-w-0 flex-1", t39);
|
|
730
|
+
$[49] = t39;
|
|
731
|
+
$[50] = t40;
|
|
690
732
|
} else {
|
|
691
|
-
|
|
733
|
+
t40 = $[50];
|
|
692
734
|
}
|
|
693
|
-
const t40 = pressable && "cursor-pointer";
|
|
694
735
|
let t41;
|
|
695
|
-
if ($[52] !==
|
|
696
|
-
t41 =
|
|
697
|
-
|
|
736
|
+
if ($[51] !== overhang || $[52] !== scroll) {
|
|
737
|
+
t41 = overhang > 0 ? {
|
|
738
|
+
marginLeft: -overhang,
|
|
739
|
+
paddingLeft: overhang,
|
|
740
|
+
clipPath: scroll > 0 ? `inset(0 0 0 ${overhang}px)` : undefined
|
|
741
|
+
} : undefined;
|
|
742
|
+
$[51] = overhang;
|
|
743
|
+
$[52] = scroll;
|
|
698
744
|
$[53] = t41;
|
|
699
745
|
} else {
|
|
700
746
|
t41 = $[53];
|
|
701
747
|
}
|
|
702
748
|
let t42;
|
|
703
|
-
if ($[54]
|
|
704
|
-
t42 =
|
|
705
|
-
$[54] =
|
|
706
|
-
|
|
707
|
-
$[
|
|
749
|
+
if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
|
|
750
|
+
t42 = e_3 => setScroll(e_3.currentTarget.scrollLeft);
|
|
751
|
+
$[54] = t42;
|
|
752
|
+
} else {
|
|
753
|
+
t42 = $[54];
|
|
754
|
+
}
|
|
755
|
+
const t43 = height;
|
|
756
|
+
let t44;
|
|
757
|
+
if ($[55] !== interactive || $[56] !== t) {
|
|
758
|
+
t44 = interactive ? t("chart") : undefined;
|
|
759
|
+
$[55] = interactive;
|
|
760
|
+
$[56] = t;
|
|
761
|
+
$[57] = t44;
|
|
708
762
|
} else {
|
|
709
|
-
|
|
763
|
+
t44 = $[57];
|
|
710
764
|
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
765
|
+
const t45 = pressable && "cursor-pointer";
|
|
766
|
+
let t46;
|
|
767
|
+
if ($[58] !== t45) {
|
|
768
|
+
t46 = clsx("block overflow-visible outline-none", t45);
|
|
769
|
+
$[58] = t45;
|
|
770
|
+
$[59] = t46;
|
|
771
|
+
} else {
|
|
772
|
+
t46 = $[59];
|
|
773
|
+
}
|
|
774
|
+
let t47;
|
|
775
|
+
if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
|
|
776
|
+
t47 = /*#__PURE__*/_jsx("g", {
|
|
714
777
|
ref: setRulesSlot,
|
|
715
778
|
tabIndex: -1
|
|
716
779
|
});
|
|
717
|
-
$[
|
|
780
|
+
$[60] = t47;
|
|
718
781
|
} else {
|
|
719
|
-
|
|
782
|
+
t47 = $[60];
|
|
720
783
|
}
|
|
721
|
-
let
|
|
722
|
-
if ($[
|
|
723
|
-
|
|
784
|
+
let t48;
|
|
785
|
+
if ($[61] !== measureGroups) {
|
|
786
|
+
t48 = node => {
|
|
724
787
|
setGroupsSlot(node);
|
|
725
788
|
measureGroups(node);
|
|
726
789
|
};
|
|
727
|
-
$[
|
|
728
|
-
$[
|
|
790
|
+
$[61] = measureGroups;
|
|
791
|
+
$[62] = t48;
|
|
729
792
|
} else {
|
|
730
|
-
|
|
793
|
+
t48 = $[62];
|
|
731
794
|
}
|
|
732
|
-
let
|
|
733
|
-
if ($[
|
|
734
|
-
|
|
795
|
+
let t49;
|
|
796
|
+
if ($[63] !== width) {
|
|
797
|
+
t49 = {
|
|
735
798
|
width
|
|
736
799
|
};
|
|
737
|
-
$[
|
|
738
|
-
$[
|
|
800
|
+
$[63] = width;
|
|
801
|
+
$[64] = t49;
|
|
739
802
|
} else {
|
|
740
|
-
|
|
803
|
+
t49 = $[64];
|
|
741
804
|
}
|
|
742
|
-
let
|
|
743
|
-
if ($[
|
|
744
|
-
|
|
745
|
-
ref:
|
|
805
|
+
let t50;
|
|
806
|
+
if ($[65] !== t48 || $[66] !== t49) {
|
|
807
|
+
t50 = /*#__PURE__*/_jsx("div", {
|
|
808
|
+
ref: t48,
|
|
746
809
|
className: "empty:hidden",
|
|
747
|
-
style:
|
|
810
|
+
style: t49
|
|
748
811
|
});
|
|
749
|
-
$[
|
|
750
|
-
$[
|
|
751
|
-
$[
|
|
812
|
+
$[65] = t48;
|
|
813
|
+
$[66] = t49;
|
|
814
|
+
$[67] = t50;
|
|
752
815
|
} else {
|
|
753
|
-
|
|
816
|
+
t50 = $[67];
|
|
754
817
|
}
|
|
755
|
-
let
|
|
756
|
-
if ($[
|
|
757
|
-
|
|
818
|
+
let t51;
|
|
819
|
+
if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
|
|
820
|
+
t51 = /*#__PURE__*/_jsx("g", {
|
|
758
821
|
ref: setRightSlot,
|
|
759
822
|
tabIndex: -1
|
|
760
823
|
});
|
|
761
|
-
$[
|
|
762
|
-
} else {
|
|
763
|
-
t47 = $[65];
|
|
764
|
-
}
|
|
765
|
-
let t48;
|
|
766
|
-
if ($[66] !== height || $[67] !== rightAxis) {
|
|
767
|
-
t48 = /*#__PURE__*/_jsx("svg", {
|
|
768
|
-
width: rightAxis,
|
|
769
|
-
height: height,
|
|
770
|
-
"aria-hidden": true,
|
|
771
|
-
className: "shrink-0 overflow-visible",
|
|
772
|
-
children: t47
|
|
773
|
-
});
|
|
774
|
-
$[66] = height;
|
|
775
|
-
$[67] = rightAxis;
|
|
776
|
-
$[68] = t48;
|
|
824
|
+
$[68] = t51;
|
|
777
825
|
} else {
|
|
778
|
-
|
|
826
|
+
t51 = $[68];
|
|
779
827
|
}
|
|
780
|
-
let
|
|
828
|
+
let t52;
|
|
781
829
|
if ($[69] === Symbol.for("react.memo_cache_sentinel")) {
|
|
782
|
-
|
|
830
|
+
t52 = /*#__PURE__*/_jsx("div", {
|
|
783
831
|
ref: setTooltipSlot,
|
|
784
832
|
className: "pointer-events-none absolute inset-0"
|
|
785
833
|
});
|
|
786
|
-
$[69] =
|
|
834
|
+
$[69] = t52;
|
|
787
835
|
} else {
|
|
788
|
-
|
|
836
|
+
t52 = $[69];
|
|
789
837
|
}
|
|
790
|
-
let
|
|
838
|
+
let t53;
|
|
791
839
|
if ($[70] === Symbol.for("react.memo_cache_sentinel")) {
|
|
792
|
-
|
|
840
|
+
t53 = /*#__PURE__*/_jsx("div", {
|
|
793
841
|
ref: setTableSlot,
|
|
794
842
|
className: "empty:hidden"
|
|
795
843
|
});
|
|
796
|
-
$[70] =
|
|
844
|
+
$[70] = t53;
|
|
797
845
|
} else {
|
|
798
|
-
|
|
846
|
+
t53 = $[70];
|
|
799
847
|
}
|
|
800
848
|
return /*#__PURE__*/_jsx(ChartContext, {
|
|
801
849
|
value: context,
|
|
802
850
|
children: /*#__PURE__*/_jsxs("div", {
|
|
803
851
|
ref: ref,
|
|
804
|
-
className:
|
|
805
|
-
children: [
|
|
852
|
+
className: t33,
|
|
853
|
+
children: [t34, /*#__PURE__*/_jsxs("div", {
|
|
806
854
|
ref: measure,
|
|
807
|
-
className:
|
|
808
|
-
style:
|
|
809
|
-
|
|
855
|
+
className: t37,
|
|
856
|
+
style: t38,
|
|
857
|
+
...(horizontal ? pointer : {}),
|
|
858
|
+
children: [horizontal ? /*#__PURE__*/_jsx("div", {
|
|
859
|
+
ref: setRowsSlot,
|
|
860
|
+
"aria-hidden": true,
|
|
861
|
+
className: "relative shrink-0",
|
|
862
|
+
style: {
|
|
863
|
+
width: leftAxis,
|
|
864
|
+
height
|
|
865
|
+
}
|
|
866
|
+
}) : /*#__PURE__*/_jsx("svg", {
|
|
867
|
+
width: leftAxis,
|
|
868
|
+
height: height,
|
|
869
|
+
"aria-hidden": true,
|
|
870
|
+
className: "shrink-0 overflow-visible",
|
|
871
|
+
children: /*#__PURE__*/_jsx("g", {
|
|
872
|
+
ref: setLeftSlot,
|
|
873
|
+
tabIndex: -1
|
|
874
|
+
})
|
|
875
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
810
876
|
ref: scroller,
|
|
811
|
-
className:
|
|
812
|
-
style:
|
|
813
|
-
onScroll:
|
|
877
|
+
className: t40,
|
|
878
|
+
style: t41,
|
|
879
|
+
onScroll: t42,
|
|
814
880
|
children: [/*#__PURE__*/_jsxs("svg", {
|
|
815
881
|
width: width,
|
|
816
|
-
height:
|
|
882
|
+
height: t43,
|
|
817
883
|
role: interactive ? "group" : "img",
|
|
818
884
|
tabIndex: interactive ? 0 : undefined,
|
|
819
|
-
"aria-roledescription":
|
|
885
|
+
"aria-roledescription": t44,
|
|
820
886
|
"aria-label": label,
|
|
821
887
|
"aria-describedby": interactive ? `${id}-hint` : undefined,
|
|
822
888
|
"aria-activedescendant": pressable && from_0 >= 0 ? `${id}-${from_0}` : undefined,
|
|
823
|
-
className:
|
|
824
|
-
|
|
825
|
-
onPointerLeave: t42,
|
|
826
|
-
onClick: pressable ? e_3 => activate(indexAtPointer(e_3)) : undefined,
|
|
889
|
+
className: t46,
|
|
890
|
+
...(horizontal ? {} : pointer),
|
|
827
891
|
onKeyDown: interactive ? onKeyDown : undefined,
|
|
828
892
|
onBlur: () => {
|
|
829
893
|
setAnnounce(false);
|
|
@@ -832,35 +896,29 @@ export function ChartRoot(t0) {
|
|
|
832
896
|
setActiveX(null);
|
|
833
897
|
}
|
|
834
898
|
},
|
|
835
|
-
children: [layout !== null && highlighted.map(
|
|
836
|
-
|
|
837
|
-
y: plot.top,
|
|
838
|
-
width: Math.max(1, Math.round(layout.bucket)),
|
|
839
|
-
height: plot.height,
|
|
899
|
+
children: [layout !== null && highlighted.map(index_28 => /*#__PURE__*/_jsx("rect", {
|
|
900
|
+
...bucketBox(index_28, false),
|
|
840
901
|
className: "fill-surface-hover"
|
|
841
|
-
},
|
|
902
|
+
}, index_28)), children, t47, continuous !== null && !points && activeIndex >= 0 && cursor !== "none" && /*#__PURE__*/_jsx(Crosshair, {
|
|
842
903
|
context: context,
|
|
843
904
|
dots: cursor === "full"
|
|
844
905
|
}), points && /*#__PURE__*/_jsx(Guides, {
|
|
845
906
|
context: context
|
|
846
|
-
}), pressable && points && positions.map((position,
|
|
847
|
-
id: `${id}-${
|
|
907
|
+
}), pressable && points && positions.map((position, index_29) => position === null ? null : /*#__PURE__*/_jsx("circle", {
|
|
908
|
+
id: `${id}-${index_29}`,
|
|
848
909
|
role: "button",
|
|
849
|
-
"aria-pressed": selectedRows[
|
|
850
|
-
"aria-label": describe(
|
|
910
|
+
"aria-pressed": selectedRows[index_29],
|
|
911
|
+
"aria-label": describe(index_29),
|
|
851
912
|
cx: position[0],
|
|
852
913
|
cy: position[1],
|
|
853
914
|
r: 10,
|
|
854
915
|
fill: "transparent"
|
|
855
|
-
}, keys[
|
|
856
|
-
id: `${id}-${
|
|
916
|
+
}, keys[index_29])), pressable && layout !== null && xs.map((key_1, index_30) => /*#__PURE__*/_jsx("rect", {
|
|
917
|
+
id: `${id}-${index_30}`,
|
|
857
918
|
role: "button",
|
|
858
|
-
"aria-pressed": selectedRows[
|
|
859
|
-
"aria-label": describe(
|
|
860
|
-
|
|
861
|
-
y: plot.top,
|
|
862
|
-
width: Math.max(1, Math.round(layout.bucket)),
|
|
863
|
-
height: height - plot.top,
|
|
919
|
+
"aria-pressed": selectedRows[index_30],
|
|
920
|
+
"aria-label": describe(index_30),
|
|
921
|
+
...bucketBox(index_30, true),
|
|
864
922
|
fill: "transparent"
|
|
865
923
|
}, String(key_1))), xs.length === 0 && /*#__PURE__*/_jsx("text", {
|
|
866
924
|
x: Math.round((plot.left + plot.right) / 2),
|
|
@@ -870,9 +928,15 @@ export function ChartRoot(t0) {
|
|
|
870
928
|
className: "fill-text-faint text-xs",
|
|
871
929
|
children: t("noData")
|
|
872
930
|
})]
|
|
873
|
-
}),
|
|
874
|
-
}),
|
|
875
|
-
|
|
931
|
+
}), t50]
|
|
932
|
+
}), /*#__PURE__*/_jsx("svg", {
|
|
933
|
+
width: rightAxis,
|
|
934
|
+
height: height,
|
|
935
|
+
"aria-hidden": true,
|
|
936
|
+
className: "shrink-0 overflow-visible",
|
|
937
|
+
children: t51
|
|
938
|
+
}), t52]
|
|
939
|
+
}), t53, interactive && /*#__PURE__*/_jsxs(_Fragment, {
|
|
876
940
|
children: [/*#__PURE__*/_jsx("p", {
|
|
877
941
|
id: `${id}-hint`,
|
|
878
942
|
className: "sr-only",
|
|
@@ -887,44 +951,51 @@ export function ChartRoot(t0) {
|
|
|
887
951
|
});
|
|
888
952
|
}
|
|
889
953
|
/* The line at the cursor and a dot where it crosses each line and area. */
|
|
890
|
-
function
|
|
954
|
+
function _temp11(run_1) {
|
|
891
955
|
return run_1.first;
|
|
892
956
|
}
|
|
893
|
-
function
|
|
957
|
+
function _temp10(note) {
|
|
894
958
|
return note.detail === null ? note.label : `${note.label}, ${note.detail}`;
|
|
895
959
|
}
|
|
896
|
-
function
|
|
960
|
+
function _temp1(part) {
|
|
897
961
|
return part !== undefined;
|
|
898
962
|
}
|
|
899
|
-
function
|
|
900
|
-
return
|
|
963
|
+
function _temp0(entry_7) {
|
|
964
|
+
return entry_7.kind === "bar";
|
|
901
965
|
}
|
|
902
|
-
function
|
|
966
|
+
function _temp9(run_0) {
|
|
903
967
|
return run_0.key;
|
|
904
968
|
}
|
|
905
|
-
function
|
|
969
|
+
function _temp8(row_5) {
|
|
906
970
|
return row_5.format === undefined ? [] : [row_5.format];
|
|
907
971
|
}
|
|
908
|
-
function
|
|
909
|
-
return
|
|
972
|
+
function _temp7(entry_5) {
|
|
973
|
+
return entry_5.kind === "point" || entry_5.kind === "line";
|
|
910
974
|
}
|
|
911
|
-
function
|
|
975
|
+
function _temp6(rule) {
|
|
912
976
|
return rule.value;
|
|
913
977
|
}
|
|
914
|
-
function
|
|
915
|
-
const [seriesId,
|
|
978
|
+
function _temp5(t0) {
|
|
979
|
+
const [seriesId, entry_2] = t0;
|
|
916
980
|
return {
|
|
917
981
|
id: seriesId,
|
|
918
|
-
values:
|
|
919
|
-
stack:
|
|
982
|
+
values: entry_2.values,
|
|
983
|
+
stack: entry_2.stack
|
|
920
984
|
};
|
|
921
985
|
}
|
|
922
|
-
function
|
|
923
|
-
return
|
|
986
|
+
function _temp4(entry_1) {
|
|
987
|
+
return entry_1.valueLabels;
|
|
924
988
|
}
|
|
925
|
-
function
|
|
989
|
+
function _temp3(sum, row_4) {
|
|
926
990
|
return sum + row_4.room;
|
|
927
991
|
}
|
|
992
|
+
function _temp2(entry_0) {
|
|
993
|
+
return entry_0.endRoom ?? 0;
|
|
994
|
+
}
|
|
995
|
+
function _temp(t0) {
|
|
996
|
+
const [, entry] = t0;
|
|
997
|
+
return entry.kind === "bar";
|
|
998
|
+
}
|
|
928
999
|
function Crosshair(t0) {
|
|
929
1000
|
const $ = _c(19);
|
|
930
1001
|
const {
|
|
@@ -1034,7 +1105,7 @@ function Guides(t0) {
|
|
|
1034
1105
|
} = context;
|
|
1035
1106
|
let t1;
|
|
1036
1107
|
if ($[0] !== activeIndex || $[1] !== selected) {
|
|
1037
|
-
t1 = new Set([activeIndex, ...selected.flatMap(
|
|
1108
|
+
t1 = new Set([activeIndex, ...selected.flatMap(_temp12)]);
|
|
1038
1109
|
$[0] = activeIndex;
|
|
1039
1110
|
$[1] = selected;
|
|
1040
1111
|
$[2] = t1;
|
|
@@ -1064,7 +1135,7 @@ function Guides(t0) {
|
|
|
1064
1135
|
if ($[8] !== context.halo || $[9] !== data || $[10] !== formatX || $[11] !== formatY || $[12] !== plot || $[13] !== positions || $[14] !== series || $[15] !== shown || $[16] !== xs) {
|
|
1065
1136
|
t5 = Symbol.for("react.early_return_sentinel");
|
|
1066
1137
|
bb0: {
|
|
1067
|
-
const placing = [...series.values()].find(
|
|
1138
|
+
const placing = [...series.values()].find(_temp13);
|
|
1068
1139
|
if (shown.length === 0 || placing === undefined || data.length === 0) {
|
|
1069
1140
|
t5 = null;
|
|
1070
1141
|
break bb0;
|
|
@@ -1129,9 +1200,9 @@ function Guides(t0) {
|
|
|
1129
1200
|
}
|
|
1130
1201
|
return t4;
|
|
1131
1202
|
}
|
|
1132
|
-
function
|
|
1203
|
+
function _temp13(entry) {
|
|
1133
1204
|
return entry.kind === "point" || entry.kind === "line";
|
|
1134
1205
|
}
|
|
1135
|
-
function
|
|
1206
|
+
function _temp12(picked, index) {
|
|
1136
1207
|
return picked ? [index] : [];
|
|
1137
1208
|
}
|