@cardenelabs/dragon 0.45.0 → 0.45.2
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/dist/cli.cjs +70 -29
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +70 -29
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +70 -29
- package/dist/export.cjs.map +1 -1
- package/dist/export.js +70 -29
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +70 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +70 -29
- package/dist/index.js.map +1 -1
- package/dist/light/{chunk-VRAW7VAQ.cjs → chunk-5OQV42W3.cjs} +50 -19
- package/dist/light/chunk-5OQV42W3.cjs.map +1 -0
- package/dist/light/chunk-CLS6JVKK.cjs.map +1 -1
- package/dist/light/{chunk-JNSHZTPF.js → chunk-EHTQUCW4.js} +49 -18
- package/dist/light/chunk-EHTQUCW4.js.map +1 -0
- package/dist/light/{chunk-OUQ44P45.cjs → chunk-JCEKXALJ.cjs} +81 -81
- package/dist/light/{chunk-OUQ44P45.cjs.map → chunk-JCEKXALJ.cjs.map} +1 -1
- package/dist/light/{chunk-6ZUKJ3VO.js → chunk-YEQSLVIN.js} +2 -2
- package/dist/light/{git-C4RVNFT6.js → git-GESUYKGR.js} +3 -3
- package/dist/light/{git-I7D7RIW2.cjs → git-K3KAAAWW.cjs} +59 -59
- package/dist/light/{git-I7D7RIW2.cjs.map → git-K3KAAAWW.cjs.map} +1 -1
- package/dist/light/index.cjs +231 -219
- package/dist/light/index.cjs.map +1 -1
- package/dist/light/index.js +31 -19
- package/dist/light/index.js.map +1 -1
- package/dist/light/{lineup-YEG4HHEI.js → lineup-2V2U7HZH.js} +3 -3
- package/dist/light/{lineup-FAIKTH3Y.cjs → lineup-623J25LU.cjs} +40 -40
- package/dist/light/{lineup-FAIKTH3Y.cjs.map → lineup-623J25LU.cjs.map} +1 -1
- package/dist/light/{state-ZZUK6AQT.cjs → state-OZVCHX7H.cjs} +41 -41
- package/dist/light/{state-ZZUK6AQT.cjs.map → state-OZVCHX7H.cjs.map} +1 -1
- package/dist/light/{state-P3LIVI3K.js → state-T4OTVING.js} +2 -2
- package/dist/light/{time-B5WUQOFP.js → time-6WEMD4FQ.js} +3 -3
- package/dist/light/{time-64DJKYAL.cjs → time-PQCPVQOE.cjs} +84 -84
- package/dist/light/{time-64DJKYAL.cjs.map → time-PQCPVQOE.cjs.map} +1 -1
- package/dist/light/{tree-66EH4QVI.cjs → tree-6D7KI57H.cjs} +62 -62
- package/dist/light/{tree-66EH4QVI.cjs.map → tree-6D7KI57H.cjs.map} +1 -1
- package/dist/light/{tree-5HPREYW2.js → tree-ZJZQI5QT.js} +3 -3
- package/dist/player.global.js +3 -3
- package/package.json +1 -1
- package/src/layout/scene.ts +58 -16
- package/src/look/values.ts +1 -1
- package/src/render/draw.ts +34 -14
- package/dist/light/chunk-JNSHZTPF.js.map +0 -1
- package/dist/light/chunk-VRAW7VAQ.cjs.map +0 -1
- /package/dist/light/{chunk-6ZUKJ3VO.js.map → chunk-YEQSLVIN.js.map} +0 -0
- /package/dist/light/{git-C4RVNFT6.js.map → git-GESUYKGR.js.map} +0 -0
- /package/dist/light/{lineup-YEG4HHEI.js.map → lineup-2V2U7HZH.js.map} +0 -0
- /package/dist/light/{state-P3LIVI3K.js.map → state-T4OTVING.js.map} +0 -0
- /package/dist/light/{time-B5WUQOFP.js.map → time-6WEMD4FQ.js.map} +0 -0
- /package/dist/light/{tree-5HPREYW2.js.map → tree-ZJZQI5QT.js.map} +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkJCEKXALJcjs = require('./chunk-JCEKXALJ.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -34,7 +34,7 @@ var _chunkOUQ44P45cjs = require('./chunk-OUQ44P45.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk5OQV42W3cjs = require('./chunk-5OQV42W3.cjs');
|
|
38
38
|
|
|
39
39
|
// src/layout/tree.ts
|
|
40
40
|
function grow(diagram) {
|
|
@@ -54,20 +54,20 @@ function grow(diagram) {
|
|
|
54
54
|
return { grown, parents };
|
|
55
55
|
}
|
|
56
56
|
function linesOf(g, root) {
|
|
57
|
-
if (g.hash === void 0) return [{ text: g.id, style:
|
|
57
|
+
if (g.hash === void 0) return [{ text: g.id, style: _chunk5OQV42W3cjs.TYPE.boxName }];
|
|
58
58
|
if (root)
|
|
59
59
|
return [
|
|
60
|
-
{ text: g.id, style:
|
|
61
|
-
{ text: g.hash, style:
|
|
60
|
+
{ text: g.id, style: _chunk5OQV42W3cjs.TYPE.rootName },
|
|
61
|
+
{ text: g.hash, style: _chunk5OQV42W3cjs.TYPE.rootHash }
|
|
62
62
|
];
|
|
63
|
-
if (g.kind === "leaf") return [{ text: g.hash, style:
|
|
63
|
+
if (g.kind === "leaf") return [{ text: g.hash, style: _chunk5OQV42W3cjs.TYPE.treeHash }];
|
|
64
64
|
return [
|
|
65
|
-
{ text: g.hash, style:
|
|
66
|
-
{ text: g.id, style:
|
|
65
|
+
{ text: g.hash, style: _chunk5OQV42W3cjs.TYPE.treeHash },
|
|
66
|
+
{ text: g.id, style: _chunk5OQV42W3cjs.TYPE.treeName }
|
|
67
67
|
];
|
|
68
68
|
}
|
|
69
69
|
function route(a, b) {
|
|
70
|
-
const i =
|
|
70
|
+
const i = _chunk5OQV42W3cjs.LOOK.edge.inset;
|
|
71
71
|
const top = Math.max(a.y, b.y);
|
|
72
72
|
const bottom = Math.min(a.y + a.h, b.y + b.h);
|
|
73
73
|
if (bottom > top) {
|
|
@@ -101,7 +101,7 @@ function route(a, b) {
|
|
|
101
101
|
];
|
|
102
102
|
}
|
|
103
103
|
function layoutTree(diagram) {
|
|
104
|
-
const { margin, gap, box: B, tree: T, badge: BD } =
|
|
104
|
+
const { margin, gap, box: B, tree: T, badge: BD } = _chunk5OQV42W3cjs.LOOK;
|
|
105
105
|
const { grown, parents } = grow(diagram);
|
|
106
106
|
const tops = grown.filter((g) => !parents.has(g.id));
|
|
107
107
|
const rootId = _optionalChain([tops, 'access', _ => _[tops.length - 1], 'optionalAccess', _2 => _2.id]);
|
|
@@ -113,9 +113,9 @@ function layoutTree(diagram) {
|
|
|
113
113
|
};
|
|
114
114
|
for (const t of tops) walk(t.id, 0);
|
|
115
115
|
const texts = new Map(grown.map((g) => [g.id, linesOf(g, g.id === rootId)]));
|
|
116
|
-
const widest = (id) => Math.max(0, ...(_nullishCoalesce(texts.get(id), () => ( []))).map((line) =>
|
|
116
|
+
const widest = (id) => Math.max(0, ...(_nullishCoalesce(texts.get(id), () => ( []))).map((line) => _chunk5OQV42W3cjs.textWidth.call(void 0, line.text, line.style)));
|
|
117
117
|
const widthOf = (g) => g.id === rootId ? Math.max(T.root.w, T.root.textX + widest(g.id) + T.root.padR) : Math.max(T.w, widest(g.id) + T.padX * 2);
|
|
118
|
-
const cardW = (g) => Math.max(T.card.minW, T.card.padX * 2 + T.card.icon + T.card.gap +
|
|
118
|
+
const cardW = (g) => Math.max(T.card.minW, T.card.padX * 2 + T.card.icon + T.card.gap + _chunk5OQV42W3cjs.textWidth.call(void 0, g.id, _chunk5OQV42W3cjs.TYPE.treeCard));
|
|
119
119
|
const hasCard = (g) => g.kind === "leaf" && g.hash !== void 0;
|
|
120
120
|
const slots = grown.filter((g) => g.children.length === 0);
|
|
121
121
|
const pitch = Math.max(...grown.filter((g) => g.id !== rootId || g.children.length === 0).map((g) => Math.max(widthOf(g), hasCard(g) ? cardW(g) : 0)), T.w) + T.slotGap;
|
|
@@ -132,7 +132,7 @@ function layoutTree(diagram) {
|
|
|
132
132
|
};
|
|
133
133
|
const top0 = margin + T.top;
|
|
134
134
|
const yOf = (d) => top0 + T.root.h / 2 + d * T.row;
|
|
135
|
-
const colors =
|
|
135
|
+
const colors = _chunk5OQV42W3cjs.boxColors.call(void 0, diagram);
|
|
136
136
|
const nodes = grown.map((g) => {
|
|
137
137
|
const root = g.id === rootId;
|
|
138
138
|
const d = _nullishCoalesce(depth.get(g.id), () => ( 0));
|
|
@@ -176,23 +176,23 @@ function layoutTree(diagram) {
|
|
|
176
176
|
if (!c) return [];
|
|
177
177
|
const mid = (c.y + p.y + p.h) / 2;
|
|
178
178
|
const points2 = [
|
|
179
|
-
[c.cx, c.y -
|
|
179
|
+
[c.cx, c.y - _chunk5OQV42W3cjs.LOOK.edge.inset],
|
|
180
180
|
[c.cx, mid],
|
|
181
181
|
[p.cx, mid],
|
|
182
|
-
[p.cx, p.y + p.h +
|
|
182
|
+
[p.cx, p.y + p.h + _chunk5OQV42W3cjs.LOOK.edge.inset]
|
|
183
183
|
];
|
|
184
184
|
return [{ from: c.id, to: p.id, step: p.step, event: p.event, points: points2 }];
|
|
185
185
|
})
|
|
186
186
|
);
|
|
187
|
-
const rooms =
|
|
187
|
+
const rooms = _chunk5OQV42W3cjs.slotRooms.call(void 0, diagram);
|
|
188
188
|
const treeRight = Math.max(x0, ...nodes.flatMap((n) => [n.x + n.w, ...n.card ? [n.card.x + n.card.w] : []]));
|
|
189
189
|
const rootBox = nodes.find((n) => n.root);
|
|
190
190
|
const ids = new Set(diagram.boxes.map((b) => b.id));
|
|
191
|
-
const named =
|
|
191
|
+
const named = _chunk5OQV42W3cjs.edgesOf.call(void 0, diagram).flatMap(({ edge }) => edge.label !== void 0 && (ids.has(edge.from) || ids.has(edge.to)) ? [_chunk5OQV42W3cjs.textWidth.call(void 0, edge.label, _chunk5OQV42W3cjs.labelStyle.call(void 0, edge.label)) + _chunk5OQV42W3cjs.LOOK.label.padX * 2] : []);
|
|
192
192
|
const boxX = Math.max(treeRight + T.boxGap, (rootBox ? rootBox.x + rootBox.w : x0) + Math.max(0, ...named) + gap * 2);
|
|
193
193
|
let by = _nullishCoalesce(_optionalChain([rootBox, 'optionalAccess', _9 => _9.y]), () => ( top0));
|
|
194
194
|
const boxes = diagram.boxes.map((b) => {
|
|
195
|
-
const w = Math.max(
|
|
195
|
+
const w = Math.max(_chunk5OQV42W3cjs.boxWidth.call(void 0, diagram, b.id, true), _chunk5OQV42W3cjs.slotBoxWidth.call(void 0, rooms.get(b.id), b.icon !== void 0, B.padX));
|
|
196
196
|
const y = by;
|
|
197
197
|
by += B.h + gap;
|
|
198
198
|
const box = {
|
|
@@ -208,7 +208,7 @@ function layoutTree(diagram) {
|
|
|
208
208
|
cx: boxX + w / 2,
|
|
209
209
|
cy: y + B.h / 2
|
|
210
210
|
};
|
|
211
|
-
|
|
211
|
+
_chunk5OQV42W3cjs.placeSlot.call(void 0, box, rooms.get(b.id));
|
|
212
212
|
return box;
|
|
213
213
|
});
|
|
214
214
|
const boxById = new Map(boxes.map((b) => [b.id, b]));
|
|
@@ -223,11 +223,11 @@ function layoutTree(diagram) {
|
|
|
223
223
|
const down = links.find((l) => l.from === e.to && l.to === e.from);
|
|
224
224
|
const link = _nullishCoalesce(up, () => ( down));
|
|
225
225
|
if (link) runs.push({ step: s, event: k, link: link.from });
|
|
226
|
-
const points2 = up ? up.points : down ? [...down.points].reverse() : e.from === e.to ?
|
|
227
|
-
return [{ step: s, event: k, from: e.from, to: e.to, points: points2, color:
|
|
226
|
+
const points2 = up ? up.points : down ? [...down.points].reverse() : e.from === e.to ? _chunk5OQV42W3cjs.loopUnder.call(void 0, { cx: a.x + a.w / 2, y: a.y, h: a.h }) : route(a, b);
|
|
227
|
+
return [{ step: s, event: k, from: e.from, to: e.to, points: points2, color: _chunk5OQV42W3cjs.edgeColor.call(void 0, e, colors), carry: e.carry }];
|
|
228
228
|
})
|
|
229
229
|
);
|
|
230
|
-
|
|
230
|
+
_chunk5OQV42W3cjs.seatCarriers.call(void 0, edges, boxById, rooms);
|
|
231
231
|
const layout = {
|
|
232
232
|
kind: "tree",
|
|
233
233
|
width: 0,
|
|
@@ -252,8 +252,8 @@ function layoutTree(diagram) {
|
|
|
252
252
|
const points = edges.flatMap((e) => e.points);
|
|
253
253
|
const right = Math.max(...solids.map((r) => r.x + r.w), ...points.map(([x]) => x), x0);
|
|
254
254
|
const bottom = Math.max(...solids.map((r) => r.y + r.h), ...points.map(([, y]) => y), top0);
|
|
255
|
-
const width = Math.max(right + margin,
|
|
256
|
-
const strip =
|
|
255
|
+
const width = Math.max(right + margin, _chunk5OQV42W3cjs.stripNeed.call(void 0, diagram) + margin * 2);
|
|
256
|
+
const strip = _chunk5OQV42W3cjs.layoutStrip.call(void 0, diagram, margin, bottom + gap, width - margin * 2);
|
|
257
257
|
layout.width = width;
|
|
258
258
|
layout.height = (strip ? strip.y + strip.h : bottom) + margin;
|
|
259
259
|
if (strip) layout.strip = strip;
|
|
@@ -261,12 +261,12 @@ function layoutTree(diagram) {
|
|
|
261
261
|
return layout;
|
|
262
262
|
}
|
|
263
263
|
function badgesOf(diagram, layout) {
|
|
264
|
-
const { r, inset } =
|
|
264
|
+
const { r, inset } = _chunk5OQV42W3cjs.LOOK.badge;
|
|
265
265
|
const apart = r * 2 + inset;
|
|
266
266
|
const taken = [];
|
|
267
267
|
const out = [];
|
|
268
268
|
const solids = [...layout.nodes, ...layout.nodes.flatMap((n) => n.card ? [n.card] : []), ...layout.boxes];
|
|
269
|
-
const free = (p) => taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && solids.every((s) =>
|
|
269
|
+
const free = (p) => taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && solids.every((s) => _chunk5OQV42W3cjs.gapBetween.call(void 0, _chunk5OQV42W3cjs.badgeRect.call(void 0, p), s) >= _chunk5OQV42W3cjs.LOOK.label.touch);
|
|
270
270
|
const put = (s, p, color) => {
|
|
271
271
|
taken.push(p);
|
|
272
272
|
out.push({ step: s, x: p[0], y: p[1], color });
|
|
@@ -291,7 +291,7 @@ function badgesOf(diagram, layout) {
|
|
|
291
291
|
const key = [e.from, e.to].sort().join("\n");
|
|
292
292
|
const run = layout.runs.some((x) => x.step === s && x.event === k);
|
|
293
293
|
const lines = layout.edges.filter((x) => x !== e).map((x) => x.points);
|
|
294
|
-
const point = _nullishCoalesce(_nullishCoalesce(passed.get(key), () => ( (run ? onLink(e.points, free) : midway(e, free)))), () => (
|
|
294
|
+
const point = _nullishCoalesce(_nullishCoalesce(passed.get(key), () => ( (run ? onLink(e.points, free) : midway(e, free)))), () => ( _chunk5OQV42W3cjs.badgeOnPath.call(void 0, e.points, taken, lines)));
|
|
295
295
|
passed.set(key, point);
|
|
296
296
|
put(s, point, e.color);
|
|
297
297
|
return;
|
|
@@ -307,27 +307,27 @@ function badgesOf(diagram, layout) {
|
|
|
307
307
|
}
|
|
308
308
|
const before = out[out.length - 1];
|
|
309
309
|
const root = layout.nodes.find((x) => x.root);
|
|
310
|
-
out.push(before ? { ...before, step: s } : { step: s, x: _nullishCoalesce(_optionalChain([root, 'optionalAccess', _11 => _11.x]), () => (
|
|
310
|
+
out.push(before ? { ...before, step: s } : { step: s, x: _nullishCoalesce(_optionalChain([root, 'optionalAccess', _11 => _11.x]), () => ( _chunk5OQV42W3cjs.LOOK.margin)), y: _nullishCoalesce(_optionalChain([root, 'optionalAccess', _12 => _12.y]), () => ( _chunk5OQV42W3cjs.LOOK.margin)), color: _nullishCoalesce(_optionalChain([root, 'optionalAccess', _13 => _13.color]), () => ( "slate")) });
|
|
311
311
|
});
|
|
312
|
-
return
|
|
312
|
+
return _chunk5OQV42W3cjs.replaceSameSpot.call(void 0, out);
|
|
313
313
|
}
|
|
314
314
|
function onLink(points, free) {
|
|
315
315
|
const [p0, p1, p2] = points;
|
|
316
316
|
const flat = Math.abs(p2[0] - p1[0]);
|
|
317
|
-
const { r, inset } =
|
|
318
|
-
if (flat >=
|
|
319
|
-
const p =
|
|
317
|
+
const { r, inset } = _chunk5OQV42W3cjs.LOOK.badge;
|
|
318
|
+
if (flat >= _chunk5OQV42W3cjs.LOOK.tree.badgeAlong + r) {
|
|
319
|
+
const p = _chunk5OQV42W3cjs.along.call(void 0, points, _chunk5OQV42W3cjs.pathLength.call(void 0, [p0, p1]) + _chunk5OQV42W3cjs.LOOK.tree.badgeAlong);
|
|
320
320
|
if (free(p)) return p;
|
|
321
321
|
}
|
|
322
322
|
const side = [p1[0] + r + inset, p1[1]];
|
|
323
323
|
return free(side) ? side : void 0;
|
|
324
324
|
}
|
|
325
325
|
function midway(e, free) {
|
|
326
|
-
const length =
|
|
327
|
-
const room =
|
|
326
|
+
const length = _chunk5OQV42W3cjs.pathLength.call(void 0, e.points);
|
|
327
|
+
const room = _chunk5OQV42W3cjs.carrierHalf.call(void 0, e.carry)[0] + _chunk5OQV42W3cjs.LOOK.badge.r + _chunk5OQV42W3cjs.LOOK.badge.inset;
|
|
328
328
|
for (let d = 0; d <= length / 2 - room; d += 1) {
|
|
329
329
|
for (const at of [length / 2 - d, length / 2 + d]) {
|
|
330
|
-
const p =
|
|
330
|
+
const p = _chunk5OQV42W3cjs.along.call(void 0, e.points, at);
|
|
331
331
|
if (free(p)) return p;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
@@ -339,9 +339,9 @@ function labelsOf(diagram, layout) {
|
|
|
339
339
|
for (const e of layout.edges) {
|
|
340
340
|
const source = _optionalChain([diagram, 'access', _14 => _14.steps, 'access', _15 => _15[e.step], 'optionalAccess', _16 => _16.events, 'access', _17 => _17[e.event]]);
|
|
341
341
|
if (_optionalChain([source, 'optionalAccess', _18 => _18.type]) !== "edge" || source.label === void 0) continue;
|
|
342
|
-
const seen = layout.badges.filter((b) => b.step <= e.step).map((b) =>
|
|
342
|
+
const seen = layout.badges.filter((b) => b.step <= e.step).map((b) => _chunk5OQV42W3cjs.badgeRect.call(void 0, [b.x, b.y]));
|
|
343
343
|
labels.push(
|
|
344
|
-
|
|
344
|
+
_chunk5OQV42W3cjs.placeLabel.call(void 0,
|
|
345
345
|
{ step: e.step, event: e.event, text: source.label, points: e.points, color: e.color, ...source.labelSide ? { side: source.labelSide } : {}, flip: true },
|
|
346
346
|
{ hard: [...layout.nodes, ...layout.boxes], soft: [...cards, ...labels.filter((l) => l.step === e.step)], touch: seen }
|
|
347
347
|
)
|
|
@@ -354,8 +354,8 @@ function labelsOf(diagram, layout) {
|
|
|
354
354
|
var r1 = (v) => Math.round(v * 100) / 100;
|
|
355
355
|
function drawTree(layout, diagram, timeline, ctx) {
|
|
356
356
|
const { m } = ctx;
|
|
357
|
-
const T =
|
|
358
|
-
const B =
|
|
357
|
+
const T = _chunk5OQV42W3cjs.LOOK.tree;
|
|
358
|
+
const B = _chunk5OQV42W3cjs.LOOK.box;
|
|
359
359
|
const timeOf = (step, event) => timeline.edges.find((t) => t.step === step && t.event === event);
|
|
360
360
|
const active = /* @__PURE__ */ new Map();
|
|
361
361
|
const touched = /* @__PURE__ */ new Map();
|
|
@@ -381,11 +381,11 @@ function drawTree(layout, diagram, timeline, ctx) {
|
|
|
381
381
|
const back = t === void 0 ? void 0 : _optionalChain([timeline, 'access', _27 => _27.steps, 'access', _28 => _28[t], 'optionalAccess', _29 => _29.start]);
|
|
382
382
|
const frames = [
|
|
383
383
|
[0, { opacity: 1 }],
|
|
384
|
-
[fadeAt, { opacity: 1 },
|
|
385
|
-
[fadeAt +
|
|
384
|
+
[fadeAt, { opacity: 1 }, _chunk5OQV42W3cjs.EASE.inOut],
|
|
385
|
+
[fadeAt + _chunk5OQV42W3cjs.MOTION.fade, { opacity: T.faint }]
|
|
386
386
|
];
|
|
387
|
-
if (back !== void 0) frames.push([back, { opacity: T.faint },
|
|
388
|
-
frames.push([m.last, { opacity: back === void 0 ? T.faint : 1 },
|
|
387
|
+
if (back !== void 0) frames.push([back, { opacity: T.faint }, _chunk5OQV42W3cjs.EASE.inOut], [back + _chunk5OQV42W3cjs.MOTION.fade, { opacity: 1 }]);
|
|
388
|
+
frames.push([m.last, { opacity: back === void 0 ? T.faint : 1 }, _chunk5OQV42W3cjs.EASE.inOut], [m.total, { opacity: 1 }]);
|
|
389
389
|
return m.kf(frames);
|
|
390
390
|
};
|
|
391
391
|
const faded = (id, markup, attrs = "") => {
|
|
@@ -399,18 +399,18 @@ function drawTree(layout, diagram, timeline, ctx) {
|
|
|
399
399
|
ctx.traces.push({ from: l.from, to: l.to, points: l.points, shown: [[time.start, Number.POSITIVE_INFINITY]] });
|
|
400
400
|
const kf = m.kf([
|
|
401
401
|
[0, { opacity: 0, "stroke-dashoffset": 1 }],
|
|
402
|
-
[time.start, { opacity: 0, "stroke-dashoffset": 1 },
|
|
402
|
+
[time.start, { opacity: 0, "stroke-dashoffset": 1 }, _chunk5OQV42W3cjs.EASE.inOut],
|
|
403
403
|
[time.start + 0.05, { opacity: 1 }],
|
|
404
404
|
[time.drawn, { "stroke-dashoffset": 0 }],
|
|
405
|
-
[m.last, { opacity: 1, "stroke-dashoffset": 0 },
|
|
405
|
+
[m.last, { opacity: 1, "stroke-dashoffset": 0 }, _chunk5OQV42W3cjs.EASE.inOut],
|
|
406
406
|
[m.total, { opacity: 0, "stroke-dashoffset": 0 }]
|
|
407
407
|
]);
|
|
408
|
-
return faded(l.from, `<path class="dg-tree-l dg-a" data-tree-link="${
|
|
408
|
+
return faded(l.from, `<path class="dg-tree-l dg-a" data-tree-link="${_chunkJCEKXALJcjs.esc.call(void 0, l.from)}" pathLength="1" d="${_chunkJCEKXALJcjs.pathOf.call(void 0, l.points)}" style="${kf}"/>`);
|
|
409
409
|
}).join("");
|
|
410
410
|
const ties = layout.nodes.flatMap((n) => {
|
|
411
411
|
if (!n.card) return [];
|
|
412
412
|
const at = _nullishCoalesce(drawnAt.get(n.id), () => ( 0));
|
|
413
|
-
const d = `M ${r1(n.cx)} ${r1(n.y + n.h +
|
|
413
|
+
const d = `M ${r1(n.cx)} ${r1(n.y + n.h + _chunk5OQV42W3cjs.LOOK.edge.inset)} V ${r1(n.card.y - _chunk5OQV42W3cjs.LOOK.edge.inset)}`;
|
|
414
414
|
return [faded(n.id, `<path class="dg-tree-con dg-a" d="${d}" style="${m.vis(at)}"/>`)];
|
|
415
415
|
}).join("");
|
|
416
416
|
const traced = /* @__PURE__ */ new Set();
|
|
@@ -425,15 +425,15 @@ function drawTree(layout, diagram, timeline, ctx) {
|
|
|
425
425
|
traced.add(run.link);
|
|
426
426
|
const kf = m.kf([
|
|
427
427
|
[0, { opacity: 0, "stroke-dashoffset": 1 }],
|
|
428
|
-
[a, { opacity: 0, "stroke-dashoffset": 1 },
|
|
428
|
+
[a, { opacity: 0, "stroke-dashoffset": 1 }, _chunk5OQV42W3cjs.EASE.inOut],
|
|
429
429
|
[a + 0.05, { opacity: 1 }],
|
|
430
430
|
[b, { "stroke-dashoffset": 0 }],
|
|
431
|
-
[m.last, { opacity: 1, "stroke-dashoffset": 0 },
|
|
431
|
+
[m.last, { opacity: 1, "stroke-dashoffset": 0 }, _chunk5OQV42W3cjs.EASE.inOut],
|
|
432
432
|
[m.total, { opacity: 0, "stroke-dashoffset": 0 }]
|
|
433
433
|
]);
|
|
434
|
-
const d =
|
|
434
|
+
const d = _chunkJCEKXALJcjs.pathOf.call(void 0, e.points);
|
|
435
435
|
return [
|
|
436
|
-
`<g style="${
|
|
436
|
+
`<g style="${_chunkJCEKXALJcjs.cs.call(void 0, e.color)}"><path class="dg-tree-tr dg-a" data-tree-trail="${_chunkJCEKXALJcjs.esc.call(void 0, run.link)}" pathLength="1" d="${d}" style="${kf}"/><path class="dg-tree-h dg-a" d="${_chunkJCEKXALJcjs.arrowHead.call(void 0, e.points)}" style="${m.vis(b)}"/></g>`
|
|
437
437
|
];
|
|
438
438
|
}).join("");
|
|
439
439
|
const cards = layout.nodes.flatMap((n) => {
|
|
@@ -441,33 +441,33 @@ function drawTree(layout, diagram, timeline, ctx) {
|
|
|
441
441
|
if (!c) return [];
|
|
442
442
|
const gx = c.x + T.card.padX + T.card.icon / 2;
|
|
443
443
|
const cy = c.y + c.h / 2;
|
|
444
|
-
const text =
|
|
444
|
+
const text = _chunkJCEKXALJcjs.write.call(void 0, ctx.ink, "dg-tree-ct", c.x + T.card.padX + T.card.icon + T.card.gap, cy + _chunk5OQV42W3cjs.LOOK.baseline.label, c.text, _chunk5OQV42W3cjs.TYPE.treeCard, _chunkJCEKXALJcjs.ALWAYS);
|
|
445
445
|
return [
|
|
446
446
|
faded(
|
|
447
447
|
n.id,
|
|
448
|
-
`<rect class="dg-tree-card" x="${r1(c.x)}" y="${r1(c.y)}" width="${r1(c.w)}" height="${c.h}" rx="${T.card.radius}"/>${
|
|
449
|
-
` data-tree-card="${
|
|
448
|
+
`<rect class="dg-tree-card" x="${r1(c.x)}" y="${r1(c.y)}" width="${r1(c.w)}" height="${c.h}" rx="${T.card.radius}"/>${_chunkJCEKXALJcjs.glyph.call(void 0, "doc", gx, cy, T.card.glyph, "dg-tree-cg")}${text}`,
|
|
449
|
+
` data-tree-card="${_chunkJCEKXALJcjs.esc.call(void 0, n.id)}"`
|
|
450
450
|
)
|
|
451
451
|
];
|
|
452
452
|
}).join("");
|
|
453
453
|
const nodes = layout.nodes.map((n) => {
|
|
454
454
|
const at = _nullishCoalesce(drawnAt.get(n.id), () => ( 0));
|
|
455
455
|
const on = [..._nullishCoalesce(active.get(n.id), () => ( []))].sort((x, y) => x - y);
|
|
456
|
-
const act = on.length > 0 ?
|
|
456
|
+
const act = on.length > 0 ? _chunkJCEKXALJcjs.activeKf.call(void 0, ctx, on) : void 0;
|
|
457
457
|
const radius = n.root ? T.root.radius : T.radius;
|
|
458
458
|
const rect = (cls, extra = "") => `<rect class="${cls}" x="${r1(n.x)}" y="${r1(n.y)}" width="${r1(n.w)}" height="${n.h}" rx="${radius}"${extra}/>`;
|
|
459
459
|
const frame = `${act ? `<g class="dg-a" style="${act}">${rect("dg-halo")}</g>` : ""}${rect("dg-st", ` ${ctx.sh}`)}${act ? `<g class="dg-a" style="${act}">${rect("dg-on")}</g>` : ""}`;
|
|
460
460
|
const ix = n.x + T.root.iconX + B.icon / 2;
|
|
461
|
-
const mark = n.root ? `<rect class="dg-ic" x="${r1(ix - B.icon / 2)}" y="${r1(n.cy - B.icon / 2)}" width="${B.icon}" height="${B.icon}" rx="${B.iconRadius}"/>${
|
|
461
|
+
const mark = n.root ? `<rect class="dg-ic" x="${r1(ix - B.icon / 2)}" y="${r1(n.cy - B.icon / 2)}" width="${B.icon}" height="${B.icon}" rx="${B.iconRadius}"/>${_chunkJCEKXALJcjs.glyph.call(void 0, "tree", ix, n.cy, B.iconScale)}` : "";
|
|
462
462
|
const shown = [[at, Number.POSITIVE_INFINITY]];
|
|
463
463
|
const texts = n.lines.map((line, k) => {
|
|
464
|
-
const style = _nullishCoalesce(n.styles[k], () => (
|
|
465
|
-
const cls = style ===
|
|
464
|
+
const style = _nullishCoalesce(n.styles[k], () => ( _chunk5OQV42W3cjs.TYPE.boxName));
|
|
465
|
+
const cls = style === _chunk5OQV42W3cjs.TYPE.treeHash ? "dg-tree-hash" : style === _chunk5OQV42W3cjs.TYPE.treeName ? "dg-tree-name" : style === _chunk5OQV42W3cjs.TYPE.rootHash ? "dg-tree-rh" : style === _chunk5OQV42W3cjs.TYPE.rootName ? "dg-tree-rn" : "dg-tree-one";
|
|
466
466
|
const baseline = _nullishCoalesce(n.baselines[k], () => ( n.cy));
|
|
467
|
-
return n.root ?
|
|
467
|
+
return n.root ? _chunkJCEKXALJcjs.write.call(void 0, ctx.ink, cls, n.x + T.root.textX, baseline, line, style, shown) : _chunkJCEKXALJcjs.write.call(void 0, ctx.ink, cls, n.cx, baseline, line, style, shown, "middle");
|
|
468
468
|
}).join("");
|
|
469
|
-
const inner = faded(n.id, `${frame}${mark}${texts}`, ` data-tree-node="${
|
|
470
|
-
return `<g class="dg-popc dg-a" style="${
|
|
469
|
+
const inner = faded(n.id, `${frame}${mark}${texts}`, ` data-tree-node="${_chunkJCEKXALJcjs.esc.call(void 0, n.id)}"${n.root ? ` data-tree-root="${_chunkJCEKXALJcjs.esc.call(void 0, n.id)}"` : ""}`);
|
|
470
|
+
return `<g class="dg-popc dg-a" style="${_chunkJCEKXALJcjs.cs.call(void 0, n.color)};${m.pop(at)}">${inner}</g>`;
|
|
471
471
|
}).join("");
|
|
472
472
|
return { links: links + ties, trails, nodes: cards + nodes, appear: drawnAt };
|
|
473
473
|
}
|
|
@@ -475,4 +475,4 @@ function drawTree(layout, diagram, timeline, ctx) {
|
|
|
475
475
|
|
|
476
476
|
|
|
477
477
|
exports.drawTree = drawTree; exports.layoutTree = layoutTree;
|
|
478
|
-
//# sourceMappingURL=tree-
|
|
478
|
+
//# sourceMappingURL=tree-6D7KI57H.cjs.map
|