@mechane-ai/elements 0.9.0 → 0.10.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 (71) hide show
  1. package/NOTICE +24 -0
  2. package/README.md +7 -1
  3. package/dist/ai.js +129 -125
  4. package/dist/{categorical-values-DYRiw5Qd.js → categorical-values-DLRE4EEW.js} +4 -4
  5. package/dist/{chart-frame-RL1hCWBC.js → chart-frame-et6f6Vhg.js} +22 -14
  6. package/dist/{chart-input-Bm3ot1yD.js → chart-input-CdLkFomi.js} +2 -2
  7. package/dist/charts/cartesian.js +529 -450
  8. package/dist/charts/distribution.js +302 -261
  9. package/dist/charts/graph.js +137 -103
  10. package/dist/charts/hierarchy.js +7 -7
  11. package/dist/charts/matrix.js +187 -174
  12. package/dist/charts/timeline.js +118 -92
  13. package/dist/charts.js +1 -1
  14. package/dist/code-block-D77maJBB.js +180 -0
  15. package/dist/collections.js +280 -236
  16. package/dist/content/code.js +1 -1
  17. package/dist/content/diff.js +81 -63
  18. package/dist/content/link.js +1 -1
  19. package/dist/content/markdown.js +115 -96
  20. package/dist/content/tree.js +43 -38
  21. package/dist/{content-link-BrPrpBof.js → content-link-BpSZeTNK.js} +6 -2
  22. package/dist/content.js +172 -153
  23. package/dist/{assets/stylex.css → elements.css} +471 -185
  24. package/dist/feedback.js +1 -1
  25. package/dist/forms/dates.js +25 -25
  26. package/dist/forms.js +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/layout.js +239 -192
  29. package/dist/navigation/commands.js +45 -42
  30. package/dist/{navigation-yxK3iQXo.js → navigation-D2_sGy3C.js} +2 -2
  31. package/dist/navigation.js +10 -10
  32. package/dist/overlays.js +1 -1
  33. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +5 -0
  34. package/dist/packages/charts/src/cartesian/index.d.ts +2 -2
  35. package/dist/packages/charts/src/chart-frame.d.ts +3 -0
  36. package/dist/packages/charts/src/chart-theme.d.ts +2 -1
  37. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +22 -2
  38. package/dist/packages/collections/src/collection-scroll.d.ts +2 -1
  39. package/dist/packages/content/src/diff/pierre-diff.d.ts +2 -1
  40. package/dist/packages/content/src/viewer-styles.d.ts +64 -0
  41. package/dist/packages/core/src/index.d.ts +1 -1
  42. package/dist/packages/core/src/surfaces.d.ts +5 -0
  43. package/dist/packages/feedback/src/index.d.ts +4 -1
  44. package/dist/packages/feedback/src/toast.d.ts +5 -27
  45. package/dist/packages/forms/src/field-styles.d.ts +9 -0
  46. package/dist/packages/forms/src/selection-styles.d.ts +18 -2
  47. package/dist/packages/foundations/src/overlay-styles.d.ts +3 -1
  48. package/dist/packages/foundations/src/popup-styles.d.ts +7 -0
  49. package/dist/packages/foundations/src/tokens.stylex.d.ts +9 -0
  50. package/dist/packages/layout/src/frame.stylex.d.ts +1 -0
  51. package/dist/packages/layout/src/sidebar.d.ts +3 -1
  52. package/dist/packages/overlays/src/alert-dialog.d.ts +5 -2
  53. package/dist/packages/overlays/src/dialog.d.ts +7 -3
  54. package/dist/pierre-diff--zsiHCCB.js +71 -0
  55. package/dist/pierre-theme-D9hnHv3Z.js +126 -0
  56. package/dist/{pierre-tree-CRk09rx7.js → pierre-tree-BFxEuxwb.js} +3 -3
  57. package/dist/{src-Cc0Sadzr.js → src-Be7NLG8c.js} +238 -186
  58. package/dist/src-CBspCKfO.js +969 -0
  59. package/dist/src-Cs0dRc4X.js +617 -0
  60. package/dist/{src-elMBQ2Dh.js → src-sU9b0oZW.js} +224 -143
  61. package/dist/tokens.js +9 -1
  62. package/dist/viewer-styles-CpHqp5Qv.js +70 -0
  63. package/package.json +2 -1
  64. package/packages/foundations/src/tokens.stylex.ts +7 -0
  65. package/styles.css +1 -1
  66. package/dist/code-block-B30xQKqg.js +0 -175
  67. package/dist/pierre-diff-CZdzgiYm.js +0 -66
  68. package/dist/pierre-theme-BpESNIsV.js +0 -96
  69. package/dist/popup-styles-CvtZDE2t.js +0 -135
  70. package/dist/src-CfDf8TY8.js +0 -466
  71. package/dist/src-DuuAmS-c.js +0 -360
@@ -1,34 +1,34 @@
1
- import { n as e, o as t, r as n, t as r } from "../chart-frame-RL1hCWBC.js";
2
- import { n as i, r as a, t as o } from "../chart-input-Bm3ot1yD.js";
3
- import { t as s } from "../plot-width--OgdohB5.js";
4
- import * as c from "@stylexjs/stylex";
5
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
6
- import { scaleLinear as f } from "@visx/scale";
7
- import { Bar as p } from "@visx/shape";
1
+ import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-et6f6Vhg.js";
2
+ import { n as a, r as o, t as s } from "../chart-input-CdLkFomi.js";
3
+ import { t as c } from "../plot-width--OgdohB5.js";
4
+ import * as l from "@stylexjs/stylex";
5
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
6
+ import { scaleLinear as p } from "@visx/scale";
7
+ import { Bar as m } from "@visx/shape";
8
8
  // packages/charts/src/distribution/distribution-input.ts
