@mechane-ai/elements 0.23.0 → 0.24.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.
@@ -1,28 +1,30 @@
1
1
  import { u as e } from "../src-DHYcohZP.js";
2
- import { i as t, n, r, t as i } from "../categorical-values-lk7xoiOz.js";
3
- import { a, i as o, n as s, o as c, r as l, s as u, t as d } from "../chart-frame-CFEDXxpC.js";
4
- import { n as f, r as p, t as m } from "../chart-input-BrzNr3oe.js";
5
- import { t as h } from "../plot-width--OgdohB5.js";
6
- import { E as g } from "../src-DLReNPV9.js";
7
- import { g as _ } from "../src-CQOgWIzP.js";
8
- import { r as v } from "../tokens.stylex-DTHHFbyl.js";
9
- import * as y from "@stylexjs/stylex";
10
- import { useEffect as b, useId as x, useMemo as S, useRef as C, useState as w } from "react";
11
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
12
- import { scaleBand as O, scaleLinear as k } from "@visx/scale";
13
- import { AreaClosed as ee, Bar as te, LinePath as A } from "@visx/shape";
2
+ import { i as t, n, r, t as i } from "../categorical-values-CPRt9uzI.js";
3
+ import { E as a } from "../src-DLReNPV9.js";
4
+ import { t as o } from "../use-scroll-tab-index-Dxpdh4W7.js";
5
+ import { s } from "../src-d7EAi61b.js";
6
+ import { a as c, n as l, o as u, r as d, s as f, t as p } from "../chart-frame-CNr8M_b2.js";
7
+ import { n as m, r as h, t as g } from "../chart-input-DDAjzy-O.js";
8
+ import { t as _ } from "../plot-width--OgdohB5.js";
9
+ import { g as v } from "../src-CQOgWIzP.js";
10
+ import { r as y } from "../tokens.stylex-DTHHFbyl.js";
11
+ import * as b from "@stylexjs/stylex";
12
+ import { useEffect as ee, useId as x, useMemo as te, useRef as S, useState as C } from "react";
13
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
14
+ import { scaleBand as D, scaleLinear as O } from "@visx/scale";
15
+ import { AreaClosed as ne, Bar as k, LinePath as A } from "@visx/shape";
14
16
  // packages/charts/src/chart-cursor.tsx
