@mechane-ai/elements 0.45.0 → 0.46.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 (110) hide show
  1. package/README.md +48 -18
  2. package/bin/mechane-elements-catalog.mjs +42 -4
  3. package/dist/ai.js +268 -202
  4. package/dist/catalog.json +91 -31
  5. package/dist/categorical-values-BXi-rJuv.js +74 -0
  6. package/dist/chart-cursor-1mFd48Jc.js +23 -0
  7. package/dist/chart-data-CIJVWCYt.js +21 -0
  8. package/dist/{chart-frame-Ztktqs1b.js → chart-frame-BaxKn_MB.js} +22 -41
  9. package/dist/{chart-input-BO3BqlFO.js → chart-input-Bm82_9Rd.js} +2 -2
  10. package/dist/chart-theme-4zprJ3rW.js +404 -0
  11. package/dist/charts/cartesian.js +1598 -1432
  12. package/dist/charts/distribution.js +476 -404
  13. package/dist/charts/graph.js +363 -349
  14. package/dist/charts/hierarchy.js +103 -94
  15. package/dist/charts/matrix.js +340 -333
  16. package/dist/charts/timeline.js +167 -134
  17. package/dist/charts.js +3 -3
  18. package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
  19. package/dist/collections.js +1648 -1188
  20. package/dist/content/code.js +1 -1
  21. package/dist/content/diff.js +67 -66
  22. package/dist/content/link.js +1 -1
  23. package/dist/content/markdown.js +2 -2
  24. package/dist/content/tree.js +2 -2
  25. package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
  26. package/dist/content.js +1 -1
  27. package/dist/csp.js +6 -11
  28. package/dist/feedback.js +1 -1
  29. package/dist/forms/dates.js +274 -214
  30. package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
  31. package/dist/forms.js +3 -3
  32. package/dist/index.js +1 -1
  33. package/dist/layout.js +207 -207
  34. package/dist/navigation.js +4 -3
  35. package/dist/packages/ai/src/conversation.d.ts +2 -0
  36. package/dist/packages/ai/src/prompt-input.d.ts +7 -2
  37. package/dist/packages/charts/src/cartesian/composition-bars.d.ts +2 -2
  38. package/dist/packages/charts/src/cartesian/index.d.ts +3 -2
  39. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +8 -2
  40. package/dist/packages/charts/src/cartesian/time-series.d.ts +11 -1
  41. package/dist/packages/charts/src/categorical-values.d.ts +14 -9
  42. package/dist/packages/charts/src/chart-frame.d.ts +7 -9
  43. package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
  44. package/dist/packages/charts/src/chart-range.d.ts +33 -0
  45. package/dist/packages/charts/src/chart-rows.d.ts +20 -0
  46. package/dist/packages/charts/src/chart-theme.d.ts +17 -0
  47. package/dist/packages/charts/src/chart.d.ts +81 -0
  48. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +4 -4
  49. package/dist/packages/charts/src/index.d.ts +1 -0
  50. package/dist/packages/charts/src/matrix/matrix-strip.d.ts +3 -3
  51. package/dist/packages/charts/src/plot-width.d.ts +0 -1
  52. package/dist/packages/charts/src/timeline/index.d.ts +1 -1
  53. package/dist/packages/charts/src/timeline/waterfall.d.ts +6 -2
  54. package/dist/packages/collections/src/collection-controls.d.ts +5 -1
  55. package/dist/packages/collections/src/collection-filters.d.ts +4 -1
  56. package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
  57. package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
  58. package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
  59. package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
  60. package/dist/packages/collections/src/data-table-text.d.ts +13 -0
  61. package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
  62. package/dist/packages/collections/src/data-table.d.ts +3 -85
  63. package/dist/packages/collections/src/index.d.ts +11 -6
  64. package/dist/packages/collections/src/query-controls.d.ts +6 -2
  65. package/dist/packages/collections/src/table-results.d.ts +47 -13
  66. package/dist/packages/collections/src/timeline.d.ts +1 -0
  67. package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
  68. package/dist/packages/collections/src/use-table-window.d.ts +25 -0
  69. package/dist/packages/content/src/viewer.d.ts +8 -0
  70. package/dist/packages/core/src/disclosure.d.ts +9 -1
  71. package/dist/packages/core/src/index.d.ts +1 -0
  72. package/dist/packages/core/src/route-link.d.ts +11 -0
  73. package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
  74. package/dist/packages/forms/src/file-picker.d.ts +15 -0
  75. package/dist/packages/forms/src/form-controls.d.ts +1 -6
  76. package/dist/packages/forms/src/forms.d.ts +4 -1
  77. package/dist/packages/forms/src/index.d.ts +4 -2
  78. package/dist/packages/forms/src/selection.d.ts +14 -0
  79. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  80. package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
  81. package/dist/packages/navigation/src/index.d.ts +1 -1
  82. package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
  83. package/dist/plot-width-v2c_rA20.js +63 -0
  84. package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
  85. package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
  86. package/dist/src-CGc_hjxJ.js +409 -0
  87. package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
  88. package/dist/{src-Dcs3SZ9V.js → src-DVHlknB6.js} +1 -1
  89. package/dist/styles2.css +136 -114
  90. package/package.json +1 -4
  91. package/skills/extend-elements/SKILL.md +74 -0
  92. package/skills/review-elements/SKILL.md +76 -0
  93. package/skills/upgrade-elements/SKILL.md +34 -0
  94. package/skills/upgrade-elements/references/releases.md +58 -0
  95. package/skills/use-elements/SKILL.md +64 -13
  96. package/skills/use-elements/references/agent.md +57 -0
  97. package/skills/use-elements/references/charts.md +63 -0
  98. package/skills/use-elements/references/collections.md +89 -0
  99. package/skills/use-elements/references/conversations.md +47 -0
  100. package/skills/use-elements/references/forms.md +81 -0
  101. package/skills/use-elements/references/styling.md +70 -0
  102. package/skills/use-elements/references/workspace.md +3 -3
  103. package/dist/categorical-values-DZLGQVW1.js +0 -63
  104. package/dist/chart-navigation-BAbb5PV9.js +0 -154
  105. package/dist/header-styles-COxCYFZx.js +0 -90
  106. package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
  107. package/dist/packages/charts/src/chart-surface.d.ts +0 -27
  108. package/dist/packages/navigation/src/route-link.d.ts +0 -2
  109. package/dist/plot-width-CIqBiHcd.js +0 -105
  110. package/dist/src-Bk7M67zy.js +0 -396
