@mechane-ai/elements 0.48.0 → 0.49.1

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 (140) hide show
  1. package/README.md +40 -2
  2. package/dist/ai.js +5 -5
  3. package/dist/{article-BXZr10QQ.js → article-CRlhq9oA.js} +532 -464
  4. package/dist/article.js +1 -1
  5. package/dist/catalog.json +243 -1
  6. package/dist/{categorical-values-BpVq8cFj.js → categorical-values-BYP_R5gS.js} +13 -13
  7. package/dist/{cells-xVmnQ9oQ.js → cells-CNZE4us2.js} +2 -2
  8. package/dist/charts/cartesian.js +1 -1
  9. package/dist/charts/cells.js +1 -1
  10. package/dist/charts/comparison.js +1 -1
  11. package/dist/charts/distribution.js +1 -1
  12. package/dist/charts/figure.js +12 -12
  13. package/dist/charts/graph.js +1 -1
  14. package/dist/charts/hierarchy.js +1 -1
  15. package/dist/charts/image.js +1 -1
  16. package/dist/charts/matrix.js +1 -1
  17. package/dist/charts/plot.js +7 -7
  18. package/dist/charts/relationship.js +1 -1
  19. package/dist/charts/text.js +1 -1
  20. package/dist/charts/timeline.js +1 -1
  21. package/dist/charts/trend.js +1 -1
  22. package/dist/charts.js +7 -7
  23. package/dist/{code-block-DioAM2bZ.js → code-block-BZsY2sh3.js} +1 -1
  24. package/dist/collections.js +1 -1
  25. package/dist/content/code.js +1 -1
  26. package/dist/content/diff.js +3 -3
  27. package/dist/content/link.js +1 -1
  28. package/dist/content/markdown.js +2 -2
  29. package/dist/content/tree.js +1 -1
  30. package/dist/{content-link-NWuHp5rC.js → content-link-PnpcnTCx.js} +1 -1
  31. package/dist/content.js +1 -1
  32. package/dist/{dates-Cww8UR_n.js → dates-ckJdYF7t.js} +1 -1
  33. package/dist/{dumbbell-plot-DQdTxDeO.js → dumbbell-plot-B-Tn7ewW.js} +49 -48
  34. package/dist/{embedding-map-CF-J-8JW.js → embedding-map-Bljn-A5q.js} +533 -533
  35. package/dist/feedback.js +1 -1
  36. package/dist/figure-frame-CEijciL7.js +289 -0
  37. package/dist/forms/dates.js +1 -1
  38. package/dist/forms.js +3 -3
  39. package/dist/{image-grid-Dl2sjIMB.js → image-grid-mrG5u9oE.js} +49 -49
  40. package/dist/index.js +1 -1
  41. package/dist/kits/evaluation.js +5 -5
  42. package/dist/kits/interpretability.js +320 -302
  43. package/dist/kits/operations.js +6 -6
  44. package/dist/kits/research.js +558 -0
  45. package/dist/kits/training.js +6 -6
  46. package/dist/layout.js +205 -110
  47. package/dist/lesson/spec.js +11 -11
  48. package/dist/lesson.js +4 -4
  49. package/dist/mdx.js +6 -6
  50. package/dist/navigation.js +2 -2
  51. package/dist/packages/charts/src/cartesian/index.d.ts +1 -1
  52. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +18 -0
  53. package/dist/packages/charts/src/chart-theme.d.ts +1 -1
  54. package/dist/packages/charts/src/figure/caption-scope.d.ts +12 -0
  55. package/dist/packages/charts/src/figure/figure-frame.d.ts +2 -1
  56. package/dist/packages/charts/src/index.d.ts +2 -0
  57. package/dist/packages/charts/src/plot/plot-surface.d.ts +3 -1
  58. package/dist/packages/collections/src/index.d.ts +1 -1
  59. package/dist/packages/collections/src/metrics.d.ts +9 -1
  60. package/dist/packages/content/src/index.d.ts +2 -0
  61. package/dist/packages/content/src/text-match.d.ts +22 -0
  62. package/dist/packages/core/src/index.d.ts +1 -0
  63. package/dist/packages/core/src/surfaces.d.ts +12 -2
  64. package/dist/packages/forms/src/index.d.ts +2 -0
  65. package/dist/packages/forms/src/token-input.d.ts +24 -0
  66. package/dist/packages/kits/src/interpretability/index.d.ts +1 -1
  67. package/dist/packages/kits/src/interpretability/logit-lens.d.ts +10 -1
  68. package/dist/packages/kits/src/research/finding-card.d.ts +43 -0
  69. package/dist/packages/kits/src/research/index.d.ts +8 -0
  70. package/dist/packages/kits/src/research/milestone-path.d.ts +36 -0
  71. package/dist/packages/kits/src/research/specimen-diff.d.ts +41 -0
  72. package/dist/packages/kits/src/research/work-heartbeat.d.ts +34 -0
  73. package/dist/packages/layout/src/figure-grid.d.ts +8 -0
  74. package/dist/packages/layout/src/index.d.ts +4 -1
  75. package/dist/packages/layout/src/sidebar.d.ts +7 -0
  76. package/dist/packages/layout/src/workbench.d.ts +4 -1
  77. package/dist/packages/teaching/src/article/article-context.d.ts +2 -0
  78. package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +13 -0
  79. package/dist/packages/teaching/src/article/article.d.ts +6 -1
  80. package/dist/packages/teaching/src/article/figure.d.ts +20 -3
  81. package/dist/packages/teaching/src/article/index.d.ts +1 -1
  82. package/dist/packages/teaching/src/article/view-essay.d.ts +2 -1
  83. package/dist/packages/teaching/src/lesson/define-lesson.d.ts +4 -0
  84. package/dist/packages/teaching/src/lesson/index.d.ts +2 -2
  85. package/dist/packages/teaching/src/lesson/lesson-player.d.ts +19 -3
  86. package/dist/packages/teaching/src/lesson/lesson-store.d.ts +2 -0
  87. package/dist/packages/teaching/src/lesson/playback.d.ts +9 -6
  88. package/dist/packages/teaching/src/lesson/use-lesson.d.ts +7 -2
  89. package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +4 -1
  90. package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +5 -6
  91. package/dist/packages/teaching/src/scene/scene-geometry.d.ts +1 -1
  92. package/dist/packages/teaching/src/scene/scene-node.d.ts +4 -1
  93. package/dist/packages/teaching/src/scene/scene-validate.d.ts +6 -0
  94. package/dist/packages/teaching/src/scene/scene-wire.d.ts +6 -1
  95. package/dist/packages/teaching/src/scene/scene.d.ts +1 -1
  96. package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +5 -1
  97. package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +1 -1
  98. package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +1 -1
  99. package/dist/packages/teaching/src/time/tween.d.ts +2 -0
  100. package/dist/{param-CqKUTHaO.js → param-BdqTpZER.js} +175 -108
  101. package/dist/{pierre-diff-DlvjyuJn.js → pierre-diff-aGyQK5xK.js} +1 -1
  102. package/dist/{plot-axes-DJkLW4wk.js → plot-axes-D5S9BnBa.js} +1 -1
  103. package/dist/{plot-layout-CZVSJ-le.js → plot-layout-B2xRt-_k.js} +146 -132
  104. package/dist/{plot-marks-uozcbOIX.js → plot-marks-FVsbFkUs.js} +3 -3
  105. package/dist/{plot-surface-CbVBvgqZ.js → plot-surface-0cKFwtws.js} +11 -11
  106. package/dist/{plot-width-DcqtSgzb.js → plot-width-D3hTycYX.js} +1 -1
  107. package/dist/{reference-lines-BDcttOp0.js → reference-lines-nSxcZVF5.js} +2 -2
  108. package/dist/{scene-0z2gbaDE.js → scene-BwJKueD6.js} +1228 -1126
  109. package/dist/scene.js +1 -1
  110. package/dist/{slope-chart-BKVEAVCs.js → slope-chart-CGTYbFxi.js} +182 -182
  111. package/dist/{src-CpdJlDhO.js → src-9EJskqB_.js} +73 -31
  112. package/dist/{src-Dcfq8vE4.js → src-B2rgpWap.js} +48 -14
  113. package/dist/{src-BPTDJqt0.js → src-Ci8DeY8J.js} +1 -1
  114. package/dist/{src-CGc_hjxJ.js → src-DFW49IAs.js} +143 -111
  115. package/dist/{src-BD6xlvDt.js → src-Dxs3Buo_.js} +203 -137
  116. package/dist/{src-CExIrXPC.js → src-npqwq3Sa.js} +1 -1
  117. package/dist/styles2.css +136 -17
  118. package/dist/{time-series-BgzGNOk0.js → time-series-Dh8y5ba0.js} +1018 -944
  119. package/dist/{token-heatmap-BrW1OsKD.js → token-heatmap-BTrZ3-N4.js} +86 -86
  120. package/dist/{token-predictions-yerq_Oet.js → token-predictions-CUe4junQ.js} +129 -129
  121. package/dist/{transport-BJweqDPj.js → transport-4V9rfYHN.js} +291 -246
  122. package/dist/{tree-diagram-D09BRqE-.js → tree-diagram-Dpqmo-fh.js} +118 -118
  123. package/dist/{treemap-CW4WsJNL.js → treemap-BUSaVD3m.js} +28 -28
  124. package/dist/use-tween-BsaEO862.js +10 -0
  125. package/dist/{violin-plot-DrtPZ1-T.js → violin-plot-BxaLwdRi.js} +126 -126
  126. package/dist/{waterfall-DYLSnGjm.js → waterfall-CcDMdKec.js} +43 -43
  127. package/package.json +5 -1
  128. package/recipes/counting-cards.tsx +3 -3
  129. package/skills/review-explainer/SKILL.md +2 -1
  130. package/skills/upgrade-elements/references/releases.md +61 -0
  131. package/skills/use-elements/SKILL.md +3 -1
  132. package/skills/use-elements/references/kits.md +7 -6
  133. package/skills/use-elements/references/styling.md +23 -0
  134. package/skills/use-elements/references/teaching.md +13 -0
  135. package/skills/write-explainer/references/article.md +50 -2
  136. package/skills/write-explainer/references/lesson.md +18 -9
  137. package/skills/write-explainer/references/scene-parts.md +17 -12
  138. package/skills/write-explainer/references/scene.md +25 -3
  139. package/dist/figure-frame-BJ3REgTA.js +0 -270
  140. package/dist/use-tween-5HZ55_9d.js +0 -72
