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