summaryrefslogtreecommitdiff
path: root/graph/web/layout.js
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-09-25 15:00:00 -0700
committerCliff Click <cliffc@acm.org>2026-09-25 15:00:00 -0700
commita32e83c9d81cfdb3759a2961d8b192ca44d75935 (patch)
tree9898306adf1a2d2432f333a50db5576999fb82c8 /graph/web/layout.js
parente9e02b18ee3223f2cfe1990be00674f9868e1a26 (diff)
downloadSimple-a32e83c9d81cfdb3759a2961d8b192ca44d75935.tar.gz
Simple-a32e83c9d81cfdb3759a2961d8b192ca44d75935.zip
Bunch more animation work
Diffstat (limited to 'graph/web/layout.js')
-rw-r--r--graph/web/layout.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/graph/web/layout.js b/graph/web/layout.js
index 8260fbd2..880e7662 100644
--- a/graph/web/layout.js
+++ b/graph/web/layout.js
@@ -25,7 +25,7 @@ class GraphLayout {
const nodes = snap.nodes.map(n => {
const label = `${this.clip(n.label)} #${n.id}${n.proj ? "/" + n.proj.idx : ""}`, type = this.clip(n.type);
const compact = ["START", "UNIT", "STOP"].includes(n.kind);
- let w = Math.ceil(Math.max(120, this.ctx.measureText(label).width + 24,
+ let w = Math.ceil(Math.max(120, this.ctx.measureText(label).width + 24 + (n.folding ? 60 : 0),
this.ctx.measureText(type).width + 24, (n.edges.length + 1) * 18));
const scope = n.kind === "SCOPE";
const cols = scope ? n.edges.map(e => Math.ceil(Math.max(48,
@@ -49,8 +49,9 @@ class GraphLayout {
// roots; unfinished expression values are inferred from absent uses.
const used = new Set();
for (const n of snap.nodes) for (const e of n.edges) if (e.def) used.add(e.def);
+ const temps = new Set(evt?.temps);
const held = parsing ? nodes.filter(n =>
- (n.n.proj || ["DATA", "MEM", "PHI"].includes(n.n.kind)) && !used.has(n.n.id)) : [];
+ (n.n.proj || ["DATA", "MEM", "PHI"].includes(n.n.kind)) && !used.has(n.n.id) && !temps.has(n.n.id)) : [];
for (const n of held) n.held = true;
const owned = [...held, ...scopes.filter(n => parsing && roots.has(n.n.id))];
const projs = new Map();