@@ -1,15 +1,15 @@
1
1
  import { n as e, t } from "./chart-tones-ei3BC2AL.js";
2
- import { A as n, O as r, S as i, a, c as o, i as s, k as c, n as l, o as u, w as d } from "./plot-layout-CZVSJ-le.js";
2
+ import { A as n, E as r, M as i, S as a, a as o, c as s, i as c, j as l, n as u, o as d } from "./plot-layout-B2xRt-_k.js";
3
3
  import { i as f } from "./chart-link-AE_xuxiP.js";
4
4
  import { a as p } from "./tone-scope-DKiSw-JR.js";
5
5
  import { r as m } from "./figure-format-B8kRZMlo.js";
6
6
  import { a as h, o as g } from "./scale-C2xgZyZN.js";
7
7
  import { t as _ } from "./chart-cursor-1mFd48Jc.js";
8
- import { i as v, l as y, n as b, r as x, t as S } from "./figure-frame-BJ3REgTA.js";
9
- import { n as C, t as w } from "./plot-width-DcqtSgzb.js";
10
- import { t as T } from "./plot-axes-DJkLW4wk.js";
11
- import { a as E, f as D, l as O, r as k, s as A } from "./plot-marks-uozcbOIX.js";
12
- import { n as ee, r as j, t as te } from "./plot-surface-CbVBvgqZ.js";
8
+ import { i as v, l as y, n as b, r as x, t as S } from "./figure-frame-CEijciL7.js";
9
+ import { n as C, t as w } from "./plot-width-D3hTycYX.js";
10
+ import { t as T } from "./plot-axes-D5S9BnBa.js";
11
+ import { a as E, f as D, l as O, r as k, s as A } from "./plot-marks-FVsbFkUs.js";
12
+ import { n as ee, r as j, t as te } from "./plot-surface-0cKFwtws.js";
13
13
  import { r as ne } from "./path-BglsXpnO.js";