15
- function ne({ x: e, top: t, bottom: n, width: r }) {
16
- return /* @__PURE__ */ D("g", {
17
+ function re({ x: e, top: t, bottom: n, width: r }) {
18
+ return /* @__PURE__ */ E("g", {
17
19
  "aria-hidden": !0,
18
20
  className: "xlshs6z xgs60n x17y187c xbabvq0 x47corl",
19
- children: [/* @__PURE__ */ E("line", {
21
+ children: [/* @__PURE__ */ T("line", {
20
22
  x1: e,
21
23
  x2: e,
22
24
  y1: t,
23
25
  y2: n,
24
26
  className: "xnpr05h x1ntoi03 x13efnbd"
25
- }), /* @__PURE__ */ E("line", {
27
+ }), /* @__PURE__ */ T("line", {
26
28
  x1: e - r / 2,
27
29
  x2: e + r / 2,
28
30
  y1: n + 4,
@@ -31,8 +33,165 @@ function ne({ x: e, top: t, bottom: n, width: r }) {
31
33
  })]
32
34
  });
33
35
  }
36
+ // packages/charts/src/chart-data.tsx
37
+ function ie({ title: e, children: t }) {
38
+ let n = o();
39
+ return /* @__PURE__ */ E(s.Root, { children: [/* @__PURE__ */ T(s.Trigger, {
40
+ render: /* @__PURE__ */ T(a, {}),
41
+ children: "Chart data"
42
+ }), /* @__PURE__ */ E(s.Portal, { children: [/* @__PURE__ */ T(s.Backdrop, {}), /* @__PURE__ */ E(s.Popup, { children: [
43
+ /* @__PURE__ */ T(s.Title, { children: e }),
44
+ /* @__PURE__ */ T("div", {
45
+ ref: n.ref,
46
+ role: "region",
47
+ "aria-label": "Chart values",
48
+ tabIndex: n.tabIndex,
49
+ className: "xeuugli x1phlbz0 xysyzu8 x1we84gm",
50
+ children: t
51
+ }),
52
+ /* @__PURE__ */ T(s.Close, {
53
+ render: /* @__PURE__ */ T(a, {}),
54
+ children: "Close"
55
+ })
56
+ ] })] })] });
57
+ }
58
+ // packages/charts/src/chart-inspection.tsx
59
+ var ae = {
60
+ kzqmXN: "x1xc55vz",
61
+ kZKoxP: "xdk7pt",
62
+ kmuXW: "x2lah0s",
63
+ $$css: !0
64
+ }, j = {
65
+ swatch: (e) => [
66
+ ae,
67
+ {
68
+ kWkggS: e == null ? e : "xl8spv7",
69
+ $$css: !0
70
+ },
71
+ { "--x-backgroundColor": e ?? void 0 }
72
+ ],
73
+ inspector: {
74
+ k1xSpc: "xrvj5dj x1boff50",
75
+ kOIVth: "xunmzkg",
76
+ kVAEAm: "x10l6tqk",
77
+ k87sOh: "x1ridm32",
78
+ kB7OPa: "x9f619",
79
+ kfzvcC: "x47corl",
80
+ kmVPX3: "x69ldcm",
81
+ kMzoRj: "xmkeg23",
82
+ ksu8eU: "x1y0btm7",
83
+ kVAM5u: "x1ey3b81",
84
+ kaIpWk: "x1ok0vyi",
85
+ kGVxlE: "x1ghndwu",
86
+ kWkggS: "xpvm0e4",
87
+ kMwMTN: "xbixft",
88
+ kGuDYH: "xy8obcc",
89
+ kLWn49: "xas2l8k",
90
+ kcqcaj: "xss6m8b",
91
+ kHjlTd: "xj0a0fe",
92
+ $$css: !0
93
+ },
94
+ position: (e, t) => [{
95
+ kbCHJM: e == null ? e : "xgq9j65",
96
+ kzqmXN: t == null ? t : "x5lhr3w",
97
+ $$css: !0
98
+ }, {
99
+ "--x-left": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
100
+ "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
101
+ }]
102
+ };
103
+ function M({ title: e, detail: t }) {
104
+ return t === void 0 ? e : /* @__PURE__ */ E("span", {
105
+ "aria-label": e,
106
+ className: "x1lliihq xb3r6kr xlyipyv xuxw1ft",
107
+ children: [/* @__PURE__ */ T("span", {
108
+ className: "xt0psk2 x1boff50",
109
+ children: e
110
+ }), /* @__PURE__ */ T("span", {
111
+ className: "x1s85apg xfodcyb",
112
+ children: t
113
+ })]
114
+ });
115
+ }
116
+ function oe({ id: e, label: t, summary: n, legend: r, layoutLegend: i, rows: a, x: o, width: s, offset: c = 16, source: l, notes: u = [] }) {
117
+ let d = Math.min(260, s), p = o > s / 2 ? o - d - c : o + c, m = Math.max(0, Math.min(s - d, p)), h = t === void 0 ? [] : [
118
+ t,
119
+ n,
120
+ ...a.map((e) => `${e.label}: ${e.value}`),
121
+ ...u
122
+ ].filter((e) => e !== void 0);
123
+ return /* @__PURE__ */ E("div", {
124
+ className: "xeuugli",
125
+ children: [
126
+ /* @__PURE__ */ E("div", {
127
+ className: "xrvj5dj xeuugli",
128
+ children: [i !== void 0 && /* @__PURE__ */ T("ul", {
129
+ "aria-hidden": !0,
130
+ inert: !0,
131
+ className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc xlshs6z x47corl",
132
+ children: i.map((e) => /* @__PURE__ */ E("li", {
133
+ className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
134
+ children: [/* @__PURE__ */ T("span", { ...b.props(j.swatch(f[e.tone])) }), /* @__PURE__ */ E("span", {
135
+ className: "xeuugli",
136
+ children: [e.label, /* @__PURE__ */ T("span", { className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b" })]
137
+ })]
138
+ }, e.id))
139
+ }), /* @__PURE__ */ T("ul", {
140
+ "aria-label": "Legend",
141
+ className: "x78zum5 x1xnx9c1 xnby9oq x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc xas2l8k x15r89dc",
142
+ children: r.map((e) => /* @__PURE__ */ E("li", {
143
+ className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
144
+ children: [/* @__PURE__ */ T("span", {
145
+ "aria-hidden": !0,
146
+ ...b.props(j.swatch(f[e.tone]))
147
+ }), /* @__PURE__ */ E("span", {
148
+ className: "xeuugli",
149
+ children: [e.label, /* @__PURE__ */ T("span", {
150
+ className: "x1s85apg xannxpe x1mqbd49 xbixft xss6m8b",
151
+ children: t === void 0 ? "" : a.find((t) => t.id === e.id)?.value ?? "—"
152
+ })]
153
+ })]
154
+ }, e.id))
155
+ })]
156
+ }),
157
+ /* @__PURE__ */ T("span", {
158
+ id: e,
159
+ "aria-live": l === "keyboard" ? "polite" : "off",
160
+ className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xb3r6kr x1hyvwdk xuxw1ft",
161
+ children: h.join(" · ")
162
+ }),
163
+ t !== void 0 && /* @__PURE__ */ T("div", {
164
+ "aria-hidden": !0,
165
+ className: "x1n2onr6 xqtp20y x1vjfegm",
166
+ children: /* @__PURE__ */ E("div", {
167
+ ...b.props(j.inspector, j.position(m, d)),
168
+ children: [
169
+ /* @__PURE__ */ E("div", {
170
+ className: "x78zum5 x1qughib x1hnptsi xk4h15q",
171
+ children: [/* @__PURE__ */ T("span", { children: t }), n !== void 0 && /* @__PURE__ */ T("span", { children: n })]
172
+ }),
173
+ /* @__PURE__ */ T("dl", {
174
+ className: "xrvj5dj xunmzkg x1ghz6dp",
175
+ children: a.map((e) => /* @__PURE__ */ E("div", {
176
+ className: "x78zum5 x1qughib x1pha0wt x1hnptsi",
177
+ children: [/* @__PURE__ */ E("dt", {
178
+ className: "x78zum5 x1pha0wt xunmzkg xeuugli xj0a0fe",
179
+ children: [/* @__PURE__ */ T("span", { ...b.props(j.swatch(f[e.tone])) }), e.label]
180
+ }), /* @__PURE__ */ T("dd", {
181
+ className: "x1ghz6dp xuxw1ft",
182
+ children: e.value
183
+ })]
184
+ }, e.id))
185
+ }),
186
+ u.map((e) => /* @__PURE__ */ T("span", { children: e }, e))
187
+ ]
188
+ })
189
+ })
190
+ ]
191
+ });
192
+ }
34
193
  // packages/charts/src/cartesian/bar-data.ts
35
- function j({ composition: e, series: t, categoryIds: n, domain: r }) {
194
+ function se({ composition: e, series: t, categoryIds: n, domain: r }) {
36
195
  if (e === void 0) return;
37
196
  if (e.buckets.length !== n.length) return "Composition requires one explicit bucket per category.";
38
197
  let i = e.annotation;
@@ -50,119 +209,128 @@ function j({ composition: e, series: t, categoryIds: n, domain: r }) {
50
209
  }
51
210
  }
52
211
  // packages/charts/src/cartesian/composition-bars.tsx
53
- var M = { mark: {
212
+ var N = { mark: {
54
213
  k3nNDw: "x1hj3fc7",
55
214
  k1ekBW: "xwcsmn1",
56
215
  kIyJzY: "xtitasy x12w9bfk",
57
216
  kAMwcw: "x1faw7qm",
58
217
  $$css: !0
59
218
  } };
60
- function re({ bucket: e, series: t, focusedSeries: n, index: i, x: a, width: o, y: s, isHighlighted: l }) {
61
- let d = n !== void 0, f = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
62
- function p(e, t) {
219
+ function ce({ bucket: e, series: t, focusedSeries: n, index: i, x: a, width: o, y: s, isHighlighted: c, highlightedSeriesId: l }) {
220
+ let d = n !== void 0, p = n !== void 0 && !t.some((e) => e.id === n.id) ? [...t, n] : t;
221
+ function m(e, t) {
63
222
  let n = s(t), r = s(t + e);
64
223
  return `translateY(${Math.min(n, r)}px) scaleY(${Math.max(+(e === 0), Math.abs(r - n))})`;
65
224
  }
66
- return /* @__PURE__ */ D(T, { children: [e.kind !== "gap" && /* @__PURE__ */ E("rect", {
225
+ return /* @__PURE__ */ E(w, { children: [e.kind !== "gap" && /* @__PURE__ */ T("rect", {
67
226
  x: a,
68
227
  y: 0,
69
228
  width: o,
70
229
  height: 1,
71
230
  vectorEffect: "non-scaling-stroke",
72
- fill: u.neutral,
73
- ...y.props(M.mark, l && c.selected),
231
+ fill: f.neutral,
232
+ ...b.props(N.mark, c && u.selected),
74
233
  style: {
75
- transform: p(e.total, 0),
234
+ transform: m(e.total, 0),
76
235
  opacity: d ? .18 : +(e.kind === "total")
77
236
  }
78
- }), f.map((s, f) => {
79
- let m = s.values[i];
80
- if (m == null) return null;
81
- let h = n?.id === s.id, g = d ? 0 : t.slice(0, f).reduce((e, t) => e + (t.values[i] ?? 0), 0), _ = d ? h : e.kind === "parts";
82
- return /* @__PURE__ */ E("rect", {
237
+ }), p.map((s, p) => {
238
+ let h = s.values[i];
239
+ if (h == null) return null;
240
+ let g = n?.id === s.id, _ = d ? 0 : t.slice(0, p).reduce((e, t) => e + (t.values[i] ?? 0), 0), v = d ? g : e.kind === "parts", y = !d && l !== void 0 && l !== s.id;
241
+ return /* @__PURE__ */ T("rect", {
83
242
  x: a,
84
243
  y: 0,
85
244
  width: o,
86
245
  height: 1,
87
246
  vectorEffect: "non-scaling-stroke",
88
- fill: u[r(s.tone, f)],
89
- ...y.props(M.mark, l && c.selected),
247
+ fill: f[r(s.tone, p)],
248
+ ...b.props(N.mark, c && u.selected),
90
249
  style: {
91
- transform: p(m, g),
92
- opacity: +!!_
250
+ transform: m(h, _),
251
+ opacity: v ? y ? .3 : 1 : 0
93
252
  }
94
253
  }, s.id);
95
254
  })] });
96
255
  }
97
256
  // packages/charts/src/cartesian/bar-chart.tsx
98
- var ie = { plot: {
99
- kqGvvJ: "x1we84gm",
100
- $$css: !0
101
- } }, ae = /* @__PURE__ */ new Set(["Enter", " "]), oe = 200, se = "Point, tap, or use the arrow keys to inspect values.";
102
- function ce({ title: e, description: t, series: n, children: i }) {
103
- let a = n.map((e, t) => ({
257
+ var le = {
258
+ plot: {
259
+ kqGvvJ: "x1we84gm",
260
+ $$css: !0
261
+ },
262
+ mutedMark: {
263
+ kSiTet: "xuzhngd",
264
+ $$css: !0
265
+ }
266
+ }, ue = /* @__PURE__ */ new Set(["Enter", " "]), P = 200;
267
+ function de({ title: e, description: t, series: n, layoutSeries: i, children: a, inspectionId: o, label: s, detail: c, summary: l, rows: u = [], index: f = -1, formatValue: p = String, x: m = 0, width: h = 0, offset: g, source: _, data: v }) {
268
+ let y = n.map((e, t) => ({
269
+ id: e.id,
270
+ label: e.label,
271
+ tone: r(e.tone, t)
272
+ })), b = i?.map((e, t) => ({
104
273
  id: e.id,
105
274
  label: e.label,
106
275
  tone: r(e.tone, t)
107
276
  }));
108
- return /* @__PURE__ */ D(l, {
109
- title: e,
277
+ return /* @__PURE__ */ E(d, {
278
+ title: /* @__PURE__ */ T(M, {
279
+ title: e,
280
+ detail: c
281
+ }),
110
282
  description: t,
111
- children: [/* @__PURE__ */ E("div", {
112
- className: "x1mqbd49",
113
- children: /* @__PURE__ */ E(o, {
114
- items: a,
115
- isScrollable: !0
116
- })
117
- }), i]
283
+ actions: /* @__PURE__ */ T(ie, {
284
+ title: e,
285
+ children: v
286
+ }),
287
+ children: [/* @__PURE__ */ T(oe, {
288
+ id: o,
289
+ label: s,
290
+ summary: l,
291
+ legend: y,
292
+ layoutLegend: b,
293
+ rows: u.map((e, t) => ({
294
+ id: e.id,
295
+ label: e.label,
296
+ tone: r(e.tone, t),
297
+ value: e.values[f] === null || e.values[f] === void 0 ? "Unavailable" : p(e.values[f])
298
+ })),
299
+ x: m,
300
+ width: h,
301
+ offset: g,
302
+ source: _
303
+ }), a]
118
304
  });
119
305
  }
120
- function le({ title: t = "Loading chart", description: n, series: r = [], height: i = oe }) {
121
- let a = N(i);
122
- return a === void 0 ? /* @__PURE__ */ E("div", {
306
+ function F({ title: t = "Loading chart", description: n, series: r = [], height: i = P }) {
307
+ let a = I(i), o = x();
308
+ return a === void 0 ? /* @__PURE__ */ T("div", {
123
309
  "aria-hidden": !0,
124
310
  inert: !0,
125
- children: /* @__PURE__ */ D(ce, {
311
+ children: /* @__PURE__ */ T(de, {
126
312
  title: t,
127
313
  description: n,
128
314
  series: r,
129
- children: [
130
- /* @__PURE__ */ E("div", {
131
- ...y.props(c.plot, ie.plot),
132
- children: /* @__PURE__ */ E(e, { height: i })
133
- }),
134
- /* @__PURE__ */ E("div", {
135
- className: "x78zum5 x1a02dak x8zbtdt x1gkm1c7 x1rtsecp xy8obcc xas2l8k xss6m8b xj0a0fe",
136
- children: /* @__PURE__ */ D("span", {
137
- className: "x1n2onr6 xeuugli",
138
- children: [/* @__PURE__ */ E("span", {
139
- className: "xlshs6z",
140
- children: se
141
- }), /* @__PURE__ */ E("span", {
142
- className: "x10l6tqk x10a8y8t",
143
- children: /* @__PURE__ */ E(e, { height: "100%" })
144
- })]
145
- })
146
- }),
147
- /* @__PURE__ */ E("div", {
148
- className: "xlshs6z",
149
- children: /* @__PURE__ */ E(d, { children: null })
150
- })
151
- ]
315
+ inspectionId: o,
316
+ children: /* @__PURE__ */ T("div", {
317
+ ...b.props(u.plot, le.plot),
318
+ children: /* @__PURE__ */ T(e, { height: i })
319
+ })
152
320
  })
153
- }) : /* @__PURE__ */ E(m, {
321
+ }) : /* @__PURE__ */ T(g, {
154
322
  title: t,
155
323
  description: n,
156
324
  message: a
157
325
  });
158
326
  }
159
- function N(e) {
327
+ function I(e) {
160
328
  if (!Number.isFinite(e) || e < 48) return "Chart height must be at least 48 pixels.";
161
329
  }
162
- function ue({ categories: e, series: t, domain: r, mode: i }) {
330
+ function fe({ categories: e, series: t, domain: r, mode: i }) {
163
331
  if (e.length > n.items || t.length > n.series) return `Choose a window with at most ${n.items} categories and ${n.series} series.`;
164
- if (!p(r) || r[0] > 0 || r[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
165
- if (!f(e) || !f(t)) return "Bar categories and series require unique identifiers.";
332
+ if (!h(r) || r[0] > 0 || r[1] < 0) return "The bar domain must be finite, increasing, and include zero.";
333
+ if (!m(e) || !m(t)) return "Bar categories and series require unique identifiers.";
166
334
  for (let n of t) {
167
335
  if (n.values.length !== e.length) return "Every series requires one explicit value per category.";
168
336
  for (let e of n.values) {
@@ -172,228 +340,232 @@ function ue({ categories: e, series: t, domain: r, mode: i }) {
172
340
  }
173
341
  if (i === "stacked" && e.some((e, n) => t.reduce((e, t) => e + (t.values[n] ?? 0), 0) > r[1])) return "Stacked bar totals must fit the supplied domain.";
174
342
  }
175
- var P = {
343
+ var pe = {
176
344
  "x-default-marker": "x-default-marker",
177
345
  $$css: !0
178
346
  };
179
- function F({ title: e, description: t, categories: n, series: a, domain: o, mode: s = "grouped", formatValue: l, selection: f, height: p = oe, composition: g }) {
180
- let _ = g?.focusedSeries, v = x(), b = _ === void 0 ? void 0 : ue({
347
+ function L({ title: e, description: t, categories: n, series: a, domain: o, mode: s = "grouped", formatValue: c, formatTick: l = c, highlightedSeriesId: d, selection: p, height: m = P, composition: h }) {
348
+ let v = h?.focusedSeries, y = x(), te = v === void 0 ? void 0 : fe({
181
349
  categories: n,
182
- series: [_],
350
+ series: [v],
183
351
  domain: o,
184
352
  mode: "grouped"
185
- }), S = ue({
353
+ }), S = fe({
186
354
  categories: n,
187
355
  series: a,
188
356
  domain: o,
189
357
  mode: s
190
- }) ?? b, C = j({
191
- composition: g,
358
+ }) ?? te, w = se({
359
+ composition: h,
192
360
  series: a,
193
361
  categoryIds: n.map((e) => e.id),
194
362
  domain: o
195
- }) ?? N(p), ee = S ?? C, A = g === void 0 ? void 0 : {
196
- id: v,
197
- label: g.contextLabel,
363
+ }) ?? I(m), ne = S ?? w, A = h === void 0 ? void 0 : {
364
+ id: y,
365
+ label: h.contextLabel,
198
366
  tone: "neutral",
199
- values: g.buckets.map((e) => e.kind === "gap" ? null : e.total)
200
- }, M = A === void 0 ? a : [A, ..._ === void 0 ? [] : [_]], le = A === void 0 ? a : [
367
+ values: h.buckets.map((e) => e.kind === "gap" ? null : e.total)
368
+ }, ie = A === void 0 ? a : [
201
369
  A,
202
370
  ...a,
203
- ..._ === void 0 || a.some((e) => e.id === _.id) ? [] : [_]
204
- ], F = a.length > 0 ? a : M, { ref: fe, width: I } = h(), L = x(), [R, z] = w(), [B, V] = w(), H = n.findIndex((e) => e.id === R?.id), U = n[H], W = n.findIndex((e) => e.id === f?.selectedId), G = n[W], K = n.find((e) => e.id === B) ?? G ?? n[0], q = n.findIndex((e) => e.id === K?.id), J = U ?? G, Y = U === void 0 ? W : H;
205
- if (ee !== void 0) return /* @__PURE__ */ E(m, {
371
+ ...v === void 0 || a.some((e) => e.id === v.id) ? [] : [v]
372
+ ], ae = v !== void 0 && A !== void 0 ? [v, A] : a, { ref: j, width: M, element: oe } = _(), N = x(), [F, L] = C(), [R, z] = C();
373
+ ee(() => {
374
+ function e(e) {
375
+ e.target instanceof Node && oe?.contains(e.target) !== !0 && L(void 0);
376
+ }
377
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
378
+ }, [oe]);
379
+ let B = n.findIndex((e) => e.id === F?.id), V = n[B], H = n[n.findIndex((e) => e.id === p?.selectedId)], U = n.find((e) => e.id === R) ?? H ?? n[0], W = n.findIndex((e) => e.id === U?.id), G = V, he = B, K = h?.buckets[he], q = v !== void 0 && A !== void 0 ? [v, A] : A === void 0 || K?.kind === "parts" ? a : [], J = K === void 0 ? void 0 : K.kind === "gap" ? "No reported value" : c(K.total);
380
+ if (ne !== void 0) return /* @__PURE__ */ T(g, {
206
381
  title: e,
207
382
  description: t,
208
- message: ee
383
+ message: ne
209
384
  });
210
- let X = p - 28, Z = k({
385
+ let Y = m - 28, X = O({
211
386
  domain: [...o],
212
- range: [X, 12]
213
- }), Q = Math.max(52, ...Z.ticks(3).map((e) => l(e).length * 7 + 12)), pe = Math.max(Q + 1, I - 16), $ = O({
387
+ range: [Y, 12]
388
+ }), Z = Math.max(44, ...X.ticks(3).map((e) => l(e).length * 7 + 12)), Q = Math.max(Z + 1, M - 16), $ = D({
214
389
  domain: n.map((e) => e.id),
215
- range: [Q, pe],
390
+ range: [Z, Q],
216
391
  padding: .3
217
- }), me = O({
392
+ }), ge = D({
218
393
  domain: a.map((e) => e.id),
219
394
  range: [0, $.bandwidth()],
220
395
  padding: .08
221
- }), he = Math.min(120, Math.max(40, ...n.map((e) => (e.axisLabel ?? e.label).length * 7))), ge = Math.max(1, Math.ceil((he + 16) / $.step())), _e = n.length > 0 && (a.length > 0 || g !== void 0), ve = Math.max(1, Math.floor(($.step() * ge - 16) / 7));
222
- function ye(e) {
223
- let t = e.currentTarget.getBoundingClientRect(), r = (e.clientX - t.left) / t.width * I, i = Math.floor((r - Q) / $.step()), a = n[Math.max(0, Math.min(n.length - 1, i))];
224
- a !== void 0 && (e.type === "pointerdown" && V(a.id), z({
396
+ }), _e = Math.min(120, Math.max(40, ...n.map((e) => (e.axisLabel ?? e.label).length * 7))), ve = Math.max(1, Math.ceil((_e + 16) / $.step())), ye = Math.max(1, Math.floor(($.step() * ve - 16) / 7));
397
+ function be(e) {
398
+ let t = e.currentTarget.getBoundingClientRect(), r = (e.clientX - t.left) / t.width * M, i = Math.floor((r - Z) / $.step()), a = n[Math.max(0, Math.min(n.length - 1, i))];
399
+ a !== void 0 && (e.type === "pointerdown" && z(a.id), L({
225
400
  id: a.id,
226
401
  source: "pointer"
227
402
  }));
228
403
  }
229
- function be(e) {
404
+ function xe(e) {
230
405
  if (e.altKey || e.ctrlKey || e.metaKey) return;
231
406
  if (e.key === "Escape") {
232
- e.preventDefault(), e.stopPropagation(), z(void 0);
407
+ e.preventDefault(), e.stopPropagation(), L(void 0);
233
408
  return;
234
409
  }
235
- if (ae.has(e.key)) {
236
- K !== void 0 && f !== void 0 && (e.preventDefault(), f.onSelect(K.id));
410
+ if (ue.has(e.key)) {
411
+ U !== void 0 && p !== void 0 && (e.preventDefault(), p.onSelect(U.id));
237
412
  return;
238
413
  }
239
414
  let t = {
240
- ArrowRight: Math.min(n.length - 1, q + 1),
241
- ArrowLeft: Math.max(0, q - 1),
415
+ ArrowRight: Math.min(n.length - 1, W + 1),
416
+ ArrowLeft: Math.max(0, W - 1),
242
417
  Home: 0,
243
418
  End: n.length - 1
244
419
  }[e.key], r = t === void 0 ? void 0 : n[t];
245
- r !== void 0 && (e.preventDefault(), V(r.id), z({
420
+ r !== void 0 && (e.preventDefault(), z(r.id), L({
246
421
  id: r.id,
247
422
  source: "keyboard"
248
423
  }));
249
424
  }
250
- return /* @__PURE__ */ D(ce, {
425
+ return /* @__PURE__ */ T(de, {
251
426
  title: e,
252
427
  description: t,
253
- series: F,
254
- children: [
255
- /* @__PURE__ */ E("div", {
256
- ref: fe,
257
- ...y.props(c.plot, ie.plot),
258
- children: n.length === 0 || a.length === 0 && g === void 0 ? /* @__PURE__ */ E("p", {
259
- className: "x153jb6y x1ghz6dp xy8obcc",
260
- children: "No categories"
261
- }) : /* @__PURE__ */ D("svg", {
262
- role: "img",
263
- "aria-label": `${e}. Use arrow keys to inspect categories.${f === void 0 ? "" : " Press Enter to select."}`,
264
- "aria-describedby": L,
265
- tabIndex: 0,
266
- viewBox: `0 0 ${I} ${p}`,
267
- height: p,
268
- onKeyDown: be,
269
- onFocus: (e) => {
270
- if (e.currentTarget.matches(":focus-visible")) {
271
- let e = G ?? n[0];
272
- V(e?.id), z(e === void 0 ? void 0 : {
273
- id: e.id,
274
- source: "keyboard"
275
- });
276
- }
277
- },
278
- onPointerMove: (e) => {
279
- e.pointerType === "mouse" && ye(e);
280
- },
281
- onPointerDown: ye,
282
- onPointerLeave: (e) => {
283
- e.pointerType === "mouse" && R?.source === "pointer" && z(void 0);
284
- },
285
- onBlur: () => z(void 0),
286
- onClick: () => {
287
- U !== void 0 && f?.onSelect(U.id);
288
- },
289
- ...y.props(c.svg, c.inspectable, P),
290
- children: [
291
- U !== void 0 && /* @__PURE__ */ E("rect", {
292
- x: ($(U.id) ?? Q) - ($.step() - $.bandwidth()) / 2,
293
- y: 12,
294
- width: $.step(),
295
- height: X - 12,
296
- className: "x2wnxhi"
297
- }),
298
- Z.ticks(3).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
299
- x1: Q,
300
- x2: pe,
301
- y1: Z(e),
302
- y2: Z(e),
303
- ...y.props(c.grid)
304
- }), /* @__PURE__ */ E("text", {
305
- x: Q - 8,
306
- y: Z(e),
307
- textAnchor: "end",
308
- dominantBaseline: "middle",
309
- ...y.props(c.label),
310
- children: l(e)
311
- })] }, e)),
312
- g?.annotation !== void 0 && n.some((e) => e.id === g.annotation?.categoryId) && /* @__PURE__ */ E("text", {
313
- x: $(g.annotation.categoryId),
314
- y: Math.max(12, Z(g.annotation.value) - 8),
315
- ...y.props(c.label),
316
- children: g.annotation.label
317
- }),
318
- n.map((e, t) => {
319
- let n = e.axisLabel ?? e.label, i = g?.buckets[t];
320
- return /* @__PURE__ */ D("g", { children: [i === void 0 ? a.map((n, i) => {
321
- let o = n.values[t];
322
- if (o == null) return null;
323
- let l = s === "stacked" ? a.slice(0, i).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, d = Z(l), p = Z(l + o), m = f?.selectedId === e.id || U?.id === e.id;
324
- return /* @__PURE__ */ E(te, {
325
- x: ($(e.id) ?? Q) + (s === "stacked" ? 0 : me(n.id) ?? 0),
326
- y: Math.min(d, p),
327
- width: s === "stacked" ? $.bandwidth() : me.bandwidth(),
328
- height: Math.max(+(o === 0), Math.abs(p - d)),
329
- fill: u[r(n.tone, i)],
330
- ...y.props(m && c.selected)
331
- }, n.id);
332
- }) : /* @__PURE__ */ E(re, {
333
- bucket: i,
334
- series: a,
335
- focusedSeries: _,
336
- index: t,
337
- x: $(e.id) ?? Q,
338
- width: $.bandwidth(),
339
- y: Z,
340
- isHighlighted: f?.selectedId === e.id || U?.id === e.id
341
- }), t % ge === 0 && /* @__PURE__ */ E("text", {
342
- x: ($(e.id) ?? Q) + $.bandwidth() / 2,
343
- y: p - 4,
344
- textAnchor: "middle",
345
- ...y.props(c.label),
346
- children: n.length > ve ? `${n.slice(0, ve - 1)}…` : n
347
- })] }, e.id);
348
- }),
349
- K !== void 0 && /* @__PURE__ */ E(ne, {
350
- x: ($(K.id) ?? Q) + $.bandwidth() / 2,
351
- top: 12,
352
- bottom: X,
353
- width: Math.max(8, $.bandwidth())
354
- })
355
- ]
356
- })
357
- }),
358
- _e && /* @__PURE__ */ E("div", {
359
- id: L,
360
- "aria-live": R?.source === "pointer" ? "off" : "polite",
361
- className: "x78zum5 x1a02dak x8zbtdt x1gkm1c7 x1rtsecp xy8obcc xas2l8k xss6m8b xj0a0fe",
362
- children: J === void 0 ? /* @__PURE__ */ E("span", {
363
- className: "x153jb6y x1ghz6dp xy8obcc",
364
- children: se
365
- }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("span", { children: J.label }), M.map((e) => /* @__PURE__ */ D("span", { children: [
366
- e.label,
367
- ":",
368
- " ",
369
- e.values[Y] === null || e.values[Y] === void 0 ? "Unavailable" : l(e.values[Y])
370
- ] }, e.id))] })
371
- }),
372
- /* @__PURE__ */ E(d, { children: /* @__PURE__ */ E(i, {
373
- items: n.map((e, t) => ({
374
- id: e.id,
375
- label: e.label,
376
- valueLabel: de(le, t, l),
377
- tone: "neutral"
378
- })),
379
- selection: f
380
- }) })
381
- ]
428
+ series: ae,
429
+ layoutSeries: a,
430
+ inspectionId: N,
431
+ label: G?.label,
432
+ detail: G === void 0 ? void 0 : [G.axisLabel ?? G.label, J].filter(Boolean).join(" · "),
433
+ summary: J,
434
+ rows: q,
435
+ index: he,
436
+ formatValue: c,
437
+ x: ($(G?.id ?? "") ?? Z) + $.bandwidth() / 2,
438
+ width: M,
439
+ offset: $.bandwidth() / 2 + 8,
440
+ source: F?.source,
441
+ data: /* @__PURE__ */ T(i, {
442
+ items: n.map((e, t) => ({
443
+ id: e.id,
444
+ label: e.label,
445
+ valueLabel: me(ie, t, c),
446
+ tone: "neutral"
447
+ })),
448
+ selection: p
449
+ }),
450
+ children: /* @__PURE__ */ T("div", {
451
+ ref: j,
452
+ ...b.props(u.plot, le.plot),
453
+ children: n.length === 0 || a.length === 0 && h === void 0 ? /* @__PURE__ */ T("p", {
454
+ className: "x153jb6y x1ghz6dp xy8obcc",
455
+ children: "No categories"
456
+ }) : /* @__PURE__ */ E("svg", {
457
+ role: "img",
458
+ "aria-label": `${e}. Use arrow keys to inspect categories.${p === void 0 ? "" : " Press Enter to select."}`,
459
+ "aria-describedby": N,
460
+ tabIndex: 0,
461
+ viewBox: `0 0 ${M} ${m}`,
462
+ height: m,
463
+ onKeyDown: xe,
464
+ onFocus: (e) => {
465
+ if (e.currentTarget.matches(":focus-visible")) {
466
+ let e = H ?? n[0];
467
+ z(e?.id), L(e === void 0 ? void 0 : {
468
+ id: e.id,
469
+ source: "keyboard"
470
+ });
471
+ }
472
+ },
473
+ onPointerMove: (e) => {
474
+ e.pointerType === "mouse" && be(e);
475
+ },
476
+ onPointerDown: be,
477
+ onPointerLeave: (e) => {
478
+ e.pointerType === "mouse" && F?.source === "pointer" && L(void 0);
479
+ },
480
+ onBlur: () => L(void 0),
481
+ onClick: () => {
482
+ V !== void 0 && p?.onSelect(V.id);
483
+ },
484
+ ...b.props(u.svg, u.inspectable, pe),
485
+ children: [
486
+ V !== void 0 && /* @__PURE__ */ T("rect", {
487
+ x: ($(V.id) ?? Z) - ($.step() - $.bandwidth()) / 2,
488
+ y: 12,
489
+ width: $.step(),
490
+ height: Y - 12,
491
+ className: "x2wnxhi"
492
+ }),
493
+ X.ticks(3).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
494
+ x1: Z,
495
+ x2: Q,
496
+ y1: X(e),
497
+ y2: X(e),
498
+ ...b.props(u.grid)
499
+ }), /* @__PURE__ */ T("text", {
500
+ x: Z - 8,
501
+ y: X(e),
502
+ textAnchor: "end",
503
+ dominantBaseline: "middle",
504
+ ...b.props(u.label),
505
+ children: l(e)
506
+ })] }, e)),
507
+ h?.annotation !== void 0 && n.some((e) => e.id === h.annotation?.categoryId) && /* @__PURE__ */ T("text", {
508
+ x: $(h.annotation.categoryId),
509
+ y: Math.max(12, X(h.annotation.value) - 8),
510
+ ...b.props(u.label),
511
+ children: h.annotation.label
512
+ }),
513
+ n.map((e, t) => {
514
+ let n = e.axisLabel ?? e.label, i = h?.buckets[t];
515
+ return /* @__PURE__ */ E("g", { children: [i === void 0 ? a.map((n, i) => {
516
+ let o = n.values[t];
517
+ if (o == null) return null;
518
+ let c = s === "stacked" ? a.slice(0, i).reduce((e, n) => e + (n.values[t] ?? 0), 0) : 0, l = X(c), m = X(c + o), h = p?.selectedId === e.id || V?.id === e.id;
519
+ return /* @__PURE__ */ T(k, {
520
+ x: ($(e.id) ?? Z) + (s === "stacked" ? 0 : ge(n.id) ?? 0),
521
+ y: Math.min(l, m),
522
+ width: s === "stacked" ? $.bandwidth() : ge.bandwidth(),
523
+ height: Math.max(+(o === 0), Math.abs(m - l)),
524
+ fill: f[r(n.tone, i)],
525
+ ...b.props(h && u.selected, d !== void 0 && d !== n.id && le.mutedMark)
526
+ }, n.id);
527
+ }) : /* @__PURE__ */ T(ce, {
528
+ bucket: i,
529
+ series: a,
530
+ focusedSeries: v,
531
+ index: t,
532
+ x: $(e.id) ?? Z,
533
+ width: $.bandwidth(),
534
+ y: X,
535
+ isHighlighted: p?.selectedId === e.id || V?.id === e.id,
536
+ highlightedSeriesId: d
537
+ }), t % ve === 0 && /* @__PURE__ */ T("text", {
538
+ x: ($(e.id) ?? Z) + $.bandwidth() / 2,
539
+ y: m - 4,
540
+ textAnchor: "middle",
541
+ ...b.props(u.label),
542
+ children: n.length > ye ? `${n.slice(0, ye - 1)}…` : n
543
+ })] }, e.id);
544
+ }),
545
+ U !== void 0 && /* @__PURE__ */ T(re, {
546
+ x: ($(U.id) ?? Z) + $.bandwidth() / 2,
547
+ top: 12,
548
+ bottom: Y,
549
+ width: Math.max(8, $.bandwidth())
550
+ })
551
+ ]
552
+ })
553
+ })
382
554
  });
383
555
  }
384
- function de(e, t, n) {
556
+ function me(e, t, n) {
385
557
  return e.map((e) => {
386
558
  let r = e.values[t];
387
559
  return `${e.label}: ${r == null ? "Unavailable" : n(r)}`;
388
560
  }).join(" · ");
389
561
  }
390
562
  // packages/charts/src/cartesian/breakdown-bar.tsx
391
- var fe = {
563
+ var R = {
392
564
  kzqmXN: "x5lhr3w",
393
565
  kZKoxP: "x5yr21d",
394
566
  $$css: !0
395
- }, I = { segment: (e, t) => [
396
- fe,
567
+ }, z = { segment: (e, t) => [
568
+ R,
397
569
  {
398
570
  kWkggS: t == null ? t : "xl8spv7",
399
571
  $$css: !0
@@ -403,25 +575,25 @@ var fe = {
403
575
  "--x-backgroundColor": t ?? void 0
404
576
  }
405
577
  ] };
406
- function L({ title: e, description: n, items: a, total: o, formatValue: s, selection: c }) {
407
- let d = t(a), f = a.reduce((e, t) => e + (t.value ?? 0), 0), p = 2 ** -52 * Math.max(f, o, 1) * a.length;
408
- return d === void 0 ? !Number.isFinite(o) || o < 0 || f - o > p ? /* @__PURE__ */ E(m, {
578
+ function B({ title: e, description: n, items: a, total: o, formatValue: s, selection: c }) {
579
+ let l = t(a), u = a.reduce((e, t) => e + (t.value ?? 0), 0), p = 2 ** -52 * Math.max(u, o, 1) * a.length;
580
+ return l === void 0 ? !Number.isFinite(o) || o < 0 || u - o > p ? /* @__PURE__ */ T(g, {
409
581
  title: e,
410
582
  description: n,
411
583
  message: "The total must be finite and at least the sum of recorded values."
412
- }) : /* @__PURE__ */ E(l, {
584
+ }) : /* @__PURE__ */ T(d, {
413
585
  title: e,
414
586
  description: n,
415
- children: a.length === 0 ? /* @__PURE__ */ E("p", {
587
+ children: a.length === 0 ? /* @__PURE__ */ T("p", {
416
588
  className: "x153jb6y x1ghz6dp xy8obcc",
417
589
  children: "No values"
418
- }) : /* @__PURE__ */ D(T, { children: [
419
- /* @__PURE__ */ E("div", {
590
+ }) : /* @__PURE__ */ E(w, { children: [
591
+ /* @__PURE__ */ T("div", {
420
592
  "aria-hidden": !0,
421
593
  className: "x78zum5 x170jfvy xb3r6kr x1r7kqkb xmkeg23 x1y0btm7 x1ey3b81 x1jfksii",
422
- children: a.map((e, t) => e.value === null ? null : /* @__PURE__ */ E("span", { ...y.props(I.segment(o === 0 ? 0 : e.value / o * 100, u[r(e.tone, t)])) }, e.id))
594
+ children: a.map((e, t) => e.value === null ? null : /* @__PURE__ */ T("span", { ...b.props(z.segment(o === 0 ? 0 : e.value / o * 100, f[r(e.tone, t)])) }, e.id))
423
595
  }),
424
- /* @__PURE__ */ E(i, {
596
+ /* @__PURE__ */ T(i, {
425
597
  items: a.map((e, t) => ({
426
598
  id: e.id,
427
599
  label: e.label,
@@ -430,29 +602,29 @@ function L({ title: e, description: n, items: a, total: o, formatValue: s, selec
430
602
  })),
431
603
  selection: c
432
604
  }),
433
- o - f > p && /* @__PURE__ */ D("p", {
605
+ o - u > p && /* @__PURE__ */ E("p", {
434
606
  className: "x153jb6y x1ghz6dp xy8obcc",
435
607
  children: [
436
608
  "Unassigned portion: ",
437
- s(o - f),
609
+ s(o - u),
438
610
  " of ",
439
611
  s(o)
440
612
  ]
441
613
  })
442
614
  ] })
443
- }) : /* @__PURE__ */ E(m, {
615
+ }) : /* @__PURE__ */ T(g, {
444
616
  title: e,
445
617
  description: n,
446
- message: d
618
+ message: l
447
619
  });
448
620
  }
449
621
  // packages/charts/src/cartesian/scatter-plot.tsx
450
- var R = 260, z = 56, B = 20, V = 12, H = 1e3, U = {
622
+ var V = 260, H = 56, U = 20, W = 12, G = 1e3, he = {
451
623
  kzqmXN: "x1xc55vz",
452
624
  kZKoxP: "xdk7pt",
453
625
  kaIpWk: "x16rqkct",
454
626
  $$css: !0
455
- }, W = {
627
+ }, K = {
456
628
  brush: {
457
629
  kFalU9: "xx69xxh",
458
630
  kkrTdU: "xsid9ct",
@@ -490,7 +662,7 @@ var R = 260, z = 56, B = 20, V = 12, H = 1e3, U = {
490
662
  "--x-top": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
491
663
  }],
492
664
  dot: (e) => [
493
- U,
665
+ he,
494
666
  {
495
667
  kWkggS: e == null ? e : "xl8spv7",
496
668
  $$css: !0
@@ -505,74 +677,74 @@ var R = 260, z = 56, B = 20, V = 12, H = 1e3, U = {
505
677
  $$css: !0
506
678
  }
507
679
  };
508
- function G(e) {
509
- let { title: t, description: n, points: r, xDomain: i, yDomain: o, xLabel: c, yLabel: f, formatX: p, formatY: g, selection: _, rangeSelection: v, emptyLabel: b } = e, { ref: x, width: S } = h(), C = J(e);
510
- if (C !== null) return /* @__PURE__ */ E(m, {
680
+ function q(e) {
681
+ let { title: t, description: n, points: r, xDomain: i, yDomain: a, xLabel: o, yLabel: s, formatX: u, formatY: m, selection: h, rangeSelection: v, emptyLabel: y } = e, { ref: ee, width: x } = _(), te = X(e);
682
+ if (te !== null) return /* @__PURE__ */ T(g, {
511
683
  title: t,
512
684
  description: n,
513
- message: C
685
+ message: te
514
686
  });
515
- let w = k({
687
+ let S = O({
516
688
  domain: [...i],
517
- range: [z, Math.max(z, S - B)]
518
- }), T = k({
519
- domain: [...o],
520
- range: [216, V]
521
- }), O = r.find((e) => e.id === _?.selectedId);
522
- return /* @__PURE__ */ D(l, {
689
+ range: [H, Math.max(H, x - U)]
690
+ }), C = O({
691
+ domain: [...a],
692
+ range: [216, W]
693
+ }), w = r.find((e) => e.id === h?.selectedId);
694
+ return /* @__PURE__ */ E(d, {
523
695
  title: t,
524
696
  description: n,
525
- footer: _ !== void 0 && r.length > 0 ? /* @__PURE__ */ E(a, { children: O === void 0 ? "Select a point to inspect its label and coordinates." : `${O.label}, ${c}: ${p(O.x)}, ${f}: ${g(O.y)}` }) : void 0,
697
+ footer: h !== void 0 && r.length > 0 ? /* @__PURE__ */ T(c, { children: w === void 0 ? "Select a point to inspect its label and coordinates." : `${w.label}, ${o}: ${u(w.x)}, ${s}: ${m(w.y)}` }) : void 0,
526
698
  children: [
527
- r.length === 0 ? /* @__PURE__ */ E("p", {
699
+ r.length === 0 ? /* @__PURE__ */ T("p", {
528
700
  className: "x1ghz6dp x153jb6y",
529
- children: b
530
- }) : /* @__PURE__ */ D("div", {
531
- ref: x,
701
+ children: y
702
+ }) : /* @__PURE__ */ E("div", {
703
+ ref: ee,
532
704
  className: "x1n2onr6 xeuugli",
533
- children: [/* @__PURE__ */ E(K, {
534
- width: S,
535
- scaleX: w,
536
- scaleY: T,
705
+ children: [/* @__PURE__ */ T(J, {
706
+ width: x,
707
+ scaleX: S,
708
+ scaleY: C,
537
709
  ...e
538
- }, `${i[0]}:${i[1]}:${o[0]}:${o[1]}:${S}`), _ !== void 0 && /* @__PURE__ */ E("div", {
710
+ }, `${i[0]}:${i[1]}:${a[0]}:${a[1]}:${x}`), h !== void 0 && /* @__PURE__ */ T("div", {
539
711
  className: "x10l6tqk x10a8y8t x1n71m9f x47corl",
540
- children: r.map((e) => /* @__PURE__ */ E("button", {
712
+ children: r.map((e) => /* @__PURE__ */ T("button", {
541
713
  type: "button",
542
714
  title: e.label,
543
- "aria-label": `${e.label}, ${c}: ${p(e.x)}, ${f}: ${g(e.y)}`,
544
- "aria-pressed": _.selectedId === e.id,
545
- onClick: () => _.onSelect(e.id),
546
- ...y.props(W.target, W.location(w(e.x), T(e.y))),
547
- children: /* @__PURE__ */ E("span", {
715
+ "aria-label": `${e.label}, ${o}: ${u(e.x)}, ${s}: ${m(e.y)}`,
716
+ "aria-pressed": h.selectedId === e.id,
717
+ onClick: () => h.onSelect(e.id),
718
+ ...b.props(K.target, K.location(S(e.x), C(e.y))),
719
+ children: /* @__PURE__ */ T("span", {
548
720
  "aria-hidden": !0,
549
- ...y.props(W.dot(u[e.tone]), _.selectedId === e.id && W.selected)
721
+ ...b.props(K.dot(f[e.tone]), h.selectedId === e.id && K.selected)
550
722
  })
551
723
  }, e.id))
552
724
  })]
553
725
  }),
554
- v !== void 0 && /* @__PURE__ */ E(q, {
726
+ v !== void 0 && /* @__PURE__ */ T(Y, {
555
727
  ...e,
556
728
  rangeSelection: v
557
729
  }),
558
- r.length > 0 && /* @__PURE__ */ E(d, { children: r.map((e) => /* @__PURE__ */ D(s, {
559
- label: `${e.label}, ${c}: ${p(e.x)}, ${f}: ${g(e.y)}`,
560
- isSelected: _?.selectedId === e.id,
561
- onSelect: _ === void 0 ? void 0 : () => _.onSelect(e.id),
562
- children: [/* @__PURE__ */ E("span", { children: e.label }), /* @__PURE__ */ D("span", {
730
+ r.length > 0 && /* @__PURE__ */ T(p, { children: r.map((e) => /* @__PURE__ */ E(l, {
731
+ label: `${e.label}, ${o}: ${u(e.x)}, ${s}: ${m(e.y)}`,
732
+ isSelected: h?.selectedId === e.id,
733
+ onSelect: h === void 0 ? void 0 : () => h.onSelect(e.id),
734
+ children: [/* @__PURE__ */ T("span", { children: e.label }), /* @__PURE__ */ E("span", {
563
735
  className: "xeuugli xss6m8b xj0a0fe x153jb6y",
564
736
  children: [
565
- p(e.x),
737
+ u(e.x),
566
738
  " · ",
567
- g(e.y)
739
+ m(e.y)
568
740
  ]
569
741
  })]
570
742
  }, e.id)) })
571
743
  ]
572
744
  });
573
745
  }
574
- function K({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, formatX: o, formatY: s, selection: l, rangeSelection: d }) {
575
- let f = x(), [p, m] = w(null), h = p === null ? d?.value : {
746
+ function J({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, formatX: o, formatY: s, selection: c, rangeSelection: l }) {
747
+ let d = x(), [p, m] = C(null), h = p === null ? l?.value : {
576
748
  x: [Math.min(p.start.x, p.end.x), Math.max(p.start.x, p.end.x)],
577
749
  y: [Math.min(p.start.y, p.end.y), Math.max(p.start.y, p.end.y)]
578
750
  };
@@ -580,13 +752,13 @@ function K({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
580
752
  let i = r.currentTarget.getBoundingClientRect();
581
753
  return {
582
754
  x: t.copy().clamp(!0).invert((r.clientX - i.left) / i.width * e),
583
- y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height * R)
755
+ y: n.copy().clamp(!0).invert((r.clientY - i.top) / i.height * V)
584
756
  };
585
757
  }
586
758
  function _(t) {
587
- if (d === void 0 || t.button !== 0 || t.pointerType === "touch") return;
588
- let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * R;
589
- if (r < z || r > e - B || i < V || i > 216) return;
759
+ if (l === void 0 || t.button !== 0 || t.pointerType === "touch") return;
760
+ let n = t.currentTarget.getBoundingClientRect(), r = (t.clientX - n.left) / n.width * e, i = (t.clientY - n.top) / n.height * V;
761
+ if (r < H || r > e - U || i < W || i > 216) return;
590
762
  let a = g(t);
591
763
  t.currentTarget.setPointerCapture(t.pointerId), m({
592
764
  start: a,
@@ -600,108 +772,108 @@ function K({ width: e, scaleX: t, scaleY: n, points: r, xLabel: i, yLabel: a, fo
600
772
  end: g(e)
601
773
  });
602
774
  }
603
- function b(e) {
775
+ function y(e) {
604
776
  if (p === null || p.pointerId !== e.pointerId) return;
605
777
  let t = g(e), n = {
606
778
  x: [Math.min(p.start.x, t.x), Math.max(p.start.x, t.x)],
607
779
  y: [Math.min(p.start.y, t.y), Math.max(p.start.y, t.y)]
608
780
  };
609
- m(null), e.currentTarget.releasePointerCapture(e.pointerId), d?.onChange(n);
781
+ m(null), e.currentTarget.releasePointerCapture(e.pointerId), l?.onChange(n);
610
782
  }
611
- return /* @__PURE__ */ D("svg", {
783
+ return /* @__PURE__ */ E("svg", {
612
784
  width: e,
613
- height: R,
614
- viewBox: `0 0 ${e} ${R}`,
785
+ height: V,
786
+ viewBox: `0 0 ${e} ${V}`,
615
787
  "aria-hidden": !0,
616
788
  onPointerDown: _,
617
789
  onPointerMove: v,
618
- onPointerUp: b,
790
+ onPointerUp: y,
619
791
  onPointerCancel: () => m(null),
620
792
  onLostPointerCapture: () => m(null),
621
- ...y.props(c.svg, d !== void 0 && W.brush),
793
+ ...b.props(u.svg, l !== void 0 && K.brush),
622
794
  children: [
623
- /* @__PURE__ */ E("defs", { children: /* @__PURE__ */ E("clipPath", {
624
- id: f,
625
- children: /* @__PURE__ */ E("rect", {
626
- x: z,
627
- y: V,
628
- width: Math.max(0, e - z - B),
795
+ /* @__PURE__ */ T("defs", { children: /* @__PURE__ */ T("clipPath", {
796
+ id: d,
797
+ children: /* @__PURE__ */ T("rect", {
798
+ x: H,
799
+ y: W,
800
+ width: Math.max(0, e - H - U),
629
801
  height: 204
630
802
  })
631
803
  }) }),
632
- t.ticks(5).map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
804
+ t.ticks(5).map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
633
805
  x1: t(e),
634
806
  x2: t(e),
635
- y1: V,
807
+ y1: W,
636
808
  y2: 216,
637
- ...y.props(c.grid)
638
- }), /* @__PURE__ */ E("text", {
809
+ ...b.props(u.grid)
810
+ }), /* @__PURE__ */ T("text", {
639
811
  x: t(e),
640
812
  y: 234,
641
813
  textAnchor: "middle",
642
- ...y.props(c.label),
814
+ ...b.props(u.label),
643
815
  children: o(e)
644
816
  })] }, e)),
645
- n.ticks(4).map((t) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
646
- x1: z,
647
- x2: e - B,
817
+ n.ticks(4).map((t) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
818
+ x1: H,
819
+ x2: e - U,
648
820
  y1: n(t),
649
821
  y2: n(t),
650
- ...y.props(c.grid)
651
- }), /* @__PURE__ */ E("text", {
822
+ ...b.props(u.grid)
823
+ }), /* @__PURE__ */ T("text", {
652
824
  x: 48,
653
825
  y: n(t) + 4,
654
826
  textAnchor: "end",
655
- ...y.props(c.label),
827
+ ...b.props(u.label),
656
828
  children: s(t)
657
829
  })] }, t)),
658
- /* @__PURE__ */ E("text", {
659
- x: (z + e - B) / 2,
830
+ /* @__PURE__ */ T("text", {
831
+ x: (H + e - U) / 2,
660
832
  y: 256,
661
833
  textAnchor: "middle",
662
- ...y.props(c.label),
834
+ ...b.props(u.label),
663
835
  children: i
664
836
  }),
665
- /* @__PURE__ */ E("text", {
837
+ /* @__PURE__ */ T("text", {
666
838
  x: 12,
667
839
  y: 108,
668
840
  textAnchor: "middle",
669
841
  transform: "rotate(-90 12 108)",
670
- ...y.props(c.label),
842
+ ...b.props(u.label),
671
843
  children: a
672
844
  }),
673
- /* @__PURE__ */ D("g", {
674
- clipPath: `url(#${f})`,
675
- children: [h != null && /* @__PURE__ */ E("rect", {
845
+ /* @__PURE__ */ E("g", {
846
+ clipPath: `url(#${d})`,
847
+ children: [h != null && /* @__PURE__ */ T("rect", {
676
848
  x: t(h.x[0]),
677
849
  y: n(h.y[1]),
678
850
  width: t(h.x[1]) - t(h.x[0]),
679
851
  height: n(h.y[0]) - n(h.y[1]),
680
852
  className: "x1e0kj8g xv7c1pl x1tg5nk6 xnpr05h x15lqr97 x47corl"
681
- }), l === void 0 && r.map((e) => /* @__PURE__ */ E("circle", {
853
+ }), c === void 0 && r.map((e) => /* @__PURE__ */ T("circle", {
682
854
  cx: t(e.x),
683
855
  cy: n(e.y),
684
856
  r: 4,
685
- fill: u[e.tone]
857
+ fill: f[e.tone]
686
858
  }, e.id))]
687
859
  })
688
860
  ]
689
861
  });
690
862
  }
691
- function q({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: a, formatY: o }) {
692
- let s = e.value ?? {
863
+ function Y({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, formatX: o, formatY: s }) {
864
+ let c = e.value ?? {
693
865
  x: t,
694
866
  y: n
695
867
  };
696
- return /* @__PURE__ */ D("fieldset", {
868
+ return /* @__PURE__ */ E("fieldset", {
697
869
  className: "xrvj5dj x1n8ia3y x1xxf3xd xc342km x1717udv xeuugli",
698
870
  children: [
699
- /* @__PURE__ */ E("legend", {
871
+ /* @__PURE__ */ T("legend", {
700
872
  className: "x153jb6y xy8obcc x1jfksii",
701
873
  children: "Drag with a mouse, or adjust these bounds to select a coordinate range."
702
874
  }),
703
- /* @__PURE__ */ D(_.Root, {
704
- value: s.x,
875
+ /* @__PURE__ */ E(v.Root, {
876
+ value: c.x,
705
877
  min: t[0],
706
878
  max: t[1],
707
879
  step: e.xStep,
@@ -709,62 +881,62 @@ function q({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
709
881
  thumbCollisionBehavior: "none",
710
882
  onValueChange: (t) => e.onChange({
711
883
  x: t,
712
- y: s.y
884
+ y: c.y
713
885
  }),
714
- children: [/* @__PURE__ */ D("div", {
886
+ children: [/* @__PURE__ */ E("div", {
715
887
  className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
716
- children: [/* @__PURE__ */ E(_.Label, { children: r }), /* @__PURE__ */ D("span", { children: [
717
- a(s.x[0]),
888
+ children: [/* @__PURE__ */ T(v.Label, { children: r }), /* @__PURE__ */ E("span", { children: [
889
+ o(c.x[0]),
718
890
  " – ",
719
- a(s.x[1])
891
+ o(c.x[1])
720
892
  ] })]
721
- }), /* @__PURE__ */ E(_.Control, { children: /* @__PURE__ */ D(_.Track, { children: [
722
- /* @__PURE__ */ E(_.Indicator, {}),
723
- /* @__PURE__ */ E(_.Thumb, {
893
+ }), /* @__PURE__ */ T(v.Control, { children: /* @__PURE__ */ E(v.Track, { children: [
894
+ /* @__PURE__ */ T(v.Indicator, {}),
895
+ /* @__PURE__ */ T(v.Thumb, {
724
896
  index: 0,
725
897
  "aria-label": `${r} minimum`,
726
- getAriaValueText: (e, t) => a(t)
898
+ getAriaValueText: (e, t) => o(t)
727
899
  }),
728
- /* @__PURE__ */ E(_.Thumb, {
900
+ /* @__PURE__ */ T(v.Thumb, {
729
901
  index: 1,
730
902
  "aria-label": `${r} maximum`,
731
- getAriaValueText: (e, t) => a(t)
903
+ getAriaValueText: (e, t) => o(t)
732
904
  })
733
905
  ] }) })]
734
906
  }),
735
- /* @__PURE__ */ D(_.Root, {
736
- value: s.y,
907
+ /* @__PURE__ */ E(v.Root, {
908
+ value: c.y,
737
909
  min: n[0],
738
910
  max: n[1],
739
911
  step: e.yStep,
740
912
  locale: e.locale,
741
913
  thumbCollisionBehavior: "none",
742
914
  onValueChange: (t) => e.onChange({
743
- x: s.x,
915
+ x: c.x,
744
916
  y: t
745
917
  }),
746
- children: [/* @__PURE__ */ D("div", {
918
+ children: [/* @__PURE__ */ E("div", {
747
919
  className: "x78zum5 x1a02dak x1qughib x1hnptsi x153jb6y xy8obcc xj0a0fe",
748
- children: [/* @__PURE__ */ E(_.Label, { children: i }), /* @__PURE__ */ D("span", { children: [
749
- o(s.y[0]),
920
+ children: [/* @__PURE__ */ T(v.Label, { children: i }), /* @__PURE__ */ E("span", { children: [
921
+ s(c.y[0]),
750
922
  " – ",
751
- o(s.y[1])
923
+ s(c.y[1])
752
924
  ] })]
753
- }), /* @__PURE__ */ E(_.Control, { children: /* @__PURE__ */ D(_.Track, { children: [
754
- /* @__PURE__ */ E(_.Indicator, {}),
755
- /* @__PURE__ */ E(_.Thumb, {
925
+ }), /* @__PURE__ */ T(v.Control, { children: /* @__PURE__ */ E(v.Track, { children: [
926
+ /* @__PURE__ */ T(v.Indicator, {}),
927
+ /* @__PURE__ */ T(v.Thumb, {
756
928
  index: 0,
757
929
  "aria-label": `${i} minimum`,
758
- getAriaValueText: (e, t) => o(t)
930
+ getAriaValueText: (e, t) => s(t)
759
931
  }),
760
- /* @__PURE__ */ E(_.Thumb, {
932
+ /* @__PURE__ */ T(v.Thumb, {
761
933
  index: 1,
762
934
  "aria-label": `${i} maximum`,
763
- getAriaValueText: (e, t) => o(t)
935
+ getAriaValueText: (e, t) => s(t)
764
936
  })
765
937
  ] }) })]
766
938
  }),
767
- /* @__PURE__ */ E(g, {
939
+ /* @__PURE__ */ T(a, {
768
940
  type: "button",
769
941
  disabled: e.value === null,
770
942
  onClick: () => e.onChange(null),
@@ -773,10 +945,10 @@ function q({ rangeSelection: e, xDomain: t, yDomain: n, xLabel: r, yLabel: i, fo
773
945
  ]
774
946
  });
775
947
  }
776
- function J({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
777
- if (!p(t) || !p(n)) return "Scatter domains must contain finite, increasing endpoints.";
778
- if (e.length > 1e3) return `This plot exceeds the ${H}-point render limit. Supply a smaller, labelled sample.`;
779
- if (!f(e)) return "Scatter points must have unique identifiers.";
948
+ function X({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
949
+ if (!h(t) || !h(n)) return "Scatter domains must contain finite, increasing endpoints.";
950
+ if (e.length > 1e3) return `This plot exceeds the ${G}-point render limit. Supply a smaller, labelled sample.`;
951
+ if (!m(e)) return "Scatter points must have unique identifiers.";
780
952
  if (e.some((e) => !Number.isFinite(e.x) || !Number.isFinite(e.y))) return "Scatter coordinates must be finite.";
781
953
  if (e.some((e) => {
782
954
  let r = e.x < t[0] || e.x > t[1], i = e.y < n[0] || e.y > n[1];
@@ -786,18 +958,18 @@ function J({ points: e, xDomain: t, yDomain: n, rangeSelection: r }) {
786
958
  let i = Number.isFinite(r.xStep) && r.xStep > 0 && r.xStep <= t[1] - t[0], a = Number.isFinite(r.yStep) && r.yStep > 0 && r.yStep <= n[1] - n[0];
787
959
  if (!i || !a) return "Range selection steps must be finite, positive, and no larger than their domain span.";
788
960
  let o = r.value;
789
- return o === null ? null : !Y(o.x, t) || !Y(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
961
+ return o === null ? null : !Z(o.x, t) || !Z(o.y, n) ? "The selected range must have finite, ordered bounds inside the declared domain." : null;
790
962
  }
791
- function Y(e, t) {
963
+ function Z(e, t) {
792
964
  return !e.every(Number.isFinite) || e[0] > e[1] ? !1 : e[0] >= t[0] && e[1] <= t[1];
793
965
  }
794
966
  // packages/charts/src/cartesian/time-series-data.ts
795
- var X = {
967
+ var Q = {
796
968
  series: 12,
797
969
  pointsPerSeries: 2e3,
798
970
  markers: 200,
799
971
  panels: 12
800
- }, Z = .01, Q = [
972
+ }, $ = .01, ge = [
801
973
  "series1",
802
974
  "series2",
803
975
  "series3",
@@ -805,13 +977,13 @@ var X = {
805
977
  "series5",
806
978
  "series6"
807
979
  ];
808
- function pe({ series: e, isStacked: t, markers: n }) {
980
+ function _e({ series: e, isStacked: t, markers: n }) {
809
981
  let r = e[0]?.points.map((e) => e.timestamp) ?? [];
810
- if (e.length > X.series || r.length > X.pointsPerSeries || n.length > X.markers) return `Choose a window with at most ${X.series} series, ${X.pointsPerSeries} observations per series, and ${X.markers} markers.`;
811
- if (!f(e) || !f(n)) return "Series and markers require unique identifiers.";
982
+ if (e.length > Q.series || r.length > Q.pointsPerSeries || n.length > Q.markers) return `Choose a window with at most ${Q.series} series, ${Q.pointsPerSeries} observations per series, and ${Q.markers} markers.`;
983
+ if (!m(e) || !m(n)) return "Series and markers require unique identifiers.";
812
984
  for (let n of e) {
813
985
  if (n.points.length !== r.length) return "Every series must supply the same observation timestamps.";
814
- let e = ge({
986
+ let e = xe({
815
987
  points: n.points,
816
988
  timestamps: r,
817
989
  isStacked: t
@@ -829,7 +1001,7 @@ function pe({ series: e, isStacked: t, markers: n }) {
829
1001
  if (!Number.isFinite(a) || !Number.isFinite(o)) return "The elapsed-time and value ranges must be finite.";
830
1002
  if (t && r.some((t, n) => !Number.isFinite(e.reduce((e, t) => e + (t.points[n]?.value ?? 0), 0)))) return "Stacked observation totals must be finite.";
831
1003
  }
832
- function $({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
1004
+ function ve({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
833
1005
  return JSON.stringify([
834
1006
  n,
835
1007
  r,
@@ -849,15 +1021,15 @@ function $({ series: e, markers: t, timestampUnit: n, isStacked: r }) {
849
1021
  ])
850
1022
  ]);
851
1023
  }
852
- function me(e, t, n = !1) {
1024
+ function ye(e, t, n = !1) {
853
1025
  if (e !== t) return [e, t];
854
- let r = Math.max(1, Math.abs(e) * Z), i = n ? 0 : e - r, a = t + r;
1026
+ let r = Math.max(1, Math.abs(e) * $), i = n ? 0 : e - r, a = t + r;
855
1027
  return [Number.isFinite(i) ? i : e, Number.isFinite(a) ? a : t];
856
1028
  }
857
- function he(e, t) {
1029
+ function be(e, t) {
858
1030
  let n = e.filter((e) => e.tone === void 0);
859
1031
  return e.map((r, i) => {
860
- let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? Q[a % Q.length] ?? "series1", s = r.points.map((n, r) => {
1032
+ let a = n.findIndex((e) => e.id === r.id), o = r.tone ?? ge[a % ge.length] ?? "series1", s = r.points.map((n, r) => {
861
1033
  let a = t ? e.slice(0, i).reduce((e, t) => e + (t.points[r]?.value ?? 0), 0) : 0;
862
1034
  return {
863
1035
  ...n,
@@ -872,7 +1044,7 @@ function he(e, t) {
872
1044
  };
873
1045
  });
874
1046
  }
875
- function ge({ points: e, timestamps: t, isStacked: n }) {
1047
+ function xe({ points: e, timestamps: t, isStacked: n }) {
876
1048
  for (let [r, i] of e.entries()) {
877
1049
  let a = e[r - 1], o = a !== void 0 && i.timestamp <= a.timestamp;
878
1050
  if (!Number.isFinite(i.timestamp) || i.timestamp !== t[r] || o) return "Observation timestamps must be finite, aligned, and strictly increasing.";
@@ -881,49 +1053,49 @@ function ge({ points: e, timestamps: t, isStacked: n }) {
881
1053
  }
882
1054
  }
883
1055
  // packages/charts/src/cartesian/time-series-line.tsx
884
- function _e({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }) {
885
- return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(A, {
1056
+ function Se({ series: e, x: t, y: n, inspectedTimestamp: r, pointRadius: i = 3 }) {
1057
+ return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(A, {
886
1058
  data: [...e.points],
887
1059
  defined: (e) => e.value !== null,
888
1060
  x: (e) => t(e.timestamp),
889
1061
  y: (e) => n((e.value ?? 0) + e.base),
890
- stroke: u[e.tone],
891
- ...y.props(c.mark)
1062
+ stroke: f[e.tone],
1063
+ ...b.props(u.mark)
892
1064
  }), e.points.filter((t, n) => {
893
1065
  if (t.value === null) return !1;
894
1066
  let i = e.points[n - 1]?.value === null || e.points[n + 1]?.value === null;
895
1067
  return e.points.length === 1 || i || t.timestamp === r;
896
- }).map((r) => /* @__PURE__ */ E("circle", {
1068
+ }).map((r) => /* @__PURE__ */ T("circle", {
897
1069
  cx: t(r.timestamp),
898
1070
  cy: n((r.value ?? 0) + r.base),
899
1071
  r: i,
900
- fill: u[e.tone]
1072
+ fill: f[e.tone]
901
1073
  }, r.timestamp))] });
902
1074
  }
903
1075
  // packages/charts/src/cartesian/sparkline.tsx
904
- function ve({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
905
- let o = x(), s = x(), c = ye({
1076
+ function Ce({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueDomain: a }) {
1077
+ let o = x(), s = x(), c = we({
906
1078
  title: e,
907
1079
  summary: t,
908
1080
  unit: n,
909
1081
  series: i,
910
1082
  valueDomain: a
911
1083
  }), l = i.points.some((e) => e.value !== null);
912
- if (c !== void 0 || !l) return /* @__PURE__ */ E("span", {
1084
+ if (c !== void 0 || !l) return /* @__PURE__ */ T("span", {
913
1085
  role: "img",
914
1086
  "aria-label": `${e}. ${t} Values in ${n}; timestamps in ${r}. ${c ?? "No recorded values. Missing observations remain unavailable."}`,
915
1087
  title: c ?? "No recorded values",
916
1088
  className: "x2pejg6 x10w6t97 x2lah0s xxymvpz x3nfvp2 x6s0dn4 xl56j7k x153jb6y x1hz01jw xy8obcc",
917
1089
  children: c === void 0 ? "No data" : "Invalid trend"
918
1090
  });
919
- let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = k({
920
- domain: [...me(u, d)],
1091
+ let u = i.points[0]?.timestamp ?? 0, d = i.points.at(-1)?.timestamp ?? u, f = O({
1092
+ domain: [...ye(u, d)],
921
1093
  range: [3, 125]
922
- }), p = k({
1094
+ }), p = O({
923
1095
  domain: [...a],
924
1096
  range: [29, 3]
925
- }), m = he([i], !1)[0];
926
- return /* @__PURE__ */ D("svg", {
1097
+ }), m = be([i], !1)[0];
1098
+ return /* @__PURE__ */ E("svg", {
927
1099
  role: "img",
928
1100
  "aria-labelledby": o,
929
1101
  "aria-describedby": s,
@@ -933,11 +1105,11 @@ function ve({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
933
1105
  height: 32,
934
1106
  className: "x1rg5ohu x2pejg6 x10w6t97 x2lah0s xxymvpz",
935
1107
  children: [
936
- /* @__PURE__ */ E("title", {
1108
+ /* @__PURE__ */ T("title", {
937
1109
  id: o,
938
1110
  children: e
939
1111
  }),
940
- /* @__PURE__ */ D("desc", {
1112
+ /* @__PURE__ */ E("desc", {
941
1113
  id: s,
942
1114
  children: [
943
1115
  t,
@@ -955,7 +1127,7 @@ function ve({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
955
1127
  "."
956
1128
  ]
957
1129
  }),
958
- m !== void 0 && /* @__PURE__ */ E(_e, {
1130
+ m !== void 0 && /* @__PURE__ */ T(Se, {
959
1131
  series: m,
960
1132
  x: f,
961
1133
  y: p,
@@ -964,10 +1136,10 @@ function ve({ title: e, summary: t, unit: n, timestampUnit: r, series: i, valueD
964
1136
  ]
965
1137
  });
966
1138
  }
967
- function ye({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
1139
+ function we({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
968
1140
  if (e.trim() === "" || t.trim() === "" || n.trim() === "") return "A trend requires a title, a readable summary, and a value unit.";
969
- if (!p(i)) return "The displayed value domain must have finite, increasing bounds.";
970
- let a = pe({
1141
+ if (!h(i)) return "The displayed value domain must have finite, increasing bounds.";
1142
+ let a = _e({
971
1143
  series: [r],
972
1144
  isStacked: !1,
973
1145
  markers: []
@@ -976,7 +1148,7 @@ function ye({ title: e, summary: t, unit: n, series: r, valueDomain: i }) {
976
1148
  if (r.points.some((e) => e.value !== null && (e.value < i[0] || e.value > i[1]))) return "Every recorded value must be inside the declared value domain.";
977
1149
  }
978
1150
  // packages/charts/src/cartesian/time-series.tsx
979
- var be = {
1151
+ var Te = {
980
1152
  timeAxis: {
981
1153
  k1xSpc: "x78zum5",
982
1154
  kjj79g: "x1qughib",
@@ -997,47 +1169,47 @@ var be = {
997
1169
  "--x-paddingInlineEnd": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
998
1170
  }]
999
1171
  };
1000
- function xe(e) {
1001
- return /* @__PURE__ */ E(Te, {
1172
+ function Ee(e) {
1173
+ return /* @__PURE__ */ T(Ae, {
1002
1174
  ...e,
1003
1175
  kind: "line",
1004
1176
  isStacked: !1
1005
1177
  });
1006
1178
  }
1007
- function Se({ isStacked: e = !1, ...t }) {
1008
- return /* @__PURE__ */ E(Te, {
1179
+ function De({ isStacked: e = !1, ...t }) {
1180
+ return /* @__PURE__ */ T(Ae, {
1009
1181
  ...t,
1010
1182
  kind: "area",
1011
1183
  isStacked: e
1012
1184
  });
1013
1185
  }
1014
- function Ce({ charts: e, ...t }) {
1015
- let n = C(null), [r, i] = w(), a = JSON.stringify(e.map((e) => [
1186
+ function Oe({ charts: e, ...t }) {
1187
+ let n = S(null), [r, i] = C(), a = JSON.stringify(e.map((e) => [
1016
1188
  e.id,
1017
1189
  e.title,
1018
- $({
1190
+ ve({
1019
1191
  series: e.series,
1020
1192
  markers: e.markers ?? [],
1021
1193
  timestampUnit: t.timestampUnit,
1022
1194
  isStacked: !1
1023
1195
  })
1024
1196
  ])), o = JSON.stringify(e[0]?.series[0]?.points.map((e) => e.timestamp) ?? []), s = e.every((e) => JSON.stringify(e.series[0]?.points.map((e) => e.timestamp) ?? []) === o);
1025
- if (r !== void 0 && r.signature !== a && i(void 0), b(() => {
1197
+ if (r !== void 0 && r.signature !== a && i(void 0), ee(() => {
1026
1198
  function e(e) {
1027
1199
  e.target instanceof Node && n.current?.contains(e.target) !== !0 && i(void 0);
1028
1200
  }
1029
1201
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1030
- }, []), !s || !f(e)) return /* @__PURE__ */ E(m, {
1202
+ }, []), !s || !m(e)) return /* @__PURE__ */ T(g, {
1031
1203
  title: "Small multiples",
1032
1204
  message: "Charts need unique identifiers and aligned observation timestamps."
1033
1205
  });
1034
- if (e.length > X.panels) return /* @__PURE__ */ E(m, {
1206
+ if (e.length > Q.panels) return /* @__PURE__ */ T(g, {
1035
1207
  title: "Small multiples",
1036
- message: `Choose at most ${X.panels} panels.`
1208
+ message: `Choose at most ${Q.panels} panels.`
1037
1209
  });
1038
- if (e.length === 0) return /* @__PURE__ */ E(l, {
1210
+ if (e.length === 0) return /* @__PURE__ */ T(d, {
1039
1211
  title: "Small multiples",
1040
- children: /* @__PURE__ */ E("p", {
1212
+ children: /* @__PURE__ */ T("p", {
1041
1213
  className: "x153jb6y",
1042
1214
  children: "No charts"
1043
1215
  })
@@ -1048,108 +1220,109 @@ function Ce({ charts: e, ...t }) {
1048
1220
  ...e,
1049
1221
  signature: a
1050
1222
  })
1051
- }, u = Math.max(52, ...e.flatMap((e) => e.series.flatMap((t) => t.points.flatMap((t) => t.value === null || !Number.isFinite(t.value) ? [] : [e.formatValue(t.value).length * 7 + 12]))));
1052
- return /* @__PURE__ */ E("div", {
1223
+ }, l = Math.max(52, ...e.flatMap((e) => e.series.flatMap((t) => t.points.flatMap((t) => t.value === null || !Number.isFinite(t.value) ? [] : [(e.formatTick ?? e.formatValue)(t.value).length * 7 + 12]))));
1224
+ return /* @__PURE__ */ T("div", {
1053
1225
  ref: n,
1054
1226
  className: "xrvj5dj x1j825kq",
1055
- children: e.map((e) => /* @__PURE__ */ E(Te, {
1227
+ children: e.map((e) => /* @__PURE__ */ T(Ae, {
1056
1228
  ...t,
1057
1229
  title: e.title,
1058
1230
  description: e.description,
1059
1231
  series: e.series,
1060
1232
  formatValue: e.formatValue,
1233
+ formatTick: e.formatTick,
1061
1234
  markers: e.markers,
1062
1235
  kind: "line",
1063
1236
  isStacked: !1,
1064
1237
  sharedInspection: c,
1065
- axisWidth: u
1238
+ axisWidth: l
1066
1239
  }, e.id))
1067
1240
  });
1068
1241
  }
1069
- var we = {
1242
+ var ke = {
1070
1243
  "x-default-marker": "x-default-marker",
1071
1244
  $$css: !0
1072
1245
  };
1073
- function Te({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: i, formatValue: a, markers: s = [], height: f = 180, actions: p, kind: g, isStacked: _, sharedInspection: O, axisWidth: te }) {
1074
- let A = !Number.isFinite(f) || f < 48 ? "Chart height must be at least 48 pixels." : pe({
1246
+ function Ae({ title: e, description: t, series: n, timestampUnit: r, formatTimestamp: i, formatValue: a, formatTick: o = a, markers: s = [], height: c = 180, actions: l, kind: p, isStacked: m, sharedInspection: h, axisWidth: v }) {
1247
+ let D = !Number.isFinite(c) || c < 48 ? "Chart height must be at least 48 pixels." : _e({
1075
1248
  series: n,
1076
- isStacked: _,
1249
+ isStacked: m,
1077
1250
  markers: s
1078
- }), j = S(() => A === void 0 ? he(n, _) : [], [
1251
+ }), k = te(() => D === void 0 ? be(n, m) : [], [
1079
1252
  n,
1080
- _,
1081
- A
1082
- ]), M = j[0]?.points ?? [], { ref: re, width: ie, element: ae } = h(), oe = C(null), [se, ce] = w(), le = M.find((e) => e.timestamp === se) ?? M[0], [N, ue] = w(), P = $({
1253
+ m,
1254
+ D
1255
+ ]), A = k[0]?.points ?? [], { ref: ae, width: j, element: se } = _(), N = S(null), [ce, le] = C(), ue = A.find((e) => e.timestamp === ce) ?? A[0], [P, de] = C(), F = ve({
1083
1256
  series: n,
1084
1257
  markers: s,
1085
1258
  timestampUnit: r,
1086
- isStacked: _
1087
- }), F = O === void 0 ? N?.signature === P ? N : void 0 : O.value, de = x();
1088
- N !== void 0 && (N.signature !== P || A !== void 0) && ue(void 0);
1089
- let fe = O !== void 0;
1090
- if (b(() => {
1091
- if (fe) return;
1259
+ isStacked: m
1260
+ }), I = h === void 0 ? P?.signature === F ? P : void 0 : h.value, fe = x();
1261
+ P !== void 0 && (P.signature !== F || D !== void 0) && de(void 0);
1262
+ let pe = h !== void 0;
1263
+ if (ee(() => {
1264
+ if (pe) return;
1092
1265
  function e(e) {
1093
- e.target instanceof Node && oe.current?.contains(e.target) !== !0 && ue(void 0);
1266
+ e.target instanceof Node && N.current?.contains(e.target) !== !0 && de(void 0);
1094
1267
  }
1095
1268
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1096
- }, [fe]), A !== void 0) return /* @__PURE__ */ E(m, {
1269
+ }, [pe]), D !== void 0) return /* @__PURE__ */ T(g, {
1097
1270
  title: e,
1098
1271
  description: t,
1099
- message: A
1272
+ message: D
1100
1273
  });
1101
- if (M.length === 0) return /* @__PURE__ */ E(l, {
1274
+ if (A.length === 0) return /* @__PURE__ */ T(d, {
1102
1275
  title: e,
1103
1276
  description: t,
1104
- actions: p,
1105
- children: /* @__PURE__ */ E("p", {
1277
+ actions: l,
1278
+ children: /* @__PURE__ */ T("p", {
1106
1279
  className: "x153jb6y",
1107
1280
  children: "No observations"
1108
1281
  })
1109
1282
  });
1110
- let I = f - 28, L = I + 12, R = M[0]?.timestamp ?? 0, z = M.at(-1)?.timestamp ?? R, B = j.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), V = g === "area" ? Math.min(0, ...B) : Math.min(...B), H = g === "area" ? Math.max(0, ...B) : Math.max(...B), U = B.length === 0 ? 0 : V, W = B.length === 0 ? 1 : H, G = k({
1111
- domain: [...me(U, W, g === "area")],
1112
- range: [I, 12]
1113
- }), K = G.ticks(3), q = te ?? Math.max(52, ...K.map((e) => a(e).length * 7 + 12)), J = Math.max(q + 1, ie - 16), Y = k({
1114
- domain: [...me(R, z)],
1115
- range: [q, J]
1283
+ let L = c - 28, me = L + 12, R = A[0]?.timestamp ?? 0, z = A.at(-1)?.timestamp ?? R, B = k.flatMap((e) => e.points.flatMap((e) => e.value === null ? [] : [e.value + e.base])), V = p === "area" ? Math.min(0, ...B) : Math.min(...B), H = p === "area" ? Math.max(0, ...B) : Math.max(...B), U = B.length === 0 ? 0 : V, W = B.length === 0 ? 1 : H, G = O({
1284
+ domain: [...ye(U, W, p === "area")],
1285
+ range: [L, 12]
1286
+ }), he = G.ticks(3), K = v ?? Math.max(44, ...he.map((e) => o(e).length * 7 + 12)), q = Math.max(K + 1, j - 16), J = O({
1287
+ domain: [...ye(R, z)],
1288
+ range: [K, q]
1116
1289
  });
1117
- function X(e) {
1118
- let t = ae?.getBoundingClientRect();
1290
+ function Y(e) {
1291
+ let t = se?.getBoundingClientRect();
1119
1292
  if (t === void 0) return;
1120
- let n = Y.invert(e - t.left), r = M.find((e, t) => {
1121
- let r = M[t + 1];
1293
+ let n = J.invert(e - t.left), r = A.find((e, t) => {
1294
+ let r = A[t + 1];
1122
1295
  return r === void 0 || n <= e.timestamp + (r.timestamp - e.timestamp) / 2;
1123
1296
  });
1124
- r !== void 0 && Z({
1125
- signature: P,
1297
+ r !== void 0 && X({
1298
+ signature: F,
1126
1299
  timestamp: r.timestamp,
1127
1300
  source: "pointer"
1128
1301
  });
1129
1302
  }
1130
- function Z(e) {
1131
- O === void 0 ? ue(e) : O.onChange(e);
1303
+ function X(e) {
1304
+ h === void 0 ? de(e) : h.onChange(e);
1132
1305
  }
1133
- function Q(e) {
1306
+ function Z(e) {
1134
1307
  if (e.altKey || e.ctrlKey || e.metaKey) return;
1135
- let t = M.findIndex((e) => e.timestamp === le?.timestamp), n = {
1136
- ArrowRight: Math.min(M.length - 1, t + 1),
1308
+ let t = A.findIndex((e) => e.timestamp === ue?.timestamp), n = {
1309
+ ArrowRight: Math.min(A.length - 1, t + 1),
1137
1310
  ArrowLeft: Math.max(0, t - 1),
1138
1311
  Home: 0,
1139
- End: M.length - 1
1312
+ End: A.length - 1
1140
1313
  };
1141
1314
  switch (e.key) {
1142
1315
  case "Escape":
1143
- e.preventDefault(), e.stopPropagation(), Z(void 0);
1316
+ e.preventDefault(), e.stopPropagation(), X(void 0);
1144
1317
  break;
1145
1318
  case "ArrowRight":
1146
1319
  case "ArrowLeft":
1147
1320
  case "Home":
1148
1321
  case "End": {
1149
1322
  e.preventDefault();
1150
- let t = M[n[e.key]];
1151
- t !== void 0 && (ce(t.timestamp), Z({
1152
- signature: P,
1323
+ let t = A[n[e.key]];
1324
+ t !== void 0 && (le(t.timestamp), X({
1325
+ signature: F,
1153
1326
  timestamp: t.timestamp,
1154
1327
  source: "keyboard"
1155
1328
  }));
@@ -1157,144 +1330,176 @@ function Te({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1157
1330
  }
1158
1331
  }
1159
1332
  }
1160
- return /* @__PURE__ */ E("div", {
1161
- ref: oe,
1333
+ return /* @__PURE__ */ T("div", {
1334
+ ref: N,
1162
1335
  className: "xeuugli",
1163
- children: /* @__PURE__ */ D(l, {
1164
- title: e,
1336
+ children: /* @__PURE__ */ T(d, {
1337
+ title: /* @__PURE__ */ T(M, {
1338
+ title: e,
1339
+ detail: I === void 0 ? void 0 : i(I.timestamp)
1340
+ }),
1165
1341
  description: t,
1166
- actions: p,
1167
- children: [/* @__PURE__ */ D("div", {
1342
+ actions: /* @__PURE__ */ E(w, { children: [
1343
+ l,
1344
+ " ",
1345
+ /* @__PURE__ */ T(ie, {
1346
+ title: e,
1347
+ children: /* @__PURE__ */ E("table", {
1348
+ className: "xh8yej3 x1mwwwfo xy8obcc x1yc453h xss6m8b",
1349
+ children: [
1350
+ /* @__PURE__ */ E("caption", { children: [e, " observations"] }),
1351
+ /* @__PURE__ */ T("thead", { children: /* @__PURE__ */ E("tr", { children: [/* @__PURE__ */ E("th", {
1352
+ scope: "col",
1353
+ className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1354
+ children: [
1355
+ "Time (",
1356
+ r,
1357
+ ")"
1358
+ ]
1359
+ }), k.map((e) => /* @__PURE__ */ T("th", {
1360
+ scope: "col",
1361
+ className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1362
+ children: e.label
1363
+ }, e.id))] }) }),
1364
+ /* @__PURE__ */ T("tbody", { children: A.map((e, t) => /* @__PURE__ */ E("tr", { children: [/* @__PURE__ */ T("th", {
1365
+ scope: "row",
1366
+ className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1367
+ children: i(e.timestamp)
1368
+ }), k.map((e) => /* @__PURE__ */ T("td", {
1369
+ className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1370
+ children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : a(e.points[t].value)
1371
+ }, e.id))] }, e.timestamp)) })
1372
+ ]
1373
+ })
1374
+ })
1375
+ ] }),
1376
+ children: /* @__PURE__ */ E("div", {
1168
1377
  className: "xrvj5dj x1n8ia3y",
1169
1378
  children: [
1170
- /* @__PURE__ */ E(o, { items: j.map(({ id: e, label: t, tone: n }) => ({
1171
- id: e,
1172
- label: t,
1173
- tone: n
1174
- })) }),
1175
- /* @__PURE__ */ D("div", {
1176
- ref: re,
1177
- ...y.props(c.plot),
1178
- children: [/* @__PURE__ */ D("svg", {
1379
+ /* @__PURE__ */ T(oe, {
1380
+ id: fe,
1381
+ label: I === void 0 ? void 0 : i(I.timestamp),
1382
+ legend: k.map(({ id: e, label: t, tone: n }) => ({
1383
+ id: e,
1384
+ label: t,
1385
+ tone: n
1386
+ })),
1387
+ rows: k.map((e) => {
1388
+ let t = e.points.find((e) => e.timestamp === I?.timestamp);
1389
+ return {
1390
+ id: e.id,
1391
+ label: e.label,
1392
+ tone: e.tone,
1393
+ value: t?.value === null || t === void 0 ? "Unavailable" : a(t.value)
1394
+ };
1395
+ }),
1396
+ x: J(I?.timestamp ?? R),
1397
+ width: j,
1398
+ source: I?.source,
1399
+ notes: s.filter((e) => e.timestamp === I?.timestamp).map((e) => e.label)
1400
+ }),
1401
+ /* @__PURE__ */ E("div", {
1402
+ ref: ae,
1403
+ ...b.props(u.plot),
1404
+ children: [/* @__PURE__ */ E("svg", {
1179
1405
  role: "img",
1180
1406
  "aria-label": `${e}. Use arrow keys to inspect observations.`,
1181
- "aria-describedby": de,
1407
+ "aria-describedby": fe,
1182
1408
  tabIndex: 0,
1183
- viewBox: `0 0 ${ie} ${L}`,
1184
- height: L,
1185
- onKeyDown: Q,
1409
+ viewBox: `0 0 ${j} ${me}`,
1410
+ height: me,
1411
+ onKeyDown: Z,
1186
1412
  onFocus: (e) => {
1187
1413
  if (e.currentTarget.matches(":focus-visible")) {
1188
- let e = F?.timestamp ?? R;
1189
- ce(e), Z({
1190
- signature: P,
1414
+ let e = I?.timestamp ?? R;
1415
+ le(e), X({
1416
+ signature: F,
1191
1417
  timestamp: e,
1192
1418
  source: "keyboard"
1193
1419
  });
1194
1420
  }
1195
1421
  },
1196
1422
  onPointerMove: (e) => {
1197
- e.pointerType === "mouse" && X(e.clientX);
1423
+ e.pointerType === "mouse" && Y(e.clientX);
1424
+ },
1425
+ onPointerDown: (e) => Y(e.clientX),
1426
+ onPointerLeave: (e) => {
1427
+ e.pointerType === "mouse" && I?.source === "pointer" && X(void 0);
1198
1428
  },
1199
- onPointerDown: (e) => X(e.clientX),
1200
- ...y.props(c.svg, c.inspectable, we),
1429
+ onBlur: () => X(void 0),
1430
+ ...b.props(u.svg, u.inspectable, ke),
1201
1431
  children: [
1202
- K.map((e) => /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("line", {
1203
- x1: q,
1204
- x2: J,
1432
+ he.map((e) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T("line", {
1433
+ x1: K,
1434
+ x2: q,
1205
1435
  y1: G(e),
1206
1436
  y2: G(e),
1207
- ...y.props(c.grid)
1208
- }), /* @__PURE__ */ E("text", {
1209
- x: q - 8,
1437
+ ...b.props(u.grid)
1438
+ }), /* @__PURE__ */ T("text", {
1439
+ x: K - 8,
1210
1440
  y: G(e),
1211
1441
  textAnchor: "end",
1212
1442
  dominantBaseline: "middle",
1213
- ...y.props(c.label),
1214
- children: a(e)
1443
+ ...b.props(u.label),
1444
+ children: o(e)
1215
1445
  })] }, e)),
1216
- j.map((e) => /* @__PURE__ */ D("g", { children: [g === "area" && /* @__PURE__ */ E(ee, {
1446
+ k.map((e) => /* @__PURE__ */ E("g", { children: [p === "area" && /* @__PURE__ */ T(ne, {
1217
1447
  data: [...e.points],
1218
1448
  defined: (e) => e.value !== null,
1219
- x: (e) => Y(e.timestamp),
1449
+ x: (e) => J(e.timestamp),
1220
1450
  y0: (e) => G(e.base),
1221
1451
  y1: (e) => G((e.value ?? 0) + e.base),
1222
1452
  yScale: G,
1223
- fill: u[e.tone],
1224
- fillOpacity: _ ? .65 : .15
1225
- }), /* @__PURE__ */ E(_e, {
1453
+ fill: f[e.tone],
1454
+ fillOpacity: m ? .65 : .15
1455
+ }), /* @__PURE__ */ T(Se, {
1226
1456
  series: e,
1227
- x: Y,
1457
+ x: J,
1228
1458
  y: G,
1229
- inspectedTimestamp: F?.timestamp
1459
+ inspectedTimestamp: I?.timestamp
1230
1460
  })] }, e.id)),
1231
- s.map((e) => /* @__PURE__ */ D("g", { children: [e.kind === "time" ? /* @__PURE__ */ E("line", {
1232
- x1: Y(e.timestamp),
1233
- x2: Y(e.timestamp),
1461
+ s.map((e) => /* @__PURE__ */ E("g", { children: [e.kind === "time" ? /* @__PURE__ */ T("line", {
1462
+ x1: J(e.timestamp),
1463
+ x2: J(e.timestamp),
1234
1464
  y1: 12,
1235
- y2: I,
1465
+ y2: L,
1236
1466
  className: "xhq4mlf x1ntoi03 x13efnbd"
1237
- }) : /* @__PURE__ */ E("circle", {
1238
- cx: Y(e.timestamp),
1239
- cy: G(e.value + (j.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1467
+ }) : /* @__PURE__ */ T("circle", {
1468
+ cx: J(e.timestamp),
1469
+ cy: G(e.value + (k.find((t) => t.id === e.seriesId)?.points.find((t) => t.timestamp === e.timestamp)?.base ?? 0)),
1240
1470
  r: 4,
1241
- fill: v.surface,
1242
- ...y.props(c.selected)
1243
- }), /* @__PURE__ */ E("title", { children: e.kind === "point" ? `${e.label}: ${a(e.value)}` : e.label })] }, e.id)),
1244
- F !== void 0 && /* @__PURE__ */ E("line", {
1245
- x1: Y(F.timestamp),
1246
- x2: Y(F.timestamp),
1471
+ fill: y.surface,
1472
+ ...b.props(u.selected)
1473
+ }), /* @__PURE__ */ T("title", { children: e.kind === "point" ? `${e.label}: ${a(e.value)}` : e.label })] }, e.id)),
1474
+ I !== void 0 && /* @__PURE__ */ T("line", {
1475
+ x1: J(I.timestamp),
1476
+ x2: J(I.timestamp),
1247
1477
  y1: 12,
1248
- y2: I,
1478
+ y2: L,
1249
1479
  className: "xhq4mlf x1ntoi03 x13efnbd"
1250
1480
  }),
1251
- le !== void 0 && /* @__PURE__ */ E(ne, {
1252
- x: Y(le.timestamp),
1481
+ ue !== void 0 && /* @__PURE__ */ T(re, {
1482
+ x: J(ue.timestamp),
1253
1483
  top: 12,
1254
- bottom: I,
1255
- width: Math.min(16, (J - q) / 2)
1484
+ bottom: L,
1485
+ width: Math.min(16, (q - K) / 2)
1256
1486
  })
1257
1487
  ]
1258
- }), /* @__PURE__ */ D("div", {
1488
+ }), /* @__PURE__ */ E("div", {
1259
1489
  "aria-hidden": !0,
1260
- ...y.props(be.timeAxis, be.timeAxisInset(q, Math.max(0, ie - J))),
1261
- children: [/* @__PURE__ */ E("span", {
1490
+ ...b.props(Te.timeAxis, Te.timeAxisInset(K, Math.max(0, j - q))),
1491
+ children: [/* @__PURE__ */ T("span", {
1262
1492
  className: "x1cqoux5 xeuugli xj0a0fe",
1263
1493
  children: i(R)
1264
- }), z !== R && /* @__PURE__ */ E("span", {
1494
+ }), z !== R && /* @__PURE__ */ T("span", {
1265
1495
  className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
1266
1496
  children: i(z)
1267
1497
  })]
1268
1498
  })]
1269
1499
  }),
1270
- /* @__PURE__ */ E("div", {
1271
- id: de,
1272
- "aria-live": F?.source === "keyboard" ? "polite" : "off",
1273
- className: "x78zum5 x1a02dak x1pha0wt x8zbtdt x1gkm1c7 xy8obcc xas2l8k x1mqbd49 xj0a0fe",
1274
- children: F === void 0 ? /* @__PURE__ */ E("span", {
1275
- className: "x153jb6y",
1276
- children: "Point, tap, or use the arrow keys to inspect values."
1277
- }) : /* @__PURE__ */ D(T, { children: [
1278
- /* @__PURE__ */ E("span", { children: i(F.timestamp) }),
1279
- /* @__PURE__ */ E("dl", {
1280
- className: "x78zum5 x1a02dak x8zbtdt x1gkm1c7 x1ghz6dp xeuugli",
1281
- children: j.map((e) => {
1282
- let t = e.points.find((e) => e.timestamp === F.timestamp);
1283
- return /* @__PURE__ */ D("div", {
1284
- className: "x78zum5 x1a02dak xunmzkg x1ghz6dp xeuugli xss6m8b",
1285
- children: [/* @__PURE__ */ E("dt", { children: e.label }), /* @__PURE__ */ E("dd", {
1286
- className: "x1ghz6dp xbixft",
1287
- children: t?.value === null || t === void 0 ? "Unavailable" : a(t.value)
1288
- })]
1289
- }, e.id);
1290
- })
1291
- }),
1292
- s.filter((e) => e.timestamp === F.timestamp).map((e) => /* @__PURE__ */ E("span", { children: e.label }, e.id))
1293
- ] })
1294
- }),
1295
- s.length > 0 && /* @__PURE__ */ E("ul", {
1500
+ s.length > 0 && /* @__PURE__ */ T("ul", {
1296
1501
  className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx xy8obcc x153jb6y xj0a0fe",
1297
- children: s.map((e) => /* @__PURE__ */ D("li", { children: [
1502
+ children: s.map((e) => /* @__PURE__ */ E("li", { children: [
1298
1503
  i(e.timestamp),
1299
1504
  " · ",
1300
1505
  e.label,
@@ -1302,34 +1507,8 @@ function Te({ title: e, description: t, series: n, timestampUnit: r, formatTimes
1302
1507
  ] }, e.id))
1303
1508
  })
1304
1509
  ]
1305
- }), /* @__PURE__ */ E(d, { children: /* @__PURE__ */ D("table", {
1306
- className: "xh8yej3 x1mwwwfo xy8obcc x1yc453h xss6m8b",
1307
- children: [
1308
- /* @__PURE__ */ D("caption", { children: [e, " observations"] }),
1309
- /* @__PURE__ */ E("thead", { children: /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ D("th", {
1310
- scope: "col",
1311
- className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1312
- children: [
1313
- "Time (",
1314
- r,
1315
- ")"
1316
- ]
1317
- }), j.map((e) => /* @__PURE__ */ E("th", {
1318
- scope: "col",
1319
- className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1320
- children: e.label
1321
- }, e.id))] }) }),
1322
- /* @__PURE__ */ E("tbody", { children: M.map((e, t) => /* @__PURE__ */ D("tr", { children: [/* @__PURE__ */ E("th", {
1323
- scope: "row",
1324
- className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1325
- children: i(e.timestamp)
1326
- }), j.map((e) => /* @__PURE__ */ E("td", {
1327
- className: "x69ldcm x1yc453h xso031l x1q0q8m5 x1qndepd xj57cvi",
1328
- children: e.points[t]?.value === null || e.points[t]?.value === void 0 ? "Unavailable" : a(e.points[t].value)
1329
- }, e.id))] }, e.timestamp)) })
1330
- ]
1331
- }) })]
1510
+ })
1332
1511
  })
1333
1512
  });
1334
1513
  }
1335
- export { Se as AreaChart, F as BarChart, le as BarChartPlaceholder, L as BreakdownBar, xe as LineChart, H as MAX_SCATTER_POINTS, G as ScatterPlot, Ce as SmallMultiples, ve as Sparkline, X as timeSeriesLimits };
1514
+ export { De as AreaChart, L as BarChart, F as BarChartPlaceholder, B as BreakdownBar, Ee as LineChart, G as MAX_SCATTER_POINTS, q as ScatterPlot, Oe as SmallMultiples, Ce as Sparkline, Q as timeSeriesLimits };