@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,14 +1,14 @@
|
|
|
1
1
|
import { t as e } from "./accessibility-P89UG9-r.js";
|
|
2
|
-
import { T as t, k as n } from "./src-
|
|
2
|
+
import { T as t, k as n } from "./src-9EJskqB_.js";
|
|
3
3
|
import { n as r, t as i } from "./chart-tones-ei3BC2AL.js";
|
|
4
|
-
import { A as a,
|
|
4
|
+
import { A as a, D as o, E as s, M as c, O as l, S as u, T as d, c as f, j as p, x as m } from "./plot-layout-B2xRt-_k.js";
|
|
5
5
|
import { i as h } from "./chart-link-AE_xuxiP.js";
|
|
6
6
|
import { a as g } from "./tone-scope-DKiSw-JR.js";
|
|
7
7
|
import { r as _ } from "./figure-format-B8kRZMlo.js";
|
|
8
|
-
import { i as v, l as y, n as b, r as x, t as S } from "./figure-frame-
|
|
9
|
-
import { n as C, t as w } from "./plot-width-
|
|
10
|
-
import { a as T, c as E, p as D, u as O } from "./plot-marks-
|
|
11
|
-
import { r as k } from "./plot-surface-
|
|
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 { a as T, c as E, p as D, u as O } from "./plot-marks-FVsbFkUs.js";
|
|
11
|
+
import { r as k } from "./plot-surface-0cKFwtws.js";
|
|
12
12
|
import { t as A } from "./label-spacing-BncjePGb.js";
|
|
13
13
|
import { i as ee } from "./path-BglsXpnO.js";
|
|
14
14
|
import { m as j } from "./values-963L6n1m.js";
|
|
@@ -199,7 +199,7 @@ var q = {
|
|
|
199
199
|
}, ae = 8, Q = 8, oe = 16, se = 6.5, ce = 22, le = 180, ue = 48, de = 240, fe = 18, pe = 5;
|
|
200
200
|
function me({ nodes: e, links: t }) {
|
|
201
201
|
if (e.length > Z.nodes || t.length > Z.links) return `This flow exceeds the render limit of ${Z.nodes} nodes or ${Z.links} links. Supply a smaller, labelled grouping.`;
|
|
202
|
-
if (!
|
|
202
|
+
if (!c([...e, ...t])) return "Flow nodes and links require distinct, unique identifiers.";
|
|
203
203
|
let n = new Set(e.map((e) => e.id));
|
|
204
204
|
for (let e of t) {
|
|
205
205
|
if (!(n.has(e.sourceId) && n.has(e.targetId) && e.sourceId !== e.targetId)) return "Every flow link must join two different supplied nodes.";
|
|
@@ -232,12 +232,12 @@ function ye({ nodes: e, links: t, amountText: n }) {
|
|
|
232
232
|
return Math.min(le, Math.max(0, ...r) * se + Q);
|
|
233
233
|
}
|
|
234
234
|
function be(e) {
|
|
235
|
-
let { nodes: t, links: n, valueFormat:
|
|
235
|
+
let { nodes: t, links: n, valueFormat: c, height: d, selected: m, onSelectedChange: T, ...E } = e, { emptyLabel: D = "No flows", ...O } = E, { locale: k, title: A } = O, { ref: ee, width: j } = w(), N = g(), P = h();
|
|
236
236
|
function F(e) {
|
|
237
237
|
return _({
|
|
238
238
|
value: e,
|
|
239
239
|
locale: k,
|
|
240
|
-
format:
|
|
240
|
+
format: c
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
243
|
let I = me({
|
|
@@ -246,7 +246,7 @@ function be(e) {
|
|
|
246
246
|
}), z = (I === void 0 ? ne({
|
|
247
247
|
nodes: t,
|
|
248
248
|
links: n
|
|
249
|
-
}) : void 0) ?? /* @__PURE__ */ new Map(), B = Math.max(0, ...z.values()), V = Array.from({ length: B + 1 }, (e, n) => t.filter((e) => z.get(e.id) === n).length), H =
|
|
249
|
+
}) : void 0) ?? /* @__PURE__ */ new Map(), B = Math.max(0, ...z.values()), V = Array.from({ length: B + 1 }, (e, n) => t.filter((e) => z.get(e.id) === n).length), H = d === void 0 ? Math.max(de, Math.max(...V) * ue) : f[d], U = B === 0 ? [] : t.filter((e) => z.get(e.id) === 0), W = t.filter((e) => z.get(e.id) === B), G = ye({
|
|
250
250
|
nodes: U,
|
|
251
251
|
links: n,
|
|
252
252
|
amountText: F
|
|
@@ -281,28 +281,28 @@ function be(e) {
|
|
|
281
281
|
}))]), Q = te();
|
|
282
282
|
return O.status === "loading" ? /* @__PURE__ */ L(v, {
|
|
283
283
|
...O,
|
|
284
|
-
height:
|
|
285
|
-
}) : I === void 0 ? /* @__PURE__ */ L(
|
|
284
|
+
height: d ?? "regular"
|
|
285
|
+
}) : I === void 0 ? /* @__PURE__ */ L(s, {
|
|
286
286
|
...P,
|
|
287
287
|
items: Z,
|
|
288
288
|
arrows: "both",
|
|
289
289
|
selected: m ?? null,
|
|
290
290
|
onSelect: T,
|
|
291
|
-
render: (e, { inspected: n, cursor:
|
|
292
|
-
let
|
|
293
|
-
function
|
|
294
|
-
return
|
|
291
|
+
render: (e, { inspected: n, cursor: s }) => {
|
|
292
|
+
let c = Y.links.find((e) => e.link.id === n), d = Y.nodes.find((e) => e.node.id === n);
|
|
293
|
+
function f(e) {
|
|
294
|
+
return c === void 0 ? d !== void 0 && [e.source.node.id, e.target.node.id].includes(d.node.id) : c.link.id === e.link.id;
|
|
295
295
|
}
|
|
296
296
|
function h(e) {
|
|
297
|
-
return
|
|
297
|
+
return c === void 0 ? d === void 0 || d.node.id === e.node.id || Y.links.some((t) => f(t) && [t.source.node.id, t.target.node.id].includes(e.node.id)) : [c.source.node.id, c.target.node.id].includes(e.node.id);
|
|
298
298
|
}
|
|
299
299
|
let g = n !== null;
|
|
300
300
|
return /* @__PURE__ */ R(b, {
|
|
301
301
|
...O,
|
|
302
302
|
figure: e,
|
|
303
|
-
footer: /* @__PURE__ */ L(
|
|
303
|
+
footer: /* @__PURE__ */ L(u, {
|
|
304
304
|
id: Q,
|
|
305
|
-
children:
|
|
305
|
+
children: a(Z, n)
|
|
306
306
|
}),
|
|
307
307
|
children: [/* @__PURE__ */ L(y, {
|
|
308
308
|
label: `${A} flows`,
|
|
@@ -325,9 +325,9 @@ function be(e) {
|
|
|
325
325
|
}))]
|
|
326
326
|
}), /* @__PURE__ */ L("div", {
|
|
327
327
|
ref: ee,
|
|
328
|
-
children: t.length === 0 ? /* @__PURE__ */ L(S, { children: D }) : /* @__PURE__ */ L(
|
|
328
|
+
children: t.length === 0 ? /* @__PURE__ */ L(S, { children: D }) : /* @__PURE__ */ L(l, {
|
|
329
329
|
role: "group",
|
|
330
|
-
"aria-label":
|
|
330
|
+
"aria-label": p({
|
|
331
331
|
title: A,
|
|
332
332
|
isSelectable: T !== void 0
|
|
333
333
|
}),
|
|
@@ -340,14 +340,14 @@ function be(e) {
|
|
|
340
340
|
className: "x1lliihq xh8yej3 x1rea2x4",
|
|
341
341
|
children: [
|
|
342
342
|
/* @__PURE__ */ L("g", { children: Y.links.map((e) => {
|
|
343
|
-
let t = i[e.tone], n =
|
|
344
|
-
return /* @__PURE__ */ L(
|
|
343
|
+
let t = i[e.tone], n = f(e), r = e.width > 0, a = m === e.link.id, c = !g && !a && s === e.link.id;
|
|
344
|
+
return /* @__PURE__ */ L(o, {
|
|
345
345
|
value: e.link.id,
|
|
346
346
|
render: /* @__PURE__ */ L("path", { d: r ? ie(e) : K(e) }),
|
|
347
|
-
...M.props(r ? X.ribbon(t) : X.thread(t), e.link.value === null && X.unavailable, X.transition, n && r && X.lit, g && !n && X.dim,
|
|
347
|
+
...M.props(r ? X.ribbon(t) : X.thread(t), e.link.value === null && X.unavailable, X.transition, n && r && X.lit, g && !n && X.dim, a && X.selected, T !== void 0 && X.interactive, c && (r ? C.shapeCursor : C.cursor))
|
|
348
348
|
}, e.link.id);
|
|
349
349
|
}) }),
|
|
350
|
-
Y.nodes.map((e) => /* @__PURE__ */ L(
|
|
350
|
+
Y.nodes.map((e) => /* @__PURE__ */ L(o, {
|
|
351
351
|
value: e.node.id,
|
|
352
352
|
render: /* @__PURE__ */ L("rect", {
|
|
353
353
|
x: e.x,
|
|
@@ -355,7 +355,7 @@ function be(e) {
|
|
|
355
355
|
width: 12,
|
|
356
356
|
height: e.height
|
|
357
357
|
}),
|
|
358
|
-
...M.props(X.node(i[e.tone], r[e.tone]), X.transition, g && !h(e) && X.dim, m === e.node.id && X.selected, T !== void 0 && X.interactive, !g &&
|
|
358
|
+
...M.props(X.node(i[e.tone], r[e.tone]), X.transition, g && !h(e) && X.dim, m === e.node.id && X.selected, T !== void 0 && X.interactive, !g && s === e.node.id && C.cursor)
|
|
359
359
|
}, e.node.id)),
|
|
360
360
|
/* @__PURE__ */ L(xe, {
|
|
361
361
|
nodes: Y.nodes,
|
|
@@ -502,29 +502,29 @@ function De(e) {
|
|
|
502
502
|
"compact",
|
|
503
503
|
"regular",
|
|
504
504
|
"tall"
|
|
505
|
-
].toSorted((t, n) => Math.abs(
|
|
505
|
+
].toSorted((t, n) => Math.abs(f[t] - e) - Math.abs(f[n] - e))[0] ?? "regular";
|
|
506
506
|
}
|
|
507
507
|
function Oe(e) {
|
|
508
|
-
let { nodes: t, edges: n, groups: r = [], width:
|
|
508
|
+
let { nodes: t, edges: n, groups: r = [], width: c, height: d, selected: f, onSelectedChange: m, ..._ } = e, { emptyLabel: T = "No nodes were supplied.", ...E } = _, { title: D } = E, O = g(), k = t.map((e) => ({
|
|
509
509
|
id: e.id,
|
|
510
510
|
label: [e.label, e.description].filter((e) => e !== void 0).join(", ")
|
|
511
511
|
})), A = te(), ee = te(), j = w(), N = h();
|
|
512
512
|
if (E.status === "loading") return /* @__PURE__ */ L(v, {
|
|
513
513
|
...E,
|
|
514
|
-
height: De(
|
|
514
|
+
height: De(d)
|
|
515
515
|
});
|
|
516
516
|
let P = ke({
|
|
517
517
|
nodes: t,
|
|
518
518
|
edges: n,
|
|
519
519
|
groups: r,
|
|
520
|
-
width:
|
|
521
|
-
height:
|
|
520
|
+
width: c,
|
|
521
|
+
height: d
|
|
522
522
|
});
|
|
523
523
|
if (P !== null) return /* @__PURE__ */ L(x, {
|
|
524
524
|
...E,
|
|
525
525
|
message: P
|
|
526
526
|
});
|
|
527
|
-
let F = Math.min(...t.map((e) => e.width)), I = Math.max((j.width - Se) /
|
|
527
|
+
let F = Math.min(...t.map((e) => e.width)), I = Math.max((j.width - Se) / c, Math.min(1, Ce / F)), z = c * I, B = t.map((e) => we(e, I)), V = r.map((e) => ({
|
|
528
528
|
...e,
|
|
529
529
|
x: e.x * I,
|
|
530
530
|
width: e.width * I
|
|
@@ -532,7 +532,7 @@ function Oe(e) {
|
|
|
532
532
|
return ne === null ? /* @__PURE__ */ L(x, {
|
|
533
533
|
...E,
|
|
534
534
|
message: "Every relationship must refer to two supplied nodes."
|
|
535
|
-
}) : /* @__PURE__ */ L(
|
|
535
|
+
}) : /* @__PURE__ */ L(s, {
|
|
536
536
|
...N,
|
|
537
537
|
items: k,
|
|
538
538
|
place: (e) => {
|
|
@@ -544,31 +544,31 @@ function Oe(e) {
|
|
|
544
544
|
bottom: t.y + t.height
|
|
545
545
|
};
|
|
546
546
|
},
|
|
547
|
-
selected:
|
|
547
|
+
selected: f ?? null,
|
|
548
548
|
onSelect: m,
|
|
549
|
-
render: (e, { inspected: n, cursor:
|
|
549
|
+
render: (e, { inspected: n, cursor: s }) => /* @__PURE__ */ R(b, {
|
|
550
550
|
...E,
|
|
551
551
|
figure: e,
|
|
552
|
-
footer: /* @__PURE__ */ L(
|
|
552
|
+
footer: /* @__PURE__ */ L(u, {
|
|
553
553
|
id: A,
|
|
554
|
-
children:
|
|
554
|
+
children: a(k, n)
|
|
555
555
|
}),
|
|
556
556
|
children: [U ? /* @__PURE__ */ L("div", {
|
|
557
557
|
ref: j.ref,
|
|
558
558
|
className: "xeuugli x41o525",
|
|
559
|
-
children: /* @__PURE__ */ L(
|
|
559
|
+
children: /* @__PURE__ */ L(l, {
|
|
560
560
|
role: "group",
|
|
561
|
-
"aria-label":
|
|
561
|
+
"aria-label": p({
|
|
562
562
|
title: D,
|
|
563
563
|
isSelectable: m !== void 0
|
|
564
564
|
}),
|
|
565
565
|
"aria-describedby": A,
|
|
566
566
|
className: "xysyzu8 xzuc9lq xeuugli x1t137rt xmkeg23 x1y0btm7 x1ey3b81 x13qnu6 x19rmrnh x9v5kkp x1bqaal x-default-marker",
|
|
567
567
|
children: /* @__PURE__ */ R("div", {
|
|
568
|
-
...M.props(Ee.canvas(z,
|
|
568
|
+
...M.props(Ee.canvas(z, d)),
|
|
569
569
|
children: [/* @__PURE__ */ R("svg", {
|
|
570
570
|
width: z,
|
|
571
|
-
height:
|
|
571
|
+
height: d,
|
|
572
572
|
"aria-hidden": !0,
|
|
573
573
|
className: "x10l6tqk x10a8y8t x1lliihq",
|
|
574
574
|
children: [
|
|
@@ -615,25 +615,25 @@ function Oe(e) {
|
|
|
615
615
|
})
|
|
616
616
|
]
|
|
617
617
|
}), B.map((e, t) => {
|
|
618
|
-
let
|
|
618
|
+
let a = f === e.id, c = a || n === e.id, l = [
|
|
619
619
|
...r.filter((t) => t.nodeIds.includes(e.id)).map((e) => e.label),
|
|
620
620
|
e.label,
|
|
621
621
|
e.description
|
|
622
622
|
].filter((e) => e !== void 0).join(", ");
|
|
623
|
-
return /* @__PURE__ */ R(
|
|
623
|
+
return /* @__PURE__ */ R(o, {
|
|
624
624
|
value: e.id,
|
|
625
625
|
render: m === void 0 ? /* @__PURE__ */ L("div", { role: "group" }) : /* @__PURE__ */ L("button", {
|
|
626
626
|
type: "button",
|
|
627
627
|
tabIndex: -1,
|
|
628
|
-
"aria-pressed":
|
|
628
|
+
"aria-pressed": a
|
|
629
629
|
}),
|
|
630
|
-
"aria-label":
|
|
631
|
-
title:
|
|
630
|
+
"aria-label": l,
|
|
631
|
+
title: l,
|
|
632
632
|
...M.props(Ee.node, Ee.position(e.x, e.y), Ee.size(e.width, e.height), Ee.tone(i[O({
|
|
633
633
|
id: e.id,
|
|
634
634
|
tone: e.tone,
|
|
635
635
|
index: t
|
|
636
|
-
})]), m !== void 0 && Ee.action,
|
|
636
|
+
})]), m !== void 0 && Ee.action, c && Ee.selected, !c && s === e.id && C.cursor),
|
|
637
637
|
children: [/* @__PURE__ */ L("span", {
|
|
638
638
|
className: "xtqrqnz x1778rvt xk4h15q xb3r6kr xlyipyv xuxw1ft",
|
|
639
639
|
children: e.label
|
|
@@ -673,15 +673,15 @@ function Oe(e) {
|
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
675
|
function ke({ nodes: e, edges: t, groups: n, width: r, height: i }) {
|
|
676
|
-
let { dimension:
|
|
677
|
-
if (!Number.isFinite(r) || r <= 0 || r >
|
|
676
|
+
let { dimension: a } = $;
|
|
677
|
+
if (!Number.isFinite(r) || r <= 0 || r > a || !Number.isFinite(i) || i <= 0 || i > a) return `Graph dimensions must be finite, positive, and at most ${a} pixels.`;
|
|
678
678
|
if (e.length > $.nodes || t.length > $.edges || n.length > $.groups) return `This graph exceeds the render limit of ${$.nodes} nodes, ${$.edges} relationships, or ${$.groups} groups. Supply a smaller, labelled neighborhood.`;
|
|
679
|
-
let
|
|
680
|
-
return !
|
|
679
|
+
let o = new Set(e.map((e) => e.id));
|
|
680
|
+
return !c(e) || !c(t) || !c(n) ? "Graph nodes, relationships, and groups must have unique identifiers." : [...e, ...n].some((e) => {
|
|
681
681
|
if (!Number.isFinite(e.width) || !Number.isFinite(e.height) || e.width <= 0 || e.height <= 0) return !0;
|
|
682
682
|
let t = !Number.isFinite(e.x) || e.x < 0 || e.x + e.width > r, n = !Number.isFinite(e.y) || e.y < 0 || e.y + e.height > i;
|
|
683
683
|
return t || n;
|
|
684
|
-
}) ? "Graph boxes must have finite, positive dimensions and fit inside the supplied canvas." : e.some((e) => e.width < 44 || e.height < 44) ? "Graph node boxes must be at least 44 by 44 pixels." : t.some((t) => t.sourceId === t.targetId && e.some((e) => e.id === t.sourceId && e.y < 36)) ? "A self-relationship needs at least 36 pixels of space above its node." : n.some((e) => new Set(e.nodeIds).size !== e.nodeIds.length || e.nodeIds.some((e) => !
|
|
684
|
+
}) ? "Graph boxes must have finite, positive dimensions and fit inside the supplied canvas." : e.some((e) => e.width < 44 || e.height < 44) ? "Graph node boxes must be at least 44 by 44 pixels." : t.some((t) => t.sourceId === t.targetId && e.some((e) => e.id === t.sourceId && e.y < 36)) ? "A self-relationship needs at least 36 pixels of space above its node." : n.some((e) => new Set(e.nodeIds).size !== e.nodeIds.length || e.nodeIds.some((e) => !o.has(e))) ? "Each group must contain unique references to supplied nodes." : n.some((t) => t.nodeIds.some((n) => {
|
|
685
685
|
let r = e.find((e) => e.id === n);
|
|
686
686
|
if (r === void 0) return !1;
|
|
687
687
|
let i = r.x < t.x || r.x + r.width > t.x + t.width, a = r.y < t.y || r.y + r.height > t.y + t.height;
|
|
@@ -798,24 +798,24 @@ var Le = 6, Re = "…", ze = 32, Be = { ring: {
|
|
|
798
798
|
kfzvcC: "x47corl",
|
|
799
799
|
$$css: !0
|
|
800
800
|
} };
|
|
801
|
-
function Ve({ plotRef: e, title: t, marks: n, readoutId: r, isSelectable: i, width: a, height: o, cursor:
|
|
802
|
-
let d = P(null),
|
|
801
|
+
function Ve({ plotRef: e, title: t, marks: n, readoutId: r, isSelectable: i, width: a, height: o, cursor: s, onKeyDown: c, children: u }) {
|
|
802
|
+
let d = P(null), f = s?.x, m = s?.y;
|
|
803
803
|
return N(() => {
|
|
804
804
|
let e = d.current;
|
|
805
|
-
if (e === null ||
|
|
806
|
-
let t = Math.min(
|
|
805
|
+
if (e === null || f === void 0 || m === void 0 || !e.contains(e.ownerDocument.activeElement)) return;
|
|
806
|
+
let t = Math.min(f - ze, Math.max(e.scrollLeft, f + ze - e.clientWidth)), n = Math.min(m - ze, Math.max(e.scrollTop, m + ze - e.clientHeight));
|
|
807
807
|
e.scrollTo({
|
|
808
808
|
left: t,
|
|
809
809
|
top: n
|
|
810
810
|
});
|
|
811
|
-
}, [
|
|
811
|
+
}, [f, m]), /* @__PURE__ */ L("div", {
|
|
812
812
|
ref: e,
|
|
813
|
-
onKeyDown:
|
|
813
|
+
onKeyDown: c,
|
|
814
814
|
className: "xeuugli x41o525",
|
|
815
|
-
children: /* @__PURE__ */ L(
|
|
815
|
+
children: /* @__PURE__ */ L(l, {
|
|
816
816
|
ref: d,
|
|
817
817
|
role: "group",
|
|
818
|
-
"aria-label":
|
|
818
|
+
"aria-label": p({
|
|
819
819
|
title: t,
|
|
820
820
|
marks: n,
|
|
821
821
|
isSelectable: i
|
|
@@ -895,16 +895,16 @@ function ft(e) {
|
|
|
895
895
|
...e
|
|
896
896
|
};
|
|
897
897
|
}
|
|
898
|
-
function pt({ layers: e, nodes: t, edges: n, pinned: r, valueFormat: i, valueLabel:
|
|
899
|
-
let
|
|
900
|
-
if (e.length >
|
|
901
|
-
if (!
|
|
902
|
-
let
|
|
898
|
+
function pt({ layers: e, nodes: t, edges: n, pinned: r, valueFormat: i, valueLabel: a }) {
|
|
899
|
+
let o = We;
|
|
900
|
+
if (e.length > o.layers || t.length > o.nodes || n.length > o.edges) return `This graph draws at most ${o.layers} layers, ${o.nodes} nodes and ${o.edges} edges. Supply a pruned graph.`;
|
|
901
|
+
if (!c(e) || !c(t) || !c(n)) return "Layers, nodes and edges must each have unique identifiers.";
|
|
902
|
+
let s = new Map(e.map((e, t) => [e.id, t])), l = t.find((e) => !s.has(e.layerId));
|
|
903
903
|
if (l !== void 0) return `Node ${l.id} names layer ${l.layerId}, which is not supplied.`;
|
|
904
904
|
let u = t.find((e) => typeof e.value == "number" && !Number.isFinite(e.value));
|
|
905
905
|
if (u !== void 0) return `Node ${u.id} has a value that is not finite. Use null for a value that was not recorded.`;
|
|
906
|
-
if (t.some((e) => typeof e.value == "number") && (i === void 0 ||
|
|
907
|
-
let d = new Map(t.map((e) => [e.id,
|
|
906
|
+
if (t.some((e) => typeof e.value == "number") && (i === void 0 || a === void 0)) return "Nodes carry values, so the graph needs a valueLabel and a valueFormat to state them.";
|
|
907
|
+
let d = new Map(t.map((e) => [e.id, s.get(e.layerId) ?? 0]));
|
|
908
908
|
for (let e of n) {
|
|
909
909
|
let t = d.get(e.sourceId), n = d.get(e.targetId);
|
|
910
910
|
if (t === void 0 || n === void 0) return `Edge ${e.id} names a node that is not supplied.`;
|
|
@@ -985,14 +985,14 @@ function _t({ kinds: e, weightLabel: t }) {
|
|
|
985
985
|
children: [
|
|
986
986
|
/* @__PURE__ */ R("li", {
|
|
987
987
|
className: "x3nfvp2 x6s0dn4 xunmzkg xuxw1ft",
|
|
988
|
-
children: [/* @__PURE__ */ L(
|
|
988
|
+
children: [/* @__PURE__ */ L(d, {
|
|
989
989
|
tone: "positive",
|
|
990
990
|
shape: "line"
|
|
991
991
|
}), `${t} above zero`]
|
|
992
992
|
}),
|
|
993
993
|
/* @__PURE__ */ R("li", {
|
|
994
994
|
className: "x3nfvp2 x6s0dn4 xunmzkg xuxw1ft",
|
|
995
|
-
children: [/* @__PURE__ */ L(
|
|
995
|
+
children: [/* @__PURE__ */ L(d, {
|
|
996
996
|
tone: "negative",
|
|
997
997
|
shape: "line"
|
|
998
998
|
}), `${t} below zero`]
|
|
@@ -1033,18 +1033,18 @@ function vt({ label: e, placed: t, isUp: n }) {
|
|
|
1033
1033
|
});
|
|
1034
1034
|
}
|
|
1035
1035
|
function yt(r) {
|
|
1036
|
-
let { layers: i, nodes:
|
|
1036
|
+
let { layers: i, nodes: c, edges: l, weightLabel: u, weightFormat: d, valueLabel: f, valueFormat: p, direction: m = "up", pinned: g, onPinnedChange: w, selected: T, onSelectedChange: E, ...A } = r, { emptyLabel: ee = "No attribution graph is available.", ...j } = A, { locale: N, title: P } = j, z = k("tall"), B = te(), V = h(), [H, ne] = F([]);
|
|
1037
1037
|
if (j.status === "loading") return /* @__PURE__ */ L(v, {
|
|
1038
1038
|
...j,
|
|
1039
1039
|
height: "tall"
|
|
1040
1040
|
});
|
|
1041
1041
|
let U = pt({
|
|
1042
1042
|
layers: i,
|
|
1043
|
-
nodes:
|
|
1044
|
-
edges:
|
|
1043
|
+
nodes: c,
|
|
1044
|
+
edges: l,
|
|
1045
1045
|
pinned: g,
|
|
1046
|
-
valueFormat:
|
|
1047
|
-
valueLabel:
|
|
1046
|
+
valueFormat: p,
|
|
1047
|
+
valueLabel: f
|
|
1048
1048
|
});
|
|
1049
1049
|
if (U !== void 0) return /* @__PURE__ */ L(x, {
|
|
1050
1050
|
...j,
|
|
@@ -1052,37 +1052,37 @@ function yt(r) {
|
|
|
1052
1052
|
});
|
|
1053
1053
|
let W = Ie({
|
|
1054
1054
|
layers: i,
|
|
1055
|
-
nodes:
|
|
1056
|
-
edges:
|
|
1055
|
+
nodes: c,
|
|
1056
|
+
edges: l,
|
|
1057
1057
|
direction: m,
|
|
1058
1058
|
width: z.width
|
|
1059
|
-
}), G = new Map(
|
|
1059
|
+
}), G = new Map(c.map((e) => [e.id, e])), re = new Map(i.map((e) => [e.id, e])), ie = g ?? H, K = new Set(ie), q = m === "up", J = je.nodeRadius;
|
|
1060
1060
|
function Y(e) {
|
|
1061
1061
|
return _({
|
|
1062
1062
|
value: e,
|
|
1063
1063
|
locale: N,
|
|
1064
|
-
format: ft(
|
|
1064
|
+
format: ft(d)
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
function X(e) {
|
|
1068
1068
|
return _({
|
|
1069
1069
|
value: e,
|
|
1070
1070
|
locale: N,
|
|
1071
|
-
format:
|
|
1071
|
+
format: d
|
|
1072
1072
|
});
|
|
1073
1073
|
}
|
|
1074
1074
|
function Z(e) {
|
|
1075
1075
|
return e.toSorted((e, t) => Math.abs(t.weight) - Math.abs(e.weight)).slice(0, Ge).map((e) => `${G.get(e.id)?.label ?? e.id} ${Y(e.weight)}`).join(", ");
|
|
1076
1076
|
}
|
|
1077
1077
|
function ae(e) {
|
|
1078
|
-
let t = e.kind ?? "feature", n = re.get(e.layerId)?.label ?? e.layerId, r = e.value !== void 0 &&
|
|
1078
|
+
let t = e.kind ?? "feature", n = re.get(e.layerId)?.label ?? e.layerId, r = e.value !== void 0 && f !== void 0 && p !== void 0 ? `${f} ${_({
|
|
1079
1079
|
value: e.value ?? null,
|
|
1080
1080
|
locale: N,
|
|
1081
|
-
format:
|
|
1082
|
-
})}` : void 0, i =
|
|
1081
|
+
format: p
|
|
1082
|
+
})}` : void 0, i = l.filter((t) => t.targetId === e.id).map((e) => ({
|
|
1083
1083
|
id: e.sourceId,
|
|
1084
1084
|
weight: e.weight
|
|
1085
|
-
})), a =
|
|
1085
|
+
})), a = l.filter((t) => t.sourceId === e.id).map((e) => ({
|
|
1086
1086
|
id: e.targetId,
|
|
1087
1087
|
weight: e.weight
|
|
1088
1088
|
}));
|
|
@@ -1098,7 +1098,7 @@ function yt(r) {
|
|
|
1098
1098
|
outputs: a.length === 0 ? "No outputs" : `Strongest outputs: ${Z(a)}`
|
|
1099
1099
|
};
|
|
1100
1100
|
}
|
|
1101
|
-
let Q = i.flatMap((e) =>
|
|
1101
|
+
let Q = i.flatMap((e) => c.filter((t) => t.layerId === e.id)), oe = new Map(Q.map((e) => [e.id, ae(e)])), se = Q.map((e) => {
|
|
1102
1102
|
let t = oe.get(e.id);
|
|
1103
1103
|
return {
|
|
1104
1104
|
id: e.id,
|
|
@@ -1108,7 +1108,7 @@ function yt(r) {
|
|
|
1108
1108
|
t.outputs
|
|
1109
1109
|
].join(". ")
|
|
1110
1110
|
};
|
|
1111
|
-
}), ce = ct.filter((e) =>
|
|
1111
|
+
}), ce = ct.filter((e) => c.some((t) => (t.kind ?? "feature") === e));
|
|
1112
1112
|
function le(e, t) {
|
|
1113
1113
|
w?.(e, t), g === void 0 && !t.canceled && ne(e);
|
|
1114
1114
|
}
|
|
@@ -1125,15 +1125,15 @@ function yt(r) {
|
|
|
1125
1125
|
};
|
|
1126
1126
|
}
|
|
1127
1127
|
function fe(e) {
|
|
1128
|
-
let { inspected: t, cursor: n } = e, r =
|
|
1128
|
+
let { inspected: t, cursor: n } = e, r = l.some((e) => K.has(e.sourceId) && K.has(e.targetId)), i = t !== null || r;
|
|
1129
1129
|
function a(e) {
|
|
1130
1130
|
return t !== null && (e.sourceId === t || e.targetId === t) || K.has(e.sourceId) && K.has(e.targetId);
|
|
1131
1131
|
}
|
|
1132
|
-
let s = new Set(
|
|
1132
|
+
let s = new Set(l.filter(a).map((e) => e.id)), c = /* @__PURE__ */ new Set([
|
|
1133
1133
|
...ie,
|
|
1134
1134
|
...t === null ? [] : [t],
|
|
1135
|
-
...
|
|
1136
|
-
]),
|
|
1135
|
+
...l.flatMap((e) => s.has(e.id) ? [e.sourceId, e.targetId] : [])
|
|
1136
|
+
]), u = W.edges.toSorted((e, t) => Number(s.has(e.id)) - Number(s.has(t.id))), d = n === null ? void 0 : W.nodes.get(n);
|
|
1137
1137
|
function f(e) {
|
|
1138
1138
|
return i && !c.has(e) ? "receded" : "normal";
|
|
1139
1139
|
}
|
|
@@ -1168,8 +1168,8 @@ function yt(r) {
|
|
|
1168
1168
|
...M.props(C.label, C.tick, lt.layerLabel),
|
|
1169
1169
|
children: q ? e.label : Ue(e.label, e.end - e.start)
|
|
1170
1170
|
}, e.id)),
|
|
1171
|
-
|
|
1172
|
-
let t =
|
|
1171
|
+
u.map((e) => {
|
|
1172
|
+
let t = l.find((t) => t.id === e.id);
|
|
1173
1173
|
return t === void 0 ? null : /* @__PURE__ */ L(O, {
|
|
1174
1174
|
d: e.d,
|
|
1175
1175
|
tone: dt(t.weight),
|
|
@@ -1181,7 +1181,7 @@ function yt(r) {
|
|
|
1181
1181
|
let n = W.nodes.get(e.id);
|
|
1182
1182
|
if (n === void 0) return null;
|
|
1183
1183
|
let r = e.kind ?? "feature", i = f(e.id);
|
|
1184
|
-
return /* @__PURE__ */ R(
|
|
1184
|
+
return /* @__PURE__ */ R(o, {
|
|
1185
1185
|
value: e.id,
|
|
1186
1186
|
render: /* @__PURE__ */ L("g", {}),
|
|
1187
1187
|
children: [
|
|
@@ -1227,7 +1227,7 @@ function yt(r) {
|
|
|
1227
1227
|
]
|
|
1228
1228
|
});
|
|
1229
1229
|
}
|
|
1230
|
-
return /* @__PURE__ */ L(
|
|
1230
|
+
return /* @__PURE__ */ L(s, {
|
|
1231
1231
|
...V,
|
|
1232
1232
|
items: se,
|
|
1233
1233
|
place: de,
|
|
@@ -1235,13 +1235,13 @@ function yt(r) {
|
|
|
1235
1235
|
onSelect: E,
|
|
1236
1236
|
within: (e) => e instanceof Element && e.closest(rt) !== null,
|
|
1237
1237
|
render: (r, i) => {
|
|
1238
|
-
let
|
|
1238
|
+
let o = T != null && G.has(T), s = i.inspected ?? (o ? T : null), d = i.inspected === null ? void 0 : oe.get(i.inspected), f = s === null ? void 0 : G.get(s)?.label, p = s !== null && K.has(s), m = c.length === 0 ? void 0 : /* @__PURE__ */ R("div", {
|
|
1239
1239
|
className: "x78zum5 x1a02dak x7a106z x1qughib x1hnptsi xeuugli",
|
|
1240
1240
|
children: [
|
|
1241
1241
|
/* @__PURE__ */ L("span", {
|
|
1242
1242
|
id: B,
|
|
1243
1243
|
...M.props(e.hidden),
|
|
1244
|
-
children:
|
|
1244
|
+
children: a(se, i.inspected)
|
|
1245
1245
|
}),
|
|
1246
1246
|
/* @__PURE__ */ R("div", {
|
|
1247
1247
|
"aria-hidden": !0,
|
|
@@ -1270,10 +1270,10 @@ function yt(r) {
|
|
|
1270
1270
|
children: [/* @__PURE__ */ L(t, {
|
|
1271
1271
|
variant: "outline",
|
|
1272
1272
|
density: "compact",
|
|
1273
|
-
disabled:
|
|
1273
|
+
disabled: s === null,
|
|
1274
1274
|
"aria-label": f === void 0 ? "Pin a node" : `${p ? "Unpin" : "Pin"} ${f}`,
|
|
1275
1275
|
onClick: (e, { source: t }) => {
|
|
1276
|
-
|
|
1276
|
+
s !== null && le(ue(s), mt({
|
|
1277
1277
|
reason: "item-press",
|
|
1278
1278
|
event: e.nativeEvent
|
|
1279
1279
|
}, t));
|
|
@@ -1293,17 +1293,17 @@ function yt(r) {
|
|
|
1293
1293
|
return /* @__PURE__ */ L(b, {
|
|
1294
1294
|
...j,
|
|
1295
1295
|
figure: r,
|
|
1296
|
-
seriesLegend:
|
|
1296
|
+
seriesLegend: c.length === 0 ? void 0 : /* @__PURE__ */ L(_t, {
|
|
1297
1297
|
kinds: ce,
|
|
1298
|
-
weightLabel:
|
|
1298
|
+
weightLabel: u
|
|
1299
1299
|
}),
|
|
1300
|
-
scaleLegend:
|
|
1301
|
-
weightLabel:
|
|
1300
|
+
scaleLegend: c.length === 0 || W.weightMax === 0 ? void 0 : /* @__PURE__ */ L(gt, {
|
|
1301
|
+
weightLabel: u,
|
|
1302
1302
|
weightMax: W.weightMax,
|
|
1303
1303
|
weightText: X
|
|
1304
1304
|
}),
|
|
1305
1305
|
footer: m,
|
|
1306
|
-
children:
|
|
1306
|
+
children: c.length === 0 ? /* @__PURE__ */ L(S, { children: ee }) : /* @__PURE__ */ R(I, { children: [fe(i), /* @__PURE__ */ L(y, {
|
|
1307
1307
|
label: `${P} nodes and edges`,
|
|
1308
1308
|
columns: [{
|
|
1309
1309
|
id: "record",
|
|
@@ -1315,9 +1315,9 @@ function yt(r) {
|
|
|
1315
1315
|
rows: [...se.map((e) => ({
|
|
1316
1316
|
id: `node:${e.id}`,
|
|
1317
1317
|
values: [G.get(e.id)?.label ?? e.id, e.label]
|
|
1318
|
-
})), ...
|
|
1318
|
+
})), ...l.map((e) => ({
|
|
1319
1319
|
id: `edge:${e.id}`,
|
|
1320
|
-
values: [`${G.get(e.sourceId)?.label ?? e.sourceId} → ${G.get(e.targetId)?.label ?? e.targetId}`, `${
|
|
1320
|
+
values: [`${G.get(e.sourceId)?.label ?? e.sourceId} → ${G.get(e.targetId)?.label ?? e.targetId}`, `${u} ${Y(e.weight)}`]
|
|
1321
1321
|
}))]
|
|
1322
1322
|
})] })
|
|
1323
1323
|
});
|
|
@@ -1460,7 +1460,7 @@ var Tt = {
|
|
|
1460
1460
|
}, Et = " › ", Dt = 4, Ot = 9, kt = 13, At = 8, jt = 18, Mt = 4, Nt = 90;
|
|
1461
1461
|
function Pt({ nodes: e, valueFormat: t, valueLabel: n }) {
|
|
1462
1462
|
if (e.length > Tt.nodes) return `This tree draws at most ${Tt.nodes} nodes. Supply a cut of the hierarchy.`;
|
|
1463
|
-
if (!
|
|
1463
|
+
if (!c(e)) return "Tree nodes must have unique identifiers.";
|
|
1464
1464
|
let r = e.find((e) => typeof e.value == "number" && !Number.isFinite(e.value));
|
|
1465
1465
|
return r === void 0 ? e.some((e) => typeof e.value == "number") && (t === void 0 || n === void 0) ? "Nodes carry values, so the tree needs a valueLabel and a valueFormat to state them." : void 0 : `Node ${r.id} has a value that is not finite. Use null for a value that was not recorded.`;
|
|
1466
1466
|
}
|
|
@@ -1494,14 +1494,14 @@ function Ft({ label: e, placed: t, leafLabels: n }) {
|
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
1496
|
function It(e) {
|
|
1497
|
-
let { nodes: t, direction: n = "right", link: r = "elbow", valueLabel: i, valueFormat:
|
|
1497
|
+
let { nodes: t, direction: n = "right", link: r = "elbow", valueLabel: i, valueFormat: c, toneLegend: l, selected: d, onSelectedChange: f, ...p } = e, { emptyLabel: g = "No hierarchy is available.", ...C } = p, { locale: w, title: E } = C, D = k("tall"), A = te(), ee = h();
|
|
1498
1498
|
if (C.status === "loading") return /* @__PURE__ */ L(v, {
|
|
1499
1499
|
...C,
|
|
1500
1500
|
height: "tall"
|
|
1501
1501
|
});
|
|
1502
1502
|
let j = Pt({
|
|
1503
1503
|
nodes: t,
|
|
1504
|
-
valueFormat:
|
|
1504
|
+
valueFormat: c,
|
|
1505
1505
|
valueLabel: i
|
|
1506
1506
|
});
|
|
1507
1507
|
if (j !== void 0) return /* @__PURE__ */ L(x, {
|
|
@@ -1524,10 +1524,10 @@ function It(e) {
|
|
|
1524
1524
|
link: r,
|
|
1525
1525
|
width: D.width
|
|
1526
1526
|
}), F = new Map((M?.order ?? []).map((e) => [e.id, e.lineage])), z = (M?.order ?? []).map((e) => {
|
|
1527
|
-
let t = N.get(e.id), n = e.lineage.map((e) => N.get(e)?.label ?? e), r = t?.value !== void 0 && i !== void 0 &&
|
|
1527
|
+
let t = N.get(e.id), n = e.lineage.map((e) => N.get(e)?.label ?? e), r = t?.value !== void 0 && i !== void 0 && c !== void 0 ? `${i} ${_({
|
|
1528
1528
|
value: t.value ?? null,
|
|
1529
1529
|
locale: w,
|
|
1530
|
-
format:
|
|
1530
|
+
format: c
|
|
1531
1531
|
})}` : void 0;
|
|
1532
1532
|
return {
|
|
1533
1533
|
id: e.id,
|
|
@@ -1538,7 +1538,7 @@ function It(e) {
|
|
|
1538
1538
|
].filter((e) => e !== void 0).join(" · ")
|
|
1539
1539
|
};
|
|
1540
1540
|
});
|
|
1541
|
-
return /* @__PURE__ */ L(
|
|
1541
|
+
return /* @__PURE__ */ L(s, {
|
|
1542
1542
|
...ee,
|
|
1543
1543
|
items: z,
|
|
1544
1544
|
place: (e) => {
|
|
@@ -1550,24 +1550,24 @@ function It(e) {
|
|
|
1550
1550
|
bottom: t.y + Dt
|
|
1551
1551
|
};
|
|
1552
1552
|
},
|
|
1553
|
-
selected:
|
|
1554
|
-
onSelect:
|
|
1553
|
+
selected: d ?? null,
|
|
1554
|
+
onSelect: f,
|
|
1555
1555
|
render: (e, { inspected: t, cursor: n }) => {
|
|
1556
1556
|
let r = new Set(t === null ? [] : F.get(t) ?? []), i = n === null ? void 0 : P?.nodes.get(n);
|
|
1557
1557
|
return /* @__PURE__ */ L(b, {
|
|
1558
1558
|
...C,
|
|
1559
1559
|
figure: e,
|
|
1560
|
-
seriesLegend: P !== void 0 &&
|
|
1561
|
-
footer: P === void 0 ? void 0 : /* @__PURE__ */ L(
|
|
1560
|
+
seriesLegend: P !== void 0 && l !== void 0 && l.length > 0 ? /* @__PURE__ */ L(m, { items: l }) : void 0,
|
|
1561
|
+
footer: P === void 0 ? void 0 : /* @__PURE__ */ L(u, {
|
|
1562
1562
|
id: A,
|
|
1563
|
-
children:
|
|
1563
|
+
children: a(z, t)
|
|
1564
1564
|
}),
|
|
1565
1565
|
children: P === void 0 ? /* @__PURE__ */ L(S, { children: g }) : /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ R(Ve, {
|
|
1566
1566
|
plotRef: D.ref,
|
|
1567
1567
|
title: E,
|
|
1568
1568
|
marks: "nodes",
|
|
1569
1569
|
readoutId: A,
|
|
1570
|
-
isSelectable:
|
|
1570
|
+
isSelectable: f !== void 0,
|
|
1571
1571
|
width: P.width,
|
|
1572
1572
|
height: P.height,
|
|
1573
1573
|
cursor: i,
|
|
@@ -1579,7 +1579,7 @@ function It(e) {
|
|
|
1579
1579
|
}, e.id)),
|
|
1580
1580
|
z.map((e) => {
|
|
1581
1581
|
let n = N.get(e.id), r = P.nodes.get(e.id);
|
|
1582
|
-
return n === void 0 || r === void 0 ? null : /* @__PURE__ */ R(
|
|
1582
|
+
return n === void 0 || r === void 0 ? null : /* @__PURE__ */ R(o, {
|
|
1583
1583
|
value: e.id,
|
|
1584
1584
|
render: /* @__PURE__ */ L("g", {}),
|
|
1585
1585
|
children: [
|
|
@@ -1589,7 +1589,7 @@ function It(e) {
|
|
|
1589
1589
|
radius: Dt,
|
|
1590
1590
|
tone: n.tone ?? "neutral",
|
|
1591
1591
|
isInspected: t === e.id,
|
|
1592
|
-
isSelected:
|
|
1592
|
+
isSelected: d === e.id
|
|
1593
1593
|
}),
|
|
1594
1594
|
/* @__PURE__ */ L(Ft, {
|
|
1595
1595
|
label: n.label,
|