@cardenelabs/dragon 0.46.4 → 0.47.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.ja.md +4 -2
- package/README.md +4 -2
- package/dist/cli.cjs +71 -70
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +71 -70
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +13 -10
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +2 -2
- package/dist/export.d.ts +2 -2
- package/dist/export.js +13 -10
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +10 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/{ink-DeDtzaTL.d.cts → ink-Sz5_zWte.d.cts} +1 -1
- package/dist/{ink-DeDtzaTL.d.ts → ink-Sz5_zWte.d.ts} +1 -1
- package/dist/light/{chunk-YO3UBEC3.js → chunk-AHUJ37R3.js} +4 -3
- package/dist/light/chunk-AHUJ37R3.js.map +1 -0
- package/dist/light/{chunk-SUL4AJLI.cjs → chunk-KNA5HH2H.cjs} +85 -2
- package/dist/light/chunk-KNA5HH2H.cjs.map +1 -0
- package/dist/light/{chunk-V34DCH34.cjs → chunk-O7RQ6R54.cjs} +84 -83
- package/dist/light/chunk-O7RQ6R54.cjs.map +1 -0
- package/dist/light/{chunk-DVGDEPCV.js → chunk-VUVRSYH6.js} +84 -1
- package/dist/light/chunk-VUVRSYH6.js.map +1 -0
- package/dist/light/{git-WBGFDRBD.cjs → git-M63KYUUK.cjs} +66 -68
- package/dist/light/git-M63KYUUK.cjs.map +1 -0
- package/dist/light/{git-WEJL6VAY.js → git-NMPPSCRM.js} +4 -6
- package/dist/light/{git-WEJL6VAY.js.map → git-NMPPSCRM.js.map} +1 -1
- package/dist/light/index.cjs +292 -293
- package/dist/light/index.cjs.map +1 -1
- package/dist/light/index.d.cts +4 -4
- package/dist/light/index.d.ts +4 -4
- package/dist/light/index.js +41 -42
- package/dist/light/index.js.map +1 -1
- package/dist/light/{lineup-WLGNGTFX.cjs → lineup-2VWQ74CU.cjs} +42 -44
- package/dist/light/lineup-2VWQ74CU.cjs.map +1 -0
- package/dist/light/{lineup-6LN6Z5T2.js → lineup-HZ5YTQ36.js} +4 -6
- package/dist/light/{lineup-6LN6Z5T2.js.map → lineup-HZ5YTQ36.js.map} +1 -1
- package/dist/light/{state-JVAH4TSM.cjs → state-MFCHMESP.cjs} +42 -44
- package/dist/light/state-MFCHMESP.cjs.map +1 -0
- package/dist/light/{state-DFYTMQI7.js → state-RRAJPRO3.js} +3 -5
- package/dist/light/{state-DFYTMQI7.js.map → state-RRAJPRO3.js.map} +1 -1
- package/dist/light/{time-M3EGEFDU.js → time-7V7RUEYS.js} +5 -4
- package/dist/light/time-7V7RUEYS.js.map +1 -0
- package/dist/light/{time-EXRPI34B.cjs → time-RISQEAB7.cjs} +86 -85
- package/dist/light/time-RISQEAB7.cjs.map +1 -0
- package/dist/light/{tree-MFU54QKY.js → tree-PWSU7R6R.js} +3 -3
- package/dist/light/{tree-DECHTXFU.cjs → tree-S23P2PW7.cjs} +62 -62
- package/dist/light/tree-S23P2PW7.cjs.map +1 -0
- package/dist/node.cjs +5 -2
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +5 -2
- package/dist/node.js.map +1 -1
- package/dist/player.global.js +3 -3
- package/package.json +1 -1
- package/src/cli.ts +10 -10
- package/src/export/index.ts +3 -3
- package/src/figure-text.ts +2 -2
- package/src/kinds/registry.ts +2 -2
- package/src/layout/time.ts +2 -2
- package/src/messages.ts +1 -1
- package/src/parser.ts +3 -2
- package/src/player.ts +3 -2
- package/src/render/draw.ts +4 -4
- package/src/render/ink.ts +2 -2
- package/src/schema.ts +4 -4
- package/src/version.ts +3 -3
- package/src/words.ts +6 -0
- package/dist/light/chunk-CLS6JVKK.cjs +0 -84
- package/dist/light/chunk-CLS6JVKK.cjs.map +0 -1
- package/dist/light/chunk-DVGDEPCV.js.map +0 -1
- package/dist/light/chunk-SUL4AJLI.cjs.map +0 -1
- package/dist/light/chunk-V34DCH34.cjs.map +0 -1
- package/dist/light/chunk-YDKPEKGZ.js +0 -84
- package/dist/light/chunk-YDKPEKGZ.js.map +0 -1
- package/dist/light/chunk-YO3UBEC3.js.map +0 -1
- package/dist/light/git-WBGFDRBD.cjs.map +0 -1
- package/dist/light/lineup-WLGNGTFX.cjs.map +0 -1
- package/dist/light/state-JVAH4TSM.cjs.map +0 -1
- package/dist/light/time-EXRPI34B.cjs.map +0 -1
- package/dist/light/time-M3EGEFDU.js.map +0 -1
- package/dist/light/tree-DECHTXFU.cjs.map +0 -1
- /package/dist/light/{tree-MFU54QKY.js.map → tree-PWSU7R6R.js.map} +0 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkO7RQ6R54cjs = require('./chunk-O7RQ6R54.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -32,7 +32,8 @@ var _chunkV34DCH34cjs = require('./chunk-V34DCH34.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
var _chunkKNA5HH2Hcjs = require('./chunk-KNA5HH2H.cjs');
|
|
36
37
|
|
|
37
38
|
// src/layout/time.ts
|
|
38
39
|
var SECONDS = { d: 86400, h: 3600, min: 60, s: 1, ms: 1e-3 };
|
|
@@ -44,13 +45,13 @@ function durationOf(text) {
|
|
|
44
45
|
return { seconds: Number(m[1]) * SECONDS[unit], unit };
|
|
45
46
|
}
|
|
46
47
|
var unitFor = (max, fallback) => _nullishCoalesce(UNITS.find((u) => max / SECONDS[u] >= 2 - 1e-9), () => ( fallback));
|
|
47
|
-
var timeText = (seconds, unit, lang) => `${Number((seconds / SECONDS[unit]).toFixed(2))} ${
|
|
48
|
+
var timeText = (seconds, unit, lang) => `${Number((seconds / SECONDS[unit]).toFixed(2))} ${_chunkKNA5HH2Hcjs.FIGURE_TEXT[lang].timeUnits[unit]}`;
|
|
48
49
|
function majorTicks(count, period, unitPx) {
|
|
49
50
|
let step = 1;
|
|
50
51
|
if (period) step = period * Math.max(1, Math.ceil(count / period / 8));
|
|
51
52
|
else {
|
|
52
53
|
for (let k = 1; ; k *= 10) {
|
|
53
|
-
const found = [k, k * 2, k * 5].find((n) => count / n <=
|
|
54
|
+
const found = [k, k * 2, k * 5].find((n) => count / n <= _chunkKNA5HH2Hcjs.LOOK.time.ticks);
|
|
54
55
|
if (found !== void 0) {
|
|
55
56
|
step = found;
|
|
56
57
|
break;
|
|
@@ -60,11 +61,11 @@ function majorTicks(count, period, unitPx) {
|
|
|
60
61
|
const at = [];
|
|
61
62
|
for (let u = 0; u <= count; u += step) at.push(u);
|
|
62
63
|
const last = at[at.length - 1];
|
|
63
|
-
if (last !== count && (count - last) * unitPx >=
|
|
64
|
+
if (last !== count && (count - last) * unitPx >= _chunkKNA5HH2Hcjs.LOOK.time.minorPx) at.push(count);
|
|
64
65
|
return { at, step };
|
|
65
66
|
}
|
|
66
67
|
function minorTicks(count, step, unitPx, majors) {
|
|
67
|
-
const by = Array.from({ length: step - 1 }, (_, k) => k + 1).find((d) => step % d === 0 && d * unitPx >=
|
|
68
|
+
const by = Array.from({ length: step - 1 }, (_, k) => k + 1).find((d) => step % d === 0 && d * unitPx >= _chunkKNA5HH2Hcjs.LOOK.time.minorPx);
|
|
68
69
|
if (by === void 0) return [];
|
|
69
70
|
const out = [];
|
|
70
71
|
for (let u = by; u < count; u += by) if (!majors.includes(u)) out.push(u);
|
|
@@ -78,22 +79,22 @@ function needleSteps(diagram) {
|
|
|
78
79
|
return [from, at];
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
|
-
function layoutTime(diagram, lang =
|
|
82
|
-
const T =
|
|
83
|
-
const { margin, gap } =
|
|
84
|
-
const R =
|
|
85
|
-
const text =
|
|
82
|
+
function layoutTime(diagram, lang = _chunkKNA5HH2Hcjs.DEFAULT_LANG) {
|
|
83
|
+
const T = _chunkKNA5HH2Hcjs.LOOK.time;
|
|
84
|
+
const { margin, gap } = _chunkKNA5HH2Hcjs.LOOK;
|
|
85
|
+
const R = _chunkKNA5HH2Hcjs.LOOK.region;
|
|
86
|
+
const text = _chunkKNA5HH2Hcjs.FIGURE_TEXT[lang];
|
|
86
87
|
const spec = _nullishCoalesce(diagram.time, () => ( { scale: { unit: "", length: "1s", count: 1 }, rows: [] }));
|
|
87
88
|
const { scale } = spec;
|
|
88
89
|
const count = Math.max(1, scale.count);
|
|
89
90
|
const length = durationOf(scale.length);
|
|
90
|
-
const width = Math.max(T.width,
|
|
91
|
-
const nameRight = Math.max(0, ...spec.rows.map((r) =>
|
|
91
|
+
const width = Math.max(T.width, _chunkKNA5HH2Hcjs.stripNeed.call(void 0, diagram) + margin * 2);
|
|
92
|
+
const nameRight = Math.max(0, ...spec.rows.map((r) => _chunkKNA5HH2Hcjs.textWidth.call(void 0, r.name, _chunkKNA5HH2Hcjs.TYPE.timeRow)));
|
|
92
93
|
const axisX = Math.max(T.axisX, margin + R.inset + nameRight + T.gutterGap);
|
|
93
94
|
const axisW = width - T.right - axisX;
|
|
94
95
|
const unit = axisW / count;
|
|
95
|
-
const colors =
|
|
96
|
-
const rooms =
|
|
96
|
+
const colors = _chunkKNA5HH2Hcjs.boxColors.call(void 0, diagram);
|
|
97
|
+
const rooms = _chunkKNA5HH2Hcjs.slotRooms.call(void 0, diagram);
|
|
97
98
|
const regions = [];
|
|
98
99
|
const boxes = [];
|
|
99
100
|
const edges = [];
|
|
@@ -113,8 +114,8 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
113
114
|
const x = axisX + k * colW;
|
|
114
115
|
const placed = diagram.boxes.map((b, j) => {
|
|
115
116
|
const room = rooms.get(b.id);
|
|
116
|
-
const w = Math.max(
|
|
117
|
-
const y2 = top + T.boxTop + j * (
|
|
117
|
+
const w = Math.max(_chunkKNA5HH2Hcjs.boxWidth.call(void 0, diagram, b.id, false), _chunkKNA5HH2Hcjs.slotBoxWidth.call(void 0, room, b.icon !== void 0, _chunkKNA5HH2Hcjs.LOOK.box.padX));
|
|
118
|
+
const y2 = top + T.boxTop + j * (_chunkKNA5HH2Hcjs.LOOK.box.h + T.boxGap);
|
|
118
119
|
const row = rowIds.get(b.id);
|
|
119
120
|
const box = {
|
|
120
121
|
id: b.id,
|
|
@@ -125,13 +126,13 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
125
126
|
x: x + colW / 2 - w / 2,
|
|
126
127
|
y: y2,
|
|
127
128
|
w,
|
|
128
|
-
h:
|
|
129
|
+
h: _chunkKNA5HH2Hcjs.LOOK.box.h,
|
|
129
130
|
cx: x + colW / 2,
|
|
130
|
-
cy: y2 +
|
|
131
|
+
cy: y2 + _chunkKNA5HH2Hcjs.LOOK.box.h / 2,
|
|
131
132
|
...row ? { row: row.id } : {},
|
|
132
133
|
..._optionalChain([row, 'optionalAccess', _2 => _2.empty, 'optionalAccess', _3 => _3.includes, 'call', _4 => _4(u)]) ? { empty: true } : {}
|
|
133
134
|
};
|
|
134
|
-
|
|
135
|
+
_chunkKNA5HH2Hcjs.placeSlot.call(void 0, box, room);
|
|
135
136
|
return box;
|
|
136
137
|
});
|
|
137
138
|
boxes.push(...placed);
|
|
@@ -151,7 +152,7 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
151
152
|
y: top,
|
|
152
153
|
w: width - margin * 2,
|
|
153
154
|
h: bottom2 - top,
|
|
154
|
-
header: { x: margin + R.inset, y: top + R.inset, w: Math.max(R.icon,
|
|
155
|
+
header: { x: margin + R.inset, y: top + R.inset, w: Math.max(R.icon, _chunkKNA5HH2Hcjs.textWidth.call(void 0, text.zoom, _chunkKNA5HH2Hcjs.TYPE.regionName)), h: R.nameY - R.inset + R.line }
|
|
155
156
|
});
|
|
156
157
|
zoom = { from, to, frame: { x: 0, y: 0, w: 0, h: 0 }, guides: [], columns, empty: text.empty, headY: top + T.head };
|
|
157
158
|
axisTop = bottom2 + T.zoomGap;
|
|
@@ -161,7 +162,7 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
161
162
|
id: r.id,
|
|
162
163
|
name: r.name,
|
|
163
164
|
// 色を書かない列は、同じ名札の箱の色にそろえる。印と拡大の帯の箱が同じ物だと見て分かるため
|
|
164
|
-
color: _nullishCoalesce(_nullishCoalesce(r.color, () => ( colors.get(r.id))), () => (
|
|
165
|
+
color: _nullishCoalesce(_nullishCoalesce(r.color, () => ( colors.get(r.id))), () => ( _chunkKNA5HH2Hcjs.COLOR_ORDER[k % _chunkKNA5HH2Hcjs.COLOR_ORDER.length])),
|
|
165
166
|
x: axisX,
|
|
166
167
|
y: rowsTop + k * (T.row + T.rowGap),
|
|
167
168
|
w: axisW,
|
|
@@ -213,9 +214,9 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
213
214
|
);
|
|
214
215
|
const cx = axisX + (p.at + 0.5) * unit;
|
|
215
216
|
const tx = cx + T.point.text;
|
|
216
|
-
const w = Math.max(
|
|
217
|
-
const top = pointCy + T.point.nameY -
|
|
218
|
-
const bottom2 = pointCy + T.point.stateY +
|
|
217
|
+
const w = Math.max(_chunkKNA5HH2Hcjs.textWidth.call(void 0, p.id, _chunkKNA5HH2Hcjs.TYPE.pointName), ...changes.map((c) => _chunkKNA5HH2Hcjs.textWidth.call(void 0, c.text, _chunkKNA5HH2Hcjs.TYPE.pointState)));
|
|
218
|
+
const top = pointCy + T.point.nameY - _chunkKNA5HH2Hcjs.TYPE.pointName.size * 0.8;
|
|
219
|
+
const bottom2 = pointCy + T.point.stateY + _chunkKNA5HH2Hcjs.TYPE.pointState.size * 0.2;
|
|
219
220
|
return { id: p.id, unit: p.at, cx, cy: pointCy, r: T.point.r, text: { x: tx, y: top, w, h: bottom2 - top }, changes };
|
|
220
221
|
});
|
|
221
222
|
const pointOf = new Map(points.map((p) => [p.id, p]));
|
|
@@ -234,13 +235,13 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
234
235
|
const x0 = right ? Math.max(a.cx + a.r, a.text.x + a.text.w + T.point.link) : a.cx - a.r - T.point.end;
|
|
235
236
|
const x1 = right ? b.cx - b.r - T.point.end : Math.min(b.cx - b.r, b.text.x + b.text.w + T.point.link);
|
|
236
237
|
const edge2 = { step: s, event: e, from: event.from, to: event.to, points: [[x0, a.cy], [x1, b.cy]], color: event.carry.kind === "coin" ? "coin" : _nullishCoalesce(colorAt(event.to, s), () => ( "slate")), carry: event.carry };
|
|
237
|
-
if (event.carry.kind !== "none") edge2.settle = [x1 - (right ? 1 : -1) * (
|
|
238
|
+
if (event.carry.kind !== "none") edge2.settle = [x1 - (right ? 1 : -1) * (_chunkKNA5HH2Hcjs.LOOK.carrier.coinR + _chunkKNA5HH2Hcjs.LOOK.edge.arrow), b.cy];
|
|
238
239
|
edges.push(edge2);
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
242
|
const wired = wire(event, zoom);
|
|
242
243
|
if (!wired) return;
|
|
243
|
-
const edge = { step: s, event: e, from: event.from, to: event.to, points: wired.points, color:
|
|
244
|
+
const edge = { step: s, event: e, from: event.from, to: event.to, points: wired.points, color: _chunkKNA5HH2Hcjs.edgeColor.call(void 0, event, colors), carry: event.carry };
|
|
244
245
|
seat(edge, wired.from, wired.to, rooms);
|
|
245
246
|
edges.push(edge);
|
|
246
247
|
wires.push({ step: s, event: e, from: wired.from, to: wired.to, column: event.at, into: _nullishCoalesce(event.into, () => ( event.at)) });
|
|
@@ -273,7 +274,7 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
273
274
|
};
|
|
274
275
|
const marksBottom = rowsBottom;
|
|
275
276
|
const named = diagram.steps.some((step) => step.events.some((e) => e.type === "edge" && e.at === void 0 && e.label !== void 0));
|
|
276
|
-
const { r: badgeR, inset } =
|
|
277
|
+
const { r: badgeR, inset } = _chunkKNA5HH2Hcjs.LOOK.badge;
|
|
277
278
|
let y = points.length > 0 ? pointCy + T.point.r + (named ? T.point.room : T.point.plain) : marksBottom + (badgeR + inset) * 2;
|
|
278
279
|
const spans = [];
|
|
279
280
|
const events = diagram.steps.flatMap((step, s) => step.events.flatMap((event, e) => event.type === "span" ? [{ s, e, event }] : []));
|
|
@@ -287,18 +288,18 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
287
288
|
if (kind === "box") {
|
|
288
289
|
const B = T.box;
|
|
289
290
|
const rect = { x: x0 - B.pad, y: rowsTop - B.pad, w: x1 - x0 + B.pad * 2, h: rowsBottom - rowsTop + B.pad * 2 };
|
|
290
|
-
const w =
|
|
291
|
+
const w = _chunkKNA5HH2Hcjs.textWidth.call(void 0, event.text, _chunkKNA5HH2Hcjs.TYPE.tag) + B.tagPadX * 2;
|
|
291
292
|
const textRect = { x: rect.x + B.tagX, y: rect.y - B.tagH / 2, w, h: B.tagH };
|
|
292
|
-
spans.push({ ...base, ...rect, textRect, textY: rect.y +
|
|
293
|
+
spans.push({ ...base, ...rect, textRect, textY: rect.y + _chunkKNA5HH2Hcjs.LOOK.baseline.tag });
|
|
293
294
|
} else spans.push({ ...base, x: x0, y: 0, w: x1 - x0, h: T.bracket.tick, textRect: { x: 0, y: 0, w: 0, h: 0 }, textY: 0 });
|
|
294
295
|
}
|
|
295
296
|
layout.spans = spans;
|
|
296
297
|
layout.badges = badgesOf(diagram, layout, needleSteps(diagram));
|
|
297
298
|
layout.labels = labelsOf(diagram, layout);
|
|
298
|
-
y = Math.max(y, ...layout.labels.map((l) => l.y + l.h +
|
|
299
|
+
y = Math.max(y, ...layout.labels.map((l) => l.y + l.h + _chunkKNA5HH2Hcjs.LOOK.label.soft));
|
|
299
300
|
const lanes = [];
|
|
300
301
|
for (const span of spans.filter((x) => x.kind === "bracket")) {
|
|
301
|
-
const w =
|
|
302
|
+
const w = _chunkKNA5HH2Hcjs.textWidth.call(void 0, span.text, _chunkKNA5HH2Hcjs.TYPE.spanText);
|
|
302
303
|
const cx = Math.min(axisX + axisW - w / 2, Math.max(axisX + w / 2, span.x + span.w / 2));
|
|
303
304
|
const reach = { x: Math.min(span.x, cx - w / 2), w: Math.max(span.x + span.w, cx + w / 2) - Math.min(span.x, cx - w / 2) };
|
|
304
305
|
const clash = (other) => {
|
|
@@ -315,7 +316,7 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
315
316
|
lanes[lane].push(span);
|
|
316
317
|
span.y = y + T.bracket.gap + lane * T.bracket.lane;
|
|
317
318
|
span.textY = span.y + T.bracket.tick + T.bracket.text;
|
|
318
|
-
span.textRect =
|
|
319
|
+
span.textRect = _chunkKNA5HH2Hcjs.textBox.call(void 0, span.text, cx, span.textY, _chunkKNA5HH2Hcjs.TYPE.spanText, "middle");
|
|
319
320
|
}
|
|
320
321
|
if (lanes.length > 0) y = Math.max(...spans.filter((x) => x.kind === "bracket").map((x) => x.textRect.y + x.textRect.h));
|
|
321
322
|
const axisLine = y + T.axisGap;
|
|
@@ -325,13 +326,13 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
325
326
|
const tickUnit = unitFor(count * length.seconds, length.unit);
|
|
326
327
|
layout.ticks = majors.at.map((at) => {
|
|
327
328
|
const label = timeText(at * length.seconds, tickUnit, lang);
|
|
328
|
-
const w =
|
|
329
|
+
const w = _chunkKNA5HH2Hcjs.textWidth.call(void 0, label, _chunkKNA5HH2Hcjs.TYPE.timeTick);
|
|
329
330
|
const x = axisX + at * unit;
|
|
330
331
|
const left = at === 0 ? x : at === count ? x - w : Math.min(axisX + axisW - w, Math.max(axisX, x - w / 2));
|
|
331
332
|
return { at, x, text: label, left, y: tickY };
|
|
332
333
|
});
|
|
333
334
|
layout.minor = minorTicks(count, majors.step, unit, majors.at);
|
|
334
|
-
let bottom = tickY +
|
|
335
|
+
let bottom = tickY + _chunkKNA5HH2Hcjs.TYPE.timeTick.size * 0.2;
|
|
335
336
|
if (spec.period) {
|
|
336
337
|
const P = spec.period;
|
|
337
338
|
const list = [];
|
|
@@ -342,9 +343,9 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
342
343
|
const range = `${scale.unit} ${text.range(String(first), String((_nullishCoalesce(scale.from, () => ( 0))) + to))}`;
|
|
343
344
|
list.push({ index, from, to, name, range, x: axisX + from * unit, y: axisLine, w: (to - from + 1) * unit, h: 0, nameY: tickY, rangeY: tickY + T.rangeY });
|
|
344
345
|
}
|
|
345
|
-
const tickRects = layout.ticks.map((t) =>
|
|
346
|
+
const tickRects = layout.ticks.map((t) => _chunkKNA5HH2Hcjs.textBox.call(void 0, t.text, t.left, t.y, _chunkKNA5HH2Hcjs.TYPE.timeTick));
|
|
346
347
|
const clash = list.some((p) => {
|
|
347
|
-
const r =
|
|
348
|
+
const r = _chunkKNA5HH2Hcjs.textBox.call(void 0, p.name, p.x + p.w / 2, p.nameY, _chunkKNA5HH2Hcjs.TYPE.timePeriod, "middle");
|
|
348
349
|
return tickRects.some((t) => r.x < t.x + t.w + T.nameGap && t.x < r.x + r.w + T.nameGap);
|
|
349
350
|
});
|
|
350
351
|
for (const p of list) {
|
|
@@ -352,14 +353,14 @@ function layoutTime(diagram, lang = "ja") {
|
|
|
352
353
|
p.nameY = tickY + T.rangeY + 2;
|
|
353
354
|
p.rangeY = p.nameY + T.rangeY;
|
|
354
355
|
}
|
|
355
|
-
p.h = p.rangeY +
|
|
356
|
+
p.h = p.rangeY + _chunkKNA5HH2Hcjs.TYPE.timeRange.size * 0.2 - axisLine;
|
|
356
357
|
}
|
|
357
358
|
layout.periods = list;
|
|
358
|
-
bottom = Math.max(bottom, ...list.map((p) => p.rangeY +
|
|
359
|
+
bottom = Math.max(bottom, ...list.map((p) => p.rangeY + _chunkKNA5HH2Hcjs.TYPE.timeRange.size * 0.2));
|
|
359
360
|
}
|
|
360
361
|
const axisBottom = bottom + T.bottom;
|
|
361
362
|
regions.push({ id: "axis", lines: [], color: "slate", x: margin, y: axisTop, w: width - margin * 2, h: axisBottom - axisTop, header: { x: margin + R.inset, y: axisTop + R.inset, w: 0, h: 0 } });
|
|
362
|
-
const strip =
|
|
363
|
+
const strip = _chunkKNA5HH2Hcjs.layoutStrip.call(void 0, diagram, margin, axisBottom + gap, width - margin * 2);
|
|
363
364
|
if (strip) layout.strip = strip;
|
|
364
365
|
layout.height = (strip ? strip.y + strip.h : axisBottom) + margin;
|
|
365
366
|
layout.badges = badgesOf(diagram, layout, needleSteps(diagram));
|
|
@@ -378,7 +379,7 @@ function wire(event, zoom) {
|
|
|
378
379
|
const down = jt > jf;
|
|
379
380
|
if (fromColumn === toColumn) {
|
|
380
381
|
if (Math.abs(jt - jf) === 1) return { from, to, points: [[from.cx, down ? from.y + from.h + 1 : from.y - 1], [to.cx, down ? to.y - 1 : to.y + to.h + 1]] };
|
|
381
|
-
const lane = Math.min(fromColumn.x + fromColumn.w -
|
|
382
|
+
const lane = Math.min(fromColumn.x + fromColumn.w - _chunkKNA5HH2Hcjs.LOOK.gap, Math.max(from.x + from.w, to.x + to.w) + _chunkKNA5HH2Hcjs.LOOK.gap);
|
|
382
383
|
return {
|
|
383
384
|
from,
|
|
384
385
|
to,
|
|
@@ -398,18 +399,18 @@ function wire(event, zoom) {
|
|
|
398
399
|
}
|
|
399
400
|
function seat(edge, from, to, rooms) {
|
|
400
401
|
const arrive = { ...edge };
|
|
401
|
-
|
|
402
|
+
_chunkKNA5HH2Hcjs.seatCarriers.call(void 0, [arrive], /* @__PURE__ */ new Map([[edge.to, to]]), rooms);
|
|
402
403
|
const leave = { ...edge };
|
|
403
|
-
|
|
404
|
+
_chunkKNA5HH2Hcjs.seatCarriers.call(void 0, [leave], /* @__PURE__ */ new Map([[edge.from, from]]), rooms);
|
|
404
405
|
if (arrive.settle) edge.settle = arrive.settle;
|
|
405
406
|
if (leave.wait) edge.wait = leave.wait;
|
|
406
407
|
}
|
|
407
408
|
function badgesOf(diagram, layout, needle) {
|
|
408
|
-
const { r, inset } =
|
|
409
|
+
const { r, inset } = _chunkKNA5HH2Hcjs.LOOK.badge;
|
|
409
410
|
const { axis } = layout;
|
|
410
411
|
const taken = [];
|
|
411
412
|
const out = [];
|
|
412
|
-
const top = Math.min(...layout.rows.map((row) => row.y), layout.needle.y1 +
|
|
413
|
+
const top = Math.min(...layout.rows.map((row) => row.y), layout.needle.y1 + _chunkKNA5HH2Hcjs.LOOK.time.needle.over);
|
|
413
414
|
const bottom = Math.max(...layout.rows.map((row) => row.y + row.h), top);
|
|
414
415
|
const between = layout.points[0] ? (bottom + layout.points[0].cy - layout.points[0].r) / 2 : bottom + r + inset;
|
|
415
416
|
diagram.steps.forEach((step, s) => {
|
|
@@ -421,7 +422,7 @@ function badgesOf(diagram, layout, needle) {
|
|
|
421
422
|
if (edge) {
|
|
422
423
|
const waits = edge.carry.kind !== "none" && !edge.wait ? [edge.points[0]] : [];
|
|
423
424
|
const others = layout.edges.filter((e) => e !== edge).map((e) => e.points);
|
|
424
|
-
push(
|
|
425
|
+
push(_chunkKNA5HH2Hcjs.badgeOnPath.call(void 0, edge.points, [...taken, ...waits], others), edge.color);
|
|
425
426
|
return;
|
|
426
427
|
}
|
|
427
428
|
const [from, to] = _nullishCoalesce(needle[s], () => ( [0, 0]));
|
|
@@ -446,10 +447,10 @@ function badgesOf(diagram, layout, needle) {
|
|
|
446
447
|
const before = out[out.length - 1];
|
|
447
448
|
out.push(before ? { ...before, step: s } : { step: s, x: axis.x - r - inset, y: top, color: "slate" });
|
|
448
449
|
});
|
|
449
|
-
return
|
|
450
|
+
return _chunkKNA5HH2Hcjs.replaceSameSpot.call(void 0, out);
|
|
450
451
|
}
|
|
451
452
|
function spotOf(event, step, layout) {
|
|
452
|
-
const { r, inset } =
|
|
453
|
+
const { r, inset } = _chunkKNA5HH2Hcjs.LOOK.badge;
|
|
453
454
|
if (event.type === "span") {
|
|
454
455
|
const span = layout.spans.find((x) => x.step === step && x.from === event.from && x.to === event.to && x.text === event.text);
|
|
455
456
|
if (!span) return void 0;
|
|
@@ -471,14 +472,14 @@ function labelsOf(diagram, layout) {
|
|
|
471
472
|
const labels = [];
|
|
472
473
|
const circles = layout.points.map((p) => ({ x: p.cx - p.r, y: p.cy - p.r, w: p.r * 2, h: p.r * 2 }));
|
|
473
474
|
const texts = layout.points.map((p) => p.text);
|
|
474
|
-
const heads = (_nullishCoalesce(_optionalChain([layout, 'access', _24 => _24.zoom, 'optionalAccess', _25 => _25.columns]), () => ( []))).map((c) =>
|
|
475
|
+
const heads = (_nullishCoalesce(_optionalChain([layout, 'access', _24 => _24.zoom, 'optionalAccess', _25 => _25.columns]), () => ( []))).map((c) => _chunkKNA5HH2Hcjs.textBox.call(void 0, c.head, c.x + c.w / 2, _nullishCoalesce(_optionalChain([layout, 'access', _26 => _26.zoom, 'optionalAccess', _27 => _27.headY]), () => ( 0)), _chunkKNA5HH2Hcjs.TYPE.timeHead, "middle"));
|
|
475
476
|
for (const edge of layout.edges) {
|
|
476
477
|
const source = _optionalChain([diagram, 'access', _28 => _28.steps, 'access', _29 => _29[edge.step], 'optionalAccess', _30 => _30.events, 'access', _31 => _31[edge.event]]);
|
|
477
478
|
if (_optionalChain([source, 'optionalAccess', _32 => _32.type]) !== "edge" || source.label === void 0) continue;
|
|
478
|
-
const seen = layout.badges.filter((b) => b.step <= edge.step).map((b) =>
|
|
479
|
+
const seen = layout.badges.filter((b) => b.step <= edge.step).map((b) => _chunkKNA5HH2Hcjs.badgeRect.call(void 0, [b.x, b.y]));
|
|
479
480
|
const side = _nullishCoalesce(source.labelSide, () => ( (source.at === void 0 ? "below" : void 0)));
|
|
480
481
|
labels.push(
|
|
481
|
-
|
|
482
|
+
_chunkKNA5HH2Hcjs.placeLabel.call(void 0,
|
|
482
483
|
{ step: edge.step, event: edge.event, text: source.label, points: edge.points, color: edge.color, ...side ? { side } : {}, flip: source.at !== void 0 },
|
|
483
484
|
{ hard: [...circles, ...layout.boxes], soft: [...texts, ...heads, ...labels.filter((l) => l.step === edge.step)], touch: seen }
|
|
484
485
|
)
|
|
@@ -489,7 +490,7 @@ function labelsOf(diagram, layout) {
|
|
|
489
490
|
|
|
490
491
|
// src/render/time.ts
|
|
491
492
|
var r1 = (v) => Math.round(v * 100) / 100;
|
|
492
|
-
var ja = (cls, text) =>
|
|
493
|
+
var ja = (cls, text) => _chunkKNA5HH2Hcjs.hasWide.call(void 0, text) ? `${cls} ${cls}j` : cls;
|
|
493
494
|
function simplify(keys) {
|
|
494
495
|
const out = [];
|
|
495
496
|
for (const key of keys) {
|
|
@@ -517,7 +518,7 @@ function valueAt(keys, t) {
|
|
|
517
518
|
}
|
|
518
519
|
function drawTime(layout, diagram, timeline, ctx, subs) {
|
|
519
520
|
const { m, ink } = ctx;
|
|
520
|
-
const T =
|
|
521
|
+
const T = _chunkKNA5HH2Hcjs.LOOK.time;
|
|
521
522
|
const { axis } = layout;
|
|
522
523
|
const passed = new Map((_nullishCoalesce(timeline.units, () => ( []))).map((u) => [u.unit, u.passed]));
|
|
523
524
|
const at = (step, event) => _optionalChain([timeline, 'access', _33 => _33.events, 'access', _34 => _34.find, 'call', _35 => _35((t) => t.step === step && t.event === event), 'optionalAccess', _36 => _36.at]);
|
|
@@ -543,20 +544,20 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
|
|
|
543
544
|
const z = layout.zoom;
|
|
544
545
|
z.columns.forEach((c, k) => {
|
|
545
546
|
if (k > 0) base.push(`<line class="dg-tm-sep" x1="${r1(c.x)}" y1="${r1(c.y + T.sep)}" x2="${r1(c.x)}" y2="${r1(c.y + c.h - T.sep)}"/>`);
|
|
546
|
-
base.push(
|
|
547
|
+
base.push(_chunkO7RQ6R54cjs.write.call(void 0, ink, ja("dg-tm-hd", c.head), c.x + c.w / 2, z.headY, c.head, _chunkKNA5HH2Hcjs.TYPE.timeHead, _chunkO7RQ6R54cjs.ALWAYS, "middle"));
|
|
547
548
|
for (const box of c.boxes) node.push(columnBox(box, c.unit));
|
|
548
549
|
});
|
|
549
550
|
}
|
|
550
551
|
function columnBox(box, unit) {
|
|
551
552
|
const on = [...new Set(layout.wires.filter((w) => w.from === box || w.to === box).map((w) => w.step))].sort((a, b) => a - b);
|
|
552
|
-
const frame = (cls) => `<rect class="${cls}" x="${r1(box.x)}" y="${r1(box.y)}" width="${r1(box.w)}" height="${box.h}" rx="${
|
|
553
|
+
const frame = (cls) => `<rect class="${cls}" x="${r1(box.x)}" y="${r1(box.y)}" width="${r1(box.w)}" height="${box.h}" rx="${_chunkKNA5HH2Hcjs.LOOK.box.radius}"/>`;
|
|
553
554
|
if (box.empty) {
|
|
554
555
|
const shown2 = passed.get(unit);
|
|
555
556
|
const word = _nullishCoalesce(_optionalChain([layout, 'access', _48 => _48.zoom, 'optionalAccess', _49 => _49.empty]), () => ( ""));
|
|
556
|
-
const mark = shown2 === void 0 ? "" : `<g class="dg-a" style="${m.vis(shown2)}">${frame("dg-tm-ex")}${
|
|
557
|
-
return `<g data-empty="${
|
|
557
|
+
const mark = shown2 === void 0 ? "" : `<g class="dg-a" style="${m.vis(shown2)}">${frame("dg-tm-ex")}${_chunkO7RQ6R54cjs.write.call(void 0, ink, "dg-tm-ext", box.cx, box.cy + _chunkKNA5HH2Hcjs.LOOK.baseline.mark, word, _chunkKNA5HH2Hcjs.TYPE.emptyText, [[shown2, Number.POSITIVE_INFINITY]], "middle")}</g>`;
|
|
558
|
+
return `<g data-empty="${_chunkO7RQ6R54cjs.esc.call(void 0, box.id)}">${frame("dg-tm-ph")}${mark}</g>`;
|
|
558
559
|
}
|
|
559
|
-
const drawn =
|
|
560
|
+
const drawn = _chunkO7RQ6R54cjs.linkTo.call(void 0, _optionalChain([diagram, 'access', _50 => _50.boxes, 'access', _51 => _51.find, 'call', _52 => _52((b) => b.id === box.id), 'optionalAccess', _53 => _53.link]), _chunkO7RQ6R54cjs.card.call(void 0, box, ctx, on, _nullishCoalesce(subs.get(box.id), () => ( []))));
|
|
560
561
|
if (!box.row) return drawn;
|
|
561
562
|
const shown = filled(box.row, unit);
|
|
562
563
|
if (shown === void 0) return frame("dg-tm-ph");
|
|
@@ -579,16 +580,16 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
|
|
|
579
580
|
if (t === void 0) return;
|
|
580
581
|
const next = mark.colors[k + 1];
|
|
581
582
|
const until = next ? at(next.step, next.event) : void 0;
|
|
582
|
-
parts.push(`<g style="${
|
|
583
|
+
parts.push(`<g style="${_chunkO7RQ6R54cjs.cs.call(void 0, c.color)}">${rect("dg-tm-m dg-a", ` style="${m.vis(t, _nullishCoalesce(until, () => ( m.last)), { f: 0.35 })}"`)}</g>`);
|
|
583
584
|
});
|
|
584
585
|
}
|
|
585
|
-
base.push(`<g data-row="${
|
|
586
|
-
base.push(
|
|
586
|
+
base.push(`<g data-row="${_chunkO7RQ6R54cjs.esc.call(void 0, row.id)}" style="${_chunkO7RQ6R54cjs.cs.call(void 0, row.color)}">${parts.join("")}</g>`);
|
|
587
|
+
base.push(_chunkO7RQ6R54cjs.write.call(void 0, ink, "dg-tm-rn", _chunkKNA5HH2Hcjs.LOOK.margin + _chunkKNA5HH2Hcjs.LOOK.region.inset, row.y + row.h / 2 + _chunkKNA5HH2Hcjs.LOOK.baseline.mark, row.name, _chunkKNA5HH2Hcjs.TYPE.timeRow));
|
|
587
588
|
}
|
|
588
589
|
if (layout.zoom) {
|
|
589
590
|
const z = layout.zoom;
|
|
590
591
|
const hide = layout.spans.filter((s) => s.kind === "box" && s.from <= z.to && z.from <= s.to).map((s) => at(s.step, s.event)).filter((t) => t !== void 0).sort((a, b) => a - b)[0];
|
|
591
|
-
const guides = z.guides.map((g) => `<path class="dg-tm-gd" d="${
|
|
592
|
+
const guides = z.guides.map((g) => `<path class="dg-tm-gd" d="${_chunkO7RQ6R54cjs.pathOf.call(void 0, g)}"/>`).join("");
|
|
592
593
|
const lens = `<rect class="dg-tm-fr" x="${r1(z.frame.x)}" y="${r1(z.frame.y)}" width="${r1(z.frame.w)}" height="${r1(z.frame.h)}" rx="4"/>${guides}`;
|
|
593
594
|
base.push(hide === void 0 ? lens : `<g class="dg-a" style="${m.until(hide)}">${lens}</g>`);
|
|
594
595
|
}
|
|
@@ -596,10 +597,10 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
|
|
|
596
597
|
const majors = layout.ticks.map((t) => `M ${x(t.at)} ${r1(axis.line - T.major / 2)} V ${r1(axis.line + T.major / 2)}`);
|
|
597
598
|
const minors = layout.minor.map((u) => `M ${x(u)} ${r1(axis.line - T.minor / 2)} V ${r1(axis.line + T.minor / 2)}`);
|
|
598
599
|
base.push(`<path class="dg-tm-ax" d="M ${x(0)} ${r1(axis.line)} H ${x(axis.count)} ${[...majors, ...minors].join(" ")}"/>`);
|
|
599
|
-
for (const t of layout.ticks) base.push(
|
|
600
|
+
for (const t of layout.ticks) base.push(_chunkO7RQ6R54cjs.write.call(void 0, ink, ja("dg-tm-tk", t.text), t.left, t.y, t.text, _chunkKNA5HH2Hcjs.TYPE.timeTick));
|
|
600
601
|
for (const p of layout.periods) {
|
|
601
|
-
base.push(
|
|
602
|
-
base.push(
|
|
602
|
+
base.push(_chunkO7RQ6R54cjs.write.call(void 0, ink, ja("dg-tm-en", p.name), p.x + p.w / 2, p.nameY, p.name, _chunkKNA5HH2Hcjs.TYPE.timePeriod, _chunkO7RQ6R54cjs.ALWAYS, "middle"));
|
|
603
|
+
base.push(_chunkO7RQ6R54cjs.write.call(void 0, ink, ja("dg-tm-er", p.range), p.x + p.w / 2, p.rangeY, p.range, _chunkKNA5HH2Hcjs.TYPE.timeRange, _chunkO7RQ6R54cjs.ALWAYS, "middle"));
|
|
603
604
|
}
|
|
604
605
|
for (const span of layout.spans) {
|
|
605
606
|
const a = at(span.step, span.event);
|
|
@@ -609,15 +610,15 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
|
|
|
609
610
|
const vis = until === void 0 ? m.vis(a) : m.vis(a, until, { within: true });
|
|
610
611
|
if (span.kind === "bracket") {
|
|
611
612
|
const [x0, x1, y0, y12] = [r1(span.x + 1), r1(span.x + span.w - 1), r1(span.y), r1(span.y + span.h)];
|
|
612
|
-
const words =
|
|
613
|
-
base.push(`<g class="dg-a" data-span="${span.step}" style="${
|
|
613
|
+
const words = _chunkO7RQ6R54cjs.write.call(void 0, ink, ja("dg-tm-bt", span.text), span.textRect.x + span.textRect.w / 2, span.textY, span.text, _chunkKNA5HH2Hcjs.TYPE.spanText, shown, "middle");
|
|
614
|
+
base.push(`<g class="dg-a" data-span="${span.step}" style="${_chunkO7RQ6R54cjs.cs.call(void 0, span.color)};${vis}"><path class="dg-tm-br" d="M ${x0} ${y0} L ${x0} ${y12} L ${x1} ${y12} L ${x1} ${y0}"/>${words}</g>`);
|
|
614
615
|
continue;
|
|
615
616
|
}
|
|
616
|
-
base.push(`<g class="dg-a" data-span="${span.step}" style="${
|
|
617
|
+
base.push(`<g class="dg-a" data-span="${span.step}" style="${_chunkO7RQ6R54cjs.cs.call(void 0, span.color)};${vis}"><rect class="dg-tm-bx" x="${r1(span.x)}" y="${r1(span.y)}" width="${r1(span.w)}" height="${r1(span.h)}" rx="6"/></g>`);
|
|
617
618
|
const tag = span.textRect;
|
|
618
619
|
ink.push({ text: span.text, rect: tag, shown, boxed: true });
|
|
619
620
|
top.push(
|
|
620
|
-
`<g class="dg-tg dg-popc dg-a" style="${
|
|
621
|
+
`<g class="dg-tg dg-popc dg-a" style="${_chunkO7RQ6R54cjs.cs.call(void 0, span.color)};${until === void 0 ? m.pop(a) : m.pop(a, until)}"><rect x="${r1(tag.x)}" y="${r1(tag.y)}" width="${r1(tag.w)}" height="${tag.h}" rx="${tag.h / 2}"/><text x="${r1(tag.x + tag.w / 2)}" y="${r1(span.textY)}" text-anchor="middle">${_chunkO7RQ6R54cjs.esc.call(void 0, span.text)}</text></g>`
|
|
621
622
|
);
|
|
622
623
|
}
|
|
623
624
|
const P = T.point;
|
|
@@ -627,23 +628,23 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
|
|
|
627
628
|
const first = times[0];
|
|
628
629
|
base.push(`<path class="dg-tm-con" d="M ${r1(cx)} ${r1(rowsBottom + 3)} L ${r1(cx)} ${r1(cy - r - 2)}"/>`);
|
|
629
630
|
const tx = point.text.x;
|
|
630
|
-
const name =
|
|
631
|
+
const name = _chunkO7RQ6R54cjs.write.call(void 0, ink, ja("dg-tm-pn", point.id), tx, cy + P.nameY, point.id, _chunkKNA5HH2Hcjs.TYPE.pointName);
|
|
631
632
|
const grey = name.replace(/class="([^"]*)"/u, 'class="$1 dg-tm-pn-g"');
|
|
632
633
|
const label = first === void 0 || !Number.isFinite(first) ? grey : `<g class="dg-a" style="${m.until(first)}">${grey}</g><g class="dg-a" style="${m.vis(first)}">${name}</g>`;
|
|
633
634
|
const states = point.changes.map((c, k) => {
|
|
634
635
|
const t = times[k];
|
|
635
636
|
if (!Number.isFinite(t)) return "";
|
|
636
637
|
const next = times[k + 1];
|
|
637
|
-
const end2 = next !== void 0 && Number.isFinite(next) ? next -
|
|
638
|
-
const words =
|
|
639
|
-
return `<g class="dg-a" style="${
|
|
638
|
+
const end2 = next !== void 0 && Number.isFinite(next) ? next - _chunkKNA5HH2Hcjs.MOTION.untilFade : void 0;
|
|
639
|
+
const words = _chunkO7RQ6R54cjs.write.call(void 0, ink, ja("dg-tm-ps", c.text), tx, cy + P.stateY, c.text, _chunkKNA5HH2Hcjs.TYPE.pointState, [[t, _nullishCoalesce(end2, () => ( Number.POSITIVE_INFINITY))]]);
|
|
640
|
+
return `<g class="dg-a" style="${_chunkO7RQ6R54cjs.cs.call(void 0, _nullishCoalesce(c.color, () => ( "slate")))};${end2 === void 0 ? m.rise(t) : m.rise(t, end2)}">${words}</g>`;
|
|
640
641
|
}).join("");
|
|
641
642
|
const rings = point.changes.map((c, k) => {
|
|
642
643
|
const t = times[k];
|
|
643
644
|
if (!c.color || !Number.isFinite(t)) return "";
|
|
644
|
-
return `<g class="dg-popc dg-a" style="${
|
|
645
|
+
return `<g class="dg-popc dg-a" style="${_chunkO7RQ6R54cjs.cs.call(void 0, c.color)};${m.pop(t)}"><circle class="dg-tm-pc" cx="${r1(cx)}" cy="${r1(cy)}" r="${r + 0.5}"/>${_chunkO7RQ6R54cjs.glyph.call(void 0, "flag", cx, cy, P.glyph, "dg-tm-pcg")}</g>`;
|
|
645
646
|
}).join("");
|
|
646
|
-
node.push(`<g data-point="${
|
|
647
|
+
node.push(`<g data-point="${_chunkO7RQ6R54cjs.esc.call(void 0, point.id)}"><circle class="dg-tm-pg" cx="${r1(cx)}" cy="${r1(cy)}" r="${r}"/>${_chunkO7RQ6R54cjs.glyph.call(void 0, "flag", cx, cy, P.glyph, "dg-tm-pgl")}${rings}${label}${states}</g>`);
|
|
647
648
|
}
|
|
648
649
|
const wired = new Set(layout.wires.map((w) => `${w.step}/${w.event}`));
|
|
649
650
|
for (const e of layout.edges) {
|
|
@@ -653,20 +654,20 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
|
|
|
653
654
|
ctx.traces.push({ from: e.from, to: e.to, points: e.points, shown: [[time.start, Number.POSITIVE_INFINITY]] });
|
|
654
655
|
const kf = m.kf([
|
|
655
656
|
[0, { opacity: 0, "stroke-dashoffset": 1 }],
|
|
656
|
-
[time.start, { opacity: 0, "stroke-dashoffset": 1 },
|
|
657
|
+
[time.start, { opacity: 0, "stroke-dashoffset": 1 }, _chunkKNA5HH2Hcjs.EASE.inOut],
|
|
657
658
|
[time.start + 0.05, { opacity: 1 }],
|
|
658
659
|
[time.drawn, { "stroke-dashoffset": 0 }],
|
|
659
|
-
[m.last, { opacity: 1, "stroke-dashoffset": 0 },
|
|
660
|
+
[m.last, { opacity: 1, "stroke-dashoffset": 0 }, _chunkKNA5HH2Hcjs.EASE.inOut],
|
|
660
661
|
[m.total, { opacity: 0, "stroke-dashoffset": 0 }]
|
|
661
662
|
]);
|
|
662
663
|
const head = m.kf([
|
|
663
664
|
[0, { opacity: 0 }],
|
|
664
665
|
[time.drawn - 0.05, { opacity: 0 }],
|
|
665
666
|
[time.drawn, { opacity: 1 }],
|
|
666
|
-
[m.last, { opacity: 1 },
|
|
667
|
+
[m.last, { opacity: 1 }, _chunkKNA5HH2Hcjs.EASE.inOut],
|
|
667
668
|
[m.total, { opacity: 0 }]
|
|
668
669
|
]);
|
|
669
|
-
lit.push(`<g data-link="${
|
|
670
|
+
lit.push(`<g data-link="${_chunkO7RQ6R54cjs.esc.call(void 0, `${e.from}->${e.to}`)}" style="${_chunkO7RQ6R54cjs.cs.call(void 0, e.color)}"><path class="dg-tm-ln dg-a" pathLength="1" d="${_chunkO7RQ6R54cjs.pathOf.call(void 0, e.points)}" style="${kf}"/><path class="dg-eh-on dg-a" d="${_chunkO7RQ6R54cjs.arrowHead.call(void 0, e.points)}" style="${head}"/></g>`);
|
|
670
671
|
}
|
|
671
672
|
const keys = _nullishCoalesce(timeline.needle, () => ( []));
|
|
672
673
|
const moved = simplify(keys.filter(([t]) => t < m.total));
|
|
@@ -681,20 +682,20 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
|
|
|
681
682
|
}
|
|
682
683
|
function meterField(field, keys, ctx) {
|
|
683
684
|
const { m } = ctx;
|
|
684
|
-
const M =
|
|
685
|
+
const M = _chunkKNA5HH2Hcjs.LOOK.time.meter;
|
|
685
686
|
const { x, w, line, text } = field.meter;
|
|
686
687
|
const y = field.y + M.y;
|
|
687
688
|
const kf = m.kf([
|
|
688
689
|
...simplify(keys).map(([t, v]) => [t, { transform: `scaleX(${r1(v * 1e3) / 1e3})` }]),
|
|
689
|
-
[m.last, { transform: `scaleX(${r1(valueAt(keys, m.last) * 1e3) / 1e3})` },
|
|
690
|
+
[m.last, { transform: `scaleX(${r1(valueAt(keys, m.last) * 1e3) / 1e3})` }, _chunkKNA5HH2Hcjs.EASE.inOut],
|
|
690
691
|
[m.total, { transform: "scaleX(0)" }]
|
|
691
692
|
]);
|
|
692
693
|
const lx = x + w * line;
|
|
693
|
-
return `<rect class="dg-tm-mt" x="${r1(x)}" y="${r1(y)}" width="${r1(w)}" height="${M.h}" rx="${M.h / 2}"/><rect class="dg-tm-mf dg-a" x="${r1(x)}" y="${r1(y)}" width="${r1(w)}" height="${M.h}" rx="${M.h / 2}" style="${
|
|
694
|
+
return `<rect class="dg-tm-mt" x="${r1(x)}" y="${r1(y)}" width="${r1(w)}" height="${M.h}" rx="${M.h / 2}"/><rect class="dg-tm-mf dg-a" x="${r1(x)}" y="${r1(y)}" width="${r1(w)}" height="${M.h}" rx="${M.h / 2}" style="${_chunkO7RQ6R54cjs.cs.call(void 0, M.color)};${kf}"/><line class="dg-tm-mk" x1="${r1(lx)}" y1="${r1(y - M.mark)}" x2="${r1(lx)}" y2="${r1(y + M.h + M.mark)}"/>` + _chunkO7RQ6R54cjs.write.call(void 0, ctx.ink, "dg-tm-ml", lx, field.y + M.textY, text, _chunkKNA5HH2Hcjs.TYPE.meterLine, _chunkO7RQ6R54cjs.ALWAYS, "middle");
|
|
694
695
|
}
|
|
695
696
|
function timeFocus(layout, timeline, step, parts, vw, vh) {
|
|
696
697
|
const span = timeline.steps[step];
|
|
697
|
-
const position = valueAt(_nullishCoalesce(timeline.needle, () => ( [])), span.end -
|
|
698
|
+
const position = valueAt(_nullishCoalesce(timeline.needle, () => ( [])), span.end - _chunkKNA5HH2Hcjs.MOTION.still);
|
|
698
699
|
const badge = layout.badges.find((b) => b.step === step);
|
|
699
700
|
const anchored = badge && valueAt(_nullishCoalesce(timeline.needle, () => ( [])), span.start) === position && !(layout.strip && badge.y >= layout.strip.y);
|
|
700
701
|
const ax = anchored ? badge.x : layout.axis.x + position * layout.axis.unit;
|
|
@@ -703,7 +704,7 @@ function timeFocus(layout, timeline, step, parts, vw, vh) {
|
|
|
703
704
|
let held = { x: ax - 1, y: top, w: 2, h: bottom - top };
|
|
704
705
|
const near = (p) => Math.hypot(Math.max(0, p.x - ax, ax - p.x - p.w), Math.max(0, p.y - top, top - p.y - p.h));
|
|
705
706
|
const changed = layout.points.filter((point) => point.changes.some((change) => change.step === step)).map((point) => ({ x: point.cx - point.r, y: point.cy - point.r, w: point.text.x + point.text.w - point.cx + point.r, h: point.r * 2 }));
|
|
706
|
-
const extra = [...badge ? [{ x: badge.x -
|
|
707
|
+
const extra = [...badge ? [{ x: badge.x - _chunkKNA5HH2Hcjs.LOOK.badge.r, y: badge.y - _chunkKNA5HH2Hcjs.LOOK.badge.r, w: _chunkKNA5HH2Hcjs.LOOK.badge.r * 2, h: _chunkKNA5HH2Hcjs.LOOK.badge.r * 2 }] : [], ...[...parts, ...changed].sort((a, b) => near(a) - near(b))];
|
|
707
708
|
for (const p of extra) {
|
|
708
709
|
const x = Math.min(held.x, p.x);
|
|
709
710
|
const y = Math.min(held.y, p.y);
|
|
@@ -718,4 +719,4 @@ function timeFocus(layout, timeline, step, parts, vw, vh) {
|
|
|
718
719
|
|
|
719
720
|
|
|
720
721
|
exports.drawTime = drawTime; exports.layoutTime = layoutTime; exports.meterField = meterField; exports.timeFocus = timeFocus;
|
|
721
|
-
//# sourceMappingURL=time-
|
|
722
|
+
//# sourceMappingURL=time-RISQEAB7.cjs.map
|