9
- var m = {
9
+ var h = {
10
10
  bins: 200,
11
11
  cumulativePoints: 2e3,
12
12
  rows: 200
13
13
  };
14
- function h({ items: e, domain: t, maxEntries: n }) {
15
- if (!a(t)) return "The chart domain must contain two finite, increasing values.";
16
- if (!i(e)) return "Chart records must have unique identifiers.";
14
+ function g({ items: e, domain: t, maxEntries: n }) {
15
+ if (!o(t)) return "The chart domain must contain two finite, increasing values.";
16
+ if (!a(e)) return "Chart records must have unique identifiers.";
17
17
  if (e.length > n) return `This chart supports at most ${n} records. Supply an explicit data window or aggregation.`;
18
18
  }
19
- function g(e, t) {
19
+ function _(e, t) {
20
20
  return !Number.isFinite(e) || e < t[0] || e > t[1];
21
21
  }
22
22
  // packages/charts/src/distribution/distribution-plot.tsx
23
- var _ = { height: 160 }, v = [
23
+ var v = { height: 160 }, y = [
24
24
  0,
25
25
  .5,
26
26
  1
27
- ], y = {
27
+ ], b = {
28
28
  plot: {
29
29
  k7Eaqz: "xeuugli",
30
30
  k1xSpc: "xrvj5dj",
31
- kumcoG: "x16lqc3j",
31
+ kumcoG: "x37z1gs",
32
32
  kOIVth: "x1hnptsi",
33
33
  $$css: !0
34
34
  },
@@ -42,6 +42,12 @@ var _ = { height: 160 }, v = [
42
42
  kGuDYH: "xy8obcc",
43
43
  kLWn49: "xas2l8k",
44
44
  kcqcaj: "xss6m8b",
45
+ ks0D6T: "x2aouup",
46
+ kHjlTd: "xj0a0fe",
47
+ $$css: !0
48
+ },
49
+ plotArea: {
50
+ k7Eaqz: "xeuugli",
45
51
  $$css: !0
46
52
  },
47
53
  svg: {
@@ -67,6 +73,20 @@ var _ = { height: 160 }, v = [
67
73
  kcqcaj: "xss6m8b",
68
74
  $$css: !0
69
75
  },
76
+ tick: {
77
+ kUk6DE: "x1cqoux5",
78
+ k7Eaqz: "xeuugli",
79
+ kHjlTd: "xj0a0fe",
80
+ $$css: !0
81
+ },
82
+ middleTick: {
83
+ k9WMMc: "x2b8uid",
84
+ $$css: !0
85
+ },
86
+ endTick: {
87
+ k9WMMc: "xp4054r",
88
+ $$css: !0
89
+ },
70
90
  axisNames: {
71
91
  kBCFzs: "x1osaytk",
72
92
  k1xSpc: "x78zum5",
@@ -84,17 +104,21 @@ var _ = { height: 160 }, v = [
84
104
  values: {
85
105
  k1xSpc: "xrvj5dj",
86
106
  k7Eaqz: "xeuugli",
107
+ k9g6sI: "x12h1iku",
87
108
  $$css: !0
88
109
  },
89
110
  value: {
90
111
  k1xSpc: "x78zum5",
112
+ kwnvtZ: "x1a02dak",
91
113
  kjj79g: "x1qughib",
92
- kOIVth: "xaml1ju",
114
+ k1C7PZ: "x1y1mm1b",
115
+ khm7nJ: "x1gkm1c7",
93
116
  k7Eaqz: "xeuugli",
94
117
  kzqmXN: "xh8yej3",
95
118
  $$css: !0
96
119
  },
97
120
  summary: {
121
+ k7Eaqz: "xeuugli",
98
122
  kcqcaj: "xss6m8b",
99
123
  kHjlTd: "xj0a0fe",
100
124
  k9WMMc: "xp4054r",
@@ -102,7 +126,7 @@ var _ = { height: 160 }, v = [
102
126
  },
103
127
  row: {
104
128
  k1xSpc: "xrvj5dj",
105
- kumcoG: "x95ly28 x1lpzo89",
129
+ kumcoG: "x95ly28 xjfytmr",
106
130
  kOIVth: "x1n8ia3y",
107
131
  kGNEyG: "x6s0dn4",
108
132
  k7Eaqz: "xeuugli",
@@ -115,7 +139,7 @@ var _ = { height: 160 }, v = [
115
139
  $$css: !0
116
140
  },
117
141
  axisSpacer: {
118
- k1xSpc: "x1lliihq x18i6vp0",
142
+ k1xSpc: "x1lliihq x1mf2q18",
119
143
  $$css: !0
120
144
  },
121
145
  rowLabel: {
@@ -157,132 +181,148 @@ var _ = { height: 160 }, v = [
157
181
  $$css: !0
158
182
  }
159
183
  };
160
- function b({ xDomain: e, yDomain: t, xLabel: n, yLabel: r, formatX: i, formatY: a, children: o }) {
161
- let { ref: c, width: l } = s(), f = v.map((t) => e[0] + t * (e[1] - e[0])), p = v.map((e) => t[1] - e * (t[1] - t[0]));
162
- return /* @__PURE__ */ d("div", {
163
- className: "xeuugli xrvj5dj x16lqc3j x1hnptsi",
184
+ function x({ xDomain: e, yDomain: t, xLabel: n, yLabel: r, formatX: i, formatY: a, children: o }) {
185
+ let { ref: s, width: l } = c(), u = y.map((t) => e[0] + t * (e[1] - e[0])), p = y.map((e) => t[1] - e * (t[1] - t[0]));
186
+ return /* @__PURE__ */ f("div", {
187
+ className: "xeuugli xrvj5dj x37z1gs x1hnptsi",
164
188
  children: [
165
- /* @__PURE__ */ d("div", {
189
+ /* @__PURE__ */ f("div", {
166
190
  className: "x1osaytk x78zum5 x1qughib x1n8ia3y",
167
- children: [/* @__PURE__ */ u("span", {
191
+ children: [/* @__PURE__ */ d("span", {
168
192
  className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
169
193
  children: r
170
- }), /* @__PURE__ */ u("span", {
194
+ }), /* @__PURE__ */ d("span", {
171
195
  className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
172
196
  children: n
173
197
  })]
174
198
  }),
175
- /* @__PURE__ */ u("div", {
199
+ /* @__PURE__ */ d("div", {
176
200
  "aria-hidden": !0,
177
- className: "x1ymw6g x78zum5 xdt5ytf x1qughib xp4054r x153jb6y xy8obcc xas2l8k xss6m8b",
178
- children: p.map((e) => /* @__PURE__ */ u("span", { children: a(e) }, e))
201
+ className: "x1ymw6g x78zum5 xdt5ytf x1qughib xp4054r x153jb6y xy8obcc xas2l8k xss6m8b x2aouup xj0a0fe",
202
+ children: p.map((e) => /* @__PURE__ */ d("span", { children: a(e) }, e))
179
203
  }),
180
- /* @__PURE__ */ u("div", {
181
- ref: c,
182
- children: /* @__PURE__ */ d("svg", {
204
+ /* @__PURE__ */ d("div", {
205
+ ref: s,
206
+ className: "xeuugli",
207
+ children: /* @__PURE__ */ f("svg", {
183
208
  "aria-hidden": !0,
184
- viewBox: `0 0 ${l} ${_.height}`,
209
+ viewBox: `0 0 ${l} ${v.height}`,
185
210
  preserveAspectRatio: "none",
186
211
  className: "x1lliihq xh8yej3 x1ymw6g xb3r6kr",
187
- children: [v.map((e) => /* @__PURE__ */ u("line", {
212
+ children: [y.map((e) => /* @__PURE__ */ d("line", {
188
213
  x1: 0,
189
214
  x2: l,
190
- y1: _.height * e,
191
- y2: _.height * e,
215
+ y1: v.height * e,
216
+ y2: v.height * e,
192
217
  className: "x13hfdr1 x1ntoi03 x13efnbd"
193
218
  }, e)), o(l)]
194
219
  })
195
220
  }),
196
- /* @__PURE__ */ u("span", {}),
197
- /* @__PURE__ */ u("div", {
221
+ /* @__PURE__ */ d("span", {}),
222
+ /* @__PURE__ */ d("div", {
198
223
  "aria-hidden": !0,
199
224
  className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xss6m8b",
200
- children: f.map((e) => /* @__PURE__ */ u("span", { children: i(e) }, e))
225
+ children: u.map((e, t) => /* @__PURE__ */ d("span", {
226
+ ...{
227
+ 0: { className: "x1cqoux5 xeuugli xj0a0fe" },
228
+ 2: { className: "x1cqoux5 xeuugli xj0a0fe x2b8uid" },
229
+ 1: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" },
230
+ 3: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" }
231
+ }[(t === 1) << 1 | t === 2],
232
+ children: i(e)
233
+ }, e))
201
234
  })
202
235
  ]
203
236
  });
204
237
  }
205
- function x({ domain: e, formatValue: t }) {
206
- return /* @__PURE__ */ d("div", {
238
+ function S({ domain: e, formatValue: t }) {
239
+ return /* @__PURE__ */ f("div", {
207
240
  className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xss6m8b",
208
- children: [/* @__PURE__ */ u("span", { children: t(e[0]) }), /* @__PURE__ */ u("span", { children: t(e[1]) })]
241
+ children: [/* @__PURE__ */ d("span", {
242
+ className: "x1cqoux5 xeuugli xj0a0fe",
243
+ children: t(e[0])
244
+ }), /* @__PURE__ */ d("span", {
245
+ className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
246
+ children: t(e[1])
247
+ })]
209
248
  });
210
249
  }
211
250
  // packages/charts/src/distribution/ecdf.tsx
212
- function S({ title: i, description: a, points: s, domain: p, valueLabel: m, probabilityLabel: h, formatValue: g, formatProbability: v, tone: x = "series1", selection: S, emptyLabel: w = "No cumulative distribution points are available." }) {
213
- let T = C({
214
- points: s,
215
- domain: p
251
+ function C({ title: a, description: o, points: c, domain: m, valueLabel: h, probabilityLabel: g, formatValue: _, formatProbability: y, tone: S = "series1", selection: C, emptyLabel: T = "No cumulative distribution points are available." }) {
252
+ let E = w({
253
+ points: c,
254
+ domain: m
216
255
  });
217
- if (T !== void 0) return /* @__PURE__ */ u(o, {
218
- title: i,
219
- description: a,
220
- message: T
256
+ if (E !== void 0) return /* @__PURE__ */ d(s, {
257
+ title: a,
258
+ description: o,
259
+ message: E
221
260
  });
222
- let E = f({
261
+ let D = p({
223
262
  domain: [0, 1],
224
- range: [_.height, 0]
225
- });
226
- return /* @__PURE__ */ u(n, {
227
- title: i,
228
- description: a,
229
- children: s.length === 0 ? /* @__PURE__ */ u("p", {
230
- ...c.props(y.empty),
231
- children: w
232
- }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(b, {
233
- xDomain: p,
263
+ range: [v.height, 0]
264
+ }), O = c.find((e) => e.id === C?.selectedId);
265
+ return /* @__PURE__ */ d(n, {
266
+ title: a,
267
+ description: o,
268
+ footer: C !== void 0 && c.length > 0 ? /* @__PURE__ */ d(e, { children: O === void 0 ? "Select a point in View data to inspect its probability." : `${h}: ${_(O.value)}, ${g}: ${O.probability === null ? "Unavailable" : y(O.probability)}` }) : void 0,
269
+ children: c.length === 0 ? /* @__PURE__ */ d("p", {
270
+ ...l.props(b.empty),
271
+ children: T
272
+ }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(x, {
273
+ xDomain: m,
234
274
  yDomain: [0, 1],
235
- xLabel: m,
236
- yLabel: h,
237
- formatX: g,
238
- formatY: v,
275
+ xLabel: h,
276
+ yLabel: g,
277
+ formatX: _,
278
+ formatY: y,
239
279
  children: (e) => {
240
- let n = f({
241
- domain: [...p],
280
+ let t = p({
281
+ domain: [...m],
242
282
  range: [0, e]
243
- }), r = s.map((e, t) => {
283
+ }), n = c.map((e, n) => {
244
284
  if (e.probability === null) return "";
245
- let r = n(e.value), i = E(e.probability), a = s[t - 1];
285
+ let r = t(e.value), i = D(e.probability), a = c[n - 1];
246
286
  return a === void 0 || a.probability === null ? `M ${r} ${i}` : `H ${r} V ${i}`;
247
287
  }).join(" ");
248
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("path", {
249
- d: r,
288
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", {
289
+ d: n,
250
290
  fill: "none",
251
- stroke: t[x],
291
+ stroke: r[S],
252
292
  strokeWidth: 2,
253
293
  vectorEffect: "non-scaling-stroke"
254
- }), s.map((e) => e.probability === null ? null : /* @__PURE__ */ u("circle", {
255
- cx: n(e.value),
256
- cy: E(e.probability),
257
- r: S?.selectedId === e.id ? 4 : 2,
258
- fill: t[x]
294
+ }), c.map((e) => e.probability === null ? null : /* @__PURE__ */ d("circle", {
295
+ cx: t(e.value),
296
+ cy: D(e.probability),
297
+ r: C?.selectedId === e.id ? 4 : 2,
298
+ fill: r[S]
259
299
  }, e.id))] });
260
300
  }
261
- }), /* @__PURE__ */ u(r, { children: /* @__PURE__ */ u("div", {
262
- ...c.props(y.values),
263
- children: s.map((t) => {
264
- let n = g(t.value), r = t.probability === null ? "Unavailable" : v(t.probability);
265
- return /* @__PURE__ */ u(e, {
266
- label: `${m}: ${n}, ${h}: ${r}`,
267
- selected: S?.selectedId === t.id,
268
- onSelect: S === void 0 ? void 0 : () => S.onSelect(t.id),
269
- children: /* @__PURE__ */ d("span", {
270
- ...c.props(y.value),
271
- children: [/* @__PURE__ */ u("span", { children: n }), /* @__PURE__ */ u("span", {
272
- ...c.props(y.summary),
301
+ }), /* @__PURE__ */ d(i, { children: /* @__PURE__ */ d("div", {
302
+ ...l.props(b.values),
303
+ children: c.map((e) => {
304
+ let n = _(e.value), r = e.probability === null ? "Unavailable" : y(e.probability);
305
+ return /* @__PURE__ */ d(t, {
306
+ label: `${h}: ${n}, ${g}: ${r}`,
307
+ selected: C?.selectedId === e.id,
308
+ onSelect: C === void 0 ? void 0 : () => C.onSelect(e.id),
309
+ children: /* @__PURE__ */ f("span", {
310
+ ...l.props(b.value),
311
+ children: [/* @__PURE__ */ d("span", { children: n }), /* @__PURE__ */ d("span", {
312
+ ...l.props(b.summary),
273
313
  children: r
274
314
  })]
275
315
  })
276
- }, t.id);
316
+ }, e.id);
277
317
  })
278
318
  }) })] })
279
319
  });
280
320
  }
281
- function C({ points: e, domain: t }) {
282
- let n = h({
321
+ function w({ points: e, domain: t }) {
322
+ let n = g({
283
323
  items: e,
284
324
  domain: t,
285
- maxEntries: m.cumulativePoints
325
+ maxEntries: h.cumulativePoints
286
326
  });
287
327
  if (n !== void 0) return n;
288
328
  let r = {
@@ -290,7 +330,7 @@ function C({ points: e, domain: t }) {
290
330
  probability: 0
291
331
  };
292
332
  for (let n of e) {
293
- if (g(n.value, t) || n.value < r.value) return `Cumulative point ${n.id} is non-finite, outside the domain, or out of order.`;
333
+ if (_(n.value, t) || n.value < r.value) return `Cumulative point ${n.id} is non-finite, outside the domain, or out of order.`;
294
334
  if (n.probability !== null) {
295
335
  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.`;
296
336
  r.probability = n.probability;
@@ -299,183 +339,184 @@ function C({ points: e, domain: t }) {
299
339
  }
300
340
  }
301
341
  // packages/charts/src/distribution/histogram.tsx
302
- function w({ title: i, description: a, bins: s, domain: m, maximumCount: h, valueLabel: g, countLabel: v, formatValue: x, formatCount: S, tone: C = "series1", selection: w, emptyLabel: E = "No histogram bins are available." }) {
303
- let D = T({
304
- bins: s,
305
- domain: m,
306
- maximumCount: h
342
+ function T({ title: a, description: o, bins: c, domain: h, maximumCount: g, valueLabel: _, countLabel: y, formatValue: S, formatCount: C, tone: w = "series1", selection: T, emptyLabel: D = "No histogram bins are available." }) {
343
+ let O = E({
344
+ bins: c,
345
+ domain: h,
346
+ maximumCount: g
307
347
  });
308
- if (D !== void 0) return /* @__PURE__ */ u(o, {
309
- title: i,
310
- description: a,
311
- message: D
348
+ if (O !== void 0) return /* @__PURE__ */ d(s, {
349
+ title: a,
350
+ description: o,
351
+ message: O
312
352
  });
313
- let O = f({
314
- domain: [0, h],
315
- range: [_.height, 0]
316
- });
317
- return /* @__PURE__ */ u(n, {
318
- title: i,
319
- description: a,
320
- children: s.length === 0 ? /* @__PURE__ */ u("p", {
321
- ...c.props(y.empty),
322
- children: E
323
- }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(b, {
324
- xDomain: m,
325
- yDomain: [0, h],
326
- xLabel: g,
327
- yLabel: v,
328
- formatX: x,
329
- formatY: S,
353
+ let k = p({
354
+ domain: [0, g],
355
+ range: [v.height, 0]
356
+ }), A = c.find((e) => e.id === T?.selectedId);
357
+ return /* @__PURE__ */ d(n, {
358
+ title: a,
359
+ description: o,
360
+ footer: T !== void 0 && c.length > 0 ? /* @__PURE__ */ d(e, { children: A === void 0 ? "Select a bin in View data to inspect its count." : `${A.label}, ${S(A.lowerBound)} – ${S(A.upperBound)}, ${y}: ${A.count === null ? "Unavailable" : C(A.count)}` }) : void 0,
361
+ children: c.length === 0 ? /* @__PURE__ */ d("p", {
362
+ ...l.props(b.empty),
363
+ children: D
364
+ }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(x, {
365
+ xDomain: h,
366
+ yDomain: [0, g],
367
+ xLabel: _,
368
+ yLabel: y,
369
+ formatX: S,
370
+ formatY: C,
330
371
  children: (e) => {
331
- let n = f({
332
- domain: [...m],
372
+ let t = p({
373
+ domain: [...h],
333
374
  range: [0, e]
334
375
  });
335
- return s.map((e) => {
336
- let r = n(e.lowerBound), i = n(e.upperBound) - r, a = Math.min(2, i * .2), o = w?.selectedId === e.id;
337
- if (e.count === null) return /* @__PURE__ */ u(p, {
338
- x: r + a / 2,
339
- y: _.height - 6,
376
+ return c.map((e) => {
377
+ let n = t(e.lowerBound), i = t(e.upperBound) - n, a = Math.min(2, i * .2), o = T?.selectedId === e.id;
378
+ if (e.count === null) return /* @__PURE__ */ d(m, {
379
+ x: n + a / 2,
380
+ y: v.height - 6,
340
381
  width: i - a,
341
382
  height: 5,
342
- ...c.props(y.missing)
383
+ ...l.props(b.missing)
343
384
  }, e.id);
344
- let s = O(e.count);
345
- return /* @__PURE__ */ u(p, {
346
- x: r + a / 2,
385
+ let s = k(e.count);
386
+ return /* @__PURE__ */ d(m, {
387
+ x: n + a / 2,
347
388
  y: s,
348
389
  width: i - a,
349
- height: _.height - s,
350
- fill: t[C],
351
- opacity: w?.selectedId === void 0 || o ? 1 : .45
390
+ height: v.height - s,
391
+ fill: r[w],
392
+ opacity: T?.selectedId === void 0 || o ? 1 : .45
352
393
  }, e.id);
353
394
  });
354
395
  }
355
- }), /* @__PURE__ */ u(r, { children: /* @__PURE__ */ u("div", {
356
- ...c.props(y.values),
357
- children: s.map((t) => {
358
- let n = t.count === null ? "Unavailable" : S(t.count), r = `${x(t.lowerBound)} – ${x(t.upperBound)}`;
359
- return /* @__PURE__ */ u(e, {
360
- label: `${t.label}, ${r}, ${v}: ${n}`,
361
- selected: w?.selectedId === t.id,
362
- onSelect: w === void 0 ? void 0 : () => w.onSelect(t.id),
363
- children: /* @__PURE__ */ d("span", {
364
- ...c.props(y.value),
365
- children: [/* @__PURE__ */ d("span", { children: [
366
- t.label,
396
+ }), /* @__PURE__ */ d(i, { children: /* @__PURE__ */ d("div", {
397
+ ...l.props(b.values),
398
+ children: c.map((e) => {
399
+ let n = e.count === null ? "Unavailable" : C(e.count), r = `${S(e.lowerBound)} – ${S(e.upperBound)}`;
400
+ return /* @__PURE__ */ d(t, {
401
+ label: `${e.label}, ${r}, ${y}: ${n}`,
402
+ selected: T?.selectedId === e.id,
403
+ onSelect: T === void 0 ? void 0 : () => T.onSelect(e.id),
404
+ children: /* @__PURE__ */ f("span", {
405
+ ...l.props(b.value),
406
+ children: [/* @__PURE__ */ f("span", { children: [
407
+ e.label,
367
408
  " · ",
368
409
  r
369
- ] }), /* @__PURE__ */ u("span", {
370
- ...c.props(y.summary),
410
+ ] }), /* @__PURE__ */ d("span", {
411
+ ...l.props(b.summary),
371
412
  children: n
372
413
  })]
373
414
  })
374
- }, t.id);
415
+ }, e.id);
375
416
  })
376
417
  }) })] })
377
418
  });
378
419
  }
379
- function T({ bins: e, domain: t, maximumCount: n }) {
380
- let r = h({
420
+ function E({ bins: e, domain: t, maximumCount: n }) {
421
+ let r = g({
381
422
  items: e,
382
423
  domain: t,
383
- maxEntries: m.bins
424
+ maxEntries: h.bins
384
425
  });
385
426
  if (r !== void 0) return r;
386
427
  if (!Number.isFinite(n) || n <= 0) return "The histogram count domain must have a finite maximum greater than zero.";
387
428
  for (let [r, i] of e.entries()) {
388
- if (g(i.lowerBound, t) || g(i.upperBound, t)) return `Histogram bin ${i.id} has a non-finite bound or lies outside the declared domain.`;
429
+ if (_(i.lowerBound, t) || _(i.upperBound, t)) return `Histogram bin ${i.id} has a non-finite bound or lies outside the declared domain.`;
389
430
  let a = e[r - 1];
390
431
  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.`;
391
432
  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.`;
392
433
  }
393
434
  }
394
435
  // packages/charts/src/distribution/interval-plot.tsx
395
- function E({ title: r, description: i, items: a, domain: l, valueLabel: p, intervalLabel: m, formatValue: h, selection: g, emptyLabel: _ = "No interval estimates are available." }) {
396
- let { ref: v, width: b } = s(), S = D({
436
+ function D({ title: e, description: i, items: a, domain: o, valueLabel: u, intervalLabel: m, formatValue: h, selection: g, emptyLabel: _ = "No interval estimates are available." }) {
437
+ let { ref: v, width: y } = c(), x = O({
397
438
  items: a,
398
- domain: l
439
+ domain: o
399
440
  });
400
- if (S !== void 0) return /* @__PURE__ */ u(o, {
401
- title: r,
441
+ if (x !== void 0) return /* @__PURE__ */ d(s, {
442
+ title: e,
402
443
  description: i,
403
- message: S
444
+ message: x
404
445
  });
405
- let C = f({
406
- domain: [...l],
407
- range: [0, b]
446
+ let C = p({
447
+ domain: [...o],
448
+ range: [0, y]
408
449
  });
409
- return /* @__PURE__ */ u(n, {
410
- title: r,
450
+ return /* @__PURE__ */ d(n, {
451
+ title: e,
411
452
  description: i,
412
- footer: `${p} · ${m}`,
413
- children: a.length === 0 ? /* @__PURE__ */ u("p", {
414
- ...c.props(y.empty),
453
+ footer: `${u} · ${m}`,
454
+ children: a.length === 0 ? /* @__PURE__ */ d("p", {
455
+ ...l.props(b.empty),
415
456
  children: _
416
- }) : /* @__PURE__ */ d("div", {
417
- ...c.props(y.values),
418
- children: [a.map((n) => {
419
- let r = n.estimate === null ? "Estimate unavailable" : h(n.estimate), i = `${m}: ${n.lower === null ? "Unavailable" : h(n.lower)} – ${n.upper === null ? "Unavailable" : h(n.upper)}`, a = t[n.tone ?? "series1"];
420
- return /* @__PURE__ */ u(e, {
421
- label: `${n.label}, ${p}: ${r}, ${i}`,
422
- selected: g?.selectedId === n.id,
423
- onSelect: g === void 0 ? void 0 : () => g.onSelect(n.id),
424
- children: /* @__PURE__ */ d("span", {
425
- ...c.props(y.row),
426
- children: [/* @__PURE__ */ d("span", {
427
- ...c.props(y.rowLabel),
457
+ }) : /* @__PURE__ */ f("div", {
458
+ ...l.props(b.values),
459
+ children: [a.map((e) => {
460
+ let n = e.estimate === null ? "Estimate unavailable" : h(e.estimate), i = `${m}: ${e.lower === null ? "Unavailable" : h(e.lower)} – ${e.upper === null ? "Unavailable" : h(e.upper)}`, a = r[e.tone ?? "series1"];
461
+ return /* @__PURE__ */ d(t, {
462
+ label: `${e.label}, ${u}: ${n}, ${i}`,
463
+ selected: g?.selectedId === e.id,
464
+ onSelect: g === void 0 ? void 0 : () => g.onSelect(e.id),
465
+ children: /* @__PURE__ */ f("span", {
466
+ ...l.props(b.row),
467
+ children: [/* @__PURE__ */ f("span", {
468
+ ...l.props(b.rowLabel),
428
469
  children: [
429
- /* @__PURE__ */ u("span", { children: n.label }),
430
- /* @__PURE__ */ u("span", {
431
- ...c.props(y.rowValue),
432
- children: r
470
+ /* @__PURE__ */ d("span", { children: e.label }),
471
+ /* @__PURE__ */ d("span", {
472
+ ...l.props(b.rowValue),
473
+ children: n
433
474
  }),
434
- /* @__PURE__ */ u("span", {
435
- ...c.props(y.label),
475
+ /* @__PURE__ */ d("span", {
476
+ ...l.props(b.label),
436
477
  children: i
437
478
  })
438
479
  ]
439
- }), /* @__PURE__ */ d("svg", {
480
+ }), /* @__PURE__ */ f("svg", {
440
481
  "aria-hidden": !0,
441
- viewBox: `0 0 ${b} 28`,
482
+ viewBox: `0 0 ${y} 28`,
442
483
  preserveAspectRatio: "none",
443
- ...c.props(y.rowSvg),
484
+ ...l.props(b.rowSvg),
444
485
  children: [
445
- /* @__PURE__ */ u("line", {
486
+ /* @__PURE__ */ d("line", {
446
487
  x1: 0,
447
- x2: b,
488
+ x2: y,
448
489
  y1: 14,
449
490
  y2: 14,
450
- ...c.props(y.baseline)
491
+ ...l.props(b.baseline)
451
492
  }),
452
- n.lower !== null && n.upper !== null && /* @__PURE__ */ d("g", {
493
+ e.lower !== null && e.upper !== null && /* @__PURE__ */ f("g", {
453
494
  stroke: a,
454
495
  strokeWidth: 2,
455
496
  vectorEffect: "non-scaling-stroke",
456
497
  children: [
457
- /* @__PURE__ */ u("line", {
458
- x1: C(n.lower),
459
- x2: C(n.upper),
498
+ /* @__PURE__ */ d("line", {
499
+ x1: C(e.lower),
500
+ x2: C(e.upper),
460
501
  y1: 14,
461
502
  y2: 14
462
503
  }),
463
- /* @__PURE__ */ u("line", {
464
- x1: C(n.lower),
465
- x2: C(n.lower),
504
+ /* @__PURE__ */ d("line", {
505
+ x1: C(e.lower),
506
+ x2: C(e.lower),
466
507
  y1: 9,
467
508
  y2: 19
468
509
  }),
469
- /* @__PURE__ */ u("line", {
470
- x1: C(n.upper),
471
- x2: C(n.upper),
510
+ /* @__PURE__ */ d("line", {
511
+ x1: C(e.upper),
512
+ x2: C(e.upper),
472
513
  y1: 9,
473
514
  y2: 19
474
515
  })
475
516
  ]
476
517
  }),
477
- n.estimate !== null && /* @__PURE__ */ u("circle", {
478
- cx: C(n.estimate),
518
+ e.estimate !== null && /* @__PURE__ */ d("circle", {
519
+ cx: C(e.estimate),
479
520
  cy: 14,
480
521
  r: 4,
481
522
  fill: a
@@ -483,13 +524,13 @@ function E({ title: r, description: i, items: a, domain: l, valueLabel: p, inter
483
524
  ]
484
525
  })]
485
526
  })
486
- }, n.id);
487
- }), /* @__PURE__ */ d("div", {
488
- ...c.props(y.row, y.rowAxis),
489
- children: [/* @__PURE__ */ u("span", { ...c.props(y.axisSpacer) }), /* @__PURE__ */ u("div", {
527
+ }, e.id);
528
+ }), /* @__PURE__ */ f("div", {
529
+ ...l.props(b.row, b.rowAxis),
530
+ children: [/* @__PURE__ */ d("span", { ...l.props(b.axisSpacer) }), /* @__PURE__ */ d("div", {
490
531
  ref: v,
491
- children: /* @__PURE__ */ u(x, {
492
- domain: l,
532
+ children: /* @__PURE__ */ d(S, {
533
+ domain: o,
493
534
  formatValue: h
494
535
  })
495
536
  })]
@@ -497,11 +538,11 @@ function E({ title: r, description: i, items: a, domain: l, valueLabel: p, inter
497
538
  })
498
539
  });
499
540
  }
500
- function D({ items: e, domain: t }) {
501
- let n = h({
541
+ function O({ items: e, domain: t }) {
542
+ let n = g({
502
543
  items: e,
503
544
  domain: t,
504
- maxEntries: m.rows
545
+ maxEntries: h.rows
505
546
  });
506
547
  if (n !== void 0) return n;
507
548
  for (let n of e) {
@@ -509,7 +550,7 @@ function D({ items: e, domain: t }) {
509
550
  n.lower,
510
551
  n.estimate,
511
552
  n.upper
512
- ].some((e) => e !== null && g(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
553
+ ].some((e) => e !== null && _(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
513
554
  if (n.lower !== null && n.upper !== null && n.lower > n.upper) return `Interval ${n.id} has reversed endpoints.`;
514
555
  if (n.estimate !== null) {
515
556
  if (n.lower !== null && n.estimate < n.lower) return `Interval ${n.id} has an estimate below its lower endpoint.`;
@@ -518,55 +559,55 @@ function D({ items: e, domain: t }) {
518
559
  }
519
560
  }
520
561
  // packages/charts/src/distribution/ranked-bars.tsx
521
- function O({ title: r, description: i, items: a, domain: l, valueLabel: m, formatValue: h, selection: g, emptyLabel: _ = "No ranked values are available." }) {
522
- let { ref: v, width: b } = s(), S = k({
562
+ function k({ title: e, description: i, items: a, domain: o, valueLabel: u, formatValue: h, selection: g, emptyLabel: _ = "No ranked values are available." }) {
563
+ let { ref: v, width: y } = c(), x = A({
523
564
  items: a,
524
- domain: l
565
+ domain: o
525
566
  });
526
- if (S !== void 0) return /* @__PURE__ */ u(o, {
527
- title: r,
567
+ if (x !== void 0) return /* @__PURE__ */ d(s, {
568
+ title: e,
528
569
  description: i,
529
- message: S
570
+ message: x
530
571
  });
531
- let C = f({
532
- domain: [...l],
533
- range: [0, b]
572
+ let C = p({
573
+ domain: [...o],
574
+ range: [0, y]
534
575
  }), w = C(0);
535
- return /* @__PURE__ */ u(n, {
536
- title: r,
576
+ return /* @__PURE__ */ d(n, {
577
+ title: e,
537
578
  description: i,
538
- footer: m,
539
- children: a.length === 0 ? /* @__PURE__ */ u("p", {
540
- ...c.props(y.empty),
579
+ footer: u,
580
+ children: a.length === 0 ? /* @__PURE__ */ d("p", {
581
+ ...l.props(b.empty),
541
582
  children: _
542
- }) : /* @__PURE__ */ d("div", {
543
- ...c.props(y.values),
544
- children: [a.map((n) => {
545
- let r = n.value === null ? "Unavailable" : h(n.value), i = n.rank === void 0 ? n.label : `${n.rank} · ${n.label}`, a = t[n.tone ?? "series1"];
546
- return /* @__PURE__ */ u(e, {
547
- label: `${i}, ${m}: ${r}`,
548
- selected: g?.selectedId === n.id,
549
- onSelect: g === void 0 ? void 0 : () => g.onSelect(n.id),
550
- children: /* @__PURE__ */ d("span", {
551
- ...c.props(y.row),
552
- children: [/* @__PURE__ */ d("span", {
553
- ...c.props(y.rowLabel),
554
- children: [/* @__PURE__ */ u("span", { children: i }), /* @__PURE__ */ u("span", {
555
- ...c.props(y.rowValue),
556
- children: r
583
+ }) : /* @__PURE__ */ f("div", {
584
+ ...l.props(b.values),
585
+ children: [a.map((e) => {
586
+ let n = e.value === null ? "Unavailable" : h(e.value), i = e.rank === void 0 ? e.label : `${e.rank} · ${e.label}`, a = r[e.tone ?? "series1"];
587
+ return /* @__PURE__ */ d(t, {
588
+ label: `${i}, ${u}: ${n}`,
589
+ selected: g?.selectedId === e.id,
590
+ onSelect: g === void 0 ? void 0 : () => g.onSelect(e.id),
591
+ children: /* @__PURE__ */ f("span", {
592
+ ...l.props(b.row),
593
+ children: [/* @__PURE__ */ f("span", {
594
+ ...l.props(b.rowLabel),
595
+ children: [/* @__PURE__ */ d("span", { children: i }), /* @__PURE__ */ d("span", {
596
+ ...l.props(b.rowValue),
597
+ children: n
557
598
  })]
558
- }), /* @__PURE__ */ d("svg", {
599
+ }), /* @__PURE__ */ f("svg", {
559
600
  "aria-hidden": !0,
560
- viewBox: `0 0 ${b} 28`,
601
+ viewBox: `0 0 ${y} 28`,
561
602
  preserveAspectRatio: "none",
562
- ...c.props(y.rowSvg),
563
- children: [/* @__PURE__ */ u("line", {
603
+ ...l.props(b.rowSvg),
604
+ children: [/* @__PURE__ */ d("line", {
564
605
  x1: w,
565
606
  x2: w,
566
607
  y1: 3,
567
608
  y2: 25,
568
- ...c.props(y.baseline)
569
- }), n.value !== null && (n.value === 0 ? /* @__PURE__ */ u("line", {
609
+ ...l.props(b.baseline)
610
+ }), e.value !== null && (e.value === 0 ? /* @__PURE__ */ d("line", {
570
611
  x1: w,
571
612
  x2: w,
572
613
  y1: 10,
@@ -574,22 +615,22 @@ function O({ title: r, description: i, items: a, domain: l, valueLabel: m, forma
574
615
  stroke: a,
575
616
  strokeWidth: 2,
576
617
  vectorEffect: "non-scaling-stroke"
577
- }) : /* @__PURE__ */ u(p, {
578
- x: Math.min(w, C(n.value)),
618
+ }) : /* @__PURE__ */ d(m, {
619
+ x: Math.min(w, C(e.value)),
579
620
  y: 10,
580
- width: Math.abs(C(n.value) - w),
621
+ width: Math.abs(C(e.value) - w),
581
622
  height: 8,
582
623
  fill: a
583
624
  }))]
584
625
  })]
585
626
  })
586
- }, n.id);
587
- }), /* @__PURE__ */ d("div", {
588
- ...c.props(y.row, y.rowAxis),
589
- children: [/* @__PURE__ */ u("span", { ...c.props(y.axisSpacer) }), /* @__PURE__ */ u("div", {
627
+ }, e.id);
628
+ }), /* @__PURE__ */ f("div", {
629
+ ...l.props(b.row, b.rowAxis),
630
+ children: [/* @__PURE__ */ d("span", { ...l.props(b.axisSpacer) }), /* @__PURE__ */ d("div", {
590
631
  ref: v,
591
- children: /* @__PURE__ */ u(x, {
592
- domain: l,
632
+ children: /* @__PURE__ */ d(S, {
633
+ domain: o,
593
634
  formatValue: h
594
635
  })
595
636
  })]
@@ -597,14 +638,14 @@ function O({ title: r, description: i, items: a, domain: l, valueLabel: m, forma
597
638
  })
598
639
  });
599
640
  }
600
- function k({ items: e, domain: t }) {
601
- let n = h({
641
+ function A({ items: e, domain: t }) {
642
+ let n = g({
602
643
  items: e,
603
644
  domain: t,
604
- maxEntries: m.rows
645
+ maxEntries: h.rows
605
646
  });
606
647
  if (n !== void 0) return n;
607
648
  if (t[0] > 0 || t[1] < 0) return "The ranked-value domain must include zero.";
608
- for (let n of e) if (n.value !== null && g(n.value, t)) return `Ranked value ${n.id} is non-finite or lies outside the declared domain.`;
649
+ for (let n of e) if (n.value !== null && _(n.value, t)) return `Ranked value ${n.id} is non-finite or lies outside the declared domain.`;
609
650
  }
610
- export { S as ECDF, w as Histogram, E as IntervalPlot, O as RankedBars };
651
+ export { C as ECDF, T as Histogram, D as IntervalPlot, k as RankedBars };