@@ -1,32 +1,35 @@
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";
1
+ import { c as e, l as t } from "../src-DVHlknB6.js";
2
+ import { t as n } from "../chart-cursor-1mFd48Jc.js";
3
+ import { t as r } from "../chart-data-CIJVWCYt.js";
4
+ import { r as i, t as a } from "../chart-frame-BaxKn_MB.js";
5
+ import { n as o, r as s, t as c } from "../chart-input-Bm82_9Rd.js";
6
+ import { i as l, l as u, n as d, s as f, t as p } from "../chart-theme-4zprJ3rW.js";
7
+ import { n as m, r as h, t as g } from "../plot-width-v2c_rA20.js";
8
+ import * as _ from "@stylexjs/stylex";
9
+ import { useId as v } from "react";
10
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
11
+ import { scaleLinear as S } from "@visx/scale";
12
+ import { Bar as C } from "@visx/shape";
10
13
  // packages/charts/src/distribution/distribution-input.ts
11
- var y = {
14
+ var w = {
12
15
  bins: 200,
13
16
  cumulativePoints: 2e3,
14
17
  rows: 200
15
18
  };
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
+ function T({ items: e, domain: t, maxEntries: n }) {
20
+ if (!s(t)) return "The chart domain must contain two finite, increasing values.";
21
+ if (!o(e)) return "Chart records must have unique identifiers.";
19
22
  if (e.length > n) return `This chart supports at most ${n} records. Supply an explicit data window or aggregation.`;
20
23
  }
21
- function x(e, t) {
24
+ function E(e, t) {
22
25
  return !Number.isFinite(e) || e < t[0] || e > t[1];
23
26
  }
24
27
  // packages/charts/src/distribution/distribution-plot.tsx
25
- var S = { height: 160 }, C = [
28
+ var D = { height: 160 }, O = [
26
29
  0,
27
30
  .5,
28
31
  1
29
- ], w = {
32
+ ], k = {
30
33
  plot: {
31
34
  k7Eaqz: "xeuugli",
32
35
  k1xSpc: "xrvj5dj",
@@ -188,171 +191,179 @@ var S = { height: 160 }, C = [
188
191
  $$css: !0
189
192
  }
190
193
  };
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", {
194
+ function A({ label: e, readoutId: t, xDomain: n, yDomain: r, xLabel: i, yLabel: a, formatX: o, formatY: s, children: c }) {
195
+ let { ref: u, width: d } = g(), f = O.map((e) => n[0] + e * (n[1] - n[0])), p = O.map((e) => r[1] - e * (r[1] - r[0]));
196
+ return /* @__PURE__ */ x("div", {
194
197
  className: "xeuugli xrvj5dj x37z1gs x1hnptsi",
195
198
  children: [
196
- /* @__PURE__ */ g("div", {
199
+ /* @__PURE__ */ x("div", {
197
200
  className: "x1osaytk x78zum5 x1qughib x1n8ia3y",
198
- children: [/* @__PURE__ */ h("span", {
199
- className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
200
- children: o
201
- }), /* @__PURE__ */ h("span", {
201
+ children: [/* @__PURE__ */ b("span", {
202
202
  className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
203
203
  children: a
204
+ }), /* @__PURE__ */ b("span", {
205
+ className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
206
+ children: i
204
207
  })]
205
208
  }),
206
- /* @__PURE__ */ h("div", {
209
+ /* @__PURE__ */ b("div", {
207
210
  "aria-hidden": !0,
208
211
  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))
212
+ children: p.map((e) => /* @__PURE__ */ b("span", { children: s(e) }, e))
210
213
  }),
211
- /* @__PURE__ */ h(r, {
214
+ /* @__PURE__ */ b(l, {
212
215
  ref: u,
213
- ...e,
214
- className: "xeuugli",
215
- children: /* @__PURE__ */ g("svg", {
216
+ role: "group",
217
+ "aria-label": e,
218
+ "aria-describedby": t,
219
+ className: "xeuugli x-default-marker",
220
+ children: /* @__PURE__ */ x("svg", {
216
221
  "aria-hidden": !0,
217
- onPointerMove: (e) => {
218
- let r = e.currentTarget.getBoundingClientRect();
219
- t?.(n[0] + (e.clientX - r.left) / r.width * (n[1] - n[0]));
220
- },
221
- onPointerDown: (e) => {
222
- let r = e.currentTarget.getBoundingClientRect();
223
- t?.(n[0] + (e.clientX - r.left) / r.width * (n[1] - n[0]));
224
- },
225
- viewBox: `0 0 ${d} ${S.height}`,
222
+ viewBox: `0 0 ${d} ${D.height}`,
226
223
  preserveAspectRatio: "none",
227
224
  className: "x1lliihq xh8yej3 x1ymw6g xb3r6kr",
228
- children: [C.map((e) => /* @__PURE__ */ h("line", {
225
+ children: [O.map((e) => /* @__PURE__ */ b("line", {
229
226
  x1: 0,
230
227
  x2: d,
231
- y1: S.height * e,
232
- y2: S.height * e,
228
+ y1: D.height * e,
229
+ y2: D.height * e,
233
230
  className: "x13hfdr1 x13efnbd"
234
- }, e)), l(d)]
231
+ }, e)), c(d)]
235
232
  })
236
233
  }),
237
- /* @__PURE__ */ h("span", {}),
238
- /* @__PURE__ */ h("div", {
234
+ /* @__PURE__ */ b("span", {}),
235
+ /* @__PURE__ */ b("div", {
239
236
  "aria-hidden": !0,
240
237
  className: "x78zum5 x1qughib x1hnptsi xbixft xiard35 xy8obcc xas2l8k xss6m8b",
241
- children: p.map((e, t) => /* @__PURE__ */ h("span", {
238
+ children: f.map((e, t) => /* @__PURE__ */ b("span", {
242
239
  ...{
243
240
  0: { className: "x1cqoux5 xeuugli xj0a0fe" },
244
241
  2: { className: "x1cqoux5 xeuugli xj0a0fe x2b8uid" },
245
242
  1: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" },
246
243
  3: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" }
247
244
  }[(t === 1) << 1 | t === 2],
248
- children: s(e)
245
+ children: o(e)
249
246
  }, e))
250
247
  })
251
248
  ]
252
249
  });
253
250
  }
254
- function E({ domain: e, formatValue: t }) {
255
- return /* @__PURE__ */ g("div", {
251
+ function j({ domain: e, formatValue: t }) {
252
+ return /* @__PURE__ */ x("div", {
256
253
  className: "x78zum5 x1qughib x1hnptsi xbixft xiard35 xy8obcc xas2l8k xss6m8b",
257
- children: [/* @__PURE__ */ h("span", {
254
+ children: [/* @__PURE__ */ b("span", {
258
255
  className: "x1cqoux5 xeuugli xj0a0fe",
259
256
  children: t(e[0])
260
- }), /* @__PURE__ */ h("span", {
257
+ }), /* @__PURE__ */ b("span", {
261
258
  className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
262
259
  children: t(e[1])
263
260
  })]
264
261
  });
265
262
  }
266
263
  // packages/charts/src/distribution/ecdf.tsx
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." }) {
268
- let E = c.map((e) => ({
264
+ var M = 6, N = 12;
265
+ function P({ title: t, report: o, description: s, points: l, domain: p, valueLabel: m, probabilityLabel: h, formatValue: g, formatProbability: C, tone: w = "series1", selection: T, emptyLabel: E = "No cumulative distribution points are available." }) {
266
+ let O = l.map((e) => ({
269
267
  id: e.id,
270
- label: `${d}: ${v(e.value)}, ${f}: ${e.probability === null ? "Unavailable" : y(e.probability)}`
271
- })), D = i({
272
- title: t,
273
- items: E,
274
- selection: x
275
- }), k = O({
276
- points: c,
277
- domain: l
268
+ label: `${m}: ${g(e.value)}, ${h}: ${e.probability === null ? "Unavailable" : C(e.probability)}`
269
+ })), j = v(), P = F({
270
+ points: l,
271
+ domain: p
278
272
  });
279
- if (k !== void 0) return /* @__PURE__ */ h(u, {
273
+ if (P !== void 0) return /* @__PURE__ */ b(c, {
280
274
  title: t,
281
- report: r,
275
+ report: o,
282
276
  description: s,
283
- message: k
277
+ message: P
284
278
  });
285
- let A = _({
279
+ let I = S({
286
280
  domain: [0, 1],
287
- range: [S.height, 0]
281
+ range: [D.height, 0]
288
282
  });
289
- return /* @__PURE__ */ h(o, {
290
- title: t,
291
- report: r,
292
- description: s,
293
- footer: /* @__PURE__ */ h(a, {
294
- id: D.id,
295
- children: D.label ?? "\xA0"
296
- }),
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,
302
- onInspectValue: (e) => {
303
- let t = { point: c[0] };
304
- for (let n of c) (t.point === void 0 || Math.abs(n.value - e) < Math.abs(t.point.value - e)) && (t.point = n);
305
- let n = t.point;
306
- n !== void 0 && D.inspect(n.id);
307
- },
308
- xDomain: l,
309
- yDomain: [0, 1],
310
- xLabel: d,
311
- yLabel: f,
312
- formatX: v,
313
- formatY: y,
314
- children: (t) => {
315
- let n = _({
316
- domain: [...l],
317
- range: [0, t]
318
- }), r = c.map((e, t) => {
319
- if (e.probability === null) return "";
320
- let r = n(e.value), i = A(e.probability), a = c[t - 1];
321
- return a === void 0 || a.probability === null ? `M ${r} ${i}` : `H ${r} V ${i}`;
322
- }).join(" ");
323
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("path", {
324
- d: r,
325
- fill: "none",
326
- stroke: e[b],
327
- strokeWidth: 2,
328
- vectorEffect: "non-scaling-stroke"
329
- }), c.map((t) => t.probability === null ? null : /* @__PURE__ */ h("circle", {
330
- onPointerEnter: () => D.inspect(t.id),
331
- onClick: () => x?.onSelect(t.id),
332
- cx: n(t.value),
333
- cy: A(t.probability),
334
- r: x?.selectedId === t.id || D.label !== void 0 && D.activeId === t.id ? 4 : 2,
335
- fill: e[b]
336
- }, t.id))] });
337
- }
338
- }), /* @__PURE__ */ h(n, {
339
- label: `${t} observations`,
340
- columns: [{
341
- id: "observation",
342
- label: "Observation"
343
- }],
344
- rows: E.map((e) => ({
345
- id: e.id,
346
- values: [e.label]
347
- }))
348
- })] })
283
+ return /* @__PURE__ */ b(d, {
284
+ items: O,
285
+ arrows: "both",
286
+ locate: (e) => {
287
+ let t = p[0] + e.x / e.width * (p[1] - p[0]), n = { point: l[0] };
288
+ for (let e of l) (n.point === void 0 || Math.abs(e.value - t) < Math.abs(n.point.value - t)) && (n.point = e);
289
+ return n.point?.id;
290
+ },
291
+ selected: T?.selectedId ?? null,
292
+ onSelect: T?.onSelect,
293
+ render: (c, { inspected: d, cursor: v }) => /* @__PURE__ */ b(a, {
294
+ figure: c,
295
+ title: t,
296
+ report: o,
297
+ description: s,
298
+ footer: /* @__PURE__ */ b(i, {
299
+ id: j,
300
+ children: f(O, d)
301
+ }),
302
+ children: l.length === 0 ? /* @__PURE__ */ b("p", {
303
+ ..._.props(k.empty),
304
+ children: E
305
+ }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(A, {
306
+ label: u({
307
+ title: t,
308
+ isSelectable: T !== void 0
309
+ }),
310
+ readoutId: j,
311
+ xDomain: p,
312
+ yDomain: [0, 1],
313
+ xLabel: m,
314
+ yLabel: h,
315
+ formatX: g,
316
+ formatY: C,
317
+ children: (t) => {
318
+ let r = S({
319
+ domain: [...p],
320
+ range: [0, t]
321
+ }), i = l.map((e, t) => {
322
+ if (e.probability === null) return "";
323
+ let n = r(e.value), i = I(e.probability), a = l[t - 1];
324
+ return a === void 0 || a.probability === null ? `M ${n} ${i}` : `H ${n} V ${i}`;
325
+ }).join(" "), a = l.find((e) => e.id === v);
326
+ return /* @__PURE__ */ x(y, { children: [
327
+ /* @__PURE__ */ b("path", {
328
+ d: i,
329
+ fill: "none",
330
+ stroke: e[w],
331
+ strokeWidth: 2,
332
+ vectorEffect: "non-scaling-stroke"
333
+ }),
334
+ l.map((t) => t.probability === null ? null : /* @__PURE__ */ b("circle", {
335
+ cx: r(t.value),
336
+ cy: I(t.probability),
337
+ r: T?.selectedId === t.id || d === t.id ? 4 : 2,
338
+ fill: e[w]
339
+ }, t.id)),
340
+ a !== void 0 && /* @__PURE__ */ b(n, {
341
+ x: r(a.value),
342
+ top: 0,
343
+ bottom: D.height - M,
344
+ width: N
345
+ })
346
+ ] });
347
+ }
348
+ }), /* @__PURE__ */ b(r, {
349
+ label: `${t} observations`,
350
+ columns: [{
351
+ id: "observation",
352
+ label: "Observation"
353
+ }],
354
+ rows: O.map((e) => ({
355
+ id: e.id,
356
+ values: [e.label]
357
+ }))
358
+ })] })
359
+ })
349
360
  });
350
361
  }
351
- function O({ points: e, domain: t }) {
352
- let n = b({
362
+ function F({ points: e, domain: t }) {
363
+ let n = T({
353
364
  items: e,
354
365
  domain: t,
355
- maxEntries: y.cumulativePoints
366
+ maxEntries: w.cumulativePoints
356
367
  });
357
368
  if (n !== void 0) return n;
358
369
  let r = {
@@ -360,7 +371,7 @@ function O({ points: e, domain: t }) {
360
371
  probability: 0
361
372
  };
362
373
  for (let n of e) {
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.`;
374
+ if (E(n.value, t) || n.value < r.value) return `Cumulative point ${n.id} is non-finite, outside the domain, or out of order.`;
364
375
  if (n.probability !== null) {
365
376
  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.`;
366
377
  r.probability = n.probability;
@@ -369,224 +380,259 @@ function O({ points: e, domain: t }) {
369
380
  }
370
381
  }
371
382
  // packages/charts/src/distribution/histogram.tsx
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) => ({
383
+ var I = 6;
384
+ function L({ title: o, report: s, description: l, bins: m, domain: h, maximumCount: g, valueLabel: C, countLabel: w, formatValue: T, formatCount: E, tone: O = "series1", selection: j, emptyLabel: M = "No histogram bins are available." }) {
385
+ let N = m.map((e) => ({
374
386
  id: e.id,
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
387
+ label: `${e.label}, ${T(e.lowerBound)} – ${T(e.upperBound)}, ${w}: ${e.count === null ? "Unavailable" : E(e.count)}`
388
+ })), P = v(), F = R({
389
+ bins: m,
390
+ domain: h,
391
+ maximumCount: g
384
392
  });
385
- if (N !== void 0) return /* @__PURE__ */ h(u, {
386
- title: r,
393
+ if (F !== void 0) return /* @__PURE__ */ b(c, {
394
+ title: o,
387
395
  report: s,
388
- description: c,
389
- message: N
396
+ description: l,
397
+ message: F
390
398
  });
391
- let P = _({
392
- domain: [0, y],
393
- range: [S.height, 0]
399
+ let L = S({
400
+ domain: [0, g],
401
+ range: [D.height, 0]
394
402
  });
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"
402
- }),
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,
408
- onInspectValue: (e) => {
409
- let t = l.find((t) => e >= t.lowerBound && e <= t.upperBound);
410
- t !== void 0 && M.inspect(t.id);
411
- },
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]
422
- });
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,
431
- height: 5,
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);
447
- });
448
- }
449
- }), /* @__PURE__ */ h(n, {
450
- label: `${r} observations`,
451
- columns: [{
452
- id: "observation",
453
- label: "Observation"
454
- }],
455
- rows: j.map((e) => ({
456
- id: e.id,
457
- values: [e.label]
458
- }))
459
- })] })
403
+ return /* @__PURE__ */ b(d, {
404
+ items: N,
405
+ arrows: "both",
406
+ locate: (e) => {
407
+ let t = h[0] + e.x / e.width * (h[1] - h[0]);
408
+ return m.find((e) => t >= e.lowerBound && t <= e.upperBound)?.id;
409
+ },
410
+ selected: j?.selectedId ?? null,
411
+ onSelect: j?.onSelect,
412
+ render: (c, { inspected: d, cursor: v }) => /* @__PURE__ */ b(a, {
413
+ figure: c,
414
+ title: o,
415
+ report: s,
416
+ description: l,
417
+ footer: /* @__PURE__ */ b(i, {
418
+ id: P,
419
+ children: f(N, d)
420
+ }),
421
+ children: m.length === 0 ? /* @__PURE__ */ b("p", {
422
+ ..._.props(k.empty),
423
+ children: M
424
+ }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(A, {
425
+ label: u({
426
+ title: o,
427
+ isSelectable: j !== void 0
428
+ }),
429
+ readoutId: P,
430
+ xDomain: h,
431
+ yDomain: [0, g],
432
+ xLabel: C,
433
+ yLabel: w,
434
+ formatX: T,
435
+ formatY: E,
436
+ children: (r) => {
437
+ let i = S({
438
+ domain: [...h],
439
+ range: [0, r]
440
+ }), a = m.map((n) => {
441
+ let r = i(n.lowerBound), a = i(n.upperBound) - r, o = Math.min(2, a * .2), s = j?.selectedId === n.id || d === n.id;
442
+ if (n.count === null) return /* @__PURE__ */ b("rect", {
443
+ x: r + o / 2,
444
+ y: D.height - 6,
445
+ width: a - o,
446
+ height: 5,
447
+ ..._.props(k.missing)
448
+ }, n.id);
449
+ let c = L(n.count);
450
+ return /* @__PURE__ */ b("rect", {
451
+ x: r + o / 2,
452
+ y: c,
453
+ width: a - o,
454
+ height: D.height - c,
455
+ fill: e[O],
456
+ stroke: t[O],
457
+ ..._.props(p.outlined, s && p.selected),
458
+ opacity: j?.selectedId === void 0 || s ? 1 : .45
459
+ }, n.id);
460
+ }), o = m.find((e) => e.id === v);
461
+ return /* @__PURE__ */ x(y, { children: [a, o !== void 0 && /* @__PURE__ */ b(n, {
462
+ x: (i(o.lowerBound) + i(o.upperBound)) / 2,
463
+ top: 0,
464
+ bottom: D.height - I,
465
+ width: i(o.upperBound) - i(o.lowerBound)
466
+ })] });
467
+ }
468
+ }), /* @__PURE__ */ b(r, {
469
+ label: `${o} observations`,
470
+ columns: [{
471
+ id: "observation",
472
+ label: "Observation"
473
+ }],
474
+ rows: N.map((e) => ({
475
+ id: e.id,
476
+ values: [e.label]
477
+ }))
478
+ })] })
479
+ })
460
480
  });
461
481
  }
462
- function A({ bins: e, domain: t, maximumCount: n }) {
463
- let r = b({
482
+ function R({ bins: e, domain: t, maximumCount: n }) {
483
+ let r = T({
464
484
  items: e,
465
485
  domain: t,
466
- maxEntries: y.bins
486
+ maxEntries: w.bins
467
487
  });
468
488
  if (r !== void 0) return r;
469
489
  if (!Number.isFinite(n) || n <= 0) return "The histogram count domain must have a finite maximum greater than zero.";
470
490
  for (let [r, i] of e.entries()) {
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.`;
491
+ if (E(i.lowerBound, t) || E(i.upperBound, t)) return `Histogram bin ${i.id} has a non-finite bound or lies outside the declared domain.`;
472
492
  let a = e[r - 1];
473
493
  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.`;
474
494
  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.`;
475
495
  }
476
496
  }
477
497
  // packages/charts/src/distribution/interval-plot.tsx
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({
498
+ function z({ title: t, report: n, description: r, items: i, domain: o, valueLabel: s, intervalLabel: l, formatValue: u, selection: f, emptyLabel: p = "No interval estimates are available." }) {
499
+ let { ref: v, width: y } = g(), C = B({
480
500
  items: i,
481
- domain: a
501
+ domain: o
482
502
  });
483
- if (x !== void 0) return /* @__PURE__ */ h(u, {
503
+ if (C !== void 0) return /* @__PURE__ */ b(c, {
484
504
  title: t,
485
505
  report: n,
486
506
  description: r,
487
- message: x
488
- });
489
- let S = _({
490
- domain: [...a],
491
- range: [0, b]
507
+ message: C
492
508
  });
493
- return /* @__PURE__ */ h(o, {
494
- title: t,
495
- report: n,
496
- description: r,
497
- footer: `${c} · ${l}`,
498
- children: i.length === 0 ? /* @__PURE__ */ h("p", {
499
- ...p.props(w.empty),
500
- children: v
501
- }) : /* @__PURE__ */ g("div", {
502
- ...p.props(w.values),
503
- children: [i.map((t) => {
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, {
506
- label: `${t.label}, ${c}: ${n}, ${r}`,
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),
513
- children: [
514
- /* @__PURE__ */ h("span", { children: t.label }),
515
- /* @__PURE__ */ h("span", {
516
- ...p.props(w.rowValue),
517
- children: n
518
- }),
519
- /* @__PURE__ */ h("span", {
520
- ...p.props(w.label),
521
- children: r
509
+ let w = S({
510
+ domain: [...o],
511
+ range: [0, y]
512
+ }), T = i.map((e) => {
513
+ let t = e.estimate === null ? "Estimate unavailable" : u(e.estimate), n = `${l}: ${e.lower === null ? "Unavailable" : u(e.lower)} – ${e.upper === null ? "Unavailable" : u(e.upper)}`;
514
+ return {
515
+ item: e,
516
+ estimate: t,
517
+ interval: n,
518
+ readout: `${e.label}, ${s}: ${t}, ${n}`
519
+ };
520
+ }), E = T.map((e) => ({
521
+ id: e.item.id,
522
+ label: e.readout
523
+ }));
524
+ return /* @__PURE__ */ b(d, {
525
+ items: E,
526
+ arrows: "both",
527
+ selected: f?.selectedId ?? null,
528
+ onSelect: f?.onSelect,
529
+ render: (c, d) => {
530
+ let g = f === void 0 ? void 0 : d;
531
+ return /* @__PURE__ */ b(a, {
532
+ figure: c,
533
+ title: t,
534
+ report: n,
535
+ description: r,
536
+ footer: `${s} · ${l}`,
537
+ children: i.length === 0 ? /* @__PURE__ */ b("p", {
538
+ ..._.props(k.empty),
539
+ children: p
540
+ }) : /* @__PURE__ */ b(h, {
541
+ title: t,
542
+ items: E,
543
+ view: g,
544
+ children: /* @__PURE__ */ x("div", {
545
+ ..._.props(k.values),
546
+ children: [T.map(({ item: t, estimate: n, interval: r, readout: i }) => {
547
+ let a = e[t.tone ?? "series1"];
548
+ return /* @__PURE__ */ b(m, {
549
+ id: t.id,
550
+ label: i,
551
+ view: g,
552
+ children: /* @__PURE__ */ x("span", {
553
+ ..._.props(k.row),
554
+ children: [/* @__PURE__ */ x("span", {
555
+ ..._.props(k.rowLabel),
556
+ children: [
557
+ /* @__PURE__ */ b("span", { children: t.label }),
558
+ /* @__PURE__ */ b("span", {
559
+ ..._.props(k.rowValue),
560
+ children: n
561
+ }),
562
+ /* @__PURE__ */ b("span", {
563
+ ..._.props(k.label),
564
+ children: r
565
+ })
566
+ ]
567
+ }), /* @__PURE__ */ x("svg", {
568
+ "aria-hidden": !0,
569
+ viewBox: `0 0 ${y} 28`,
570
+ preserveAspectRatio: "none",
571
+ ..._.props(k.rowSvg),
572
+ children: [
573
+ /* @__PURE__ */ b("line", {
574
+ x1: 0,
575
+ x2: y,
576
+ y1: 14,
577
+ y2: 14,
578
+ ..._.props(k.baseline)
579
+ }),
580
+ t.lower !== null && t.upper !== null && /* @__PURE__ */ x("g", {
581
+ stroke: a,
582
+ strokeWidth: 2,
583
+ vectorEffect: "non-scaling-stroke",
584
+ children: [
585
+ /* @__PURE__ */ b("line", {
586
+ x1: w(t.lower),
587
+ x2: w(t.upper),
588
+ y1: 14,
589
+ y2: 14
590
+ }),
591
+ /* @__PURE__ */ b("line", {
592
+ x1: w(t.lower),
593
+ x2: w(t.lower),
594
+ y1: 9,
595
+ y2: 19
596
+ }),
597
+ /* @__PURE__ */ b("line", {
598
+ x1: w(t.upper),
599
+ x2: w(t.upper),
600
+ y1: 9,
601
+ y2: 19
602
+ })
603
+ ]
604
+ }),
605
+ t.estimate !== null && /* @__PURE__ */ b("circle", {
606
+ cx: w(t.estimate),
607
+ cy: 14,
608
+ r: 4,
609
+ fill: a
610
+ })
611
+ ]
612
+ })]
522
613
  })
523
- ]
524
- }), /* @__PURE__ */ g("svg", {
525
- "aria-hidden": !0,
526
- viewBox: `0 0 ${b} 28`,
527
- preserveAspectRatio: "none",
528
- ...p.props(w.rowSvg),
529
- children: [
530
- /* @__PURE__ */ h("line", {
531
- x1: 0,
532
- x2: b,
533
- y1: 14,
534
- y2: 14,
535
- ...p.props(w.baseline)
536
- }),
537
- t.lower !== null && t.upper !== null && /* @__PURE__ */ g("g", {
538
- stroke: i,
539
- strokeWidth: 2,
540
- vectorEffect: "non-scaling-stroke",
541
- children: [
542
- /* @__PURE__ */ h("line", {
543
- x1: S(t.lower),
544
- x2: S(t.upper),
545
- y1: 14,
546
- y2: 14
547
- }),
548
- /* @__PURE__ */ h("line", {
549
- x1: S(t.lower),
550
- x2: S(t.lower),
551
- y1: 9,
552
- y2: 19
553
- }),
554
- /* @__PURE__ */ h("line", {
555
- x1: S(t.upper),
556
- x2: S(t.upper),
557
- y1: 9,
558
- y2: 19
559
- })
560
- ]
561
- }),
562
- t.estimate !== null && /* @__PURE__ */ h("circle", {
563
- cx: S(t.estimate),
564
- cy: 14,
565
- r: 4,
566
- fill: i
614
+ }, t.id);
615
+ }), /* @__PURE__ */ x("div", {
616
+ ..._.props(k.row, k.rowAxis),
617
+ children: [/* @__PURE__ */ b("span", { ..._.props(k.axisSpacer) }), /* @__PURE__ */ b("div", {
618
+ ref: v,
619
+ children: /* @__PURE__ */ b(j, {
620
+ domain: o,
621
+ formatValue: u
567
622
  })
568
- ]
623
+ })]
569
624
  })]
570
625
  })
571
- }, t.id);
572
- }), /* @__PURE__ */ g("div", {
573
- ...p.props(w.row, w.rowAxis),
574
- children: [/* @__PURE__ */ h("span", { ...p.props(w.axisSpacer) }), /* @__PURE__ */ h("div", {
575
- ref: y,
576
- children: /* @__PURE__ */ h(E, {
577
- domain: a,
578
- formatValue: d
579
- })
580
- })]
581
- })]
582
- })
626
+ })
627
+ });
628
+ }
583
629
  });
584
630
  }
585
- function M({ items: e, domain: t }) {
586
- let n = b({
631
+ function B({ items: e, domain: t }) {
632
+ let n = T({
587
633
  items: e,
588
634
  domain: t,
589
- maxEntries: y.rows
635
+ maxEntries: w.rows
590
636
  });
591
637
  if (n !== void 0) return n;
592
638
  for (let n of e) {
@@ -594,7 +640,7 @@ function M({ items: e, domain: t }) {
594
640
  n.lower,
595
641
  n.estimate,
596
642
  n.upper
597
- ].some((e) => e !== null && x(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
643
+ ].some((e) => e !== null && E(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
598
644
  if (n.lower !== null && n.upper !== null && n.lower > n.upper) return `Interval ${n.id} has reversed endpoints.`;
599
645
  if (n.estimate !== null) {
600
646
  if (n.lower !== null && n.estimate < n.lower) return `Interval ${n.id} has an estimate below its lower endpoint.`;
@@ -603,107 +649,133 @@ function M({ items: e, domain: t }) {
603
649
  }
604
650
  }
605
651
  // packages/charts/src/distribution/ranked-bars.tsx
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
652
+ function V({ title: n, report: r, description: i, items: o, domain: s, valueLabel: l, formatValue: u, selection: f, emptyLabel: v = "No ranked values are available." }) {
653
+ let { ref: y, width: w } = g(), T = H({
654
+ items: o,
655
+ domain: s
610
656
  });
611
- if (C !== void 0) return /* @__PURE__ */ h(u, {
657
+ if (T !== void 0) return /* @__PURE__ */ b(c, {
612
658
  title: n,
613
659
  report: r,
614
660
  description: i,
615
- message: C
661
+ message: T
616
662
  });
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
663
+ let E = S({
664
+ domain: [...s],
665
+ range: [0, w]
666
+ }), D = E(0), O = o.map((e) => {
667
+ let t = e.value === null ? "Unavailable" : u(e.value), n = e.rank === void 0 ? e.label : `${e.rank} · ${e.label}`;
668
+ return {
669
+ item: e,
670
+ value: t,
671
+ label: n,
672
+ readout: `${n}, ${l}: ${t}`
673
+ };
674
+ }), A = O.map((e) => ({
675
+ id: e.item.id,
676
+ label: e.readout
677
+ }));
678
+ return /* @__PURE__ */ b(d, {
679
+ items: A,
680
+ arrows: "both",
681
+ selected: f?.selectedId ?? null,
682
+ onSelect: f?.onSelect,
683
+ render: (c, d) => {
684
+ let g = f === void 0 ? void 0 : d;
685
+ return /* @__PURE__ */ b(a, {
686
+ figure: c,
687
+ title: n,
688
+ report: r,
689
+ description: i,
690
+ footer: l,
691
+ children: o.length === 0 ? /* @__PURE__ */ b("p", {
692
+ ..._.props(k.empty),
693
+ children: v
694
+ }) : /* @__PURE__ */ b(h, {
695
+ title: n,
696
+ items: A,
697
+ view: g,
698
+ children: /* @__PURE__ */ x("div", {
699
+ ..._.props(k.values),
700
+ children: [O.map(({ item: n, value: r, label: i, readout: a }) => {
701
+ let o = n.tone ?? "series1", s = e[o];
702
+ return /* @__PURE__ */ b(m, {
703
+ id: n.id,
704
+ label: a,
705
+ view: g,
706
+ children: /* @__PURE__ */ x("span", {
707
+ ..._.props(k.row),
708
+ children: [/* @__PURE__ */ x("span", {
709
+ ..._.props(k.rowLabel),
710
+ children: [/* @__PURE__ */ b("span", { children: i }), /* @__PURE__ */ b("span", {
711
+ ..._.props(k.rowValue),
712
+ children: r
713
+ })]
714
+ }), /* @__PURE__ */ x("svg", {
715
+ "aria-hidden": !0,
716
+ viewBox: `0 0 ${w} 28`,
717
+ preserveAspectRatio: "none",
718
+ ..._.props(k.rowSvg),
719
+ children: [
720
+ /* @__PURE__ */ b("rect", {
721
+ x: 0,
722
+ y: 10,
723
+ width: w,
724
+ height: 8,
725
+ ..._.props(k.track)
726
+ }),
727
+ /* @__PURE__ */ b("line", {
728
+ x1: D,
729
+ x2: D,
730
+ y1: 3,
731
+ y2: 25,
732
+ ..._.props(k.baseline)
733
+ }),
734
+ n.value !== null && (n.value === 0 ? /* @__PURE__ */ b("line", {
735
+ x1: D,
736
+ x2: D,
737
+ y1: 10,
738
+ y2: 18,
739
+ stroke: s,
740
+ strokeWidth: 2,
741
+ vectorEffect: "non-scaling-stroke"
742
+ }) : /* @__PURE__ */ b(C, {
743
+ x: Math.min(D, E(n.value)),
744
+ y: 10,
745
+ width: Math.abs(E(n.value) - D),
746
+ height: 8,
747
+ fill: s,
748
+ stroke: t[o],
749
+ ..._.props(p.outlined)
750
+ }))
751
+ ]
752
+ })]
753
+ })
754
+ }, n.id);
755
+ }), /* @__PURE__ */ x("div", {
756
+ ..._.props(k.row, k.rowAxis),
757
+ children: [/* @__PURE__ */ b("span", { ..._.props(k.axisSpacer) }), /* @__PURE__ */ b("div", {
758
+ ref: y,
759
+ children: /* @__PURE__ */ b(j, {
760
+ domain: s,
761
+ formatValue: u
762
+ })
644
763
  })]
645
- }), /* @__PURE__ */ g("svg", {
646
- "aria-hidden": !0,
647
- viewBox: `0 0 ${S} 28`,
648
- preserveAspectRatio: "none",
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
- ]
683
764
  })]
684
765
  })
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
693
- })
694
- })]
695
- })]
696
- })
766
+ })
767
+ });
768
+ }
697
769
  });
698
770
  }
699
- function P({ items: e, domain: t }) {
700
- let n = b({
771
+ function H({ items: e, domain: t }) {
772
+ let n = T({
701
773
  items: e,
702
774
  domain: t,
703
- maxEntries: y.rows
775
+ maxEntries: w.rows
704
776
  });
705
777
  if (n !== void 0) return n;
706
778
  if (t[0] > 0 || t[1] < 0) return "The ranked-value domain must include zero.";
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.`;
779
+ for (let n of e) if (n.value !== null && E(n.value, t)) return `Ranked value ${n.id} is non-finite or lies outside the declared domain.`;
708
780
  }
709
- export { D as ECDF, k as Histogram, j as IntervalPlot, N as RankedBars };
781
+ export { P as ECDF, L as Histogram, z as IntervalPlot, V as RankedBars };