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