@mechane-ai/elements 0.49.0 → 0.50.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.
- 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 +37 -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/collections.js +1 -1
- package/dist/{dumbbell-plot-CMv9llfd.js → dumbbell-plot-BC8d_IJy.js} +45 -45
- package/dist/{embedding-map-DC-lgzCq.js → embedding-map-Bj8krO-d.js} +528 -528
- package/dist/figure-frame-koVKcXph.js +323 -0
- package/dist/{image-grid-DHqtj_zs.js → image-grid-CLhol2jy.js} +47 -47
- package/dist/kits/evaluation.js +50 -48
- package/dist/kits/interpretability.js +7 -7
- package/dist/kits/operations.js +4 -4
- package/dist/kits/research.js +346 -264
- package/dist/kits/training.js +3 -3
- package/dist/layout.js +1 -1075
- package/dist/lesson/spec.js +11 -11
- package/dist/lesson.js +4 -4
- package/dist/mdx.js +4 -4
- package/dist/packages/charts/src/chart-inspection.d.ts +4 -1
- 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/collections/src/data-table-trigger.d.ts +2 -0
- package/dist/packages/kits/src/evaluation/leaderboard.d.ts +2 -0
- package/dist/packages/kits/src/research/collection-page.d.ts +46 -0
- package/dist/packages/kits/src/research/index.d.ts +2 -0
- package/dist/packages/kits/src/research/milestone-path.d.ts +1 -2
- package/dist/packages/kits/src/research/work-heartbeat.d.ts +4 -3
- package/dist/packages/layout/src/detail-page.d.ts +3 -1
- 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-4ePpWdmE.js} +1227 -1125
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-C8eeSgL4.js → slope-chart-DWZIYDty.js} +179 -179
- package/dist/{src-B2rgpWap.js → src-DNclWY4V.js} +1 -1
- package/dist/src-DhWMspwr.js +1085 -0
- package/dist/styles2.css +77 -14
- package/dist/{time-series-BL933QyA.js → time-series-CsngFxr1.js} +952 -948
- package/dist/{token-heatmap-BB65awva.js → token-heatmap-BQLIxPky.js} +84 -84
- package/dist/{token-predictions-Pa8eUGan.js → token-predictions-C3B5L-eO.js} +126 -126
- package/dist/{transport-DzyxVXbL.js → transport-4V9rfYHN.js} +278 -233
- package/dist/{tree-diagram-DJhKBiia.js → tree-diagram-Dau9jeXS.js} +115 -115
- package/dist/{treemap-CxxgABUg.js → treemap-DWrMQndu.js} +27 -27
- package/dist/use-tween-BsaEO862.js +10 -0
- package/dist/{violin-plot-CoAEF_7Z.js → violin-plot-D05ODcyc.js} +123 -123
- package/dist/{waterfall-DdoEXEkT.js → waterfall-BkLLv2Lm.js} +39 -39
- package/package.json +1 -1
- package/recipes/counting-cards.tsx +3 -3
- package/skills/review-elements/SKILL.md +14 -0
- package/skills/review-explainer/SKILL.md +2 -1
- package/skills/upgrade-elements/references/releases.md +61 -0
- package/skills/use-elements/SKILL.md +21 -17
- package/skills/use-elements/references/editorial-restraint.md +40 -0
- package/skills/use-elements/references/styling.md +23 -0
- package/skills/use-elements/references/teaching.md +13 -0
- package/skills/use-elements/references/workspace.md +14 -8
- 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,12 +1,12 @@
|
|
|
1
1
|
import { t as e } from "./chart-tones-ei3BC2AL.js";
|
|
2
|
-
import { A as t,
|
|
3
|
-
import { i as s, n as c, t as l } from "./categorical-values-
|
|
2
|
+
import { A as t, E as n, M as r, S as i, j as a, s as o } from "./plot-layout-B2xRt-_k.js";
|
|
3
|
+
import { i as s, n as c, t as l } from "./categorical-values-BYP_R5gS.js";
|
|
4
4
|
import { i as u } from "./chart-link-AE_xuxiP.js";
|
|
5
5
|
import { a as d } from "./tone-scope-DKiSw-JR.js";
|
|
6
6
|
import { r as f } from "./figure-format-B8kRZMlo.js";
|
|
7
|
-
import { i as p, l as m, n as h, r as g, t as _ } from "./figure-frame-
|
|
7
|
+
import { i as p, l as m, n as h, r as g, t as _ } from "./figure-frame-koVKcXph.js";
|
|
8
8
|
import { n as v } from "./plot-width-D3hTycYX.js";
|
|
9
|
-
import { n as y, r as b } from "./plot-surface-
|
|
9
|
+
import { n as y, r as b } from "./plot-surface-0cKFwtws.js";
|
|
10
10
|
import * as x from "@stylexjs/stylex";
|
|
11
11
|
import { useId as S } from "react";
|
|
12
12
|
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
@@ -127,19 +127,19 @@ function H(e, t, n) {
|
|
|
127
127
|
}
|
|
128
128
|
function ee(e) {
|
|
129
129
|
if (e.length > R.nodes) return `This chart draws at most ${R.nodes} nodes. Supply a coarser hierarchy.`;
|
|
130
|
-
if (!
|
|
130
|
+
if (!r(e)) return "Hierarchy nodes must have unique identifiers.";
|
|
131
131
|
if (e.filter((e) => e.parentId === null).length !== 1) return "A hierarchy needs exactly one root node with a null parent.";
|
|
132
|
-
let
|
|
133
|
-
if (
|
|
134
|
-
if (
|
|
132
|
+
let t = e.map((t) => H(e, t, /* @__PURE__ */ new Set([t.id])));
|
|
133
|
+
if (t.includes(void 0)) return "Every node must name a supplied parent, and the parents must not form a cycle.";
|
|
134
|
+
if (t.some((e) => e !== void 0 && e > R.depth)) return `This chart draws at most ${R.depth} levels below the root.`;
|
|
135
135
|
if (e.some((e) => e.value !== null && (!Number.isFinite(e.value) || e.value < 0))) return "Node values must be finite and nonnegative, or explicitly missing.";
|
|
136
|
-
let
|
|
136
|
+
let n = e.find((t) => {
|
|
137
137
|
let n = e.filter((e) => e.parentId === t.id), r = n.reduce((e, t) => e + (t.value ?? 0), 0);
|
|
138
138
|
return t.value !== null && r > t.value * (1 + 2 ** -52 * n.length);
|
|
139
139
|
});
|
|
140
|
-
return
|
|
140
|
+
return n === void 0 ? void 0 : `${n.label} is less than the sum of its children. Supply each node's own total.`;
|
|
141
141
|
}
|
|
142
|
-
function U({ nodes: e, valueFormat:
|
|
142
|
+
function U({ nodes: e, valueFormat: r, selected: s, onSelectedChange: c, height: l = "regular", ...v }) {
|
|
143
143
|
let { emptyLabel: x = "No hierarchy was supplied.", ...E } = v, { locale: D, title: O } = E, k = b(l), A = S(), j = d(), M = u();
|
|
144
144
|
if (E.status === "loading") return /* @__PURE__ */ w(p, {
|
|
145
145
|
...E,
|
|
@@ -168,7 +168,7 @@ function U({ nodes: e, valueFormat: t, selected: s, onSelectedChange: c, height:
|
|
|
168
168
|
id: e.id,
|
|
169
169
|
parentId: e.parentId,
|
|
170
170
|
value: e.value
|
|
171
|
-
}] : []), K =
|
|
171
|
+
}] : []), K = o({
|
|
172
172
|
width: k.width,
|
|
173
173
|
height: k.height,
|
|
174
174
|
margins: {
|
|
@@ -186,7 +186,7 @@ function U({ nodes: e, valueFormat: t, selected: s, onSelectedChange: c, height:
|
|
|
186
186
|
return f({
|
|
187
187
|
value: e,
|
|
188
188
|
locale: D,
|
|
189
|
-
format:
|
|
189
|
+
format: r
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
function Y(e) {
|
|
@@ -214,25 +214,25 @@ function U({ nodes: e, valueFormat: t, selected: s, onSelectedChange: c, height:
|
|
|
214
214
|
right: e.x1,
|
|
215
215
|
bottom: e.y1
|
|
216
216
|
}])), $ = e.length - G.length;
|
|
217
|
-
return /* @__PURE__ */ w(
|
|
217
|
+
return /* @__PURE__ */ w(n, {
|
|
218
218
|
...M,
|
|
219
219
|
items: Z,
|
|
220
220
|
place: (e) => Q.get(e),
|
|
221
221
|
locate: (e) => L(q, e.x / e.width * K.width, e.y / e.height * K.height)?.id,
|
|
222
222
|
selected: s ?? null,
|
|
223
223
|
onSelect: c,
|
|
224
|
-
render: (
|
|
224
|
+
render: (n, { inspected: r, cursor: o }) => /* @__PURE__ */ w(h, {
|
|
225
225
|
...E,
|
|
226
|
-
figure:
|
|
227
|
-
footer: /* @__PURE__ */ w(
|
|
226
|
+
figure: n,
|
|
227
|
+
footer: /* @__PURE__ */ w(i, {
|
|
228
228
|
id: A,
|
|
229
|
-
children:
|
|
229
|
+
children: t(Z, r)
|
|
230
230
|
}),
|
|
231
231
|
children: e.length === 0 ? /* @__PURE__ */ w(_, { children: x }) : /* @__PURE__ */ T(C, { children: [
|
|
232
232
|
/* @__PURE__ */ w(y, {
|
|
233
233
|
plotRef: k.ref,
|
|
234
234
|
box: K,
|
|
235
|
-
label:
|
|
235
|
+
label: a({
|
|
236
236
|
title: O,
|
|
237
237
|
marks: "nodes",
|
|
238
238
|
isSelectable: c !== void 0
|
|
@@ -244,7 +244,7 @@ function U({ nodes: e, valueFormat: t, selected: s, onSelectedChange: c, height:
|
|
|
244
244
|
label: t.label,
|
|
245
245
|
valueLabel: J(t.value),
|
|
246
246
|
labelWidth: B,
|
|
247
|
-
isInspected:
|
|
247
|
+
isInspected: r === t.id,
|
|
248
248
|
isSelected: s === t.id,
|
|
249
249
|
isCursor: o === t.id
|
|
250
250
|
}, t.id))
|
|
@@ -391,11 +391,11 @@ function Q({ items: e, width: t, height: n, gap: r = 0 }) {
|
|
|
391
391
|
}
|
|
392
392
|
// packages/charts/src/hierarchy/treemap.tsx
|
|
393
393
|
var $ = 2, te = 96;
|
|
394
|
-
function ne({ items: e, valueFormat: t, selected:
|
|
395
|
-
let { emptyLabel: u = "No positive values to size the areas", ...m } =
|
|
394
|
+
function ne({ items: e, valueFormat: t, selected: r, onSelectedChange: i, height: a = "compact", ...o }) {
|
|
395
|
+
let { emptyLabel: u = "No positive values to size the areas", ...m } = o, { locale: y, title: S } = m, { ref: C, width: E, height: D } = b(a), O = d();
|
|
396
396
|
if (m.status === "loading") return /* @__PURE__ */ w(p, {
|
|
397
397
|
...m,
|
|
398
|
-
height:
|
|
398
|
+
height: a
|
|
399
399
|
});
|
|
400
400
|
let k = s(e);
|
|
401
401
|
if (k !== void 0) return /* @__PURE__ */ w(g, {
|
|
@@ -424,11 +424,11 @@ function ne({ items: e, valueFormat: t, selected: n, onSelectedChange: r, height
|
|
|
424
424
|
height: D,
|
|
425
425
|
gap: $
|
|
426
426
|
});
|
|
427
|
-
return /* @__PURE__ */ w(
|
|
427
|
+
return /* @__PURE__ */ w(n, {
|
|
428
428
|
items: c(A),
|
|
429
429
|
arrows: "both",
|
|
430
|
-
selected:
|
|
431
|
-
onSelect:
|
|
430
|
+
selected: r ?? null,
|
|
431
|
+
onSelect: i,
|
|
432
432
|
render: (t, n) => /* @__PURE__ */ T(h, {
|
|
433
433
|
...m,
|
|
434
434
|
figure: t,
|
|
@@ -459,7 +459,7 @@ function ne({ items: e, valueFormat: t, selected: n, onSelectedChange: r, height
|
|
|
459
459
|
/* @__PURE__ */ w(l, {
|
|
460
460
|
title: S,
|
|
461
461
|
items: A,
|
|
462
|
-
view:
|
|
462
|
+
view: i === void 0 ? void 0 : n
|
|
463
463
|
}),
|
|
464
464
|
e.some((e) => e.value === null) && /* @__PURE__ */ w("p", {
|
|
465
465
|
className: "x153jb6y x1ghz6dp xy8obcc",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { _ as e } from "./param-BdqTpZER.js";
|
|
2
|
+
import { useEffect as t, useState as n, useSyncExternalStore as r } from "react";
|
|
3
|
+
// packages/teaching/src/time/use-tween.ts
|
|
4
|
+
function i(i, a = "regular") {
|
|
5
|
+
let [o] = n(() => e(i));
|
|
6
|
+
return t(() => {
|
|
7
|
+
o.to(i, a);
|
|
8
|
+
}), t(() => o.destroy, [o]), r(o.subscribe, o.get, o.get);
|
|
9
|
+
}
|
|
10
|
+
export { i as t };
|