@mechane-ai/elements 0.43.0 → 0.45.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,32 +1,32 @@
1
- import { c as e } from "../src-BpvnBWrF.js";
2
- import { a as t, n, t as r } from "../chart-navigation-BAbb5PV9.js";
3
- import { i, n as a, t as o } from "../chart-frame-9dQQNF3F.js";
4
- import { n as s, r as c, t as l } from "../chart-input-DT0STflx.js";
5
- import { n as u, t as d } from "../plot-width-DzCmthQW.js";
6
- import * as f from "@stylexjs/stylex";
7
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
8
- import { scaleLinear as g } from "@visx/scale";
9
- import { Bar as _ } from "@visx/shape";
1
+ import { c as e, l as t } from "../src-Dcs3SZ9V.js";
2
+ import { a as n, n as r, t as i } from "../chart-navigation-BAbb5PV9.js";
3
+ import { i as a, n as o, t as s } from "../chart-frame-Ztktqs1b.js";
4
+ import { n as c, r as l, t as u } from "../chart-input-BO3BqlFO.js";
5
+ import { n as d, t as f } from "../plot-width-CIqBiHcd.js";
6
+ import * as p from "@stylexjs/stylex";
7
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
8
+ import { scaleLinear as _ } from "@visx/scale";
9
+ import { Bar as v } from "@visx/shape";
10
10
  // packages/charts/src/distribution/distribution-input.ts
