@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.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
- height: t5,
44
- grow: t6,
45
- margin: t7,
46
- surface: t8,
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: t9,
52
- minBucketWidth: t10,
60
+ groupGap: t11,
61
+ minBucketWidth: t12,
53
62
  selected,
54
- interactive: t11,
55
- cursor: t12,
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 leastHeight = t5 === undefined ? 200 : t5;
67
- const grow = t6 === undefined ? false : t6;
68
- const margin = t7 === undefined ? {} : t7;
69
- const surface = t8 === undefined ? "base" : t8;
70
- const groupGap = t9 === undefined ? GROUP_GAP : t9;
71
- const minBucketWidth = t10 === undefined ? 0 : t10;
72
- const interactive = t11 === undefined ? true : t11;
73
- const cursor = t12 === undefined ? "full" : t12;
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 series = useSyncExternalStore(store.subscribe, store.series, store.series);
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 markers = useSyncExternalStore(store.subscribe, store.markers, store.markers);
84
- const bands = useSyncExternalStore(store.subscribe, store.bands, store.bands);
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 height = grow ? Math.max(leastHeight, size.height - groupsSize.height) : leastHeight;
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
- let t13;
107
- if ($[0] !== x) {
108
- t13 = (row, index) => {
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
- $[0] = x;
113
- $[1] = t13;
151
+ $[5] = x;
152
+ $[6] = t17;
114
153
  } else {
115
- t13 = $[1];
154
+ t17 = $[6];
116
155
  }
117
- const xs = data.map(t13);
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 bottom = height - (xRows.length === 0 ? margin.bottom ?? 0 : (margin.bottom ?? 4) + X_AXIS_GAP + xRows.reduce(_temp, 0));
136
- const top = Math.max(margin.top ?? 8, leftY?.top ?? 0, rightY?.top ?? 0, [...series.values()].some(_temp2) ? VALUE_LABEL_ROOM : 0);
137
- const right = width - marginRight - (axes.end ?? 0);
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(_temp3);
200
+ const stackInput = [...series].map(_temp5);
149
201
  const stacked = stackSeries(stackInput, xs.length);
150
- const ruleValues = [...rules.values()].map(_temp4);
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, [plot.bottom, plot.top], leftY?.ticks ?? rightY?.ticks ?? tickCount(plot.height, Y_TICK_SPACING), !points);
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(plot.bottom, Math.max(plot.top, pixel));
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, entry_1] of series) {
164
- colors.set(seriesId_0, entry_1.color ?? seriesColor(next++));
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, entry_2] of series) {
169
- if (entry_2.kind === "bar") {
170
- const ids = members.get(entry_2.bars ?? "");
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(entry_2.bars ?? "", [seriesId_1]);
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(_temp5) : undefined;
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((t14, index_7, all) => {
224
- const [, entry_4] = t14;
225
- return !points || all.findIndex(t15 => {
226
- const [, other] = t15;
227
- return other.label === entry_4.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 plot.left + (layout.lefts[index_10] ?? 0) + layout.bucket / 2;
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: plot.left + (layout.lefts[index_11] ?? 0),
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(_temp6).toReversed();
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 t16;
332
- if ($[2] !== controlled || $[3] !== id || $[4] !== onActiveXChange || $[5] !== sharedCursor) {
333
- t16 = value_5 => {
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
- $[2] = controlled;
344
- $[3] = id;
345
- $[4] = onActiveXChange;
346
- $[5] = sharedCursor;
347
- $[6] = t16;
396
+ $[7] = controlled;
397
+ $[8] = id;
398
+ $[9] = onActiveXChange;
399
+ $[10] = sharedCursor;
400
+ $[11] = t20;
348
401
  } else {
349
- t16 = $[6];
402
+ t20 = $[11];
350
403
  }
351
- const setActiveX = t16;
352
- let t17;
353
- if ($[7] !== selected) {
354
- t17 = new Set((selected ?? []).map(String));
355
- $[7] = selected;
356
- $[8] = t17;
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
- t17 = $[8];
411
+ t21 = $[13];
359
412
  }
360
- const picked = t17;
361
- let t18;
362
- if ($[9] !== picked) {
363
- t18 = key_0 => picked.has(String(key_0));
364
- $[9] = picked;
365
- $[10] = t18;
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
- t18 = $[10];
420
+ t22 = $[15];
368
421
  }
369
- const selectedRows = (keys ?? xs).map(t18);
370
- let t19;
371
- if ($[11] !== dimmed) {
372
- t19 = (row_6, index_16) => dimmed?.(row_6, index_16) ?? false;
373
- $[11] = dimmed;
374
- $[12] = t19;
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
- t19 = $[12];
429
+ t23 = $[17];
377
430
  }
378
- const dimmedRows = data.map(t19);
379
- const dimmedGroups = new Set(pointGroups.filter(run => run.indexes.every(index_17 => dimmedRows[index_17])).map(_temp7));
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(_temp8)?.dimOpacity ?? null;
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(_temp9);
390
- for (const [, entry_6] of readable) {
391
- const value_6 = entry_6.values[index_19];
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(`${entry_6.label} ${formatY(value_6)}`);
446
+ parts.push(`${entry_8.label} ${formatY(value_6)}`);
394
447
  }
395
448
  }
396
- return [...parts, ...notesAt(index_19).map(_temp0)].join(", ");
449
+ return [...parts, ...notesAt(index_19).map(_temp10)].join(", ");
397
450
  };
398
- let t20;
399
- let t21;
400
- if ($[13] !== data || $[14] !== x) {
401
- t20 = () => {
451
+ let t24;
452
+ let t25;
453
+ if ($[18] !== data || $[19] !== x) {
454
+ t24 = () => {
402
455
  warnMissingKey(x, data, "Chart.Root");
403
456
  };
404
- t21 = [x, data];
405
- $[13] = data;
406
- $[14] = x;
407
- $[15] = t20;
408
- $[16] = t21;
457
+ t25 = [x, data];
458
+ $[18] = data;
459
+ $[19] = x;
460
+ $[20] = t24;
461
+ $[21] = t25;
409
462
  } else {
410
- t20 = $[15];
411
- t21 = $[16];
463
+ t24 = $[20];
464
+ t25 = $[21];
412
465
  }
413
- useEffect(t20, t21);
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 t22;
450
- if ($[17] !== data || $[18] !== onActivate || $[19] !== pressable) {
451
- t22 = index_24 => {
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
- $[17] = data;
457
- $[18] = onActivate;
458
- $[19] = pressable;
459
- $[20] = t22;
509
+ $[22] = data;
510
+ $[23] = onActivate;
511
+ $[24] = pressable;
512
+ $[25] = t26;
460
513
  } else {
461
- t22 = $[20];
514
+ t26 = $[25];
462
515
  }
463
- const activate = t22;
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(_temp1) ?? [];
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 t23;
561
- if ($[21] !== points || $[22] !== t) {
562
- t23 = points ? t("keyboard.points") : t("keyboard.move");
563
- $[21] = points;
564
- $[22] = t;
565
- $[23] = t23;
566
- } else {
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
- t26 = $[31];
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 ($[35] === Symbol.for("react.memo_cache_sentinel")) {
604
- t29 = /*#__PURE__*/_jsx("div", {
605
- ref: setLegendSlot,
606
- className: "empty:hidden"
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 = $[35];
634
+ t29 = $[32];
611
635
  }
612
- const t30 = grow && "min-h-0 flex-1";
613
- let t31;
614
- if ($[36] !== t30) {
615
- t31 = clsx("focus-ring-within relative flex rounded-md", t30);
616
- $[36] = t30;
617
- $[37] = t31;
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
- t31 = $[37];
645
+ t30 = $[37];
620
646
  }
621
- let t32;
622
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
623
- t32 = {
624
- outlineOffset: 4
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
- $[38] = t32;
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
- t32 = $[38];
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 ($[39] === Symbol.for("react.memo_cache_sentinel")) {
632
- t33 = /*#__PURE__*/_jsx("g", {
633
- ref: setLeftSlot,
634
- tabIndex: -1
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 = $[39];
694
+ t33 = $[43];
639
695
  }
640
696
  let t34;
641
- if ($[40] !== height || $[41] !== leftAxis) {
642
- t34 = /*#__PURE__*/_jsx("svg", {
643
- width: leftAxis,
644
- height: height,
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
- $[40] = height;
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
- t36 = $[44];
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] !== overhang || $[46] !== scroll) {
666
- t37 = overhang > 0 ? {
667
- marginLeft: -overhang,
668
- paddingLeft: overhang,
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 = e_2 => setScroll(e_2.currentTarget.scrollLeft);
719
+ t38 = {
720
+ outlineOffset: 4
721
+ };
680
722
  $[48] = t38;
681
723
  } else {
682
724
  t38 = $[48];
683
725
  }
684
- let t39;
685
- if ($[49] !== interactive || $[50] !== t) {
686
- t39 = interactive ? t("chart") : undefined;
687
- $[49] = interactive;
688
- $[50] = t;
689
- $[51] = t39;
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
- t39 = $[51];
733
+ t40 = $[50];
692
734
  }
693
- const t40 = pressable && "cursor-pointer";
694
735
  let t41;
695
- if ($[52] !== t40) {
696
- t41 = clsx("block overflow-visible outline-none", t40);
697
- $[52] = t40;
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] !== keyX || $[55] !== setActiveX) {
704
- t42 = () => setActiveX(keyX);
705
- $[54] = keyX;
706
- $[55] = setActiveX;
707
- $[56] = t42;
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
- t42 = $[56];
763
+ t44 = $[57];
710
764
  }
711
- let t43;
712
- if ($[57] === Symbol.for("react.memo_cache_sentinel")) {
713
- t43 = /*#__PURE__*/_jsx("g", {
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
- $[57] = t43;
780
+ $[60] = t47;
718
781
  } else {
719
- t43 = $[57];
782
+ t47 = $[60];
720
783
  }
721
- let t44;
722
- if ($[58] !== measureGroups) {
723
- t44 = node => {
784
+ let t48;
785
+ if ($[61] !== measureGroups) {
786
+ t48 = node => {
724
787
  setGroupsSlot(node);
725
788
  measureGroups(node);
726
789
  };
727
- $[58] = measureGroups;
728
- $[59] = t44;
790
+ $[61] = measureGroups;
791
+ $[62] = t48;
729
792
  } else {
730
- t44 = $[59];
793
+ t48 = $[62];
731
794
  }
732
- let t45;
733
- if ($[60] !== width) {
734
- t45 = {
795
+ let t49;
796
+ if ($[63] !== width) {
797
+ t49 = {
735
798
  width
736
799
  };
737
- $[60] = width;
738
- $[61] = t45;
800
+ $[63] = width;
801
+ $[64] = t49;
739
802
  } else {
740
- t45 = $[61];
803
+ t49 = $[64];
741
804
  }
742
- let t46;
743
- if ($[62] !== t44 || $[63] !== t45) {
744
- t46 = /*#__PURE__*/_jsx("div", {
745
- ref: t44,
805
+ let t50;
806
+ if ($[65] !== t48 || $[66] !== t49) {
807
+ t50 = /*#__PURE__*/_jsx("div", {
808
+ ref: t48,
746
809
  className: "empty:hidden",
747
- style: t45
810
+ style: t49
748
811
  });
749
- $[62] = t44;
750
- $[63] = t45;
751
- $[64] = t46;
812
+ $[65] = t48;
813
+ $[66] = t49;
814
+ $[67] = t50;
752
815
  } else {
753
- t46 = $[64];
816
+ t50 = $[67];
754
817
  }
755
- let t47;
756
- if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
757
- t47 = /*#__PURE__*/_jsx("g", {
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
- $[65] = t47;
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
- t48 = $[68];
826
+ t51 = $[68];
779
827
  }
780
- let t49;
828
+ let t52;
781
829
  if ($[69] === Symbol.for("react.memo_cache_sentinel")) {
782
- t49 = /*#__PURE__*/_jsx("div", {
830
+ t52 = /*#__PURE__*/_jsx("div", {
783
831
  ref: setTooltipSlot,
784
832
  className: "pointer-events-none absolute inset-0"
785
833
  });
786
- $[69] = t49;
834
+ $[69] = t52;
787
835
  } else {
788
- t49 = $[69];
836
+ t52 = $[69];
789
837
  }
790
- let t50;
838
+ let t53;
791
839
  if ($[70] === Symbol.for("react.memo_cache_sentinel")) {
792
- t50 = /*#__PURE__*/_jsx("div", {
840
+ t53 = /*#__PURE__*/_jsx("div", {
793
841
  ref: setTableSlot,
794
842
  className: "empty:hidden"
795
843
  });
796
- $[70] = t50;
844
+ $[70] = t53;
797
845
  } else {
798
- t50 = $[70];
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: t28,
805
- children: [t29, /*#__PURE__*/_jsxs("div", {
852
+ className: t33,
853
+ children: [t34, /*#__PURE__*/_jsxs("div", {
806
854
  ref: measure,
807
- className: t31,
808
- style: t32,
809
- children: [t34, /*#__PURE__*/_jsxs("div", {
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: t36,
812
- style: t37,
813
- onScroll: t38,
877
+ className: t40,
878
+ style: t41,
879
+ onScroll: t42,
814
880
  children: [/*#__PURE__*/_jsxs("svg", {
815
881
  width: width,
816
- height: height,
882
+ height: t43,
817
883
  role: interactive ? "group" : "img",
818
884
  tabIndex: interactive ? 0 : undefined,
819
- "aria-roledescription": t39,
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: t41,
824
- onPointerMove: onPointerMove,
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(index_27 => /*#__PURE__*/_jsx("rect", {
836
- x: Math.round(plot.left + layout.lefts[index_27]),
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
- }, index_27)), children, t43, continuous !== null && !points && activeIndex >= 0 && cursor !== "none" && /*#__PURE__*/_jsx(Crosshair, {
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, index_28) => position === null ? null : /*#__PURE__*/_jsx("circle", {
847
- id: `${id}-${index_28}`,
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[index_28],
850
- "aria-label": describe(index_28),
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[index_28])), pressable && layout !== null && xs.map((key_1, index_29) => /*#__PURE__*/_jsx("rect", {
856
- id: `${id}-${index_29}`,
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[index_29],
859
- "aria-label": describe(index_29),
860
- x: Math.round(plot.left + layout.lefts[index_29]),
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
- }), t46]
874
- }), t48, t49]
875
- }), t50, interactive && /*#__PURE__*/_jsxs(_Fragment, {
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 _temp1(run_1) {
954
+ function _temp11(run_1) {
891
955
  return run_1.first;
892
956
  }
893
- function _temp0(note) {
957
+ function _temp10(note) {
894
958
  return note.detail === null ? note.label : `${note.label}, ${note.detail}`;
895
959
  }
896
- function _temp9(part) {
960
+ function _temp1(part) {
897
961
  return part !== undefined;
898
962
  }
899
- function _temp8(entry_5) {
900
- return entry_5.kind === "bar";
963
+ function _temp0(entry_7) {
964
+ return entry_7.kind === "bar";
901
965
  }
902
- function _temp7(run_0) {
966
+ function _temp9(run_0) {
903
967
  return run_0.key;
904
968
  }
905
- function _temp6(row_5) {
969
+ function _temp8(row_5) {
906
970
  return row_5.format === undefined ? [] : [row_5.format];
907
971
  }
908
- function _temp5(entry_3) {
909
- return entry_3.kind === "point" || entry_3.kind === "line";
972
+ function _temp7(entry_5) {
973
+ return entry_5.kind === "point" || entry_5.kind === "line";
910
974
  }
911
- function _temp4(rule) {
975
+ function _temp6(rule) {
912
976
  return rule.value;
913
977
  }
914
- function _temp3(t0) {
915
- const [seriesId, entry_0] = t0;
978
+ function _temp5(t0) {
979
+ const [seriesId, entry_2] = t0;
916
980
  return {
917
981
  id: seriesId,
918
- values: entry_0.values,
919
- stack: entry_0.stack
982
+ values: entry_2.values,
983
+ stack: entry_2.stack
920
984
  };
921
985
  }
922
- function _temp2(entry) {
923
- return entry.valueLabels;
986
+ function _temp4(entry_1) {
987
+ return entry_1.valueLabels;
924
988
  }
925
- function _temp(sum, row_4) {
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(_temp10)]);
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(_temp11);
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 _temp11(entry) {
1203
+ function _temp13(entry) {
1133
1204
  return entry.kind === "point" || entry.kind === "line";
1134
1205
  }
1135
- function _temp10(picked, index) {
1206
+ function _temp12(picked, index) {
1136
1207
  return picked ? [index] : [];
1137
1208
  }