@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.
- package/README.md +40 -2
- package/dist/ai.js +5 -5
- package/dist/{article-BXZr10QQ.js → article-CRlhq9oA.js} +532 -464
- package/dist/article.js +1 -1
- package/dist/catalog.json +243 -1
- package/dist/{categorical-values-BpVq8cFj.js → categorical-values-BYP_R5gS.js} +13 -13
- package/dist/{cells-xVmnQ9oQ.js → cells-CNZE4us2.js} +2 -2
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/cells.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 +7 -7
- 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/{code-block-DioAM2bZ.js → code-block-BZsY2sh3.js} +1 -1
- package/dist/collections.js +1 -1
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +1 -1
- package/dist/{content-link-NWuHp5rC.js → content-link-PnpcnTCx.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/{dates-Cww8UR_n.js → dates-ckJdYF7t.js} +1 -1
- package/dist/{dumbbell-plot-DQdTxDeO.js → dumbbell-plot-B-Tn7ewW.js} +49 -48
- package/dist/{embedding-map-CF-J-8JW.js → embedding-map-Bljn-A5q.js} +533 -533
- package/dist/feedback.js +1 -1
- package/dist/figure-frame-CEijciL7.js +289 -0
- package/dist/forms/dates.js +1 -1
- package/dist/forms.js +3 -3
- package/dist/{image-grid-Dl2sjIMB.js → image-grid-mrG5u9oE.js} +49 -49
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +5 -5
- package/dist/kits/interpretability.js +320 -302
- package/dist/kits/operations.js +6 -6
- package/dist/kits/research.js +558 -0
- package/dist/kits/training.js +6 -6
- package/dist/layout.js +205 -110
- package/dist/lesson/spec.js +11 -11
- package/dist/lesson.js +4 -4
- package/dist/mdx.js +6 -6
- package/dist/navigation.js +2 -2
- package/dist/packages/charts/src/cartesian/index.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +18 -0
- package/dist/packages/charts/src/chart-theme.d.ts +1 -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/charts/src/plot/plot-surface.d.ts +3 -1
- package/dist/packages/collections/src/index.d.ts +1 -1
- package/dist/packages/collections/src/metrics.d.ts +9 -1
- package/dist/packages/content/src/index.d.ts +2 -0
- package/dist/packages/content/src/text-match.d.ts +22 -0
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/surfaces.d.ts +12 -2
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/token-input.d.ts +24 -0
- package/dist/packages/kits/src/interpretability/index.d.ts +1 -1
- package/dist/packages/kits/src/interpretability/logit-lens.d.ts +10 -1
- package/dist/packages/kits/src/research/finding-card.d.ts +43 -0
- package/dist/packages/kits/src/research/index.d.ts +8 -0
- package/dist/packages/kits/src/research/milestone-path.d.ts +36 -0
- package/dist/packages/kits/src/research/specimen-diff.d.ts +41 -0
- package/dist/packages/kits/src/research/work-heartbeat.d.ts +34 -0
- package/dist/packages/layout/src/figure-grid.d.ts +8 -0
- package/dist/packages/layout/src/index.d.ts +4 -1
- package/dist/packages/layout/src/sidebar.d.ts +7 -0
- package/dist/packages/layout/src/workbench.d.ts +4 -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-CqKUTHaO.js → param-BdqTpZER.js} +175 -108
- package/dist/{pierre-diff-DlvjyuJn.js → pierre-diff-aGyQK5xK.js} +1 -1
- package/dist/{plot-axes-DJkLW4wk.js → plot-axes-D5S9BnBa.js} +1 -1
- package/dist/{plot-layout-CZVSJ-le.js → plot-layout-B2xRt-_k.js} +146 -132
- package/dist/{plot-marks-uozcbOIX.js → plot-marks-FVsbFkUs.js} +3 -3
- package/dist/{plot-surface-CbVBvgqZ.js → plot-surface-0cKFwtws.js} +11 -11
- package/dist/{plot-width-DcqtSgzb.js → plot-width-D3hTycYX.js} +1 -1
- package/dist/{reference-lines-BDcttOp0.js → reference-lines-nSxcZVF5.js} +2 -2
- package/dist/{scene-0z2gbaDE.js → scene-BwJKueD6.js} +1228 -1126
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-BKVEAVCs.js → slope-chart-CGTYbFxi.js} +182 -182
- package/dist/{src-CpdJlDhO.js → src-9EJskqB_.js} +73 -31
- package/dist/{src-Dcfq8vE4.js → src-B2rgpWap.js} +48 -14
- package/dist/{src-BPTDJqt0.js → src-Ci8DeY8J.js} +1 -1
- package/dist/{src-CGc_hjxJ.js → src-DFW49IAs.js} +143 -111
- package/dist/{src-BD6xlvDt.js → src-Dxs3Buo_.js} +203 -137
- package/dist/{src-CExIrXPC.js → src-npqwq3Sa.js} +1 -1
- package/dist/styles2.css +136 -17
- package/dist/{time-series-BgzGNOk0.js → time-series-Dh8y5ba0.js} +1018 -944
- package/dist/{token-heatmap-BrW1OsKD.js → token-heatmap-BTrZ3-N4.js} +86 -86
- package/dist/{token-predictions-yerq_Oet.js → token-predictions-CUe4junQ.js} +129 -129
- package/dist/{transport-BJweqDPj.js → transport-4V9rfYHN.js} +291 -246
- package/dist/{tree-diagram-D09BRqE-.js → tree-diagram-Dpqmo-fh.js} +118 -118
- package/dist/{treemap-CW4WsJNL.js → treemap-BUSaVD3m.js} +28 -28
- package/dist/use-tween-BsaEO862.js +10 -0
- package/dist/{violin-plot-DrtPZ1-T.js → violin-plot-BxaLwdRi.js} +126 -126
- package/dist/{waterfall-DYLSnGjm.js → waterfall-CcDMdKec.js} +43 -43
- package/package.json +5 -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/kits.md +7 -6
- 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-BJ3REgTA.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-
|
|
8
|
-
import { n as v } from "./plot-width-
|
|
9
|
-
import { n as y, r as b } from "./plot-surface-
|
|
7
|
+
import { i as p, l as m, n as h, r as g, t as _ } from "./figure-frame-CEijciL7.js";
|
|
8
|
+
import { n as v } from "./plot-width-D3hTycYX.js";
|
|
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 };
|