11
- var v = {
11
+ var y = {
12
12
  bins: 200,
13
13
  cumulativePoints: 2e3,
14
14
  rows: 200
15
15
  };
16
- function y({ items: e, domain: t, maxEntries: n }) {
17
- if (!c(t)) return "The chart domain must contain two finite, increasing values.";
18
- if (!s(e)) return "Chart records must have unique identifiers.";
16
+ function b({ items: e, domain: t, maxEntries: n }) {
17
+ if (!l(t)) return "The chart domain must contain two finite, increasing values.";
18
+ if (!c(e)) return "Chart records must have unique identifiers.";
19
19
  if (e.length > n) return `This chart supports at most ${n} records. Supply an explicit data window or aggregation.`;
20
20
  }
21
- function b(e, t) {
21
+ function x(e, t) {
22
22
  return !Number.isFinite(e) || e < t[0] || e > t[1];
23
23
  }
24
24
  // packages/charts/src/distribution/distribution-plot.tsx
25
- var x = { height: 160 }, S = [
25
+ var S = { height: 160 }, C = [
26
26
  0,
27
27
  .5,
28
28
  1
29
- ], C = {
29
+ ], w = {
30
30
  plot: {
31
31
  k7Eaqz: "xeuugli",
32
32
  k1xSpc: "xrvj5dj",
@@ -40,7 +40,8 @@ var x = { height: 160 }, S = [
40
40
  kXwgrk: "xdt5ytf",
41
41
  kjj79g: "x1qughib",
42
42
  k9WMMc: "xp4054r",
43
- kMwMTN: "x153jb6y",
43
+ kMwMTN: "xbixft",
44
+ kMv6JI: "xiard35",
44
45
  kGuDYH: "xy8obcc",
45
46
  kLWn49: "xas2l8k",
46
47
  kcqcaj: "xss6m8b",
@@ -61,7 +62,6 @@ var x = { height: 160 }, S = [
61
62
  },
62
63
  grid: {
63
64
  kjVXCG: "x13hfdr1",
64
- k5rJSQ: "x1ntoi03",
65
65
  kREpy8: "x13efnbd",
66
66
  $$css: !0
67
67
  },
@@ -69,7 +69,8 @@ var x = { height: 160 }, S = [
69
69
  k1xSpc: "x78zum5",
70
70
  kjj79g: "x1qughib",
71
71
  kOIVth: "x1hnptsi",
72
- kMwMTN: "x153jb6y",
72
+ kMwMTN: "xbixft",
73
+ kMv6JI: "xiard35",
73
74
  kGuDYH: "xy8obcc",
74
75
  kLWn49: "xas2l8k",
75
76
  kcqcaj: "xss6m8b",
@@ -175,6 +176,10 @@ var x = { height: 160 }, S = [
175
176
  kREpy8: "x13efnbd",
176
177
  $$css: !0
177
178
  },
179
+ track: {
180
+ kDwRjp: "x1y22c7u",
181
+ $$css: !0
182
+ },
178
183
  missing: {
179
184
  kDwRjp: "x2wnxhi",
180
185
  kjVXCG: "xhq4mlf",
@@ -183,57 +188,57 @@ var x = { height: 160 }, S = [
183
188
  $$css: !0
184
189
  }
185
190
  };
186
- function w({ navigation: e, onInspectValue: t, xDomain: r, yDomain: i, xLabel: a, yLabel: o, formatX: s, formatY: c, children: l }) {
187
- let { ref: u, width: f } = d(), p = S.map((e) => r[0] + e * (r[1] - r[0])), g = S.map((e) => i[1] - e * (i[1] - i[0]));
188
- return /* @__PURE__ */ h("div", {
191
+ function T({ navigation: e, onInspectValue: t, xDomain: n, yDomain: i, xLabel: a, yLabel: o, formatX: s, formatY: c, children: l }) {
192
+ let { ref: u, width: d } = f(), p = C.map((e) => n[0] + e * (n[1] - n[0])), m = C.map((e) => i[1] - e * (i[1] - i[0]));
193
+ return /* @__PURE__ */ g("div", {
189
194
  className: "xeuugli xrvj5dj x37z1gs x1hnptsi",
190
195
  children: [
191
- /* @__PURE__ */ h("div", {
196
+ /* @__PURE__ */ g("div", {
192
197
  className: "x1osaytk x78zum5 x1qughib x1n8ia3y",
193
- children: [/* @__PURE__ */ m("span", {
198
+ children: [/* @__PURE__ */ h("span", {
194
199
  className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
195
200
  children: o
196
- }), /* @__PURE__ */ m("span", {
201
+ }), /* @__PURE__ */ h("span", {
197
202
  className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
198
203
  children: a
199
204
  })]
200
205
  }),
201
- /* @__PURE__ */ m("div", {
206
+ /* @__PURE__ */ h("div", {
202
207
  "aria-hidden": !0,
203
- className: "x1ymw6g x78zum5 xdt5ytf x1qughib xp4054r x153jb6y xy8obcc xas2l8k xss6m8b x2aouup xj0a0fe",
204
- children: g.map((e) => /* @__PURE__ */ m("span", { children: c(e) }, e))
208
+ className: "x1ymw6g x78zum5 xdt5ytf x1qughib xp4054r xbixft xiard35 xy8obcc xas2l8k xss6m8b x2aouup xj0a0fe",
209
+ children: m.map((e) => /* @__PURE__ */ h("span", { children: c(e) }, e))
205
210
  }),
206
- /* @__PURE__ */ m(n, {
211
+ /* @__PURE__ */ h(r, {
207
212
  ref: u,
208
213
  ...e,
209
214
  className: "xeuugli",
210
- children: /* @__PURE__ */ h("svg", {
215
+ children: /* @__PURE__ */ g("svg", {
211
216
  "aria-hidden": !0,
212
217
  onPointerMove: (e) => {
213
- let n = e.currentTarget.getBoundingClientRect();
214
- t?.(r[0] + (e.clientX - n.left) / n.width * (r[1] - r[0]));
218
+ let r = e.currentTarget.getBoundingClientRect();
219
+ t?.(n[0] + (e.clientX - r.left) / r.width * (n[1] - n[0]));
215
220
  },
216
221
  onPointerDown: (e) => {
217
- let n = e.currentTarget.getBoundingClientRect();
218
- t?.(r[0] + (e.clientX - n.left) / n.width * (r[1] - r[0]));
222
+ let r = e.currentTarget.getBoundingClientRect();
223
+ t?.(n[0] + (e.clientX - r.left) / r.width * (n[1] - n[0]));
219
224
  },
220
- viewBox: `0 0 ${f} ${x.height}`,
225
+ viewBox: `0 0 ${d} ${S.height}`,
221
226
  preserveAspectRatio: "none",
222
227
  className: "x1lliihq xh8yej3 x1ymw6g xb3r6kr",
223
- children: [S.map((e) => /* @__PURE__ */ m("line", {
228
+ children: [C.map((e) => /* @__PURE__ */ h("line", {
224
229
  x1: 0,
225
- x2: f,
226
- y1: x.height * e,
227
- y2: x.height * e,
228
- className: "x13hfdr1 x1ntoi03 x13efnbd"
229
- }, e)), l(f)]
230
+ x2: d,
231
+ y1: S.height * e,
232
+ y2: S.height * e,
233
+ className: "x13hfdr1 x13efnbd"
234
+ }, e)), l(d)]
230
235
  })
231
236
  }),
232
- /* @__PURE__ */ m("span", {}),
233
- /* @__PURE__ */ m("div", {
237
+ /* @__PURE__ */ h("span", {}),
238
+ /* @__PURE__ */ h("div", {
234
239
  "aria-hidden": !0,
235
- className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xss6m8b",
236
- children: p.map((e, t) => /* @__PURE__ */ m("span", {
240
+ className: "x78zum5 x1qughib x1hnptsi xbixft xiard35 xy8obcc xas2l8k xss6m8b",
241
+ children: p.map((e, t) => /* @__PURE__ */ h("span", {
237
242
  ...{
238
243
  0: { className: "x1cqoux5 xeuugli xj0a0fe" },
239
244
  2: { className: "x1cqoux5 xeuugli xj0a0fe x2b8uid" },
@@ -246,92 +251,92 @@ function w({ navigation: e, onInspectValue: t, xDomain: r, yDomain: i, xLabel: a
246
251
  ]
247
252
  });
248
253
  }
249
- function T({ domain: e, formatValue: t }) {
250
- return /* @__PURE__ */ h("div", {
251
- className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xss6m8b",
252
- children: [/* @__PURE__ */ m("span", {
254
+ function E({ domain: e, formatValue: t }) {
255
+ return /* @__PURE__ */ g("div", {
256
+ className: "x78zum5 x1qughib x1hnptsi xbixft xiard35 xy8obcc xas2l8k xss6m8b",
257
+ children: [/* @__PURE__ */ h("span", {
253
258
  className: "x1cqoux5 xeuugli xj0a0fe",
254
259
  children: t(e[0])
255
- }), /* @__PURE__ */ m("span", {
260
+ }), /* @__PURE__ */ h("span", {
256
261
  className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
257
262
  children: t(e[1])
258
263
  })]
259
264
  });
260
265
  }
261
266
  // packages/charts/src/distribution/ecdf.tsx
262
- function E({ title: n, report: o, description: s, points: c, domain: u, valueLabel: d, probabilityLabel: _, formatValue: v, formatProbability: y, tone: b = "series1", selection: S, emptyLabel: T = "No cumulative distribution points are available." }) {
267
+ function D({ title: t, report: r, description: s, points: c, domain: l, valueLabel: d, probabilityLabel: f, formatValue: v, formatProbability: y, tone: b = "series1", selection: x, emptyLabel: C = "No cumulative distribution points are available." }) {
263
268
  let E = c.map((e) => ({
264
269
  id: e.id,
265
- label: `${d}: ${v(e.value)}, ${_}: ${e.probability === null ? "Unavailable" : y(e.probability)}`
266
- })), O = r({
267
- title: n,
270
+ label: `${d}: ${v(e.value)}, ${f}: ${e.probability === null ? "Unavailable" : y(e.probability)}`
271
+ })), D = i({
272
+ title: t,
268
273
  items: E,
269
- selection: S
270
- }), k = D({
274
+ selection: x
275
+ }), k = O({
271
276
  points: c,
272
- domain: u
277
+ domain: l
273
278
  });
274
- if (k !== void 0) return /* @__PURE__ */ m(l, {
275
- title: n,
276
- report: o,
279
+ if (k !== void 0) return /* @__PURE__ */ h(u, {
280
+ title: t,
281
+ report: r,
277
282
  description: s,
278
283
  message: k
279
284
  });
280
- let A = g({
285
+ let A = _({
281
286
  domain: [0, 1],
282
- range: [x.height, 0]
287
+ range: [S.height, 0]
283
288
  });
284
- return /* @__PURE__ */ m(a, {
285
- title: n,
286
- report: o,
289
+ return /* @__PURE__ */ h(o, {
290
+ title: t,
291
+ report: r,
287
292
  description: s,
288
- footer: /* @__PURE__ */ m(i, {
289
- id: O.id,
290
- children: O.label ?? "\xA0"
293
+ footer: /* @__PURE__ */ h(a, {
294
+ id: D.id,
295
+ children: D.label ?? "\xA0"
291
296
  }),
292
- children: c.length === 0 ? /* @__PURE__ */ m("p", {
293
- ...f.props(C.empty),
294
- children: T
295
- }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(w, {
296
- navigation: O.props,
297
+ children: c.length === 0 ? /* @__PURE__ */ h("p", {
298
+ ...p.props(w.empty),
299
+ children: C
300
+ }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(T, {
301
+ navigation: D.props,
297
302
  onInspectValue: (e) => {
298
303
  let t = { point: c[0] };
299
304
  for (let n of c) (t.point === void 0 || Math.abs(n.value - e) < Math.abs(t.point.value - e)) && (t.point = n);
300
305
  let n = t.point;
301
- n !== void 0 && O.inspect(n.id);
306
+ n !== void 0 && D.inspect(n.id);
302
307
  },
303
- xDomain: u,
308
+ xDomain: l,
304
309
  yDomain: [0, 1],
305
310
  xLabel: d,
306
- yLabel: _,
311
+ yLabel: f,
307
312
  formatX: v,
308
313
  formatY: y,
309
314
  children: (t) => {
310
- let n = g({
311
- domain: [...u],
315
+ let n = _({
316
+ domain: [...l],
312
317
  range: [0, t]
313
318
  }), r = c.map((e, t) => {
314
319
  if (e.probability === null) return "";
315
320
  let r = n(e.value), i = A(e.probability), a = c[t - 1];
316
321
  return a === void 0 || a.probability === null ? `M ${r} ${i}` : `H ${r} V ${i}`;
317
322
  }).join(" ");
318
- return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("path", {
323
+ return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("path", {
319
324
  d: r,
320
325
  fill: "none",
321
326
  stroke: e[b],
322
327
  strokeWidth: 2,
323
328
  vectorEffect: "non-scaling-stroke"
324
- }), c.map((t) => t.probability === null ? null : /* @__PURE__ */ m("circle", {
325
- onPointerEnter: () => O.inspect(t.id),
326
- onClick: () => S?.onSelect(t.id),
329
+ }), c.map((t) => t.probability === null ? null : /* @__PURE__ */ h("circle", {
330
+ onPointerEnter: () => D.inspect(t.id),
331
+ onClick: () => x?.onSelect(t.id),
327
332
  cx: n(t.value),
328
333
  cy: A(t.probability),
329
- r: S?.selectedId === t.id || O.label !== void 0 && O.activeId === t.id ? 4 : 2,
334
+ r: x?.selectedId === t.id || D.label !== void 0 && D.activeId === t.id ? 4 : 2,
330
335
  fill: e[b]
331
336
  }, t.id))] });
332
337
  }
333
- }), /* @__PURE__ */ m(t, {
334
- label: `${n} observations`,
338
+ }), /* @__PURE__ */ h(n, {
339
+ label: `${t} observations`,
335
340
  columns: [{
336
341
  id: "observation",
337
342
  label: "Observation"
@@ -343,11 +348,11 @@ function E({ title: n, report: o, description: s, points: c, domain: u, valueLab
343
348
  })] })
344
349
  });
345
350
  }
346
- function D({ points: e, domain: t }) {
347
- let n = y({
351
+ function O({ points: e, domain: t }) {
352
+ let n = b({
348
353
  items: e,
349
354
  domain: t,
350
- maxEntries: v.cumulativePoints
355
+ maxEntries: y.cumulativePoints
351
356
  });
352
357
  if (n !== void 0) return n;
353
358
  let r = {
@@ -355,7 +360,7 @@ function D({ points: e, domain: t }) {
355
360
  probability: 0
356
361
  };
357
362
  for (let n of e) {
358
- if (b(n.value, t) || n.value < r.value) return `Cumulative point ${n.id} is non-finite, outside the domain, or out of order.`;
363
+ if (x(n.value, t) || n.value < r.value) return `Cumulative point ${n.id} is non-finite, outside the domain, or out of order.`;
359
364
  if (n.probability !== null) {
360
365
  if (!Number.isFinite(n.probability) || n.probability < r.probability || n.probability > 1) return `Cumulative point ${n.id} must have a probability from zero to one that does not decrease.`;
361
366
  r.probability = n.probability;
@@ -364,188 +369,189 @@ function D({ points: e, domain: t }) {
364
369
  }
365
370
  }
366
371
  // packages/charts/src/distribution/histogram.tsx
367
- function O({ title: n, report: o, description: s, bins: c, domain: d, maximumCount: v, valueLabel: y, countLabel: b, formatValue: S, formatCount: T, tone: E = "series1", selection: D, emptyLabel: O = "No histogram bins are available." }) {
368
- let A = c.map((e) => ({
372
+ function k({ title: r, report: s, description: c, bins: l, domain: f, maximumCount: y, valueLabel: b, countLabel: x, formatValue: C, formatCount: E, tone: D = "series1", selection: O, emptyLabel: k = "No histogram bins are available." }) {
373
+ let j = l.map((e) => ({
369
374
  id: e.id,
370
- label: `${e.label}, ${S(e.lowerBound)} – ${S(e.upperBound)}, ${b}: ${e.count === null ? "Unavailable" : T(e.count)}`
371
- })), j = r({
372
- title: n,
373
- items: A,
374
- selection: D
375
- }), M = k({
376
- bins: c,
377
- domain: d,
378
- maximumCount: v
375
+ label: `${e.label}, ${C(e.lowerBound)} – ${C(e.upperBound)}, ${x}: ${e.count === null ? "Unavailable" : E(e.count)}`
376
+ })), M = i({
377
+ title: r,
378
+ items: j,
379
+ selection: O
380
+ }), N = A({
381
+ bins: l,
382
+ domain: f,
383
+ maximumCount: y
379
384
  });
380
- if (M !== void 0) return /* @__PURE__ */ m(l, {
381
- title: n,
382
- report: o,
383
- description: s,
384
- message: M
385
+ if (N !== void 0) return /* @__PURE__ */ h(u, {
386
+ title: r,
387
+ report: s,
388
+ description: c,
389
+ message: N
385
390
  });
386
- let N = g({
387
- domain: [0, v],
388
- range: [x.height, 0]
391
+ let P = _({
392
+ domain: [0, y],
393
+ range: [S.height, 0]
389
394
  });
390
- return /* @__PURE__ */ m(a, {
391
- title: n,
392
- report: o,
393
- description: s,
394
- footer: /* @__PURE__ */ m(i, {
395
- id: j.id,
396
- children: j.label ?? "\xA0"
395
+ return /* @__PURE__ */ h(o, {
396
+ title: r,
397
+ report: s,
398
+ description: c,
399
+ footer: /* @__PURE__ */ h(a, {
400
+ id: M.id,
401
+ children: M.label ?? "\xA0"
397
402
  }),
398
- children: c.length === 0 ? /* @__PURE__ */ m("p", {
399
- ...f.props(C.empty),
400
- children: O
401
- }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(w, {
402
- navigation: j.props,
403
+ children: l.length === 0 ? /* @__PURE__ */ h("p", {
404
+ ...p.props(w.empty),
405
+ children: k
406
+ }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(T, {
407
+ navigation: M.props,
403
408
  onInspectValue: (e) => {
404
- let t = c.find((t) => e >= t.lowerBound && e <= t.upperBound);
405
- t !== void 0 && j.inspect(t.id);
409
+ let t = l.find((t) => e >= t.lowerBound && e <= t.upperBound);
410
+ t !== void 0 && M.inspect(t.id);
406
411
  },
407
- xDomain: d,
408
- yDomain: [0, v],
409
- xLabel: y,
410
- yLabel: b,
411
- formatX: S,
412
- formatY: T,
413
- children: (t) => {
414
- let n = g({
415
- domain: [...d],
416
- range: [0, t]
412
+ xDomain: f,
413
+ yDomain: [0, y],
414
+ xLabel: b,
415
+ yLabel: x,
416
+ formatX: C,
417
+ formatY: E,
418
+ children: (n) => {
419
+ let r = _({
420
+ domain: [...f],
421
+ range: [0, n]
417
422
  });
418
- return c.map((t) => {
419
- let r = n(t.lowerBound), i = n(t.upperBound) - r, a = Math.min(2, i * .2), o = D?.selectedId === t.id || j.label !== void 0 && j.activeId === t.id;
420
- if (t.count === null) return /* @__PURE__ */ m(_, {
421
- onPointerEnter: () => j.inspect(t.id),
422
- onClick: () => D?.onSelect(t.id),
423
- x: r + a / 2,
424
- y: x.height - 6,
425
- width: i - a,
423
+ return l.map((n) => {
424
+ let i = r(n.lowerBound), a = r(n.upperBound) - i, o = Math.min(2, a * .2), s = O?.selectedId === n.id || M.label !== void 0 && M.activeId === n.id;
425
+ if (n.count === null) return /* @__PURE__ */ h(v, {
426
+ onPointerEnter: () => M.inspect(n.id),
427
+ onClick: () => O?.onSelect(n.id),
428
+ x: i + o / 2,
429
+ y: S.height - 6,
430
+ width: a - o,
426
431
  height: 5,
427
- ...f.props(C.missing)
428
- }, t.id);
429
- let s = N(t.count);
430
- return /* @__PURE__ */ m(_, {
431
- onPointerEnter: () => j.inspect(t.id),
432
- onClick: () => D?.onSelect(t.id),
433
- x: r + a / 2,
434
- y: s,
435
- width: i - a,
436
- height: x.height - s,
437
- fill: e[E],
438
- ...f.props(o && u.selected),
439
- opacity: D?.selectedId === void 0 || o ? 1 : .45
440
- }, t.id);
432
+ ...p.props(w.missing)
433
+ }, n.id);
434
+ let c = P(n.count);
435
+ return /* @__PURE__ */ h(v, {
436
+ onPointerEnter: () => M.inspect(n.id),
437
+ onClick: () => O?.onSelect(n.id),
438
+ x: i + o / 2,
439
+ y: c,
440
+ width: a - o,
441
+ height: S.height - c,
442
+ fill: e[D],
443
+ stroke: t[D],
444
+ ...p.props(d.outlined, s && d.selected),
445
+ opacity: O?.selectedId === void 0 || s ? 1 : .45
446
+ }, n.id);
441
447
  });
442
448
  }
443
- }), /* @__PURE__ */ m(t, {
444
- label: `${n} observations`,
449
+ }), /* @__PURE__ */ h(n, {
450
+ label: `${r} observations`,
445
451
  columns: [{
446
452
  id: "observation",
447
453
  label: "Observation"
448
454
  }],
449
- rows: A.map((e) => ({
455
+ rows: j.map((e) => ({
450
456
  id: e.id,
451
457
  values: [e.label]
452
458
  }))
453
459
  })] })
454
460
  });
455
461
  }
456
- function k({ bins: e, domain: t, maximumCount: n }) {
457
- let r = y({
462
+ function A({ bins: e, domain: t, maximumCount: n }) {
463
+ let r = b({
458
464
  items: e,
459
465
  domain: t,
460
- maxEntries: v.bins
466
+ maxEntries: y.bins
461
467
  });
462
468
  if (r !== void 0) return r;
463
469
  if (!Number.isFinite(n) || n <= 0) return "The histogram count domain must have a finite maximum greater than zero.";
464
470
  for (let [r, i] of e.entries()) {
465
- if (b(i.lowerBound, t) || b(i.upperBound, t)) return `Histogram bin ${i.id} has a non-finite bound or lies outside the declared domain.`;
471
+ if (x(i.lowerBound, t) || x(i.upperBound, t)) return `Histogram bin ${i.id} has a non-finite bound or lies outside the declared domain.`;
466
472
  let a = e[r - 1];
467
473
  if (i.lowerBound >= i.upperBound || a !== void 0 && i.lowerBound < a.upperBound) return `Histogram bin ${i.id} is reversed, overlaps another bin, or is out of order.`;
468
474
  if (i.count !== null && (!Number.isFinite(i.count) || i.count < 0 || i.count > n)) return `Histogram bin ${i.id} has a count outside the declared count domain.`;
469
475
  }
470
476
  }
471
477
  // packages/charts/src/distribution/interval-plot.tsx
472
- function A({ title: t, report: n, description: r, items: i, domain: s, valueLabel: c, intervalLabel: u, formatValue: p, selection: _, emptyLabel: v = "No interval estimates are available." }) {
473
- let { ref: y, width: b } = d(), x = j({
478
+ function j({ title: t, report: n, description: r, items: i, domain: a, valueLabel: c, intervalLabel: l, formatValue: d, selection: m, emptyLabel: v = "No interval estimates are available." }) {
479
+ let { ref: y, width: b } = f(), x = M({
474
480
  items: i,
475
- domain: s
481
+ domain: a
476
482
  });
477
- if (x !== void 0) return /* @__PURE__ */ m(l, {
483
+ if (x !== void 0) return /* @__PURE__ */ h(u, {
478
484
  title: t,
479
485
  report: n,
480
486
  description: r,
481
487
  message: x
482
488
  });
483
- let S = g({
484
- domain: [...s],
489
+ let S = _({
490
+ domain: [...a],
485
491
  range: [0, b]
486
492
  });
487
- return /* @__PURE__ */ m(a, {
493
+ return /* @__PURE__ */ h(o, {
488
494
  title: t,
489
495
  report: n,
490
496
  description: r,
491
- footer: `${c} · ${u}`,
492
- children: i.length === 0 ? /* @__PURE__ */ m("p", {
493
- ...f.props(C.empty),
497
+ footer: `${c} · ${l}`,
498
+ children: i.length === 0 ? /* @__PURE__ */ h("p", {
499
+ ...p.props(w.empty),
494
500
  children: v
495
- }) : /* @__PURE__ */ h("div", {
496
- ...f.props(C.values),
501
+ }) : /* @__PURE__ */ g("div", {
502
+ ...p.props(w.values),
497
503
  children: [i.map((t) => {
498
- let n = t.estimate === null ? "Estimate unavailable" : p(t.estimate), r = `${u}: ${t.lower === null ? "Unavailable" : p(t.lower)} – ${t.upper === null ? "Unavailable" : p(t.upper)}`, i = e[t.tone ?? "series1"];
499
- return /* @__PURE__ */ m(o, {
504
+ let n = t.estimate === null ? "Estimate unavailable" : d(t.estimate), r = `${l}: ${t.lower === null ? "Unavailable" : d(t.lower)} – ${t.upper === null ? "Unavailable" : d(t.upper)}`, i = e[t.tone ?? "series1"];
505
+ return /* @__PURE__ */ h(s, {
500
506
  label: `${t.label}, ${c}: ${n}, ${r}`,
501
- isSelected: _?.selectedId === t.id,
502
- onSelect: _ === void 0 ? void 0 : () => _.onSelect(t.id),
503
- children: /* @__PURE__ */ h("span", {
504
- ...f.props(C.row),
505
- children: [/* @__PURE__ */ h("span", {
506
- ...f.props(C.rowLabel),
507
+ isSelected: m?.selectedId === t.id,
508
+ onSelect: m === void 0 ? void 0 : () => m.onSelect(t.id),
509
+ children: /* @__PURE__ */ g("span", {
510
+ ...p.props(w.row),
511
+ children: [/* @__PURE__ */ g("span", {
512
+ ...p.props(w.rowLabel),
507
513
  children: [
508
- /* @__PURE__ */ m("span", { children: t.label }),
509
- /* @__PURE__ */ m("span", {
510
- ...f.props(C.rowValue),
514
+ /* @__PURE__ */ h("span", { children: t.label }),
515
+ /* @__PURE__ */ h("span", {
516
+ ...p.props(w.rowValue),
511
517
  children: n
512
518
  }),
513
- /* @__PURE__ */ m("span", {
514
- ...f.props(C.label),
519
+ /* @__PURE__ */ h("span", {
520
+ ...p.props(w.label),
515
521
  children: r
516
522
  })
517
523
  ]
518
- }), /* @__PURE__ */ h("svg", {
524
+ }), /* @__PURE__ */ g("svg", {
519
525
  "aria-hidden": !0,
520
526
  viewBox: `0 0 ${b} 28`,
521
527
  preserveAspectRatio: "none",
522
- ...f.props(C.rowSvg),
528
+ ...p.props(w.rowSvg),
523
529
  children: [
524
- /* @__PURE__ */ m("line", {
530
+ /* @__PURE__ */ h("line", {
525
531
  x1: 0,
526
532
  x2: b,
527
533
  y1: 14,
528
534
  y2: 14,
529
- ...f.props(C.baseline)
535
+ ...p.props(w.baseline)
530
536
  }),
531
- t.lower !== null && t.upper !== null && /* @__PURE__ */ h("g", {
537
+ t.lower !== null && t.upper !== null && /* @__PURE__ */ g("g", {
532
538
  stroke: i,
533
539
  strokeWidth: 2,
534
540
  vectorEffect: "non-scaling-stroke",
535
541
  children: [
536
- /* @__PURE__ */ m("line", {
542
+ /* @__PURE__ */ h("line", {
537
543
  x1: S(t.lower),
538
544
  x2: S(t.upper),
539
545
  y1: 14,
540
546
  y2: 14
541
547
  }),
542
- /* @__PURE__ */ m("line", {
548
+ /* @__PURE__ */ h("line", {
543
549
  x1: S(t.lower),
544
550
  x2: S(t.lower),
545
551
  y1: 9,
546
552
  y2: 19
547
553
  }),
548
- /* @__PURE__ */ m("line", {
554
+ /* @__PURE__ */ h("line", {
549
555
  x1: S(t.upper),
550
556
  x2: S(t.upper),
551
557
  y1: 9,
@@ -553,7 +559,7 @@ function A({ title: t, report: n, description: r, items: i, domain: s, valueLabe
553
559
  })
554
560
  ]
555
561
  }),
556
- t.estimate !== null && /* @__PURE__ */ m("circle", {
562
+ t.estimate !== null && /* @__PURE__ */ h("circle", {
557
563
  cx: S(t.estimate),
558
564
  cy: 14,
559
565
  r: 4,
@@ -563,24 +569,24 @@ function A({ title: t, report: n, description: r, items: i, domain: s, valueLabe
563
569
  })]
564
570
  })
565
571
  }, t.id);
566
- }), /* @__PURE__ */ h("div", {
567
- ...f.props(C.row, C.rowAxis),
568
- children: [/* @__PURE__ */ m("span", { ...f.props(C.axisSpacer) }), /* @__PURE__ */ m("div", {
572
+ }), /* @__PURE__ */ g("div", {
573
+ ...p.props(w.row, w.rowAxis),
574
+ children: [/* @__PURE__ */ h("span", { ...p.props(w.axisSpacer) }), /* @__PURE__ */ h("div", {
569
575
  ref: y,
570
- children: /* @__PURE__ */ m(T, {
571
- domain: s,
572
- formatValue: p
576
+ children: /* @__PURE__ */ h(E, {
577
+ domain: a,
578
+ formatValue: d
573
579
  })
574
580
  })]
575
581
  })]
576
582
  })
577
583
  });
578
584
  }
579
- function j({ items: e, domain: t }) {
580
- let n = y({
585
+ function M({ items: e, domain: t }) {
586
+ let n = b({
581
587
  items: e,
582
588
  domain: t,
583
- maxEntries: v.rows
589
+ maxEntries: y.rows
584
590
  });
585
591
  if (n !== void 0) return n;
586
592
  for (let n of e) {
@@ -588,7 +594,7 @@ function j({ items: e, domain: t }) {
588
594
  n.lower,
589
595
  n.estimate,
590
596
  n.upper
591
- ].some((e) => e !== null && b(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
597
+ ].some((e) => e !== null && x(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
592
598
  if (n.lower !== null && n.upper !== null && n.lower > n.upper) return `Interval ${n.id} has reversed endpoints.`;
593
599
  if (n.estimate !== null) {
594
600
  if (n.lower !== null && n.estimate < n.lower) return `Interval ${n.id} has an estimate below its lower endpoint.`;
@@ -597,95 +603,107 @@ function j({ items: e, domain: t }) {
597
603
  }
598
604
  }
599
605
  // packages/charts/src/distribution/ranked-bars.tsx
600
- function M({ title: t, report: n, description: r, items: i, domain: s, valueLabel: c, formatValue: u, selection: p, emptyLabel: v = "No ranked values are available." }) {
601
- let { ref: y, width: b } = d(), x = N({
602
- items: i,
603
- domain: s
606
+ function N({ title: n, report: r, description: i, items: a, domain: c, valueLabel: l, formatValue: m, selection: y, emptyLabel: b = "No ranked values are available." }) {
607
+ let { ref: x, width: S } = f(), C = P({
608
+ items: a,
609
+ domain: c
604
610
  });
605
- if (x !== void 0) return /* @__PURE__ */ m(l, {
606
- title: t,
607
- report: n,
608
- description: r,
609
- message: x
611
+ if (C !== void 0) return /* @__PURE__ */ h(u, {
612
+ title: n,
613
+ report: r,
614
+ description: i,
615
+ message: C
610
616
  });
611
- let S = g({
612
- domain: [...s],
613
- range: [0, b]
614
- }), w = S(0);
615
- return /* @__PURE__ */ m(a, {
616
- title: t,
617
- report: n,
618
- description: r,
619
- footer: c,
620
- children: i.length === 0 ? /* @__PURE__ */ m("p", {
621
- ...f.props(C.empty),
622
- children: v
623
- }) : /* @__PURE__ */ h("div", {
624
- ...f.props(C.values),
625
- children: [i.map((t) => {
626
- let n = t.value === null ? "Unavailable" : u(t.value), r = t.rank === void 0 ? t.label : `${t.rank} · ${t.label}`, i = e[t.tone ?? "series1"];
627
- return /* @__PURE__ */ m(o, {
628
- label: `${r}, ${c}: ${n}`,
629
- isSelected: p?.selectedId === t.id,
630
- onSelect: p === void 0 ? void 0 : () => p.onSelect(t.id),
631
- children: /* @__PURE__ */ h("span", {
632
- ...f.props(C.row),
633
- children: [/* @__PURE__ */ h("span", {
634
- ...f.props(C.rowLabel),
635
- children: [/* @__PURE__ */ m("span", { children: r }), /* @__PURE__ */ m("span", {
636
- ...f.props(C.rowValue),
637
- children: n
617
+ let T = _({
618
+ domain: [...c],
619
+ range: [0, S]
620
+ }), D = T(0);
621
+ return /* @__PURE__ */ h(o, {
622
+ title: n,
623
+ report: r,
624
+ description: i,
625
+ footer: l,
626
+ children: a.length === 0 ? /* @__PURE__ */ h("p", {
627
+ ...p.props(w.empty),
628
+ children: b
629
+ }) : /* @__PURE__ */ g("div", {
630
+ ...p.props(w.values),
631
+ children: [a.map((n) => {
632
+ let r = n.value === null ? "Unavailable" : m(n.value), i = n.rank === void 0 ? n.label : `${n.rank} · ${n.label}`, a = n.tone ?? "series1", o = e[a];
633
+ return /* @__PURE__ */ h(s, {
634
+ label: `${i}, ${l}: ${r}`,
635
+ isSelected: y?.selectedId === n.id,
636
+ onSelect: y === void 0 ? void 0 : () => y.onSelect(n.id),
637
+ children: /* @__PURE__ */ g("span", {
638
+ ...p.props(w.row),
639
+ children: [/* @__PURE__ */ g("span", {
640
+ ...p.props(w.rowLabel),
641
+ children: [/* @__PURE__ */ h("span", { children: i }), /* @__PURE__ */ h("span", {
642
+ ...p.props(w.rowValue),
643
+ children: r
638
644
  })]
639
- }), /* @__PURE__ */ h("svg", {
645
+ }), /* @__PURE__ */ g("svg", {
640
646
  "aria-hidden": !0,
641
- viewBox: `0 0 ${b} 28`,
647
+ viewBox: `0 0 ${S} 28`,
642
648
  preserveAspectRatio: "none",
643
- ...f.props(C.rowSvg),
644
- children: [/* @__PURE__ */ m("line", {
645
- x1: w,
646
- x2: w,
647
- y1: 3,
648
- y2: 25,
649
- ...f.props(C.baseline)
650
- }), t.value !== null && (t.value === 0 ? /* @__PURE__ */ m("line", {
651
- x1: w,
652
- x2: w,
653
- y1: 10,
654
- y2: 18,
655
- stroke: i,
656
- strokeWidth: 2,
657
- vectorEffect: "non-scaling-stroke"
658
- }) : /* @__PURE__ */ m(_, {
659
- x: Math.min(w, S(t.value)),
660
- y: 10,
661
- width: Math.abs(S(t.value) - w),
662
- height: 8,
663
- fill: i
664
- }))]
649
+ ...p.props(w.rowSvg),
650
+ children: [
651
+ /* @__PURE__ */ h("rect", {
652
+ x: 0,
653
+ y: 10,
654
+ width: S,
655
+ height: 8,
656
+ ...p.props(w.track)
657
+ }),
658
+ /* @__PURE__ */ h("line", {
659
+ x1: D,
660
+ x2: D,
661
+ y1: 3,
662
+ y2: 25,
663
+ ...p.props(w.baseline)
664
+ }),
665
+ n.value !== null && (n.value === 0 ? /* @__PURE__ */ h("line", {
666
+ x1: D,
667
+ x2: D,
668
+ y1: 10,
669
+ y2: 18,
670
+ stroke: o,
671
+ strokeWidth: 2,
672
+ vectorEffect: "non-scaling-stroke"
673
+ }) : /* @__PURE__ */ h(v, {
674
+ x: Math.min(D, T(n.value)),
675
+ y: 10,
676
+ width: Math.abs(T(n.value) - D),
677
+ height: 8,
678
+ fill: o,
679
+ stroke: t[a],
680
+ ...p.props(d.outlined)
681
+ }))
682
+ ]
665
683
  })]
666
684
  })
667
- }, t.id);
668
- }), /* @__PURE__ */ h("div", {
669
- ...f.props(C.row, C.rowAxis),
670
- children: [/* @__PURE__ */ m("span", { ...f.props(C.axisSpacer) }), /* @__PURE__ */ m("div", {
671
- ref: y,
672
- children: /* @__PURE__ */ m(T, {
673
- domain: s,
674
- formatValue: u
685
+ }, n.id);
686
+ }), /* @__PURE__ */ g("div", {
687
+ ...p.props(w.row, w.rowAxis),
688
+ children: [/* @__PURE__ */ h("span", { ...p.props(w.axisSpacer) }), /* @__PURE__ */ h("div", {
689
+ ref: x,
690
+ children: /* @__PURE__ */ h(E, {
691
+ domain: c,
692
+ formatValue: m
675
693
  })
676
694
  })]
677
695
  })]
678
696
  })
679
697
  });
680
698
  }
681
- function N({ items: e, domain: t }) {
682
- let n = y({
699
+ function P({ items: e, domain: t }) {
700
+ let n = b({
683
701
  items: e,
684
702
  domain: t,
685
- maxEntries: v.rows
703
+ maxEntries: y.rows
686
704
  });
687
705
  if (n !== void 0) return n;
688
706
  if (t[0] > 0 || t[1] < 0) return "The ranked-value domain must include zero.";
689
- for (let n of e) if (n.value !== null && b(n.value, t)) return `Ranked value ${n.id} is non-finite or lies outside the declared domain.`;
707
+ for (let n of e) if (n.value !== null && x(n.value, t)) return `Ranked value ${n.id} is non-finite or lies outside the declared domain.`;
690
708
  }
691
- export { E as ECDF, O as Histogram, A as IntervalPlot, M as RankedBars };
709
+ export { D as ECDF, k as Histogram, j as IntervalPlot, N as RankedBars };