14
14
  import { t as M } from "./locate-Bcg3QcP4.js";
15
15
  import * as N from "@stylexjs/stylex";
@@ -21,26 +21,26 @@ var L = {
21
21
  cumulativePoints: 2e3,
22
22
  rows: 200
23
23
  };
24
- function R({ items: e, domain: t, scale: r, maxEntries: i }) {
25
- let a = g(t, r);
24
+ function R({ items: e, domain: t, scale: n, maxEntries: r }) {
25
+ let a = g(t, n);
26
26
  if (a !== void 0) return a;
27
- if (!n(e)) return "Chart records must have unique identifiers.";
28
- if (e.length > i) return `This chart supports at most ${i} records. Supply an explicit data window or aggregation.`;
27
+ if (!i(e)) return "Chart records must have unique identifiers.";
28
+ if (e.length > r) return `This chart supports at most ${r} records. Supply an explicit data window or aggregation.`;
29
29
  }
30
30
  // packages/charts/src/distribution/distribution-plot.tsx
31
- function ie({ frame: e, figure: t, items: n, inspected: a, plotRef: o, plot: s, x: u, y: d, isSelectable: f, emptyLabel: p, children: m, overlay: h }) {
31
+ function ie({ frame: e, figure: t, items: r, inspected: i, plotRef: o, plot: s, x: c, y: d, isSelectable: f, emptyLabel: p, children: m, overlay: h }) {
32
32
  let g = re(), { box: _ } = s;
33
33
  return /* @__PURE__ */ F(b, {
34
34
  ...e,
35
35
  figure: t,
36
- footer: /* @__PURE__ */ F(i, {
36
+ footer: /* @__PURE__ */ F(a, {
37
37
  id: g,
38
- children: r(n, a)
38
+ children: n(r, i)
39
39
  }),
40
- children: n.length === 0 ? /* @__PURE__ */ F(S, { children: p }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ I(ee, {
40
+ children: r.length === 0 ? /* @__PURE__ */ F(S, { children: p }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ I(ee, {
41
41
  plotRef: o,
42
42
  box: _,
43
- label: c({
43
+ label: l({
44
44
  title: e.title,
45
45
  isSelectable: f
46
46
  }),
@@ -50,8 +50,8 @@ function ie({ frame: e, figure: t, items: n, inspected: a, plotRef: o, plot: s,
50
50
  box: _,
51
51
  xTicks: s.xTicks,
52
52
  yTicks: s.yTicks,
53
- xTitle: l(u),
54
- yTitle: l(d)
53
+ xTitle: u(c),
54
+ yTitle: u(d)
55
55
  }),
56
56
  /* @__PURE__ */ F(te, {
57
57
  box: _,
@@ -65,7 +65,7 @@ function ie({ frame: e, figure: t, items: n, inspected: a, plotRef: o, plot: s,
65
65
  id: "observation",
66
66
  label: "Observation"
67
67
  }],
68
- rows: n.map((e) => ({
68
+ rows: r.map((e) => ({
69
69
  id: e.id,
70
70
  values: [e.label]
71
71
  }))
@@ -91,18 +91,18 @@ function le({ points: e, value: t, probability: n, valueDomain: r, probabilityDo
91
91
  if (c !== void 0) return `Cumulative point ${c.id} must have a probability from zero to one that does not decrease.`;
92
92
  }
93
93
  function ue(e) {
94
- let { points: t, value: n, probability: r, tone: i = "series1", height: o = "regular", selected: s, onSelectedChange: c, ...l } = e, { emptyLabel: f = "No cumulative distribution points are available.", ...p } = l, { locale: h } = p, g = j(o);
94
+ let { points: t, value: n, probability: i, tone: a = "series1", height: s = "regular", selected: c, onSelectedChange: l, ...u } = e, { emptyLabel: f = "No cumulative distribution points are available.", ...p } = u, { locale: h } = p, g = j(s);
95
95
  if (p.status === "loading") return /* @__PURE__ */ F(v, {
96
96
  ...p,
97
- height: o
97
+ height: s
98
98
  });
99
- let y = n.domain ?? a({
99
+ let y = n.domain ?? o({
100
100
  values: t.map((e) => e.value),
101
101
  scale: n.scale
102
- }), b = r.domain ?? ae, S = le({
102
+ }), b = i.domain ?? ae, S = le({
103
103
  points: t,
104
104
  value: n,
105
- probability: r,
105
+ probability: i,
106
106
  valueDomain: y,
107
107
  probabilityDomain: b
108
108
  });
@@ -110,11 +110,11 @@ function ue(e) {
110
110
  ...p,
111
111
  message: S
112
112
  });
113
- let C = u({
113
+ let C = d({
114
114
  width: g.width,
115
115
  height: g.height,
116
116
  x: n,
117
- y: r,
117
+ y: i,
118
118
  xDomain: y,
119
119
  yDomain: b,
120
120
  locale: h
@@ -124,10 +124,10 @@ function ue(e) {
124
124
  value: e.value,
125
125
  locale: h,
126
126
  format: n.format
127
- })}, ${r.label}: ${m({
127
+ })}, ${i.label}: ${m({
128
128
  value: e.probability,
129
129
  locale: h,
130
- format: r.format
130
+ format: i.format
131
131
  })}`
132
132
  })), D = t.map((e) => ({
133
133
  x: C.x.position(e.value),
@@ -137,7 +137,7 @@ function ue(e) {
137
137
  x: D[t]?.x ?? 0,
138
138
  y: 0
139
139
  }));
140
- return /* @__PURE__ */ F(d, {
140
+ return /* @__PURE__ */ F(r, {
141
141
  items: T,
142
142
  arrows: "both",
143
143
  locate: M({
@@ -146,27 +146,27 @@ function ue(e) {
146
146
  height: w.height,
147
147
  axis: "x"
148
148
  }),
149
- selected: s ?? null,
150
- onSelect: c,
151
- render: (e, a) => {
152
- let o = t.find((e) => e.id === a.cursor);
149
+ selected: c ?? null,
150
+ onSelect: l,
151
+ render: (e, r) => {
152
+ let o = t.find((e) => e.id === r.cursor);
153
153
  return /* @__PURE__ */ F(ie, {
154
154
  frame: p,
155
155
  figure: e,
156
156
  items: T,
157
- inspected: a.inspected,
157
+ inspected: r.inspected,
158
158
  plotRef: g.ref,
159
159
  plot: C,
160
160
  x: n,
161
- y: r,
162
- isSelectable: c !== void 0,
161
+ y: i,
162
+ isSelectable: l !== void 0,
163
163
  emptyLabel: f,
164
164
  overlay: /* @__PURE__ */ I(P, { children: [t.map((e) => {
165
- let t = a.selected === e.id, n = a.inspected === e.id;
165
+ let t = r.selected === e.id, n = r.inspected === e.id;
166
166
  return e.probability === null ? null : /* @__PURE__ */ F(E, {
167
167
  x: C.x.position(e.value),
168
168
  y: C.y.position(e.probability),
169
- tone: i,
169
+ tone: a,
170
170
  radius: t || n ? ce : se,
171
171
  isSelected: t,
172
172
  isInspected: n
@@ -179,7 +179,7 @@ function ue(e) {
179
179
  })] }),
180
180
  children: /* @__PURE__ */ F(O, {
181
181
  d: ne(D, "step"),
182
- tone: i
182
+ tone: a
183
183
  })
184
184
  });
185
185
  }
@@ -204,22 +204,22 @@ function me({ bins: e, value: t, count: n, valueDomain: r, countDomain: i }) {
204
204
  }
205
205
  }
206
206
  function he(e) {
207
- let { bins: t, value: n, count: r, tone: i = "series1", height: o = "regular", selected: s, onSelectedChange: c, ...l } = e, { emptyLabel: f = "No histogram bins are available.", ...p } = l, { locale: h } = p, g = j(o);
207
+ let { bins: t, value: n, count: i, tone: a = "series1", height: s = "regular", selected: c, onSelectedChange: l, ...u } = e, { emptyLabel: f = "No histogram bins are available.", ...p } = u, { locale: h } = p, g = j(s);
208
208
  if (p.status === "loading") return /* @__PURE__ */ F(v, {
209
209
  ...p,
210
- height: o
210
+ height: s
211
211
  });
212
- let y = t.flatMap((e) => [e.lowerBound, e.upperBound]), b = n.domain ?? a({
212
+ let y = t.flatMap((e) => [e.lowerBound, e.upperBound]), b = n.domain ?? o({
213
213
  values: y,
214
214
  scale: n.scale
215
- }), S = t.map((e) => e.count), C = r.domain ?? a({
215
+ }), S = t.map((e) => e.count), C = i.domain ?? o({
216
216
  values: S,
217
217
  isZeroBased: !0,
218
- scale: r.scale
218
+ scale: i.scale
219
219
  }), w = me({
220
220
  bins: t,
221
221
  value: n,
222
- count: r,
222
+ count: i,
223
223
  valueDomain: b,
224
224
  countDomain: C
225
225
  });
@@ -227,11 +227,11 @@ function he(e) {
227
227
  ...p,
228
228
  message: w
229
229
  });
230
- let T = u({
230
+ let T = d({
231
231
  width: g.width,
232
232
  height: g.height,
233
233
  x: n,
234
- y: r,
234
+ y: i,
235
235
  xDomain: b,
236
236
  yDomain: C,
237
237
  locale: h
@@ -245,33 +245,33 @@ function he(e) {
245
245
  }
246
246
  let O = t.map((e) => ({
247
247
  id: e.id,
248
- label: `${e.label}, ${D(e.lowerBound)} – ${D(e.upperBound)}, ${r.label}: ${m({
248
+ label: `${e.label}, ${D(e.lowerBound)} – ${D(e.upperBound)}, ${i.label}: ${m({
249
249
  value: e.count,
250
250
  locale: h,
251
- format: r.format
251
+ format: i.format
252
252
  })}`
253
253
  }));
254
- return /* @__PURE__ */ F(d, {
254
+ return /* @__PURE__ */ F(r, {
255
255
  items: O,
256
256
  arrows: "both",
257
257
  locate: (e) => {
258
258
  let n = T.x.valueAt(e.x / e.width * E.width);
259
259
  return t.find((e) => n >= e.lowerBound && n <= e.upperBound)?.id;
260
260
  },
261
- selected: s ?? null,
262
- onSelect: c,
263
- render: (e, a) => {
264
- let o = t.find((e) => e.id === a.cursor);
261
+ selected: c ?? null,
262
+ onSelect: l,
263
+ render: (e, r) => {
264
+ let o = t.find((e) => e.id === r.cursor);
265
265
  return /* @__PURE__ */ F(ie, {
266
266
  frame: p,
267
267
  figure: e,
268
268
  items: O,
269
- inspected: a.inspected,
269
+ inspected: r.inspected,
270
270
  plotRef: g.ref,
271
271
  plot: T,
272
272
  x: n,
273
- y: r,
274
- isSelectable: c !== void 0,
273
+ y: i,
274
+ isSelectable: l !== void 0,
275
275
  emptyLabel: f,
276
276
  overlay: o !== void 0 && /* @__PURE__ */ F(_, {
277
277
  x: (T.x.position(o.lowerBound) + T.x.position(o.upperBound)) / 2,
@@ -280,13 +280,13 @@ function he(e) {
280
280
  width: T.x.position(o.upperBound) - T.x.position(o.lowerBound)
281
281
  }),
282
282
  children: t.map((e) => {
283
- let t = T.x.position(e.lowerBound), n = T.x.position(e.upperBound) - t, r = Math.min(de, n * fe), o = a.selected === e.id, s = a.inspected === e.id, c = a.selected === null || o || s, l = e.count === null ? E.bottom - pe : T.y.position(e.count);
283
+ let t = T.x.position(e.lowerBound), n = T.x.position(e.upperBound) - t, i = Math.min(de, n * fe), o = r.selected === e.id, s = r.inspected === e.id, c = r.selected === null || o || s, l = e.count === null ? E.bottom - pe : T.y.position(e.count);
284
284
  return /* @__PURE__ */ F(k, {
285
- x: t + r / 2,
285
+ x: t + i / 2,
286
286
  y: l,
287
- width: n - r,
287
+ width: n - i,
288
288
  height: E.bottom - l,
289
- tone: i,
289
+ tone: a,
290
290
  isHollow: e.count === null,
291
291
  emphasis: c ? "normal" : "receded",
292
292
  isSelected: o,
@@ -300,7 +300,7 @@ function he(e) {
300
300
  // packages/charts/src/distribution/group-plot-layout.ts
301
301
  var z = .5, ge = 28, _e = 56;
302
302
  function B({ height: e, count: t }) {
303
- return Math.max(o[e], t * ge + _e);
303
+ return Math.max(s[e], t * ge + _e);
304
304
  }
305
305
  function ve(e) {
306
306
  let t = e === "columns";
@@ -324,7 +324,7 @@ function H(e) {
324
324
  return `${ne(e)}Z`;
325
325
  }
326
326
  function U({ width: e, height: t, direction: n, groups: r, value: i, valueDomain: a, locale: o }) {
327
- let c = s({
327
+ let s = c({
328
328
  width: e,
329
329
  height: t,
330
330
  direction: n,
@@ -332,7 +332,7 @@ function U({ width: e, height: t, direction: n, groups: r, value: i, valueDomain
332
332
  value: i,
333
333
  valueDomain: a,
334
334
  locale: o
335
- }), { box: u, band: d } = c, f = n === "columns", p = ve(n), m = r.map((e) => ({
335
+ }), { box: l, band: d } = s, f = n === "columns", p = ve(n), m = r.map((e) => ({
336
336
  ...e,
337
337
  center: d.center(e.id) ?? 0
338
338
  })), h = m.map((e) => ({
@@ -341,38 +341,38 @@ function U({ width: e, height: t, direction: n, groups: r, value: i, valueDomain
341
341
  }));
342
342
  return {
343
343
  ...f ? {
344
- xTicks: c.bandTicks,
345
- yTicks: c.valueTicks,
344
+ xTicks: s.bandTicks,
345
+ yTicks: s.valueTicks,
346
346
  xTitle: void 0,
347
- yTitle: l(i),
347
+ yTitle: u(i),
348
348
  grid: "y"
349
349
  } : {
350
- xTicks: c.valueTicks,
351
- yTicks: c.bandTicks,
352
- xTitle: l(i),
350
+ xTicks: s.valueTicks,
351
+ yTicks: s.bandTicks,
352
+ xTitle: u(i),
353
353
  yTitle: void 0,
354
354
  grid: "x"
355
355
  },
356
- box: u,
357
- value: c.value,
356
+ box: l,
357
+ value: s.value,
358
358
  bandwidth: d.bandwidth,
359
359
  placed: m,
360
360
  orient: p,
361
361
  locate: M({
362
362
  marks: h,
363
- width: u.width,
364
- height: u.height,
363
+ width: l.width,
364
+ height: l.height,
365
365
  axis: f ? "x" : "y"
366
366
  }),
367
367
  slot: (e) => f ? {
368
368
  x: e - d.step * z,
369
- y: u.top,
369
+ y: l.top,
370
370
  width: d.step,
371
- height: u.innerHeight
371
+ height: l.innerHeight
372
372
  } : {
373
- x: u.left,
373
+ x: l.left,
374
374
  y: e - d.step * z,
375
- width: u.innerWidth,
375
+ width: l.innerWidth,
376
376
  height: d.step
377
377
  }
378
378
  };
@@ -464,31 +464,31 @@ function De({ x: e, y: t, radius: n }) {
464
464
  ...N.props(W.unfilled, C.shapeCursor)
465
465
  });
466
466
  }
467
- function J({ frame: e, emptyLabel: t, size: n, axes: a, items: o, locate: s, place: l, marksLabel: u, note: p, marks: m, cursor: h, selected: g, onSelectedChange: _ }) {
468
- let v = re(), x = f(), { box: C, xTicks: w, yTicks: E, xTitle: D, yTitle: O, grid: k } = a;
469
- return /* @__PURE__ */ F(d, {
467
+ function J({ frame: e, emptyLabel: t, size: i, axes: o, items: s, locate: c, place: u, marksLabel: d, note: p, marks: m, cursor: h, selected: g, onSelectedChange: _ }) {
468
+ let v = re(), x = f(), { box: C, xTicks: w, yTicks: E, xTitle: D, yTitle: O, grid: k } = o;
469
+ return /* @__PURE__ */ F(r, {
470
470
  ...x,
471
- items: o,
472
- locate: s,
473
- place: l,
471
+ items: s,
472
+ locate: c,
473
+ place: u,
474
474
  selected: g,
475
475
  onSelect: _,
476
- render: (a, s) => /* @__PURE__ */ F(b, {
476
+ render: (r, o) => /* @__PURE__ */ F(b, {
477
477
  ...e,
478
- figure: a,
479
- footer: o.length === 0 ? void 0 : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(i, {
478
+ figure: r,
479
+ footer: s.length === 0 ? void 0 : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(a, {
480
480
  id: v,
481
- children: r(o, s.inspected)
481
+ children: n(s, o.inspected)
482
482
  }), p !== void 0 && /* @__PURE__ */ F("p", {
483
483
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xe0zcna",
484
484
  children: p
485
485
  })] }),
486
- children: o.length === 0 ? /* @__PURE__ */ F(S, { children: t }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ I(ee, {
487
- plotRef: n.ref,
486
+ children: s.length === 0 ? /* @__PURE__ */ F(S, { children: t }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ I(ee, {
487
+ plotRef: i.ref,
488
488
  box: C,
489
- label: c({
489
+ label: l({
490
490
  title: e.title,
491
- marks: u,
491
+ marks: d,
492
492
  isSelectable: _ !== void 0
493
493
  }),
494
494
  readoutId: v,
@@ -503,17 +503,17 @@ function J({ frame: e, emptyLabel: t, size: n, axes: a, items: o, locate: s, pla
503
503
  }),
504
504
  /* @__PURE__ */ F(te, {
505
505
  box: C,
506
- children: m(s)
506
+ children: m(o)
507
507
  }),
508
- s.cursor !== null && h(s.cursor)
508
+ o.cursor !== null && h(o.cursor)
509
509
  ]
510
510
  }), /* @__PURE__ */ F(y, {
511
- label: `${e.title} ${u}`,
511
+ label: `${e.title} ${d}`,
512
512
  columns: [{
513
513
  id: "observation",
514
514
  label: "Observation"
515
515
  }],
516
- rows: o.map((e) => ({
516
+ rows: s.map((e) => ({
517
517
  id: e.id,
518
518
  values: [e.label]
519
519
  }))
@@ -545,7 +545,7 @@ function ke({ items: e, value: t, domain: n }) {
545
545
  }
546
546
  }
547
547
  function Ae(e) {
548
- let { items: t, value: n, intervalLabel: r, height: i = "regular", selected: o, onSelectedChange: s, ...c } = e, { emptyLabel: l = "No interval estimates are available.", ...u } = c, { locale: d } = u, { ref: f, width: p } = w(), h = G(t);
548
+ let { items: t, value: n, intervalLabel: r, height: i = "regular", selected: a, onSelectedChange: s, ...c } = e, { emptyLabel: l = "No interval estimates are available.", ...u } = c, { locale: d } = u, { ref: f, width: p } = w(), h = G(t);
549
549
  if (u.status === "loading") return /* @__PURE__ */ F(v, {
550
550
  ...u,
551
551
  height: i
@@ -554,7 +554,7 @@ function Ae(e) {
554
554
  e.lower,
555
555
  e.estimate,
556
556
  e.upper
557
- ]), _ = n.domain ?? a({
557
+ ]), _ = n.domain ?? o({
558
558
  values: g,
559
559
  scale: n.scale
560
560
  }), y = ke({
@@ -607,7 +607,7 @@ function Ae(e) {
607
607
  items: O,
608
608
  locate: b.locate,
609
609
  marksLabel: "estimates",
610
- selected: o,
610
+ selected: a,
611
611
  onSelectedChange: s,
612
612
  note: `The dot is the estimate. The line is the ${r}.`,
613
613
  cursor: (e) => {
@@ -656,7 +656,7 @@ function Ne({ items: e, value: t, domain: n }) {
656
656
  return i === void 0 ? void 0 : `Ranked value ${i.id} is non-finite or lies outside the declared domain.`;
657
657
  }
658
658
  function Pe(e) {
659
- let { items: t, value: n, height: r = "regular", selected: i, onSelectedChange: o, ...s } = e, { emptyLabel: c = "No ranked values are available.", ...l } = s, { locale: u } = l, { ref: d, width: f } = w(), p = G(t.map((e) => ({
659
+ let { items: t, value: n, height: r = "regular", selected: i, onSelectedChange: a, ...s } = e, { emptyLabel: c = "No ranked values are available.", ...l } = s, { locale: u } = l, { ref: d, width: f } = w(), p = G(t.map((e) => ({
660
660
  ...e,
661
661
  label: e.rank === void 0 ? e.label : `${e.rank} · ${e.label}`
662
662
  })));
@@ -664,7 +664,7 @@ function Pe(e) {
664
664
  ...l,
665
665
  height: r
666
666
  });
667
- let h = t.map((e) => e.value), g = n.domain ?? a({
667
+ let h = t.map((e) => e.value), g = n.domain ?? o({
668
668
  values: h,
669
669
  isZeroBased: !0,
670
670
  scale: n.scale
@@ -709,7 +709,7 @@ function Pe(e) {
709
709
  locate: y.locate,
710
710
  marksLabel: "ranked values",
711
711
  selected: i,
712
- onSelectedChange: o,
712
+ onSelectedChange: a,
713
713
  cursor: (e) => {
714
714
  let t = S.find((t) => t.id === e);
715
715
  return t === void 0 ? null : /* @__PURE__ */ F(q, { ...y.slot(t.center) });
@@ -735,11 +735,11 @@ function Pe(e) {
735
735
  }
736
736
  // packages/charts/src/distribution/group-plot-input.ts
737
737
  var Fe = 2;
738
- function X({ records: e, limit: t, noun: r, domain: i, scale: a }) {
739
- let o = g(i, a);
738
+ function X({ records: e, limit: t, noun: n, domain: r, scale: a }) {
739
+ let o = g(r, a);
740
740
  if (o !== void 0) return o;
741
- if (!n(e)) return `Each of the ${r} needs a unique identifier.`;
742
- if (e.length > t) return `This chart draws at most ${t} ${r}.`;
741
+ if (!i(e)) return `Each of the ${n} needs a unique identifier.`;
742
+ if (e.length > t) return `This chart draws at most ${t} ${n}.`;
743
743
  }
744
744
  function Ie({ id: e, density: t, domain: n, limit: r }) {
745
745
  if (t.length < Fe) return `${e} needs at least ${Fe} density points.`;
@@ -795,12 +795,12 @@ function Ue({ groups: e, domain: t, value: n }) {
795
795
  }
796
796
  }
797
797
  function We(e) {
798
- let { groups: t, value: n, direction: r = "columns", whiskerLabel: i, height: o = "regular", ...s } = e, { emptyLabel: c = "No groups are available.", ...l } = s, { locale: u } = l, d = j(o), f = G(t);
798
+ let { groups: t, value: n, direction: r = "columns", whiskerLabel: i, height: a = "regular", ...s } = e, { emptyLabel: c = "No groups are available.", ...l } = s, { locale: u } = l, d = j(a), f = G(t);
799
799
  if (l.status === "loading") return /* @__PURE__ */ F(v, {
800
800
  ...l,
801
- height: o
801
+ height: a
802
802
  });
803
- let p = n.domain ?? a({
803
+ let p = n.domain ?? o({
804
804
  values: t.flatMap((e) => [...He(e), ...e.outliers ?? []]),
805
805
  scale: n.scale
806
806
  }), h = Ue({
@@ -915,7 +915,7 @@ var Ge = {
915
915
  densityPoints: 200
916
916
  }, Ke = .5, qe = .5;
917
917
  function Je(e) {
918
- let { rows: t, value: n, overlap: r = Ke, densityLabel: i, height: o = "regular", ...c } = e, { emptyLabel: u = "No rows are available.", ...d } = c, { locale: f } = d, h = j(o), g = p(), _ = t.map((e) => ({
918
+ let { rows: t, value: n, overlap: r = Ke, densityLabel: i, height: a = "regular", ...s } = e, { emptyLabel: l = "No rows are available.", ...d } = s, { locale: f } = d, h = j(a), g = p(), _ = t.map((e) => ({
919
919
  ...e,
920
920
  tone: g({
921
921
  id: e.id,
@@ -925,9 +925,9 @@ function Je(e) {
925
925
  }));
926
926
  if (d.status === "loading") return /* @__PURE__ */ F(v, {
927
927
  ...d,
928
- height: o
928
+ height: a
929
929
  });
930
- let y = n.domain ?? a({
930
+ let y = n.domain ?? o({
931
931
  values: t.flatMap((e) => e.density.map((e) => e.value)),
932
932
  scale: n.scale
933
933
  }), b = X({
@@ -948,10 +948,10 @@ function Je(e) {
948
948
  ...d,
949
949
  message: b
950
950
  });
951
- let S = s({
951
+ let S = c({
952
952
  width: h.width,
953
953
  height: B({
954
- height: o,
954
+ height: a,
955
955
  count: t.length
956
956
  }),
957
957
  direction: "rows",
@@ -980,7 +980,7 @@ function Je(e) {
980
980
  });
981
981
  return /* @__PURE__ */ F(J, {
982
982
  frame: d,
983
- emptyLabel: u,
983
+ emptyLabel: l,
984
984
  size: h,
985
985
  axes: {
986
986
  box: C,
@@ -990,7 +990,7 @@ function Je(e) {
990
990
  position: e.baseline,
991
991
  label: e.label
992
992
  })),
993
- xTitle: l(n),
993
+ xTitle: u(n),
994
994
  grid: "x"
995
995
  },
996
996
  items: O,
@@ -1048,29 +1048,29 @@ var $ = {
1048
1048
  points: 2e3,
1049
1049
  groups: 24
1050
1050
  }, Xe = 3.5, Ze = .8, Qe = .45;
1051
- function $e({ groups: e, points: t, summary: r, domain: i, value: a }) {
1051
+ function $e({ groups: e, points: t, summary: n, domain: r, value: a }) {
1052
1052
  let o = X({
1053
1053
  records: e,
1054
1054
  limit: $.groups,
1055
1055
  noun: "groups",
1056
- domain: i,
1056
+ domain: r,
1057
1057
  scale: a.scale
1058
1058
  });
1059
1059
  if (o !== void 0) return o;
1060
- if (!n(t)) return "Each point needs a unique identifier.";
1060
+ if (!i(t)) return "Each point needs a unique identifier.";
1061
1061
  if (t.length > $.points) return `This chart draws at most ${$.points} points. Supply a sample or a window.`;
1062
1062
  let s = new Set(e.map((e) => e.id)), c = t.find((e) => !s.has(e.groupId));
1063
1063
  if (c !== void 0) return `Point ${c.id} names a group, ${c.groupId}, that is not in the chart.`;
1064
- if (t.some((e) => h(e.value, i))) return "A point has a value that is not finite or lies outside the declared domain.";
1065
- if (Object.entries(r ?? {}).some(([e, t]) => !s.has(e) || h(t, i))) return "A summary names an unknown group or lies outside the declared domain.";
1064
+ if (t.some((e) => h(e.value, r))) return "A point has a value that is not finite or lies outside the declared domain.";
1065
+ if (Object.entries(n ?? {}).some(([e, t]) => !s.has(e) || h(t, r))) return "A summary names an unknown group or lies outside the declared domain.";
1066
1066
  }
1067
1067
  function et(e) {
1068
- let { groups: t, points: n, value: r, summary: i, summaryLabel: o = "Summary", height: s = "regular", selected: c, onSelectedChange: l, ...u } = e, { emptyLabel: d = "No observations are available.", ...f } = u, { locale: p } = f, h = j(s), g = G(t);
1068
+ let { groups: t, points: n, value: r, summary: i, summaryLabel: a = "Summary", height: s = "regular", selected: c, onSelectedChange: l, ...u } = e, { emptyLabel: d = "No observations are available.", ...f } = u, { locale: p } = f, h = j(s), g = G(t);
1069
1069
  if (f.status === "loading") return /* @__PURE__ */ F(v, {
1070
1070
  ...f,
1071
1071
  height: s
1072
1072
  });
1073
- let _ = r.domain ?? a({
1073
+ let _ = r.domain ?? o({
1074
1074
  values: [...n.map((e) => e.value), ...Object.values(i ?? {})],
1075
1075
  scale: r.scale
1076
1076
  }), y = $e({
@@ -1109,7 +1109,7 @@ function et(e) {
1109
1109
  e.label ?? e.id,
1110
1110
  e.group.label,
1111
1111
  `${r.label} ${w(e.value)}`,
1112
- ...t === void 0 ? [] : [`${o} for the group ${w(t)}`]
1112
+ ...t === void 0 ? [] : [`${a} for the group ${w(t)}`]
1113
1113
  ];
1114
1114
  return {
1115
1115
  id: e.id,
@@ -1136,7 +1136,7 @@ function et(e) {
1136
1136
  selected: c,
1137
1137
  onSelectedChange: l,
1138
1138
  marksLabel: "points",
1139
- note: i === void 0 ? "Each dot is one observation. Dots are translucent, so overlaps look darker." : `Each dot is one observation. The ink tick in each group is its ${o.toLowerCase()}.`,
1139
+ note: i === void 0 ? "Each dot is one observation. Dots are translucent, so overlaps look darker." : `Each dot is one observation. The ink tick in each group is its ${a.toLowerCase()}.`,
1140
1140
  cursor: (e) => {
1141
1141
  let t = T.find((t) => t.id === e);
1142
1142
  return t === void 0 ? null : /* @__PURE__ */ F(De, {
@@ -1208,12 +1208,12 @@ function at({ groups: e, domain: t, value: n }) {
1208
1208
  }
1209
1209
  }
1210
1210
  function ot(e) {
1211
- let { groups: t, value: n, densityLabel: r, height: i = "regular", ...o } = e, { emptyLabel: s = "No groups are available.", ...c } = o, { locale: l } = c, u = j(i), d = G(t);
1211
+ let { groups: t, value: n, densityLabel: r, height: i = "regular", ...a } = e, { emptyLabel: s = "No groups are available.", ...c } = a, { locale: l } = c, u = j(i), d = G(t);
1212
1212
  if (c.status === "loading") return /* @__PURE__ */ F(v, {
1213
1213
  ...c,
1214
1214
  height: i
1215
1215
  });
1216
- let f = n.domain ?? a({
1216
+ let f = n.domain ?? o({
1217
1217
  values: t.flatMap((e) => [...e.density.map((e) => e.value), ...it(e)]),
1218
1218
  scale: n.scale
1219
1219
  }), p = at({