@mechane-ai/elements 0.49.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.
- package/README.md +40 -2
- package/dist/{article-yyNPg6VU.js → article-CRlhq9oA.js} +531 -463
- package/dist/article.js +1 -1
- package/dist/catalog.json +29 -1
- package/dist/{categorical-values-DCznViFp.js → categorical-values-BYP_R5gS.js} +13 -13
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +1 -1
- package/dist/charts/plot.js +4 -4
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +1 -1
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +7 -7
- package/dist/{dumbbell-plot-CMv9llfd.js → dumbbell-plot-B-Tn7ewW.js} +45 -45
- package/dist/{embedding-map-DC-lgzCq.js → embedding-map-Bljn-A5q.js} +528 -528
- package/dist/figure-frame-CEijciL7.js +289 -0
- package/dist/{image-grid-DHqtj_zs.js → image-grid-mrG5u9oE.js} +47 -47
- package/dist/kits/evaluation.js +3 -3
- package/dist/kits/interpretability.js +6 -6
- package/dist/kits/operations.js +3 -3
- package/dist/kits/research.js +2 -2
- package/dist/kits/training.js +2 -2
- package/dist/lesson/spec.js +11 -11
- package/dist/lesson.js +4 -4
- package/dist/mdx.js +4 -4
- package/dist/packages/charts/src/figure/caption-scope.d.ts +12 -0
- package/dist/packages/charts/src/figure/figure-frame.d.ts +2 -1
- package/dist/packages/charts/src/index.d.ts +2 -0
- package/dist/packages/teaching/src/article/article-context.d.ts +2 -0
- package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +13 -0
- package/dist/packages/teaching/src/article/article.d.ts +6 -1
- package/dist/packages/teaching/src/article/figure.d.ts +20 -3
- package/dist/packages/teaching/src/article/index.d.ts +1 -1
- package/dist/packages/teaching/src/article/view-essay.d.ts +2 -1
- package/dist/packages/teaching/src/lesson/define-lesson.d.ts +4 -0
- package/dist/packages/teaching/src/lesson/index.d.ts +2 -2
- package/dist/packages/teaching/src/lesson/lesson-player.d.ts +19 -3
- package/dist/packages/teaching/src/lesson/lesson-store.d.ts +2 -0
- package/dist/packages/teaching/src/lesson/playback.d.ts +9 -6
- package/dist/packages/teaching/src/lesson/use-lesson.d.ts +7 -2
- package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +4 -1
- package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +5 -6
- package/dist/packages/teaching/src/scene/scene-geometry.d.ts +1 -1
- package/dist/packages/teaching/src/scene/scene-node.d.ts +4 -1
- package/dist/packages/teaching/src/scene/scene-validate.d.ts +6 -0
- package/dist/packages/teaching/src/scene/scene-wire.d.ts +6 -1
- package/dist/packages/teaching/src/scene/scene.d.ts +1 -1
- package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +5 -1
- package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +1 -1
- package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +1 -1
- package/dist/packages/teaching/src/time/tween.d.ts +2 -0
- package/dist/{param-BE3VMSkH.js → param-BdqTpZER.js} +166 -99
- package/dist/{plot-layout-Bqe4-0qZ.js → plot-layout-B2xRt-_k.js} +144 -130
- package/dist/{plot-surface-DON6WUmk.js → plot-surface-0cKFwtws.js} +1 -1
- package/dist/{reference-lines-hjuD1rRZ.js → reference-lines-nSxcZVF5.js} +1 -1
- package/dist/{scene-BP0Ue0R5.js → scene-BwJKueD6.js} +1227 -1125
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-C8eeSgL4.js → slope-chart-CGTYbFxi.js} +179 -179
- package/dist/styles2.css +69 -14
- package/dist/{time-series-BL933QyA.js → time-series-Dh8y5ba0.js} +952 -948
- package/dist/{token-heatmap-BB65awva.js → token-heatmap-BTrZ3-N4.js} +84 -84
- package/dist/{token-predictions-Pa8eUGan.js → token-predictions-CUe4junQ.js} +126 -126
- package/dist/{transport-DzyxVXbL.js → transport-4V9rfYHN.js} +278 -233
- package/dist/{tree-diagram-DJhKBiia.js → tree-diagram-Dpqmo-fh.js} +115 -115
- package/dist/{treemap-CxxgABUg.js → treemap-BUSaVD3m.js} +27 -27
- package/dist/use-tween-BsaEO862.js +10 -0
- package/dist/{violin-plot-CoAEF_7Z.js → violin-plot-BxaLwdRi.js} +123 -123
- package/dist/{waterfall-DdoEXEkT.js → waterfall-CcDMdKec.js} +39 -39
- package/package.json +1 -1
- package/recipes/counting-cards.tsx +3 -3
- package/skills/review-explainer/SKILL.md +2 -1
- package/skills/upgrade-elements/references/releases.md +61 -0
- package/skills/use-elements/SKILL.md +3 -1
- package/skills/use-elements/references/styling.md +23 -0
- package/skills/use-elements/references/teaching.md +13 -0
- package/skills/write-explainer/references/article.md +50 -2
- package/skills/write-explainer/references/lesson.md +18 -9
- package/skills/write-explainer/references/scene-parts.md +17 -12
- package/skills/write-explainer/references/scene.md +25 -3
- package/dist/figure-frame-BjFzbl3m.js +0 -270
- 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,
|
|
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-
|
|
8
|
+
import { i as v, l as y, n as b, r as x, t as S } from "./figure-frame-CEijciL7.js";
|
|
9
9
|
import { n as C, t as w } from "./plot-width-D3hTycYX.js";
|
|
10
10
|
import { t as T } from "./plot-axes-D5S9BnBa.js";
|
|
11
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-
|
|
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:
|
|
25
|
-
let a = g(t,
|
|
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 (!
|
|
28
|
-
if (e.length >
|
|
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:
|
|
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(
|
|
36
|
+
footer: /* @__PURE__ */ F(a, {
|
|
37
37
|
id: g,
|
|
38
|
-
children: r
|
|
38
|
+
children: n(r, i)
|
|
39
39
|
}),
|
|
40
|
-
children:
|
|
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:
|
|
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:
|
|
54
|
-
yTitle:
|
|
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:
|
|
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:
|
|
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:
|
|
97
|
+
height: s
|
|
98
98
|
});
|
|
99
|
-
let y = n.domain ??
|
|
99
|
+
let y = n.domain ?? o({
|
|
100
100
|
values: t.map((e) => e.value),
|
|
101
101
|
scale: n.scale
|
|
102
|
-
}), b =
|
|
102
|
+
}), b = i.domain ?? ae, S = le({
|
|
103
103
|
points: t,
|
|
104
104
|
value: n,
|
|
105
|
-
probability:
|
|
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 =
|
|
113
|
+
let C = d({
|
|
114
114
|
width: g.width,
|
|
115
115
|
height: g.height,
|
|
116
116
|
x: n,
|
|
117
|
-
y:
|
|
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
|
-
})}, ${
|
|
127
|
+
})}, ${i.label}: ${m({
|
|
128
128
|
value: e.probability,
|
|
129
129
|
locale: h,
|
|
130
|
-
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(
|
|
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:
|
|
150
|
-
onSelect:
|
|
151
|
-
render: (e,
|
|
152
|
-
let o = t.find((e) => e.id ===
|
|
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:
|
|
157
|
+
inspected: r.inspected,
|
|
158
158
|
plotRef: g.ref,
|
|
159
159
|
plot: C,
|
|
160
160
|
x: n,
|
|
161
|
-
y:
|
|
162
|
-
isSelectable:
|
|
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 =
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
210
|
+
height: s
|
|
211
211
|
});
|
|
212
|
-
let y = t.flatMap((e) => [e.lowerBound, e.upperBound]), b = n.domain ??
|
|
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 =
|
|
215
|
+
}), S = t.map((e) => e.count), C = i.domain ?? o({
|
|
216
216
|
values: S,
|
|
217
217
|
isZeroBased: !0,
|
|
218
|
-
scale:
|
|
218
|
+
scale: i.scale
|
|
219
219
|
}), w = me({
|
|
220
220
|
bins: t,
|
|
221
221
|
value: n,
|
|
222
|
-
count:
|
|
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 =
|
|
230
|
+
let T = d({
|
|
231
231
|
width: g.width,
|
|
232
232
|
height: g.height,
|
|
233
233
|
x: n,
|
|
234
|
-
y:
|
|
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)}, ${
|
|
248
|
+
label: `${e.label}, ${D(e.lowerBound)} – ${D(e.upperBound)}, ${i.label}: ${m({
|
|
249
249
|
value: e.count,
|
|
250
250
|
locale: h,
|
|
251
|
-
format:
|
|
251
|
+
format: i.format
|
|
252
252
|
})}`
|
|
253
253
|
}));
|
|
254
|
-
return /* @__PURE__ */ F(
|
|
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:
|
|
262
|
-
onSelect:
|
|
263
|
-
render: (e,
|
|
264
|
-
let o = t.find((e) => e.id ===
|
|
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:
|
|
269
|
+
inspected: r.inspected,
|
|
270
270
|
plotRef: g.ref,
|
|
271
271
|
plot: T,
|
|
272
272
|
x: n,
|
|
273
|
-
y:
|
|
274
|
-
isSelectable:
|
|
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,
|
|
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 +
|
|
285
|
+
x: t + i / 2,
|
|
286
286
|
y: l,
|
|
287
|
-
width: n -
|
|
287
|
+
width: n - i,
|
|
288
288
|
height: E.bottom - l,
|
|
289
|
-
tone:
|
|
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(
|
|
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
|
|
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:
|
|
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:
|
|
345
|
-
yTicks:
|
|
344
|
+
xTicks: s.bandTicks,
|
|
345
|
+
yTicks: s.valueTicks,
|
|
346
346
|
xTitle: void 0,
|
|
347
|
-
yTitle:
|
|
347
|
+
yTitle: u(i),
|
|
348
348
|
grid: "y"
|
|
349
349
|
} : {
|
|
350
|
-
xTicks:
|
|
351
|
-
yTicks:
|
|
352
|
-
xTitle:
|
|
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:
|
|
357
|
-
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:
|
|
364
|
-
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:
|
|
369
|
+
y: l.top,
|
|
370
370
|
width: d.step,
|
|
371
|
-
height:
|
|
371
|
+
height: l.innerHeight
|
|
372
372
|
} : {
|
|
373
|
-
x:
|
|
373
|
+
x: l.left,
|
|
374
374
|
y: e - d.step * z,
|
|
375
|
-
width:
|
|
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:
|
|
468
|
-
let v = re(), x = f(), { box: C, xTicks: w, yTicks: E, xTitle: D, yTitle: O, grid: k } =
|
|
469
|
-
return /* @__PURE__ */ F(
|
|
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:
|
|
472
|
-
locate:
|
|
473
|
-
place:
|
|
471
|
+
items: s,
|
|
472
|
+
locate: c,
|
|
473
|
+
place: u,
|
|
474
474
|
selected: g,
|
|
475
475
|
onSelect: _,
|
|
476
|
-
render: (
|
|
476
|
+
render: (r, o) => /* @__PURE__ */ F(b, {
|
|
477
477
|
...e,
|
|
478
|
-
figure:
|
|
479
|
-
footer:
|
|
478
|
+
figure: r,
|
|
479
|
+
footer: s.length === 0 ? void 0 : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(a, {
|
|
480
480
|
id: v,
|
|
481
|
-
children:
|
|
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:
|
|
487
|
-
plotRef:
|
|
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:
|
|
489
|
+
label: l({
|
|
490
490
|
title: e.title,
|
|
491
|
-
marks:
|
|
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(
|
|
506
|
+
children: m(o)
|
|
507
507
|
}),
|
|
508
|
-
|
|
508
|
+
o.cursor !== null && h(o.cursor)
|
|
509
509
|
]
|
|
510
510
|
}), /* @__PURE__ */ F(y, {
|
|
511
|
-
label: `${e.title} ${
|
|
511
|
+
label: `${e.title} ${d}`,
|
|
512
512
|
columns: [{
|
|
513
513
|
id: "observation",
|
|
514
514
|
label: "Observation"
|
|
515
515
|
}],
|
|
516
|
-
rows:
|
|
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:
|
|
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 ??
|
|
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:
|
|
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:
|
|
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 ??
|
|
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:
|
|
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:
|
|
739
|
-
let o = g(
|
|
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 (!
|
|
742
|
-
if (e.length > t) return `This chart draws at most ${t} ${
|
|
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:
|
|
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:
|
|
801
|
+
height: a
|
|
802
802
|
});
|
|
803
|
-
let p = n.domain ??
|
|
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:
|
|
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:
|
|
928
|
+
height: a
|
|
929
929
|
});
|
|
930
|
-
let y = n.domain ??
|
|
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 =
|
|
951
|
+
let S = c({
|
|
952
952
|
width: h.width,
|
|
953
953
|
height: B({
|
|
954
|
-
height:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
1056
|
+
domain: r,
|
|
1057
1057
|
scale: a.scale
|
|
1058
1058
|
});
|
|
1059
1059
|
if (o !== void 0) return o;
|
|
1060
|
-
if (!
|
|
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,
|
|
1065
|
-
if (Object.entries(
|
|
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:
|
|
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 ??
|
|
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 ? [] : [`${
|
|
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 ${
|
|
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", ...
|
|
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 ??
|
|
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({
|