@popcorn245/cornfield-components 0.52.0 → 0.52.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/dist/chunks/{around-D7aqHejs.js → around-BFqYTZ0K.js} +10 -10
- package/dist/chunks/{corn-layers-g9AprK6G.js → corn-layers-Cni5rISZ.js} +95 -95
- package/dist/chunks/{corn-map-DE-pg-A0.js → corn-map-B2-YxiEL.js} +3 -3
- package/dist/chunks/{corn-node-panel-CdtFb9IZ.js → corn-node-panel-BkvJThlp.js} +3 -3
- package/dist/chunks/{corn-review-9krtLSPK.js → corn-review-5wf7AT4o.js} +889 -889
- package/dist/chunks/{corn-search-BY1Po63S.js → corn-search-CXs5d06S.js} +39 -39
- package/dist/chunks/{engine-HIgX35hE.js → engine-BmXtSISH.js} +415 -400
- package/dist/chunks/{layers-n1mJVJs8.js → layers-Bj4Tluxe.js} +50 -50
- package/dist/chunks/{map-CeP9M2_w.js → map-BZRFOYkt.js} +749 -718
- package/dist/chunks/{node-panel-CY5xnuKC.js → node-panel-BdvFvWCE.js} +332 -332
- package/dist/chunks/{review-source-DWisOXyR.js → review-source-CK5tYIqk.js} +1 -1
- package/dist/chunks/{scope-CUhp8mkf.js → scope-CqPbHcKL.js} +19 -19
- package/dist/chunks/sheets-D-sMZzSs.js +204 -0
- package/dist/chunks/{status-CsFpnQxw.js → status-DI5QLlAp.js} +55 -55
- package/dist/corn-layers.js +1 -1
- package/dist/corn-map.js +1 -1
- package/dist/corn-node-panel.js +1 -1
- package/dist/corn-review.js +1 -1
- package/dist/corn-scope.js +3 -3
- package/dist/corn-search.js +1 -1
- package/dist/index.js +6 -6
- package/dist/manifest.json +43 -43
- package/dist/version.json +1 -1
- package/package.json +1 -1
- package/dist/chunks/sheets-TFCL_dIn.js +0 -204
|
@@ -1,204 +1,224 @@
|
|
|
1
|
-
import { $ as e,
|
|
2
|
-
var
|
|
3
|
-
function
|
|
1
|
+
import { $t as e, C as t, Cn as n, D as r, Dn as i, En as a, G as o, Gt as s, H as c, J as l, K as u, Kt as d, M as f, Mn as p, Mt as m, Nt as h, Pt as g, Qt as _, Sn as v, T as y, Tt as b, U as x, Wt as S, X as C, Xt as w, Y as T, Yt as E, Z as D, Zt as O, _ as k, _n as A, b as j, c as M, d as N, en as P, et as ee, f as F, g as I, i as L, it as R, j as z, k as B, l as te, ln as ne, m as V, n as H, nn as U, p as W, q as re, r as G, rn as ie, tn as K, u as ae, v as q, vn as oe, w as se, wn as ce, x as J } from "./engine-BmXtSISH.js";
|
|
2
|
+
var le = 96, ue = "letters:", de = (e) => `${ue}${e}`, fe = (e) => typeof e == "string" && e.startsWith(ue), pe = (e) => e.slice(8), me = (e, t) => !!e.letters && !e.icon && e.r * 2 * t >= 14, he = /* @__PURE__ */ new Map();
|
|
3
|
+
function ge(e, t = null) {
|
|
4
4
|
if (typeof e != "string" || !e) return null;
|
|
5
5
|
let n = `${typeof t == "string" ? t : ""}|${e}`;
|
|
6
|
-
if (
|
|
7
|
-
if (
|
|
6
|
+
if (he.has(n)) return he.get(n);
|
|
7
|
+
if (he.size >= 128) return null;
|
|
8
8
|
let r = null;
|
|
9
9
|
try {
|
|
10
|
-
let n = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(
|
|
11
|
-
width:
|
|
12
|
-
height:
|
|
10
|
+
let n = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(le, le) : typeof document < "u" ? Object.assign(document.createElement("canvas"), {
|
|
11
|
+
width: le,
|
|
12
|
+
height: le
|
|
13
13
|
}) : null, i = n && n.getContext && n.getContext("2d");
|
|
14
14
|
if (i && i.fillText) {
|
|
15
|
-
i.font = `700 ${e.length > 1 ? 56 : 72}px ${
|
|
16
|
-
let a = typeof t == "string" ? t :
|
|
17
|
-
i.strokeStyle =
|
|
15
|
+
i.font = `700 ${e.length > 1 ? 56 : 72}px ${I}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
|
|
16
|
+
let a = typeof t == "string" ? t : x;
|
|
17
|
+
i.strokeStyle = T(a) === "#ffffff" ? "rgba(11, 18, 32, 0.92)" : "rgba(255, 255, 255, 0.92)", i.strokeText(e, le / 2, 51), i.fillStyle = a, i.fillText(e, le / 2, 51), r = n;
|
|
18
18
|
}
|
|
19
19
|
} catch {
|
|
20
20
|
r = null;
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return he.set(n, r), r;
|
|
23
23
|
}
|
|
24
24
|
// ../explorer/renderer-canvas2d.js
|
|
25
|
-
var
|
|
26
|
-
|
|
25
|
+
var _e = Math.PI * 2, ve = 1.5, ye = /* @__PURE__ */ new Map();
|
|
26
|
+
function be(e) {
|
|
27
|
+
let t = ye.get(e);
|
|
28
|
+
return t === void 0 && (ye.size > 512 && ye.clear(), t = R(e)[3], ye.set(e, t)), t;
|
|
29
|
+
}
|
|
30
|
+
var Y = (e, t, n, r) => {
|
|
31
|
+
e.beginPath(), e.arc(t, n, r, 0, _e);
|
|
27
32
|
};
|
|
28
|
-
function
|
|
33
|
+
function xe(e, t, n, r, i, a = !1) {
|
|
34
|
+
let o = () => {
|
|
35
|
+
a || e.beginPath();
|
|
36
|
+
};
|
|
29
37
|
if (t === "rounded-square" || t === "square") {
|
|
30
|
-
let a = i * (t === "square" ?
|
|
31
|
-
|
|
38
|
+
let a = i * (t === "square" ? J.squareHalf : J.roundedHalf), s = i * (t === "square" ? J.squareCorner : J.roundedCorner);
|
|
39
|
+
o(), e.roundRect ? e.roundRect(n - a, r - a, a * 2, a * 2, s) : e.rect(n - a, r - a, a * 2, a * 2);
|
|
32
40
|
} else if (t === "hexagon") {
|
|
33
|
-
let t = i *
|
|
34
|
-
|
|
41
|
+
let t = i * J.hexInradius / Math.cos(Math.PI / 6);
|
|
42
|
+
o();
|
|
35
43
|
for (let i = 0; i < 6; i++) {
|
|
36
44
|
let a = Math.PI / 6 + i * Math.PI / 3, o = n + t * Math.cos(a), s = r + t * Math.sin(a);
|
|
37
45
|
i ? e.lineTo(o, s) : e.moveTo(o, s);
|
|
38
46
|
}
|
|
39
47
|
e.closePath();
|
|
40
48
|
} else if (t === "diamond") {
|
|
41
|
-
let t = i *
|
|
42
|
-
|
|
43
|
-
} else _e(e, n, r, i);
|
|
49
|
+
let t = i * J.diamondHalf;
|
|
50
|
+
o(), e.moveTo(n, r - t), e.lineTo(n + t, r), e.lineTo(n, r + t), e.lineTo(n - t, r), e.closePath();
|
|
51
|
+
} else a ? (e.moveTo(n + i, r), e.arc(n, r, i, 0, _e)) : Y(e, n, r, i);
|
|
44
52
|
}
|
|
45
|
-
function
|
|
53
|
+
function Se(e, t, n, r, i) {
|
|
46
54
|
let a = -n.x / n.zoom - t.margin, o = (r - n.x) / n.zoom + t.margin, s = -n.y / n.zoom - t.margin, c = (i - n.y) / n.zoom + t.margin;
|
|
47
55
|
e.beginPath(), e.strokeStyle = t.color, e.lineWidth = t.width;
|
|
48
56
|
for (let n = Math.floor(a / t.size) * t.size; n < o; n += t.size) e.moveTo(n, s), e.lineTo(n, c);
|
|
49
57
|
for (let n = Math.floor(s / t.size) * t.size; n < c; n += t.size) e.moveTo(a, n), e.lineTo(o, n);
|
|
50
58
|
e.stroke();
|
|
51
59
|
}
|
|
52
|
-
function
|
|
60
|
+
function Ce(e, t) {
|
|
53
61
|
e.save(), t.forEach((t) => {
|
|
54
|
-
e.lineWidth = t.width, e.setLineDash(t.dash), e.strokeStyle = t.color,
|
|
62
|
+
e.lineWidth = t.width, e.setLineDash(t.dash), e.strokeStyle = t.color, Y(e, t.x, t.y, t.r), e.stroke();
|
|
55
63
|
}), e.restore();
|
|
56
64
|
}
|
|
57
|
-
function
|
|
65
|
+
function we(e, t) {
|
|
58
66
|
e.save(), t.forEach((t) => {
|
|
59
67
|
e.fillStyle = t.fill, e.strokeStyle = t.stroke, e.lineWidth = t.strokeWidth, e.beginPath(), e.roundRect(t.x, t.y, t.w, t.h, t.radius), e.fill(), e.stroke();
|
|
60
68
|
}), e.restore();
|
|
61
69
|
}
|
|
62
|
-
function
|
|
63
|
-
if (e.save(), e.globalAlpha = t.alpha, e.beginPath(), e.moveTo(t.x1, t.y1), t.curve ? e.quadraticCurveTo(t.curve.cx, t.curve.cy, t.x2, t.y2) : e.lineTo(t.x2, t.y2), e.strokeStyle = t.color, e.lineWidth = t.mark && t.mark !== "none" ? Math.max(t.width,
|
|
70
|
+
function Te(e, t, n, r, i = !0) {
|
|
71
|
+
if (e.save(), e.globalAlpha = t.alpha, e.beginPath(), e.moveTo(t.x1, t.y1), t.curve ? e.quadraticCurveTo(t.curve.cx, t.curve.cy, t.x2, t.y2) : e.lineTo(t.x2, t.y2), e.strokeStyle = t.color, e.lineWidth = t.mark && t.mark !== "none" ? Math.max(t.width, q.edge / r) : t.width, e.setLineDash(t.dash || []), t.glow && t.glow * r >= ve) {
|
|
64
72
|
let n = e.lineWidth;
|
|
65
73
|
e.save(), e.globalAlpha = t.alpha * .3, e.strokeStyle = t.glowColor || t.color, e.lineWidth = n + t.glow * .6, e.stroke(), e.restore();
|
|
66
74
|
}
|
|
67
75
|
if (e.stroke(), e.setLineDash([]), t.mark === "removed") {
|
|
68
|
-
let n =
|
|
69
|
-
e.beginPath(), e.moveTo(n.x - o *
|
|
76
|
+
let n = y(t, .5), i = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [a, o] = i > 0 ? [(t.x2 - t.x1) / i, (t.y2 - t.y1) / i] : [1, 0];
|
|
77
|
+
e.beginPath(), e.moveTo(n.x - o * W.halfLength, n.y + a * W.halfLength), e.lineTo(n.x + o * W.halfLength, n.y - a * W.halfLength), e.lineWidth = Math.max(W.width, 1.5 / r), e.stroke();
|
|
70
78
|
}
|
|
71
|
-
if (t.ticks &&
|
|
79
|
+
if (t.ticks && De(e, t, r), t.arrow) {
|
|
72
80
|
let { cx: n, cy: i } = t.curve || {
|
|
73
81
|
cx: t.x1,
|
|
74
82
|
cy: t.y1
|
|
75
83
|
};
|
|
76
|
-
|
|
84
|
+
Ee(e, t, Math.atan2(t.y2 - i, t.x2 - n), r);
|
|
77
85
|
}
|
|
78
|
-
i && t.packet &&
|
|
86
|
+
i && t.packet && Oe(e, t, n, r), e.restore();
|
|
79
87
|
}
|
|
80
|
-
function
|
|
81
|
-
let i = t.end || "triangle", { x2: a, y2: o, color: s } = t, c = Math.cos(n), l = Math.sin(n), u = (e, t) => [a - c * e - l * t, o - l * e + c * t], d = Math.max(
|
|
82
|
-
if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n -
|
|
88
|
+
function Ee(e, t, n, r) {
|
|
89
|
+
let i = t.end || "triangle", { x2: a, y2: o, color: s } = t, c = Math.cos(n), l = Math.sin(n), u = (e, t) => [a - c * e - l * t, o - l * e + c * t], d = Math.max(V.strokeWidth, 1.2 / r);
|
|
90
|
+
if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - N.spread) * N.length, o - Math.sin(n - N.spread) * N.length), e.lineTo(a - Math.cos(n + N.spread) * N.length, o - Math.sin(n + N.spread) * N.length), e.closePath(), e.fillStyle = s, e.fill();
|
|
83
91
|
else {
|
|
84
92
|
if (e.strokeStyle = s, e.lineWidth = d, e.lineJoin = "miter", i === "chevron") {
|
|
85
|
-
let t =
|
|
93
|
+
let t = N.length * Math.cos(N.spread), n = N.length * Math.sin(N.spread);
|
|
86
94
|
e.moveTo(...u(t, n)), e.lineTo(a, o), e.lineTo(...u(t, -n));
|
|
87
|
-
} else if (i === "bar") e.moveTo(...u(d / 2,
|
|
95
|
+
} else if (i === "bar") e.moveTo(...u(d / 2, V.barHalf)), e.lineTo(...u(d / 2, -V.barHalf));
|
|
88
96
|
else {
|
|
89
|
-
let t =
|
|
90
|
-
e.moveTo(a, o), e.lineTo(...u(t,
|
|
97
|
+
let t = V.diamondHalf;
|
|
98
|
+
e.moveTo(a, o), e.lineTo(...u(t, V.diamondAcross)), e.lineTo(...u(2 * t, 0)), e.lineTo(...u(t, -V.diamondAcross)), e.closePath();
|
|
91
99
|
}
|
|
92
100
|
e.stroke();
|
|
93
101
|
}
|
|
94
102
|
}
|
|
95
|
-
function
|
|
96
|
-
let r = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [i, a] = r > 0 ? [(t.x2 - t.x1) / r, (t.y2 - t.y1) / r] : [1, 0], o =
|
|
103
|
+
function De(e, t, n) {
|
|
104
|
+
let r = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [i, a] = r > 0 ? [(t.x2 - t.x1) / r, (t.y2 - t.y1) / r] : [1, 0], o = y(t, .5);
|
|
97
105
|
e.beginPath();
|
|
98
106
|
for (let n = 0; n < t.ticks; n++) {
|
|
99
|
-
let r = (n - (t.ticks - 1) / 2) *
|
|
100
|
-
e.moveTo(s - a *
|
|
107
|
+
let r = (n - (t.ticks - 1) / 2) * V.tickGap, s = o.x + i * r, c = o.y + a * r;
|
|
108
|
+
e.moveTo(s - a * V.tickHalf, c + i * V.tickHalf), e.lineTo(s + a * V.tickHalf, c - i * V.tickHalf);
|
|
101
109
|
}
|
|
102
|
-
e.strokeStyle = t.color, e.lineWidth = Math.max(
|
|
110
|
+
e.strokeStyle = t.color, e.lineWidth = Math.max(V.tickWidth, 1.5 / n), e.setLineDash([]), e.stroke();
|
|
103
111
|
}
|
|
104
|
-
function
|
|
105
|
-
let i =
|
|
106
|
-
a.glow && a.glow * r >=
|
|
112
|
+
function Oe(e, t, n, r) {
|
|
113
|
+
let i = f(t, n), { packet: a } = t;
|
|
114
|
+
a.glow && a.glow * r >= ve && (e.beginPath(), e.arc(i.x, i.y, a.radius + a.glow * .5, 0, _e), e.globalAlpha = t.alpha * .3, e.fillStyle = a.glowColor || a.color, e.fill(), e.globalAlpha = t.alpha), e.beginPath(), e.arc(i.x, i.y, a.radius, 0, _e), e.fillStyle = a.color, e.fill();
|
|
107
115
|
}
|
|
108
|
-
function
|
|
109
|
-
e.save(), e.globalAlpha = t.alpha,
|
|
116
|
+
function ke(e, t, n, r) {
|
|
117
|
+
e.save(), e.globalAlpha = t.alpha, Oe(e, t, n, r), e.restore();
|
|
110
118
|
}
|
|
111
|
-
var
|
|
112
|
-
function
|
|
113
|
-
let t =
|
|
119
|
+
var Ae = 16, je = /* @__PURE__ */ new WeakMap();
|
|
120
|
+
function Me(e) {
|
|
121
|
+
let t = je.get(e);
|
|
114
122
|
return t || (t = new Float64Array(e.edges.length * 4), e.edges.forEach((e, n) => {
|
|
115
|
-
let r = e.curve ? e.curve.cx : e.x1, i = e.curve ? e.curve.cy : e.y1, a = (e.glow || 0) * .6 + (e.packet ? e.packet.radius + (e.packet.glow || 0) * .5 : 0), o = (e.width || 0) / 2 + a +
|
|
123
|
+
let r = e.curve ? e.curve.cx : e.x1, i = e.curve ? e.curve.cy : e.y1, a = (e.glow || 0) * .6 + (e.packet ? e.packet.radius + (e.packet.glow || 0) * .5 : 0), o = (e.width || 0) / 2 + a + Ae;
|
|
116
124
|
t[n * 4] = Math.min(e.x1, e.x2, r) - o, t[n * 4 + 1] = Math.min(e.y1, e.y2, i) - o, t[n * 4 + 2] = Math.max(e.x1, e.x2, r) + o, t[n * 4 + 3] = Math.max(e.y1, e.y2, i) + o;
|
|
117
|
-
}),
|
|
125
|
+
}), je.set(e, t)), t;
|
|
118
126
|
}
|
|
119
|
-
function
|
|
120
|
-
let i =
|
|
127
|
+
function Ne(e, t, n, r) {
|
|
128
|
+
let i = Me(e), a = t.zoom || 1, o = 4 / a, s = -t.x / a - o, c = -t.y / a - o, l = (n - t.x) / a + o, u = (r - t.y) / a + o, d = [];
|
|
121
129
|
for (let t = 0; t < e.edges.length; t++) i[t * 4 + 2] < s || i[t * 4] > l || i[t * 4 + 3] < c || i[t * 4 + 1] > u || d.push(e.edges[t]);
|
|
122
130
|
return d;
|
|
123
131
|
}
|
|
124
|
-
function
|
|
132
|
+
function Pe(e, t, n, r, i, a) {
|
|
125
133
|
e.save(), e.globalAlpha = t.alpha;
|
|
126
|
-
let
|
|
127
|
-
|
|
128
|
-
let
|
|
129
|
-
if (
|
|
130
|
-
let r = t.r + Math.max(
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
let s = r.halo[t.halo];
|
|
135
|
+
s && (s.fill && (Y(e, t.x, t.y, t.r + s.fillR), e.fillStyle = s.fill, e.fill()), Y(e, t.x, t.y, t.r + s.ringR), e.strokeStyle = s.ring, e.lineWidth = s.ringWidth, e.stroke());
|
|
136
|
+
let l = r.mark[t.mark];
|
|
137
|
+
if (l) {
|
|
138
|
+
let r = t.r + Math.max(l.ringR, q.gap / n);
|
|
139
|
+
Y(e, t.x, t.y, r), e.strokeStyle = l.color, e.lineWidth = Math.max(l.ringWidth, q.ring / n), e.setLineDash(l.ringDash || []), e.stroke(), e.setLineDash([]), t.mark === "removed" && (e.beginPath(), e.moveTo(t.x - r, t.y), e.lineTo(t.x + r, t.y), e.stroke());
|
|
140
|
+
}
|
|
141
|
+
if (xe(e, t.shape, t.x, t.y, t.r), t.glow && t.glow * n >= ve) {
|
|
142
|
+
e.save(), e.globalAlpha = t.alpha * .28;
|
|
143
|
+
let n = t.r + t.glow * .7;
|
|
144
|
+
if (e.fillStyle = t.color, be(t.color) < 1) {
|
|
145
|
+
if (t.r * (j[t.shape] || 1) < n) Y(e, t.x, t.y, n), xe(e, t.shape, t.x, t.y, t.r, !0), e.fill("evenodd");
|
|
146
|
+
else {
|
|
147
|
+
let r = n + t.r;
|
|
148
|
+
e.beginPath(), e.rect(t.x - r, t.y - r, r * 2, r * 2), xe(e, t.shape, t.x, t.y, t.r, !0), e.clip("evenodd"), Y(e, t.x, t.y, n), e.fill();
|
|
149
|
+
}
|
|
150
|
+
} else Y(e, t.x, t.y, n), e.fill();
|
|
151
|
+
e.restore(), xe(e, t.shape, t.x, t.y, t.r);
|
|
152
|
+
}
|
|
153
|
+
e.fillStyle = t.color, e.fill();
|
|
154
|
+
let d = t.icon && i.icons ? i.icons.get(t.icon) : null, f = !d && me(t, n), p = !d && !f && D(t, n) ? o(t.glyph, u(t, i, a)) : null;
|
|
155
|
+
if (p || (Y(e, t.x, t.y, t.r * F), e.fillStyle = r.core, e.fill()), t.stroke && (xe(e, t.shape, t.x, t.y, Math.max(0, t.r - t.stroke.width / 2)), e.strokeStyle = t.stroke.color, e.lineWidth = t.stroke.width, e.stroke()), d) {
|
|
136
156
|
let n = t.r * G;
|
|
137
|
-
e.imageSmoothingEnabled = !i.pixelated, e.drawImage(
|
|
138
|
-
} else if (
|
|
139
|
-
let n =
|
|
157
|
+
e.imageSmoothingEnabled = !i.pixelated, e.drawImage(d, t.x - n / 2, t.y - n / 2, n, n);
|
|
158
|
+
} else if (f) {
|
|
159
|
+
let n = ge(t.letters, i.values && i.values["--corn-map-glyph"]);
|
|
140
160
|
if (n) {
|
|
141
161
|
let r = t.r * 1;
|
|
142
162
|
e.imageSmoothingEnabled = !0, e.drawImage(n, t.x - r / 2, t.y - r / 2, r, r);
|
|
143
163
|
}
|
|
144
|
-
} else if (
|
|
145
|
-
let n = t.r *
|
|
146
|
-
e.imageSmoothingEnabled = !0, e.drawImage(
|
|
164
|
+
} else if (p) {
|
|
165
|
+
let n = t.r * c;
|
|
166
|
+
e.imageSmoothingEnabled = !0, e.drawImage(p, t.x - n / 2, t.y - n / 2, n, n);
|
|
147
167
|
}
|
|
148
168
|
e.restore();
|
|
149
169
|
}
|
|
150
|
-
function
|
|
151
|
-
let
|
|
152
|
-
if (
|
|
170
|
+
function Fe(e, t = {}) {
|
|
171
|
+
let n = t.mapStyle || (() => L), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c = null, l = null, u = () => {
|
|
172
|
+
if (s) return s;
|
|
153
173
|
try {
|
|
154
|
-
|
|
174
|
+
s = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e.width || 1, e.height || 1) : e.ownerDocument ? e.ownerDocument.createElement("canvas") : null, c = s && s.getContext ? s.getContext("2d") : null;
|
|
155
175
|
} catch {
|
|
156
|
-
|
|
176
|
+
c = null;
|
|
157
177
|
}
|
|
158
|
-
return
|
|
159
|
-
},
|
|
160
|
-
function
|
|
178
|
+
return c || (s = null), s;
|
|
179
|
+
}, d = t.layerMinEdges ?? 600, f = /* @__PURE__ */ new WeakMap(), p = (e) => (f.has(e) || f.set(e, e.edges.some((e) => e.packet)), f.get(e));
|
|
180
|
+
function m(e, t, n) {
|
|
161
181
|
e.save(), e.translate(n.x, n.y), e.scale(n.zoom, n.zoom);
|
|
162
182
|
let { decor: r } = t;
|
|
163
|
-
r.grid &&
|
|
183
|
+
r.grid && Se(e, r.grid, n, i, a), r.lanes.length && we(e, r.lanes), r.rings.length && Ce(e, r.rings), Ne(t, n, i, a).forEach((t) => Te(e, t, 0, n.zoom, !1)), e.restore();
|
|
164
184
|
}
|
|
165
185
|
return {
|
|
166
186
|
kind: "canvas2d",
|
|
167
|
-
resize(t, n,
|
|
168
|
-
|
|
187
|
+
resize(t, n, u) {
|
|
188
|
+
i = t, a = n, o = u, e.width = t * u, e.height = n * u, r.setTransform(u, 0, 0, u, 0, 0), l = null, s && (s.width = e.width, s.height = e.height, c.setTransform(u, 0, 0, u, 0, 0));
|
|
169
189
|
},
|
|
170
|
-
draw(t,
|
|
171
|
-
let
|
|
172
|
-
|
|
173
|
-
let
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
scene:
|
|
177
|
-
x:
|
|
178
|
-
y:
|
|
179
|
-
zoom:
|
|
190
|
+
draw(t, f, h) {
|
|
191
|
+
let g = n(), _ = ae(t, g);
|
|
192
|
+
r.clearRect(0, 0, i, a);
|
|
193
|
+
let v = M(z(_.theme), g), y = Ne(_, f, i, a);
|
|
194
|
+
if (p(_) && y.length > d && u()) {
|
|
195
|
+
l && l.scene === _ && l.x === f.x && l.y === f.y && l.zoom === f.zoom && l.w === e.width && l.h === e.height || ((s.width !== e.width || s.height !== e.height) && (s.width = e.width, s.height = e.height), c.setTransform(o, 0, 0, o, 0, 0), c.clearRect(0, 0, i, a), m(c, _, f), l = {
|
|
196
|
+
scene: _,
|
|
197
|
+
x: f.x,
|
|
198
|
+
y: f.y,
|
|
199
|
+
zoom: f.zoom,
|
|
180
200
|
w: e.width,
|
|
181
201
|
h: e.height
|
|
182
|
-
}),
|
|
183
|
-
e.packet &&
|
|
184
|
-
}),
|
|
202
|
+
}), r.save(), r.setTransform(1, 0, 0, 1, 0, 0), r.drawImage(s, 0, 0), r.restore(), r.save(), r.translate(f.x, f.y), r.scale(f.zoom, f.zoom), y.forEach((e) => {
|
|
203
|
+
e.packet && ke(r, e, h, f.zoom);
|
|
204
|
+
}), _.nodes.forEach((e) => Pe(r, e, f.zoom, v, g, _.theme)), r.restore();
|
|
185
205
|
return;
|
|
186
206
|
}
|
|
187
|
-
|
|
188
|
-
let { decor:
|
|
189
|
-
|
|
207
|
+
r.save(), r.translate(f.x, f.y), r.scale(f.zoom, f.zoom);
|
|
208
|
+
let { decor: b } = _;
|
|
209
|
+
b.grid && Se(r, b.grid, f, i, a), b.lanes.length && we(r, b.lanes), b.rings.length && Ce(r, b.rings), y.forEach((e) => Te(r, e, h, f.zoom)), _.nodes.forEach((e) => Pe(r, e, f.zoom, v, g, _.theme)), r.restore();
|
|
190
210
|
},
|
|
191
211
|
destroy() {
|
|
192
|
-
|
|
212
|
+
s = null, c = null, l = null;
|
|
193
213
|
}
|
|
194
214
|
};
|
|
195
215
|
}
|
|
196
|
-
var
|
|
197
|
-
function
|
|
216
|
+
var Ie = (e) => typeof e.hitR == "number" && e.hitR > e.r ? e.hitR : e.r;
|
|
217
|
+
function Le(e, { cellSize: t = 64 } = {}) {
|
|
198
218
|
let n = /* @__PURE__ */ new Map(), r = 0, i = (e, t) => e * 4194304 + t;
|
|
199
219
|
for (let a = 0; a < e.length; a++) {
|
|
200
220
|
let o = e[a];
|
|
201
|
-
|
|
221
|
+
Ie(o) > r && (r = Ie(o));
|
|
202
222
|
let s = i(Math.floor(o.x / t), Math.floor(o.y / t)), c = n.get(s);
|
|
203
223
|
c ? c.push(a) : n.set(s, [a]);
|
|
204
224
|
}
|
|
@@ -214,7 +234,7 @@ function Pe(e, { cellSize: t = 64 } = {}) {
|
|
|
214
234
|
if (a) for (let t = 0; t < a.length; t++) {
|
|
215
235
|
let n = a[t];
|
|
216
236
|
if (n <= _) continue;
|
|
217
|
-
let r = e[n], i = Math.max(
|
|
237
|
+
let r = e[n], i = Math.max(Ie(r) + u, d);
|
|
218
238
|
Math.hypot(r.x - s, r.y - c) <= i && (_ = n);
|
|
219
239
|
}
|
|
220
240
|
}
|
|
@@ -227,32 +247,32 @@ function Pe(e, { cellSize: t = 64 } = {}) {
|
|
|
227
247
|
let a = n.get(i(t, r));
|
|
228
248
|
if (a) for (let t = 0; t < a.length; t++) {
|
|
229
249
|
let n = a[t], r = e[n], i = r.x - Math.min(Math.max(r.x, o), c), u = r.y - Math.min(Math.max(r.y, s), l);
|
|
230
|
-
i * i + u * u <=
|
|
250
|
+
i * i + u * u <= Ie(r) ** 2 && m.push(n);
|
|
231
251
|
}
|
|
232
252
|
}
|
|
233
253
|
return m.sort((e, t) => e - t).map((t) => e[t]);
|
|
234
254
|
}
|
|
235
255
|
};
|
|
236
256
|
}
|
|
237
|
-
function
|
|
257
|
+
function Re(e, t, n, r, i = !1) {
|
|
238
258
|
let a = t.zoom;
|
|
239
259
|
return e.nodeAt((n - t.x) / a, (r - t.y) / a, {
|
|
240
260
|
pad: (i ? 16 : 6) / a,
|
|
241
261
|
min: (i ? 32 : 12) / a
|
|
242
262
|
});
|
|
243
263
|
}
|
|
244
|
-
function
|
|
264
|
+
function ze(e) {
|
|
245
265
|
let t = null, n = null, r = {
|
|
246
266
|
builds: 0,
|
|
247
267
|
get(i) {
|
|
248
|
-
return n && t === i || (n =
|
|
268
|
+
return n && t === i || (n = Le(i.nodes, e), t = i, r.builds++), n;
|
|
249
269
|
}
|
|
250
270
|
};
|
|
251
271
|
return r;
|
|
252
272
|
}
|
|
253
273
|
// ../explorer/frame.js
|
|
254
|
-
var
|
|
255
|
-
function
|
|
274
|
+
var Be = 3e4;
|
|
275
|
+
function Ve({ dirty: e, packetsVisible: t, hidden: n, reduceMotion: r, idleMs: i, clientsWant: a = !1 }) {
|
|
256
276
|
if (n) return {
|
|
257
277
|
draw: !1,
|
|
258
278
|
again: !1
|
|
@@ -263,8 +283,8 @@ function Re({ dirty: e, packetsVisible: t, hidden: n, reduceMotion: r, idleMs: i
|
|
|
263
283
|
again: o
|
|
264
284
|
};
|
|
265
285
|
}
|
|
266
|
-
function
|
|
267
|
-
let i =
|
|
286
|
+
function He(e, t, n, r) {
|
|
287
|
+
let i = We(e);
|
|
268
288
|
if (i.length === 0) return !1;
|
|
269
289
|
if (!(n > 0) || !(r > 0)) return !0;
|
|
270
290
|
let a = -t.x / t.zoom, o = -t.y / t.zoom, s = (n - t.x) / t.zoom, c = (r - t.y) / t.zoom;
|
|
@@ -274,12 +294,12 @@ function ze(e, t, n, r) {
|
|
|
274
294
|
}
|
|
275
295
|
return !1;
|
|
276
296
|
}
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
let t =
|
|
280
|
-
return t || (t = e.edges.filter((e) => e.packet),
|
|
297
|
+
var Ue = /* @__PURE__ */ new WeakMap();
|
|
298
|
+
function We(e) {
|
|
299
|
+
let t = Ue.get(e);
|
|
300
|
+
return t || (t = e.edges.filter((e) => e.packet), Ue.set(e, t)), t;
|
|
281
301
|
}
|
|
282
|
-
function
|
|
302
|
+
function Ge(e) {
|
|
283
303
|
let { draw: t, packetsVisible: n, isHidden: r, reduceMotion: i, extraDirty: a, tickClients: o, clientsWant: s, now: c, raf: l, caf: u } = e, d = !0, f = null, p = -Infinity, m = c(), h = !1, g = /* @__PURE__ */ new Set(), _ = () => {
|
|
284
304
|
if (g.size === 0) return;
|
|
285
305
|
let e = [...g];
|
|
@@ -292,7 +312,7 @@ function He(e) {
|
|
|
292
312
|
let n = o && !r() ? o(e) : !1, i = d || (a ? a() : !1), { draw: s, again: c } = b(i, n);
|
|
293
313
|
s && (i || e - p >= 31) && (d = !1, p = e, x.draws++, t()), x.frames++, c && v();
|
|
294
314
|
}
|
|
295
|
-
let b = (e, t) =>
|
|
315
|
+
let b = (e, t) => Ve({
|
|
296
316
|
dirty: e,
|
|
297
317
|
packetsVisible: n(),
|
|
298
318
|
hidden: r(),
|
|
@@ -312,7 +332,7 @@ function He(e) {
|
|
|
312
332
|
v();
|
|
313
333
|
},
|
|
314
334
|
noteInput() {
|
|
315
|
-
let e = c(), t = e - m >=
|
|
335
|
+
let e = c(), t = e - m >= Be;
|
|
316
336
|
m = e, t && v();
|
|
317
337
|
},
|
|
318
338
|
shown() {
|
|
@@ -335,7 +355,7 @@ function He(e) {
|
|
|
335
355
|
};
|
|
336
356
|
return x;
|
|
337
357
|
}
|
|
338
|
-
var
|
|
358
|
+
var Ke = 1, qe = .3, Je = .58, Ye = 3, Xe = 100, X = 64, Z = {
|
|
339
359
|
selected: 0,
|
|
340
360
|
current: 1,
|
|
341
361
|
match: 2,
|
|
@@ -344,19 +364,19 @@ var Ue = 1, We = .3, Ge = .58, Ke = 3, qe = 100, X = 64, Z = {
|
|
|
344
364
|
hub: 5,
|
|
345
365
|
rest: 6,
|
|
346
366
|
greyed: 7
|
|
347
|
-
},
|
|
348
|
-
function
|
|
349
|
-
let { measure: r = null } = n, i =
|
|
367
|
+
}, Ze = 1.5, Qe = (e) => Number.isFinite(e) && e >= 9 ? Math.max(11, e) : 11, $e = (e) => Qe(e.labelMin), et = (e) => k.includes(e.type) && !e.greyed, tt = (e, t) => e.selected ? Z.selected : e.current ? Z.current : e.match ? Z.match : t && e.connected ? Z.lit : e.mark && e.mark !== "none" || e.labelKeep && !et(e) ? Z.marked : e.greyed ? Z.greyed : et(e) ? Z.hub : Z.rest;
|
|
368
|
+
function nt(e, t, n = {}) {
|
|
369
|
+
let { measure: r = null } = n, i = $e(e), a = e.nodes.some((e) => e.selected || !e.connected), o = [];
|
|
350
370
|
e.nodes.forEach((e, t) => {
|
|
351
371
|
e.label && e.labelAlpha >= .15 && o.push({
|
|
352
372
|
node: e,
|
|
353
373
|
index: t,
|
|
354
|
-
tier:
|
|
374
|
+
tier: tt(e, a)
|
|
355
375
|
});
|
|
356
376
|
}), o.sort((e, t) => e.tier - t.tier || t.node.r - e.node.r || (t.node.degree || 0) - (e.node.degree || 0) || e.index - t.index);
|
|
357
|
-
let s = /* @__PURE__ */ new Map(), c = (e, t) => (e + 8192) * 16384 + (t + 8192), l = [], u = Math.max(
|
|
377
|
+
let s = /* @__PURE__ */ new Map(), c = (e, t) => (e + 8192) * 16384 + (t + 8192), l = [], u = Math.max(Ye, Ye * t);
|
|
358
378
|
for (let { node: e, index: n, tier: a } of o) {
|
|
359
|
-
let o =
|
|
379
|
+
let o = et(e), d = !e.greyed && (!!e.labelBold || o), f = Math.max(o ? i + 2 : i, e.labelSize * t), p = r ? r(e.label, Xe, d) * f / Xe : e.label.length * f * Je, m = e.x * t, h = e.y * t + e.r * t + u + f, g = m - p / 2, _ = m + p / 2, v = h - f * Ke, y = h + f * qe, b = a === Z.greyed ? 2 + f * Ze : 2, x = Math.floor((g - b) / X), S = Math.floor((_ + b) / X), C = Math.floor((v - b) / X), w = Math.floor((y + b) / X), T = !1;
|
|
360
380
|
for (let e = x; e <= S && !T; e++) for (let t = C; t <= w && !T; t++) {
|
|
361
381
|
let n = s.get(c(e, t));
|
|
362
382
|
if (n) for (let e = 0; e < n.length; e++) {
|
|
@@ -394,13 +414,13 @@ function $e(e, t, n = {}) {
|
|
|
394
414
|
}
|
|
395
415
|
return l;
|
|
396
416
|
}
|
|
397
|
-
function
|
|
398
|
-
let { max:
|
|
417
|
+
function rt(e, t, n, r = {}) {
|
|
418
|
+
let { max: i = 400, margin: a = 32, measure: o = null, hover: s = null } = r, c = [], l = e.labelOutline || z(e.theme).labelOutline;
|
|
399
419
|
for (let t of e.decor.lanes) for (let n of [
|
|
400
420
|
t.title,
|
|
401
421
|
t.note,
|
|
402
422
|
t.arrow
|
|
403
|
-
]) n &&
|
|
423
|
+
]) n && c.push({
|
|
404
424
|
kind: "lane",
|
|
405
425
|
text: n.text,
|
|
406
426
|
x: n.x,
|
|
@@ -414,12 +434,12 @@ function et(e, t, r, i = {}) {
|
|
|
414
434
|
align: "center",
|
|
415
435
|
family: e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif"
|
|
416
436
|
});
|
|
417
|
-
let { zoom:
|
|
418
|
-
|
|
419
|
-
let
|
|
420
|
-
for (let e of
|
|
421
|
-
let t = Math.max(1, 1 /
|
|
422
|
-
|
|
437
|
+
let { zoom: u } = t, d = r.placed || nt(e, u, { measure: o }), f = -a - t.x, p = n.width + a - t.x, m = -a - t.y, h = n.height + a - t.y, g = d.filter((e) => e.r >= f && e.l <= p && e.b >= m && e.t <= h);
|
|
438
|
+
g.length > i && (g = g.slice(0, Math.max(0, i))), g.sort((e, t) => e.index - t.index);
|
|
439
|
+
let _ = e.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif";
|
|
440
|
+
for (let e of g) {
|
|
441
|
+
let t = Math.max(1, 1 / u);
|
|
442
|
+
c.push({
|
|
423
443
|
kind: "node",
|
|
424
444
|
id: e.id,
|
|
425
445
|
text: e.node.label,
|
|
@@ -430,99 +450,99 @@ function et(e, t, r, i = {}) {
|
|
|
430
450
|
italic: !1,
|
|
431
451
|
color: e.node.labelColor,
|
|
432
452
|
alpha: e.node.labelAlpha,
|
|
433
|
-
outline:
|
|
434
|
-
color:
|
|
435
|
-
width:
|
|
453
|
+
outline: l.node ? {
|
|
454
|
+
color: l.node.color,
|
|
455
|
+
width: l.node.width * t
|
|
436
456
|
} : null,
|
|
437
457
|
align: "center",
|
|
438
|
-
family:
|
|
458
|
+
family: _,
|
|
439
459
|
strike: !!e.node.labelStrike,
|
|
440
460
|
px: e.px,
|
|
441
461
|
screen: e.screen
|
|
442
462
|
});
|
|
443
463
|
}
|
|
444
|
-
let
|
|
464
|
+
let v = $e(e), y = g.map((e) => ({
|
|
445
465
|
l: t.x + e.l,
|
|
446
466
|
r: t.x + e.r,
|
|
447
467
|
t: t.y + e.t,
|
|
448
468
|
b: t.y + e.b
|
|
449
469
|
}));
|
|
450
|
-
for (let
|
|
451
|
-
if (
|
|
452
|
-
let e = t.x +
|
|
453
|
-
e + a < 0 || e - a >
|
|
470
|
+
for (let r of e.nodes) {
|
|
471
|
+
if (r.alpha < .5) continue;
|
|
472
|
+
let e = t.x + r.x * u, i = t.y + r.y * u, a = r.r * u;
|
|
473
|
+
e + a < 0 || e - a > n.width || i + a < 0 || i - a > n.height || y.push({
|
|
454
474
|
l: e - a,
|
|
455
475
|
r: e + a,
|
|
456
476
|
t: i - a,
|
|
457
477
|
b: i + a
|
|
458
478
|
});
|
|
459
479
|
}
|
|
460
|
-
let
|
|
461
|
-
for (let
|
|
462
|
-
let i =
|
|
463
|
-
if (!i ||
|
|
464
|
-
let a = t.x + i.x *
|
|
465
|
-
if (a < 0 || a >
|
|
466
|
-
let
|
|
467
|
-
l: a -
|
|
468
|
-
r: a +
|
|
469
|
-
t:
|
|
470
|
-
b:
|
|
480
|
+
let b = 0;
|
|
481
|
+
for (let r of e.edges) {
|
|
482
|
+
let i = r.label;
|
|
483
|
+
if (!i || b >= 120) continue;
|
|
484
|
+
let a = t.x + i.x * u, s = t.y + i.y * u;
|
|
485
|
+
if (a < 0 || a > n.width || s < 0 || s > n.height) continue;
|
|
486
|
+
let d = (o ? o(i.text, v, !1) : i.text.length * v * .55) / 2 + 2, f = {
|
|
487
|
+
l: a - d,
|
|
488
|
+
r: a + d,
|
|
489
|
+
t: s - v * .6 - 2,
|
|
490
|
+
b: s + v * .6 + 2
|
|
471
491
|
};
|
|
472
|
-
|
|
492
|
+
y.some((e) => f.l < e.r && f.r > e.l && f.t < e.b && f.b > e.t) || (y.push(f), b++, c.push({
|
|
473
493
|
kind: "edge",
|
|
474
494
|
text: i.text,
|
|
475
495
|
x: i.x,
|
|
476
|
-
y: i.y +
|
|
477
|
-
size:
|
|
478
|
-
px:
|
|
496
|
+
y: i.y + v * .35 / u,
|
|
497
|
+
size: v / u,
|
|
498
|
+
px: v,
|
|
479
499
|
screen: !0,
|
|
480
500
|
bold: !1,
|
|
481
501
|
italic: !!i.italic,
|
|
482
502
|
color: i.color,
|
|
483
|
-
alpha:
|
|
484
|
-
outline:
|
|
503
|
+
alpha: r.alpha,
|
|
504
|
+
outline: l.edge,
|
|
485
505
|
align: "center",
|
|
486
506
|
family: e.labelFont || "\"Segoe UI\", -apple-system, sans-serif"
|
|
487
507
|
}));
|
|
488
508
|
}
|
|
489
|
-
if (
|
|
490
|
-
let n = e.nodes.find((e) => e.id ===
|
|
491
|
-
if (n && n.label && !
|
|
492
|
-
let r =
|
|
493
|
-
|
|
509
|
+
if (s) {
|
|
510
|
+
let n = e.nodes.find((e) => e.id === s);
|
|
511
|
+
if (n && n.label && !d.some((e) => e.id === s && g.includes(e))) {
|
|
512
|
+
let r = $e(e), i = t.y + n.y * u - n.r * u > 40 ? n.y - n.r - 5 / u : n.y + n.r + (5 + r) / u;
|
|
513
|
+
c.push({
|
|
494
514
|
kind: "chip",
|
|
495
515
|
id: n.id,
|
|
496
516
|
text: n.label,
|
|
497
517
|
x: n.x,
|
|
498
518
|
y: i,
|
|
499
|
-
size: r /
|
|
519
|
+
size: r / u,
|
|
500
520
|
px: r,
|
|
501
521
|
screen: !0,
|
|
502
522
|
bold: !1,
|
|
503
523
|
italic: !1,
|
|
504
524
|
color: (e.nodes.find((e) => e.connected) || n).labelColor,
|
|
505
525
|
alpha: 1,
|
|
506
|
-
outline:
|
|
526
|
+
outline: l.node,
|
|
507
527
|
align: "center",
|
|
508
|
-
family:
|
|
528
|
+
family: _,
|
|
509
529
|
strike: !1
|
|
510
530
|
});
|
|
511
531
|
}
|
|
512
532
|
}
|
|
513
|
-
return
|
|
533
|
+
return c;
|
|
514
534
|
}
|
|
515
|
-
var
|
|
535
|
+
var it = (e) => `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${e.screen ? e.px : e.size}px ${e.family}`, at = {
|
|
516
536
|
ox: 0,
|
|
517
537
|
oy: 0,
|
|
518
538
|
k: 1
|
|
519
539
|
};
|
|
520
|
-
function
|
|
521
|
-
e.font =
|
|
522
|
-
let r = e.measureText(t.text).width + 8, i = t.px * 1.3 + 4, a = n.ox + t.x * n.k, o = n.oy + t.y * n.k, s = a - r / 2, c = o - t.px *
|
|
540
|
+
function ot(e, t, n) {
|
|
541
|
+
e.font = it(t);
|
|
542
|
+
let r = e.measureText(t.text).width + 8, i = t.px * 1.3 + 4, a = n.ox + t.x * n.k, o = n.oy + t.y * n.k, s = a - r / 2, c = o - t.px * Ke - 2;
|
|
523
543
|
e.globalAlpha = 1, e.beginPath(), e.roundRect ? e.roundRect(s, c, r, i, 4) : e.rect(s, c, r, i), e.fillStyle = t.outline ? t.outline.color : "rgba(9, 13, 22, 0.95)", e.fill(), e.lineWidth = 1, e.strokeStyle = t.color, e.stroke(), e.textAlign = t.align, e.fillStyle = t.color, e.fillText(t.text, a, o);
|
|
524
544
|
}
|
|
525
|
-
function
|
|
545
|
+
function st() {
|
|
526
546
|
return {
|
|
527
547
|
font: "",
|
|
528
548
|
alpha: -1,
|
|
@@ -532,13 +552,13 @@ function it() {
|
|
|
532
552
|
align: ""
|
|
533
553
|
};
|
|
534
554
|
}
|
|
535
|
-
function
|
|
555
|
+
function ct(e, t, n, r = at) {
|
|
536
556
|
if (t.kind === "chip") {
|
|
537
|
-
|
|
557
|
+
ot(e, t, r);
|
|
538
558
|
return;
|
|
539
559
|
}
|
|
540
560
|
n.alpha !== t.alpha && (e.globalAlpha = t.alpha, n.alpha = t.alpha);
|
|
541
|
-
let i =
|
|
561
|
+
let i = it(t);
|
|
542
562
|
n.font !== i && (e.font = i, n.font = i), n.align !== t.align && (e.textAlign = t.align, n.align = t.align);
|
|
543
563
|
let a = r.ox + t.x * r.k, o = r.oy + t.y * r.k;
|
|
544
564
|
if (t.outline) {
|
|
@@ -551,15 +571,15 @@ function at(e, t, n, r = nt) {
|
|
|
551
571
|
e.beginPath(), e.moveTo(a - i, o - s * .32), e.lineTo(a + i, o - s * .32), e.strokeStyle = t.color, e.lineWidth = 1.4, e.stroke(), n.stroke = t.color, n.width = 1.4;
|
|
552
572
|
}
|
|
553
573
|
}
|
|
554
|
-
function
|
|
574
|
+
function lt(e, t, n, r) {
|
|
555
575
|
let i = null;
|
|
556
576
|
for (let a of e) n >= t.x + a.l && n <= t.x + a.r && r >= t.y + a.t && r <= t.y + a.b && (!i || a.index > i.index) && (i = a);
|
|
557
577
|
return i ? i.id : null;
|
|
558
578
|
}
|
|
559
|
-
function
|
|
560
|
-
let n = t.mapStyle || (() => L), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c, l, u, d, f, p, m = null, h = !0, g = !1, _ = /* @__PURE__ */ new Map(), v =
|
|
579
|
+
function ut(e, t = {}) {
|
|
580
|
+
let n = t.mapStyle || (() => L), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c, l, u, d, f, p, m = null, h = !0, g = !1, _ = /* @__PURE__ */ new Map(), v = I, y = (e, t, n) => {
|
|
561
581
|
let i = `${n ? "b" : "n"}${t}|${v}|${e}`, a = _.get(i);
|
|
562
|
-
return a === void 0 && (_.size > 2e4 && _.clear(), r.font =
|
|
582
|
+
return a === void 0 && (_.size > 2e4 && _.clear(), r.font = it({
|
|
563
583
|
italic: !1,
|
|
564
584
|
bold: n,
|
|
565
585
|
size: t,
|
|
@@ -568,7 +588,7 @@ function st(e, t = {}) {
|
|
|
568
588
|
};
|
|
569
589
|
return {
|
|
570
590
|
hit(e, t) {
|
|
571
|
-
return m && s ?
|
|
591
|
+
return m && s ? lt(m, {
|
|
572
592
|
x: l,
|
|
573
593
|
y: u,
|
|
574
594
|
zoom: d
|
|
@@ -583,28 +603,28 @@ function st(e, t = {}) {
|
|
|
583
603
|
if (!h && e === s && e.version === c && t.x === l && t.y === u && t.zoom === d && x === f && S === p) return !1;
|
|
584
604
|
let C = m && e === s && e.version === c && t.zoom === d && x === f && !h;
|
|
585
605
|
s = e, c = e.version, l = t.x, u = t.y, d = t.zoom, f = x, p = S, h = !1;
|
|
586
|
-
let w =
|
|
587
|
-
v = w.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif", r.setTransform(o, 0, 0, o, 0, 0), r.clearRect(0, 0, i, a), r.save(), r.translate(t.x, t.y), r.scale(t.zoom, t.zoom), C || (m =
|
|
588
|
-
let T =
|
|
606
|
+
let w = ae(e, b);
|
|
607
|
+
v = w.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif", r.setTransform(o, 0, 0, o, 0, 0), r.clearRect(0, 0, i, a), r.save(), r.translate(t.x, t.y), r.scale(t.zoom, t.zoom), C || (m = nt(w, t.zoom, { measure: y }));
|
|
608
|
+
let T = rt(w, t, {
|
|
589
609
|
width: i,
|
|
590
610
|
height: a
|
|
591
611
|
}, {
|
|
592
612
|
measure: y,
|
|
593
613
|
hover: S,
|
|
594
614
|
placed: m
|
|
595
|
-
}), E =
|
|
596
|
-
for (let e of T) e.kind === "lane" &&
|
|
597
|
-
for (let e of T) e.kind === "node" && !e.screen &&
|
|
615
|
+
}), E = st();
|
|
616
|
+
for (let e of T) e.kind === "lane" && ct(r, e, E);
|
|
617
|
+
for (let e of T) e.kind === "node" && !e.screen && ct(r, e, E);
|
|
598
618
|
r.restore();
|
|
599
619
|
let D = {
|
|
600
620
|
ox: t.x,
|
|
601
621
|
oy: t.y,
|
|
602
622
|
k: t.zoom
|
|
603
623
|
};
|
|
604
|
-
E =
|
|
605
|
-
for (let e of T) e.kind === "node" && e.screen &&
|
|
606
|
-
for (let e of T) e.kind === "edge" &&
|
|
607
|
-
for (let e of T) e.kind === "chip" &&
|
|
624
|
+
E = st();
|
|
625
|
+
for (let e of T) e.kind === "node" && e.screen && ct(r, e, E, D);
|
|
626
|
+
for (let e of T) e.kind === "edge" && ct(r, e, E, D);
|
|
627
|
+
for (let e of T) e.kind === "chip" && ct(r, e, E, D);
|
|
608
628
|
return !0;
|
|
609
629
|
},
|
|
610
630
|
destroy() {
|
|
@@ -613,7 +633,7 @@ function st(e, t = {}) {
|
|
|
613
633
|
};
|
|
614
634
|
}
|
|
615
635
|
// ../explorer/engine/render.js
|
|
616
|
-
var
|
|
636
|
+
var dt = [
|
|
617
637
|
"pointerdown",
|
|
618
638
|
"pointermove",
|
|
619
639
|
"mousedown",
|
|
@@ -623,65 +643,65 @@ var ct = [
|
|
|
623
643
|
"touchmove",
|
|
624
644
|
"keydown"
|
|
625
645
|
];
|
|
626
|
-
function
|
|
646
|
+
function ft(e, n = {}) {
|
|
627
647
|
if (e.map) return e.map;
|
|
628
|
-
let { state:
|
|
629
|
-
throughChildren: !!
|
|
630
|
-
kind:
|
|
631
|
-
}) =>
|
|
632
|
-
function
|
|
633
|
-
return
|
|
634
|
-
}
|
|
635
|
-
let S = null, C = null;
|
|
636
|
-
function w() {
|
|
637
|
-
return n.labelCanvas ? (S && C === n.labelCanvas || (S && S.destroy(), S = st(n.labelCanvas, { mapStyle: i }), C = n.labelCanvas, n.width && S.resize(n.width, n.height, e.dpr())), S) : null;
|
|
648
|
+
let { state: i } = e, a = n.measureCovered || (() => i.coveredBottom || 0), o = te(e).get, s = !1, c = (e) => B(i, e), l = (e) => B(i, e, { viewer: !0 }), u = (t, n = e.viewEdges(), a = {
|
|
649
|
+
throughChildren: !!i.throughChildren,
|
|
650
|
+
kind: i.selectedKind || null
|
|
651
|
+
}) => r(t, n, a), d = se((n) => t(n, { reduceMotion: e.reducedMotion })), f = () => d.get(i), p = () => d.builds, m = ze(), h = () => m.get(f()), g = () => m.builds, _ = null, v = null;
|
|
652
|
+
function y() {
|
|
653
|
+
return _ && v === i.canvas || (_ && _.destroy(), _ = Fe(i.canvas, { mapStyle: o }), v = i.canvas, i.width && _.resize(i.width, i.height, e.dpr())), _;
|
|
638
654
|
}
|
|
639
|
-
|
|
640
|
-
|
|
655
|
+
let b = null, x = null;
|
|
656
|
+
function S() {
|
|
657
|
+
return i.labelCanvas ? (b && x === i.labelCanvas || (b && b.destroy(), b = ut(i.labelCanvas, { mapStyle: o }), x = i.labelCanvas, i.width && b.resize(i.width, i.height, e.dpr())), b) : null;
|
|
641
658
|
}
|
|
642
|
-
function
|
|
643
|
-
|
|
644
|
-
n.width = t.parentElement.clientWidth, n.height = t.parentElement.clientHeight, x().resize(n.width, n.height, e.dpr());
|
|
645
|
-
let i = w();
|
|
646
|
-
i && i.resize(n.width, n.height, e.dpr()), r !== `${n.width}x${n.height}` && O(), G();
|
|
659
|
+
function C(t) {
|
|
660
|
+
_ && _ !== t && _.destroy(), _ = t, v = i.canvas, i.width && _.resize(i.width, i.height, e.dpr()), U();
|
|
647
661
|
}
|
|
648
|
-
|
|
662
|
+
function w() {
|
|
663
|
+
let { canvas: t } = i, n = `${i.width}x${i.height}`;
|
|
664
|
+
i.width = t.parentElement.clientWidth, i.height = t.parentElement.clientHeight, y().resize(i.width, i.height, e.dpr());
|
|
665
|
+
let r = S();
|
|
666
|
+
r && r.resize(i.width, i.height, e.dpr()), n !== `${i.width}x${i.height}` && E(), U();
|
|
667
|
+
}
|
|
668
|
+
let T = e.slot("fit", () => ({
|
|
649
669
|
lastFit: null,
|
|
650
670
|
waiting: null
|
|
651
671
|
}));
|
|
652
|
-
function
|
|
653
|
-
if (!
|
|
654
|
-
if (
|
|
655
|
-
let { padding: e, only: t } =
|
|
672
|
+
function E() {
|
|
673
|
+
if (!i.width || !i.height) return;
|
|
674
|
+
if (T.waiting) {
|
|
675
|
+
let { padding: e, only: t } = T.waiting;
|
|
656
676
|
N(e === null ? P() : e, t);
|
|
657
677
|
return;
|
|
658
678
|
}
|
|
659
|
-
let { camera: e } =
|
|
679
|
+
let { camera: e } = i, t = T.lastFit;
|
|
660
680
|
t && e.x === t.x && e.y === t.y && e.zoom === t.zoom && N(t.auto ? P() : t.padding, t.only);
|
|
661
681
|
}
|
|
662
|
-
function
|
|
663
|
-
let t =
|
|
664
|
-
if (!t || !
|
|
665
|
-
let
|
|
666
|
-
|
|
682
|
+
function D() {
|
|
683
|
+
let t = i.canvas && i.canvas.parentElement, n = e.win && e.win.ResizeObserver;
|
|
684
|
+
if (!t || !n) return () => {};
|
|
685
|
+
let r = new n(() => {
|
|
686
|
+
i.canvas && (t.clientWidth !== i.width || t.clientHeight !== i.height) && w();
|
|
667
687
|
});
|
|
668
|
-
|
|
669
|
-
let a = () =>
|
|
688
|
+
r.observe(t);
|
|
689
|
+
let a = () => r.disconnect();
|
|
670
690
|
return e.own(a), a;
|
|
671
691
|
}
|
|
672
|
-
function
|
|
673
|
-
let { nodes:
|
|
692
|
+
function O(e, t = null) {
|
|
693
|
+
let { nodes: n, width: r, height: o } = i, s = n.filter(c);
|
|
674
694
|
if (t) {
|
|
675
695
|
let e = s.filter((e) => t.has(e.id));
|
|
676
696
|
e.length && (s = e);
|
|
677
697
|
}
|
|
678
698
|
if (s.length === 0) return null;
|
|
679
|
-
let l = Math.max(160, o -
|
|
699
|
+
let l = Math.max(160, o - a()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
|
|
680
700
|
s.forEach((e) => {
|
|
681
701
|
let t = e.r || 18;
|
|
682
702
|
u = Math.min(u, e.x - t - 25), d = Math.max(d, e.x + t + 25), f = Math.min(f, e.y - t - 25), p = Math.max(p, e.y + t + 35);
|
|
683
|
-
}),
|
|
684
|
-
let m = Math.max(160,
|
|
703
|
+
}), i.view === "dataflow" && i.flow && (f = Math.min(f, i.flow.top - 10)), i.view === "house" && i.house && i.house.fit && !t && ({minX: u, maxX: d, minY: f, maxY: p} = i.house.fit);
|
|
704
|
+
let m = Math.max(160, r - e * 2), h = Math.max(160, l - e * 2), g = Math.min(m / (d - u), h / (p - f));
|
|
685
705
|
return {
|
|
686
706
|
minX: u,
|
|
687
707
|
maxX: d,
|
|
@@ -691,145 +711,145 @@ function lt(e, t = {}) {
|
|
|
691
711
|
raw: g
|
|
692
712
|
};
|
|
693
713
|
}
|
|
694
|
-
let
|
|
714
|
+
let k = "", j = oe;
|
|
695
715
|
function M() {
|
|
696
|
-
let e = `${
|
|
697
|
-
if (e !==
|
|
698
|
-
|
|
699
|
-
let t =
|
|
700
|
-
j = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(
|
|
716
|
+
let e = `${i.sceneVersion}|${i.width}|${i.height}|${i.view}|${a()}`;
|
|
717
|
+
if (e !== k) {
|
|
718
|
+
k = e;
|
|
719
|
+
let t = O(P());
|
|
720
|
+
j = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(A, Math.min(oe, t.raw)) : oe;
|
|
701
721
|
}
|
|
702
722
|
return j;
|
|
703
723
|
}
|
|
704
724
|
function N(e = 40, t = null) {
|
|
705
|
-
let { width:
|
|
706
|
-
if (!
|
|
707
|
-
|
|
725
|
+
let { width: n, height: r, camera: a } = i;
|
|
726
|
+
if (!n || !r) {
|
|
727
|
+
i.nodes.length && (T.waiting = {
|
|
708
728
|
padding: e === P() ? null : e,
|
|
709
729
|
only: t
|
|
710
730
|
});
|
|
711
731
|
return;
|
|
712
732
|
}
|
|
713
|
-
|
|
714
|
-
let o =
|
|
733
|
+
T.waiting = null;
|
|
734
|
+
let o = O(e, t);
|
|
715
735
|
if (!o) return;
|
|
716
|
-
let { minX: s, maxX: c, minY: l, maxY: u, mapHeight: d } = o, f = Math.min(1, Math.max(
|
|
717
|
-
a.zoom = f, a.x =
|
|
736
|
+
let { minX: s, maxX: c, minY: l, maxY: u, mapHeight: d } = o, f = Math.min(1, Math.max(A, o.raw));
|
|
737
|
+
a.zoom = f, a.x = n / 2 - (s + c) / 2 * f, a.y = d / 2 - (l + u) / 2 * f, T.lastFit = {
|
|
718
738
|
padding: e,
|
|
719
739
|
auto: e === P(),
|
|
720
740
|
only: t,
|
|
721
741
|
x: a.x,
|
|
722
742
|
y: a.y,
|
|
723
743
|
zoom: a.zoom
|
|
724
|
-
},
|
|
725
|
-
}
|
|
726
|
-
let P = () =>
|
|
727
|
-
x: (e -
|
|
728
|
-
y: (t -
|
|
729
|
-
}),
|
|
730
|
-
function
|
|
731
|
-
if (!
|
|
744
|
+
}, U();
|
|
745
|
+
}
|
|
746
|
+
let P = () => i.width < 640 ? 24 : 48, ee = (e, t) => ({
|
|
747
|
+
x: (e - i.camera.x) / i.camera.zoom,
|
|
748
|
+
y: (t - i.camera.y) / i.camera.zoom
|
|
749
|
+
}), F = -1;
|
|
750
|
+
function I() {
|
|
751
|
+
if (!i.canvas) return;
|
|
732
752
|
let e = f();
|
|
733
|
-
|
|
734
|
-
let t =
|
|
735
|
-
t && t.draw(e,
|
|
753
|
+
F = e.version, y().draw(e, i.camera, performance.now());
|
|
754
|
+
let t = S();
|
|
755
|
+
t && t.draw(e, i.camera, { hover: i.hoverNodeId }), z.forEach((t) => t(e, i.camera));
|
|
736
756
|
}
|
|
737
|
-
function
|
|
738
|
-
let n =
|
|
757
|
+
function L(e, t) {
|
|
758
|
+
let n = S();
|
|
739
759
|
return n ? n.hit(e, t) : null;
|
|
740
760
|
}
|
|
741
|
-
function
|
|
761
|
+
function R(e) {
|
|
742
762
|
let t = e || null;
|
|
743
|
-
if (
|
|
744
|
-
|
|
745
|
-
let
|
|
746
|
-
|
|
747
|
-
}
|
|
748
|
-
let
|
|
749
|
-
draw:
|
|
750
|
-
packetsVisible: () => !!
|
|
763
|
+
if (i.hoverNodeId === t) return;
|
|
764
|
+
i.hoverNodeId = t;
|
|
765
|
+
let n = S();
|
|
766
|
+
n && i.canvas && i.width && n.draw(f(), i.camera, { hover: t });
|
|
767
|
+
}
|
|
768
|
+
let z = /* @__PURE__ */ new Set(), ne = (e) => (z.add(e), () => z.delete(e)), V = /* @__PURE__ */ new Set(), H = Ge({
|
|
769
|
+
draw: I,
|
|
770
|
+
packetsVisible: () => !!i.canvas && He(f(), i.camera, i.width, i.height),
|
|
751
771
|
isHidden: () => e.hidden(),
|
|
752
772
|
tickClients: (e) => {
|
|
753
773
|
let t = !1;
|
|
754
|
-
return
|
|
774
|
+
return V.forEach((n) => {
|
|
755
775
|
n.tick(e), n.wants() && (t = !0);
|
|
756
776
|
}), t;
|
|
757
777
|
},
|
|
758
|
-
clientsWant: () => [...
|
|
778
|
+
clientsWant: () => [...V].some((e) => e.wants()),
|
|
759
779
|
reduceMotion: () => e.reducedMotion,
|
|
760
|
-
extraDirty: () =>
|
|
780
|
+
extraDirty: () => i.sceneVersion !== F,
|
|
761
781
|
now: () => performance.now(),
|
|
762
782
|
raf: (e) => requestAnimationFrame(e),
|
|
763
783
|
caf: (e) => cancelAnimationFrame(e)
|
|
764
784
|
});
|
|
765
|
-
function
|
|
766
|
-
!
|
|
785
|
+
function U() {
|
|
786
|
+
!s && i.canvas && H.markDirty();
|
|
767
787
|
}
|
|
768
|
-
function
|
|
769
|
-
!
|
|
788
|
+
function W() {
|
|
789
|
+
!s && i.canvas && H.drawNow();
|
|
770
790
|
}
|
|
771
791
|
function re(e) {
|
|
772
|
-
return
|
|
792
|
+
return V.add(e), () => V.delete(e);
|
|
773
793
|
}
|
|
774
|
-
let
|
|
794
|
+
let G = [];
|
|
775
795
|
if (e.root) {
|
|
776
|
-
let t = () =>
|
|
777
|
-
for (let n of
|
|
796
|
+
let t = () => H.noteInput();
|
|
797
|
+
for (let n of dt) G.push(e.listen(e.root, n, t, {
|
|
778
798
|
passive: !0,
|
|
779
799
|
capture: !0
|
|
780
800
|
}));
|
|
781
801
|
}
|
|
782
|
-
|
|
783
|
-
let e =
|
|
784
|
-
!
|
|
802
|
+
G.push(e.onShown(() => H.shown())), G.push(e.onShown(() => {
|
|
803
|
+
let e = i.canvas && i.canvas.parentElement;
|
|
804
|
+
!s && e && e.clientWidth && e.clientHeight && (e.clientWidth !== i.width || e.clientHeight !== i.height) && w();
|
|
785
805
|
}));
|
|
786
806
|
function ie() {
|
|
787
|
-
|
|
788
|
-
for (let e of
|
|
789
|
-
e.map ===
|
|
807
|
+
s = !0;
|
|
808
|
+
for (let e of G.splice(0)) e();
|
|
809
|
+
e.map === K && (e.map = null), H.cancel(), _ && (_.release ? _.release() : _.destroy(), _ = null, v = null), b && (b.destroy(), b = null, x = null), z.clear(), V.clear();
|
|
790
810
|
}
|
|
791
|
-
let
|
|
811
|
+
let K = {
|
|
792
812
|
isNodeVisible: c,
|
|
793
813
|
isNodeVisibleToViewer: l,
|
|
794
814
|
getActiveSubgraph: u,
|
|
795
815
|
getScene: f,
|
|
796
816
|
sceneBuilds: p,
|
|
797
|
-
getSpatialIndex:
|
|
798
|
-
spatialBuilds:
|
|
799
|
-
getRenderer:
|
|
800
|
-
setRenderer:
|
|
801
|
-
resize:
|
|
802
|
-
watchSize:
|
|
817
|
+
getSpatialIndex: h,
|
|
818
|
+
spatialBuilds: g,
|
|
819
|
+
getRenderer: y,
|
|
820
|
+
setRenderer: C,
|
|
821
|
+
resize: w,
|
|
822
|
+
watchSize: D,
|
|
803
823
|
getMinZoom: M,
|
|
804
824
|
fitGraphToViewport: N,
|
|
805
825
|
fitPadding: P,
|
|
806
|
-
screenToWorld:
|
|
807
|
-
labelNodeAt:
|
|
808
|
-
setHoverNode:
|
|
809
|
-
onPaint:
|
|
810
|
-
render:
|
|
811
|
-
renderNow:
|
|
826
|
+
screenToWorld: ee,
|
|
827
|
+
labelNodeAt: L,
|
|
828
|
+
setHoverNode: R,
|
|
829
|
+
onPaint: ne,
|
|
830
|
+
render: U,
|
|
831
|
+
renderNow: W,
|
|
812
832
|
addFrameClient: re,
|
|
813
833
|
queueFrameWork: (e, t) => {
|
|
814
|
-
|
|
834
|
+
s || H.queue(e, t);
|
|
815
835
|
},
|
|
816
836
|
frameStats: () => ({
|
|
817
|
-
frames:
|
|
818
|
-
draws:
|
|
837
|
+
frames: H.frames,
|
|
838
|
+
draws: H.draws
|
|
819
839
|
}),
|
|
820
840
|
holdFrames: (e) => {
|
|
821
|
-
|
|
841
|
+
s || H.hold(e);
|
|
822
842
|
},
|
|
823
|
-
cancelFrame: () =>
|
|
843
|
+
cancelFrame: () => H.cancel(),
|
|
824
844
|
ensureFlowLoop: () => {
|
|
825
|
-
|
|
845
|
+
s || H.wake();
|
|
826
846
|
},
|
|
827
847
|
destroy: ie
|
|
828
848
|
};
|
|
829
|
-
return e.map =
|
|
849
|
+
return e.map = K, e.own(ie), K;
|
|
830
850
|
}
|
|
831
851
|
// ../explorer/flow-build.js
|
|
832
|
-
function
|
|
852
|
+
function pt(e, t) {
|
|
833
853
|
let n = new Map(e.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map();
|
|
834
854
|
t.forEach((e) => {
|
|
835
855
|
!e.kind && !e.dashed && n.get(e.from)?.type === "app" && n.get(e.to)?.type === "page" && r.set(e.to, e.from);
|
|
@@ -917,55 +937,55 @@ function ut(e, t) {
|
|
|
917
937
|
};
|
|
918
938
|
}
|
|
919
939
|
// ../explorer/engine/topology.js
|
|
920
|
-
function
|
|
940
|
+
function mt(e) {
|
|
921
941
|
return {
|
|
922
942
|
nodes: e && Array.isArray(e.nodes) ? e.nodes.filter((e) => e && typeof e.id == "string") : [],
|
|
923
943
|
edges: e && Array.isArray(e.edges) ? e.edges.filter((e) => e && typeof e.from == "string" && typeof e.to == "string") : []
|
|
924
944
|
};
|
|
925
945
|
}
|
|
926
|
-
function
|
|
927
|
-
let { state: n } = e, { nodes: r, edges: i } =
|
|
928
|
-
n.baseNodes = r, n.baseEdges = i, n.nodes = r.map((e) => ({ ...e })), n.edges = i.map((e) => ({ ...e })), n.mapNodes = n.nodes, n.mapEdges = n.edges, n.flow =
|
|
946
|
+
function ht(e, t) {
|
|
947
|
+
let { state: n } = e, { nodes: r, edges: i } = mt(t), a = n.selectedNode ? n.selectedNode.id : null;
|
|
948
|
+
n.baseNodes = r, n.baseEdges = i, n.nodes = r.map((e) => ({ ...e })), n.edges = i.map((e) => ({ ...e })), n.mapNodes = n.nodes, n.mapEdges = n.edges, n.flow = pt(n.nodes, n.edges);
|
|
929
949
|
let o = a && n.nodes.find((e) => e.id === a) || null;
|
|
930
950
|
return o ? (n.selectedEdge = null, n.selectedNode = o) : (n.selectedNode || n.selectedEdge) && (n.selectedNode = null, n.selectedEdge = null), e.touchScene(), n.nodes.length > 0;
|
|
931
951
|
}
|
|
932
|
-
function
|
|
933
|
-
let { state:
|
|
934
|
-
|
|
952
|
+
function gt(t, { placeLive: n } = {}) {
|
|
953
|
+
let { state: r } = t;
|
|
954
|
+
_(t), r.view === "dataflow" && r.flow ? (r.flow.tiers.forEach((e) => e.nodes.forEach((e) => {
|
|
935
955
|
e.r = Math.min(e.r, 13);
|
|
936
|
-
})),
|
|
956
|
+
})), r.proposal && r.baseNodes && vt(t) || e(t, r.flow)) : r.baseNodes && (r.proposal || r.nodes.some((e) => e.live)) ? yt(t, n) : P(t);
|
|
937
957
|
}
|
|
938
|
-
function
|
|
958
|
+
function _t(e, t, n) {
|
|
939
959
|
let { state: r } = e;
|
|
940
|
-
r.mapNodes = t, r.mapEdges = n, r.nodes = t, r.edges = n, r.flow =
|
|
941
|
-
}
|
|
942
|
-
function
|
|
943
|
-
let { state:
|
|
944
|
-
nodes:
|
|
945
|
-
edges:
|
|
946
|
-
},
|
|
947
|
-
|
|
948
|
-
let
|
|
949
|
-
|
|
960
|
+
r.mapNodes = t, r.mapEdges = n, r.nodes = t, r.edges = n, r.flow = pt(t, n), m(r.flow), e.touchScene(), gt(e);
|
|
961
|
+
}
|
|
962
|
+
function vt(t) {
|
|
963
|
+
let { state: n } = t, r = {
|
|
964
|
+
nodes: n.nodes,
|
|
965
|
+
edges: n.edges
|
|
966
|
+
}, i = n.baseNodes.map((e) => ({ ...e }));
|
|
967
|
+
n.nodes = i, n.edges = n.baseEdges, _(t);
|
|
968
|
+
let a = pt(i, n.baseEdges);
|
|
969
|
+
a.tiers.forEach((e) => e.nodes.forEach((e) => {
|
|
950
970
|
e.r = Math.min(e.r, 13);
|
|
951
|
-
})),
|
|
952
|
-
let
|
|
953
|
-
return
|
|
971
|
+
})), e(t, a), n.nodes = r.nodes, n.edges = r.edges;
|
|
972
|
+
let o = h(n.flow, a);
|
|
973
|
+
return t.touchScene(), o;
|
|
954
974
|
}
|
|
955
|
-
function
|
|
975
|
+
function yt(e, t) {
|
|
956
976
|
let { state: n } = e, r = {
|
|
957
977
|
nodes: n.nodes,
|
|
958
978
|
edges: n.edges
|
|
959
979
|
}, i = n.baseNodes.map((e) => ({ ...e }));
|
|
960
|
-
n.nodes = i, n.edges = n.baseEdges,
|
|
980
|
+
n.nodes = i, n.edges = n.baseEdges, _(e), P(e);
|
|
961
981
|
let a = new Map(i.map((e) => [e.id, e]));
|
|
962
|
-
n.nodes = r.nodes, n.edges = r.edges,
|
|
982
|
+
n.nodes = r.nodes, n.edges = r.edges, _(e), n.nodes.forEach((e) => {
|
|
963
983
|
let t = a.get(e.id);
|
|
964
984
|
t && (e.x = t.x, e.y = t.y, e.r = t.r);
|
|
965
|
-
}),
|
|
985
|
+
}), g(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
|
|
966
986
|
}
|
|
967
987
|
// ../explorer/shaders.js
|
|
968
|
-
var Q = "#version 300 es\nprecision highp float;\nuniform vec2 u_viewport;\nuniform vec3 u_cam;\nuniform float u_dpr;\n",
|
|
988
|
+
var Q = "#version 300 es\nprecision highp float;\nuniform vec2 u_viewport;\nuniform vec3 u_cam;\nuniform float u_dpr;\n", bt = "\nvec4 toClip(vec2 pos) {\n return vec4(pos.x / u_viewport.x * 2.0 - 1.0, 1.0 - pos.y / u_viewport.y * 2.0, 0.0, 1.0);\n}\n", xt = "\nout vec4 outColor;\n\n// Coverage of one device pixel by the half plane d < 0 (d: signed distance in CSS px, pix: the pixel's size)\nfloat coverEdge(float d, float pix) {\n return clamp(0.5 - d / pix, 0.0, 1.0);\n}\n\n// Coverage of one pixel by a band of half width hw around dist = 0 (dist >= 0: distance from the centre line)\nfloat coverBand(float dist, float hw, float pix) {\n float hi = min(hw, dist + 0.5 * pix);\n float lo = max(-hw, dist - 0.5 * pix);\n return clamp((hi - lo) / pix, 0.0, 1.0);\n}\n\n// Coverage by a dash pattern along an arc (on / off in world units; on <= 0 or off <= 0 is solid)\nfloat coverDash(float arc, float on, float off, float pixWorld) {\n if (on <= 0.0 || off <= 0.0) return 1.0;\n float period = on + off;\n float u = mod(arc - on * 0.5 + period * 0.5, period) - period * 0.5;\n return clamp((on * 0.5 - abs(u)) / pixWorld + 0.5, 0.0, 1.0);\n}\n\n// Straight colour at alpha a, composited over acc (premultiplied)\nvoid over(inout vec4 acc, vec3 rgb, float a) {\n acc = vec4(rgb * a, a) + acc * (1.0 - a);\n}\n\n// What Canvas 2D's shadowBlur gives a disc of radius R at distance len from its centre: a blurred copy\n// of the disc. s is the blur's sigma in CSS px (shadowBlur is in DEVICE px and sigma = blur / 2). A big\n// disc has a straight-edge profile (a logistic stands in for the Gaussian's CDF); a small one is a\n// Gaussian bump whose height is what the blur leaves of it.\nfloat glowDisc(float len, float R, float s) {\n float wide = 1.0 / (1.0 + exp(clamp(1.702 * (len - R) / s, -30.0, 30.0)));\n float narrow = (1.0 - exp(-R * R / (2.0 * s * s))) * exp(-len * len / (2.0 * s * s));\n return mix(narrow, wide, smoothstep(0.5 * s, 2.5 * s, R));\n}\n\n// The normal distribution's CDF, as the same logistic (error under 0.01)\nfloat phi(float x) {\n return 1.0 / (1.0 + exp(clamp(-1.702 * x, -30.0, 30.0)));\n}\n", St = `${Q}
|
|
969
989
|
layout(location = 0) in vec2 a_corner;
|
|
970
990
|
layout(location = 1) in vec4 a_grid; // size, width
|
|
971
991
|
layout(location = 2) in vec4 a_color;
|
|
@@ -978,7 +998,7 @@ void main() {
|
|
|
978
998
|
v_color = a_color;
|
|
979
999
|
gl_Position = vec4(a_corner, 0.0, 1.0);
|
|
980
1000
|
}
|
|
981
|
-
`,
|
|
1001
|
+
`, Ct = `${Q}${xt}
|
|
982
1002
|
in vec2 v_pos;
|
|
983
1003
|
flat in vec4 v_grid;
|
|
984
1004
|
flat in vec4 v_color;
|
|
@@ -991,7 +1011,7 @@ void main() {
|
|
|
991
1011
|
float cover = max(coverBand(dist.x, hw, pix), coverBand(dist.y, hw, pix));
|
|
992
1012
|
outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
|
|
993
1013
|
}
|
|
994
|
-
`,
|
|
1014
|
+
`, wt = `${Q}${bt}
|
|
995
1015
|
layout(location = 0) in vec2 a_corner;
|
|
996
1016
|
layout(location = 1) in vec4 a_rect; // x, y, w, h (world)
|
|
997
1017
|
layout(location = 2) in vec4 a_fill;
|
|
@@ -1015,7 +1035,7 @@ void main() {
|
|
|
1015
1035
|
v_stroke = a_stroke;
|
|
1016
1036
|
gl_Position = toClip(pos);
|
|
1017
1037
|
}
|
|
1018
|
-
`,
|
|
1038
|
+
`, Tt = `${Q}${xt}
|
|
1019
1039
|
in vec2 v_local;
|
|
1020
1040
|
flat in vec2 v_half;
|
|
1021
1041
|
flat in vec2 v_style;
|
|
@@ -1032,7 +1052,7 @@ void main() {
|
|
|
1032
1052
|
over(acc, v_stroke.rgb, v_stroke.a * coverBand(abs(sd), v_style.y * zoom * 0.5, pix));
|
|
1033
1053
|
outColor = acc;
|
|
1034
1054
|
}
|
|
1035
|
-
`,
|
|
1055
|
+
`, Et = `${Q}${bt}
|
|
1036
1056
|
layout(location = 0) in vec2 a_corner;
|
|
1037
1057
|
layout(location = 1) in vec4 a_geom; // x, y, r, width (world)
|
|
1038
1058
|
layout(location = 2) in vec4 a_color;
|
|
@@ -1052,7 +1072,7 @@ void main() {
|
|
|
1052
1072
|
v_dash = a_dash;
|
|
1053
1073
|
gl_Position = toClip(pos);
|
|
1054
1074
|
}
|
|
1055
|
-
`,
|
|
1075
|
+
`, Dt = `${Q}${xt}
|
|
1056
1076
|
in vec2 v_local;
|
|
1057
1077
|
flat in vec4 v_geom;
|
|
1058
1078
|
flat in vec4 v_color;
|
|
@@ -1067,7 +1087,7 @@ void main() {
|
|
|
1067
1087
|
cover *= coverDash(arc, v_dash.x, v_dash.y, pix / zoom);
|
|
1068
1088
|
outColor = vec4(v_color.rgb * v_color.a, v_color.a) * cover;
|
|
1069
1089
|
}
|
|
1070
|
-
`,
|
|
1090
|
+
`, Ot = `${Q}${bt}
|
|
1071
1091
|
layout(location = 0) in vec2 a_corner;
|
|
1072
1092
|
layout(location = 1) in vec4 a_geom; // x, y, r (world), alpha
|
|
1073
1093
|
layout(location = 2) in vec4 a_color; // r, g, b (0..1), glow (px)
|
|
@@ -1095,7 +1115,7 @@ void main() {
|
|
|
1095
1115
|
v_kind = a_kind;
|
|
1096
1116
|
gl_Position = toClip(centre + v_local);
|
|
1097
1117
|
}
|
|
1098
|
-
`,
|
|
1118
|
+
`, kt = `${Q}${xt}
|
|
1099
1119
|
in vec2 v_local;
|
|
1100
1120
|
flat in vec4 v_geom;
|
|
1101
1121
|
flat in vec4 v_color;
|
|
@@ -1148,15 +1168,26 @@ void main() {
|
|
|
1148
1168
|
over(acc, ring.rgb, ring.a * al * coverBand(abs(len - (rw + u_haloGeom[halo].y) * zoom), u_haloGeom[halo].z * zoom * 0.5, pix));
|
|
1149
1169
|
}
|
|
1150
1170
|
|
|
1151
|
-
// Glow: a blurred copy of the disc under it (see glowDisc)
|
|
1152
|
-
float glow = v_color.w;
|
|
1153
|
-
if (glow > 0.0) over(acc, v_color.rgb, v_kind.z * al * glowDisc(len, R, glow * 0.5 / u_dpr));
|
|
1154
|
-
|
|
1155
|
-
// The silhouette, and its white core unless the type's glyph is drawn there (glyphs.js: the icon pass draws it once the node is wide enough)
|
|
1156
1171
|
int shapeCode = int(v_kind.w + 0.5);
|
|
1157
1172
|
bool glyph = shapeCode >= 8;
|
|
1158
1173
|
if (glyph) shapeCode -= 8;
|
|
1159
|
-
|
|
1174
|
+
float shapeCover = coverEdge(sdShape(v_local, R, shapeCode, len), pix); // how much of this pixel the silhouette covers
|
|
1175
|
+
|
|
1176
|
+
// Glow: a blurred copy of the disc under it (see glowDisc), then the silhouette. An opaque fill hides the glow under it: drawn as it always was.
|
|
1177
|
+
// Under a translucent fill the glow is left out, so the fill alone sets what is seen through it, as renderer-canvas2d.js drawNode does (a clip).
|
|
1178
|
+
// Glow and fill are the same colour, so that is ONE layer: the fill in the part of the pixel the silhouette covers, the glow in the rest. Two
|
|
1179
|
+
// layers (the glow times 1 - cover, then the fill times cover) would let the ground through both at the edge: a dark line round a square or a
|
|
1180
|
+
// diamond, whose sides lie inside the glow's disc
|
|
1181
|
+
float glow = v_color.w;
|
|
1182
|
+
if (v_kind.z < 1.0) {
|
|
1183
|
+
float soft = glow > 0.0 ? glowDisc(len, R, glow * 0.5 / u_dpr) : 0.0;
|
|
1184
|
+
over(acc, v_color.rgb, v_kind.z * al * mix(soft, 1.0, shapeCover));
|
|
1185
|
+
} else {
|
|
1186
|
+
if (glow > 0.0) over(acc, v_color.rgb, v_kind.z * al * glowDisc(len, R, glow * 0.5 / u_dpr));
|
|
1187
|
+
over(acc, v_color.rgb, v_kind.z * al * shapeCover);
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// The white core unless the type's glyph is drawn there (glyphs.js: the icon pass draws it once the node is wide enough)
|
|
1160
1191
|
if (!glyph || 2.0 * R < u_glyphMin) over(acc, u_core.rgb, u_core.a * al * coverEdge(len - R * u_coreRatio, pix));
|
|
1161
1192
|
|
|
1162
1193
|
// Mark: a ring with the look of its own mark (dashed when its dash is set: added), and for removed a
|
|
@@ -1185,7 +1216,7 @@ void main() {
|
|
|
1185
1216
|
|
|
1186
1217
|
outColor = acc;
|
|
1187
1218
|
}
|
|
1188
|
-
`,
|
|
1219
|
+
`, At = "\nvec2 bez(vec2 a, vec2 c, vec2 b, float t) {\n float u = 1.0 - t;\n return u * u * a + 2.0 * u * t * c + t * t * b;\n}\nvec2 bezD(vec2 a, vec2 c, vec2 b, float t) {\n return 2.0 * (1.0 - t) * (c - a) + 2.0 * t * (b - c);\n}\n// Arc length from 0 to t, in world units (midpoint rule, 8 steps: the speed is smooth)\nfloat bezArc(vec2 a, vec2 c, vec2 b, float t) {\n float sum = 0.0;\n for (int j = 0; j < 8; j++) sum += length(bezD(a, c, b, (float(j) + 0.5) * t / 8.0));\n return sum * t / 8.0;\n}\n", jt = "\nvec2 packetPos(vec4 ends, vec4 mot, float timeSec) {\n float k = fract(timeSec * mot.z + mot.w);\n return bez(ends.xy, mot.xy, ends.zw, k);\n}\n", Mt = (e) => `${Q}${At}
|
|
1189
1220
|
#define SEGS ${e}
|
|
1190
1221
|
layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
|
|
1191
1222
|
layout(location = 2) in vec4 a_geom; // control x, y (world), width (world), glow blur (px)
|
|
@@ -1227,7 +1258,7 @@ void main() {
|
|
|
1227
1258
|
v_dash = a_dash;
|
|
1228
1259
|
gl_Position = vec4(pos.x / u_viewport.x * 2.0 - 1.0, 1.0 - pos.y / u_viewport.y * 2.0, 0.0, 1.0);
|
|
1229
1260
|
}
|
|
1230
|
-
`,
|
|
1261
|
+
`, Nt = `${Q}${xt}
|
|
1231
1262
|
in float v_across;
|
|
1232
1263
|
in float v_arc;
|
|
1233
1264
|
flat in float v_len;
|
|
@@ -1277,7 +1308,7 @@ void main() {
|
|
|
1277
1308
|
over(acc, v_color.rgb, v_color.a * cover);
|
|
1278
1309
|
outColor = acc;
|
|
1279
1310
|
}
|
|
1280
|
-
`,
|
|
1311
|
+
`, Pt = `${Q}${bt}
|
|
1281
1312
|
layout(location = 0) in vec2 a_corner;
|
|
1282
1313
|
layout(location = 1) in vec4 a_tip; // x, y (world), direction x, y (unit)
|
|
1283
1314
|
layout(location = 2) in vec4 a_color;
|
|
@@ -1297,7 +1328,7 @@ void main() {
|
|
|
1297
1328
|
v_kind = a_kind;
|
|
1298
1329
|
gl_Position = toClip(u_cam.xy + a_tip.xy * zoom + off);
|
|
1299
1330
|
}
|
|
1300
|
-
`,
|
|
1331
|
+
`, Ft = `${Q}${xt}
|
|
1301
1332
|
in vec2 v_local;
|
|
1302
1333
|
flat in vec4 v_color;
|
|
1303
1334
|
flat in float v_kind;
|
|
@@ -1353,7 +1384,7 @@ void main() {
|
|
|
1353
1384
|
}
|
|
1354
1385
|
outColor = vec4(v_color.rgb * v_color.a, v_color.a) * coverEdge(sd, pix);
|
|
1355
1386
|
}
|
|
1356
|
-
`,
|
|
1387
|
+
`, It = `${Q}${bt}${At}${jt}
|
|
1357
1388
|
layout(location = 0) in vec2 a_corner;
|
|
1358
1389
|
layout(location = 1) in vec4 a_ends; // x1, y1, x2, y2 (world)
|
|
1359
1390
|
layout(location = 2) in vec4 a_mot; // control x, y (world), speed (trips per second), phase
|
|
@@ -1374,7 +1405,7 @@ void main() {
|
|
|
1374
1405
|
v_glow = a_glow;
|
|
1375
1406
|
gl_Position = toClip(centre + v_local);
|
|
1376
1407
|
}
|
|
1377
|
-
`,
|
|
1408
|
+
`, Lt = `${Q}${xt}
|
|
1378
1409
|
in vec2 v_local;
|
|
1379
1410
|
flat in vec4 v_size;
|
|
1380
1411
|
flat in vec4 v_color;
|
|
@@ -1389,7 +1420,7 @@ void main() {
|
|
|
1389
1420
|
over(acc, v_color.rgb, v_color.a * coverEdge(len - R, pix));
|
|
1390
1421
|
outColor = acc;
|
|
1391
1422
|
}
|
|
1392
|
-
`,
|
|
1423
|
+
`, Rt = `${Q}${bt}
|
|
1393
1424
|
layout(location = 0) in vec2 a_corner;
|
|
1394
1425
|
layout(location = 1) in vec4 a_geom; // x, y, side (world), alpha
|
|
1395
1426
|
uniform float u_minR; // letters and glyphs: the least on-screen radius (px) of a node that shows them; 0 for a theme's icon
|
|
@@ -1404,7 +1435,7 @@ void main() {
|
|
|
1404
1435
|
v_alpha = a_geom.w;
|
|
1405
1436
|
gl_Position = toClip(pos);
|
|
1406
1437
|
}
|
|
1407
|
-
`,
|
|
1438
|
+
`, zt = `${Q}
|
|
1408
1439
|
uniform sampler2D u_tex;
|
|
1409
1440
|
in vec2 v_uv;
|
|
1410
1441
|
flat in float v_alpha;
|
|
@@ -1412,34 +1443,34 @@ out vec4 outColor;
|
|
|
1412
1443
|
void main() {
|
|
1413
1444
|
outColor = texture(u_tex, v_uv) * v_alpha; // the texture is uploaded premultiplied
|
|
1414
1445
|
}
|
|
1415
|
-
`,
|
|
1446
|
+
`, Bt = {
|
|
1416
1447
|
none: 0,
|
|
1417
1448
|
selected: 1,
|
|
1418
1449
|
match: 2,
|
|
1419
1450
|
child: 3
|
|
1420
|
-
},
|
|
1451
|
+
}, Vt = {
|
|
1421
1452
|
arrow: 1,
|
|
1422
1453
|
strike: 2,
|
|
1423
1454
|
chevron: 3,
|
|
1424
1455
|
bar: 4,
|
|
1425
1456
|
diamond: 5,
|
|
1426
1457
|
tick: 6
|
|
1427
|
-
},
|
|
1458
|
+
}, Ht = Object.freeze(Object.fromEntries(b.map((e, t) => [e, t]))), Ut = {
|
|
1428
1459
|
none: 0,
|
|
1429
1460
|
added: 1,
|
|
1430
1461
|
changed: 2,
|
|
1431
1462
|
removed: 3,
|
|
1432
1463
|
edit: 4
|
|
1433
1464
|
}, $ = (e) => {
|
|
1434
|
-
let [t, n, r, i] =
|
|
1465
|
+
let [t, n, r, i] = R(e);
|
|
1435
1466
|
return [
|
|
1436
1467
|
t / 255,
|
|
1437
1468
|
n / 255,
|
|
1438
1469
|
r / 255,
|
|
1439
1470
|
i
|
|
1440
1471
|
];
|
|
1441
|
-
},
|
|
1442
|
-
function
|
|
1472
|
+
}, Wt = (e, t) => Object.hasOwn(e, t) ? e[t] : 0;
|
|
1473
|
+
function Gt(e) {
|
|
1443
1474
|
let { nodes: t } = e, n = new Float32Array(t.length * 12);
|
|
1444
1475
|
return t.forEach((e, t) => {
|
|
1445
1476
|
let [r, i, a, o] = $(e.color);
|
|
@@ -1452,10 +1483,10 @@ function Ht(e) {
|
|
|
1452
1483
|
i,
|
|
1453
1484
|
a,
|
|
1454
1485
|
e.glow || 0,
|
|
1455
|
-
|
|
1456
|
-
|
|
1486
|
+
Wt(Bt, e.halo),
|
|
1487
|
+
Wt(Ut, e.mark),
|
|
1457
1488
|
o,
|
|
1458
|
-
|
|
1489
|
+
Wt(Ht, e.shape) + (e.glyph && !e.icon && !e.letters ? 8 : 0)
|
|
1459
1490
|
], t * 12);
|
|
1460
1491
|
}), {
|
|
1461
1492
|
data: n,
|
|
@@ -1463,7 +1494,7 @@ function Ht(e) {
|
|
|
1463
1494
|
stride: 12
|
|
1464
1495
|
};
|
|
1465
1496
|
}
|
|
1466
|
-
function
|
|
1497
|
+
function Kt(e) {
|
|
1467
1498
|
let { grid: t, rings: n, lanes: r } = e.decor, i = new Float32Array(t ? 8 : 0);
|
|
1468
1499
|
t && i.set([
|
|
1469
1500
|
t.size,
|
|
@@ -1515,7 +1546,7 @@ function Ut(e) {
|
|
|
1515
1546
|
}
|
|
1516
1547
|
};
|
|
1517
1548
|
}
|
|
1518
|
-
function
|
|
1549
|
+
function qt(e) {
|
|
1519
1550
|
let t = {
|
|
1520
1551
|
straight: [],
|
|
1521
1552
|
curved: [],
|
|
@@ -1550,7 +1581,7 @@ function Wt(e) {
|
|
|
1550
1581
|
l,
|
|
1551
1582
|
_
|
|
1552
1583
|
]), e.arrow) {
|
|
1553
|
-
let a = Math.atan2(e.y2 - (e.curve ? e.curve.cy : e.y1), e.x2 - (e.curve ? e.curve.cx : e.x1)), o = e.end && e.end !== "triangle" && Vt
|
|
1584
|
+
let a = Math.atan2(e.y2 - (e.curve ? e.curve.cy : e.y1), e.x2 - (e.curve ? e.curve.cx : e.x1)), o = e.end && e.end !== "triangle" && Wt(Vt, e.end) || Vt.arrow;
|
|
1554
1585
|
t.tips.push([
|
|
1555
1586
|
e.x2,
|
|
1556
1587
|
e.y2,
|
|
@@ -1564,9 +1595,9 @@ function Wt(e) {
|
|
|
1564
1595
|
]);
|
|
1565
1596
|
}
|
|
1566
1597
|
if (e.ticks) {
|
|
1567
|
-
let a =
|
|
1598
|
+
let a = y(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
|
|
1568
1599
|
for (let o = 0; o < e.ticks; o++) {
|
|
1569
|
-
let u = (o - (e.ticks - 1) / 2) *
|
|
1600
|
+
let u = (o - (e.ticks - 1) / 2) * V.tickGap;
|
|
1570
1601
|
t.tips.push([
|
|
1571
1602
|
a.x + c * u,
|
|
1572
1603
|
a.y + l * u,
|
|
@@ -1576,12 +1607,12 @@ function Wt(e) {
|
|
|
1576
1607
|
r,
|
|
1577
1608
|
i,
|
|
1578
1609
|
s,
|
|
1579
|
-
|
|
1610
|
+
Vt.tick
|
|
1580
1611
|
]);
|
|
1581
1612
|
}
|
|
1582
1613
|
}
|
|
1583
1614
|
if (e.mark === "removed") {
|
|
1584
|
-
let a =
|
|
1615
|
+
let a = y(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
|
|
1585
1616
|
t.tips.push([
|
|
1586
1617
|
a.x,
|
|
1587
1618
|
a.y,
|
|
@@ -1591,7 +1622,7 @@ function Wt(e) {
|
|
|
1591
1622
|
r,
|
|
1592
1623
|
i,
|
|
1593
1624
|
s,
|
|
1594
|
-
|
|
1625
|
+
Vt.strike
|
|
1595
1626
|
]);
|
|
1596
1627
|
}
|
|
1597
1628
|
if (e.packet) {
|
|
@@ -1633,12 +1664,12 @@ function Wt(e) {
|
|
|
1633
1664
|
packets: n(t.packets, 18)
|
|
1634
1665
|
};
|
|
1635
1666
|
}
|
|
1636
|
-
var
|
|
1637
|
-
...
|
|
1638
|
-
nodes:
|
|
1639
|
-
...
|
|
1667
|
+
var Jt = (e) => ({
|
|
1668
|
+
...Kt(e),
|
|
1669
|
+
nodes: Gt(e),
|
|
1670
|
+
...qt(e)
|
|
1640
1671
|
});
|
|
1641
|
-
function
|
|
1672
|
+
function Yt(e) {
|
|
1642
1673
|
let t = [];
|
|
1643
1674
|
e.nodes.forEach((e) => {
|
|
1644
1675
|
if (!e.stroke) return;
|
|
@@ -1663,27 +1694,27 @@ function Kt(e) {
|
|
|
1663
1694
|
stride: 10
|
|
1664
1695
|
};
|
|
1665
1696
|
}
|
|
1666
|
-
function
|
|
1697
|
+
function Xt(e, t, n = null) {
|
|
1667
1698
|
let r = /* @__PURE__ */ new Map();
|
|
1668
|
-
e.nodes.forEach((
|
|
1669
|
-
let
|
|
1670
|
-
if (!
|
|
1671
|
-
let r =
|
|
1672
|
-
t(r) && (
|
|
1699
|
+
e.nodes.forEach((i) => {
|
|
1700
|
+
let a = i.icon && t(i.icon) ? i.icon : null, o = i.r * G;
|
|
1701
|
+
if (!a && !i.icon && i.letters && t(de(i.letters)) && (a = de(i.letters), o = i.r * 1), !a && !i.icon && !i.letters && i.glyph) {
|
|
1702
|
+
let r = re(i.glyph, u(i, n, e.theme));
|
|
1703
|
+
t(r) && (a = r, o = i.r * c);
|
|
1673
1704
|
}
|
|
1674
|
-
if (!
|
|
1675
|
-
r.has(
|
|
1705
|
+
if (!a) return;
|
|
1706
|
+
r.has(a) || r.set(a, {
|
|
1676
1707
|
rows: [],
|
|
1677
1708
|
minR: Infinity,
|
|
1678
1709
|
maxR: 0
|
|
1679
1710
|
});
|
|
1680
|
-
let
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
]),
|
|
1711
|
+
let s = r.get(a);
|
|
1712
|
+
s.maxR = Math.max(s.maxR, i.r), s.rows.push([
|
|
1713
|
+
i.x,
|
|
1714
|
+
i.y,
|
|
1715
|
+
o,
|
|
1716
|
+
i.alpha
|
|
1717
|
+
]), s.minR = Math.min(s.minR, i.r);
|
|
1687
1718
|
});
|
|
1688
1719
|
let i = [], a = [];
|
|
1689
1720
|
for (let [e, { rows: t, minR: n, maxR: o }] of r) i.push({
|
|
@@ -1701,49 +1732,49 @@ function qt(e, t, n = null) {
|
|
|
1701
1732
|
groups: i
|
|
1702
1733
|
};
|
|
1703
1734
|
}
|
|
1704
|
-
function
|
|
1705
|
-
let { halo:
|
|
1706
|
-
Object.entries(
|
|
1707
|
-
let
|
|
1708
|
-
t &&
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1735
|
+
function Zt(e = "dark", t = null) {
|
|
1736
|
+
let { halo: n, mark: r, core: i } = t ? M(z(e), t) : z(e), a = /* @__PURE__ */ new Float32Array(16), o = /* @__PURE__ */ new Float32Array(16), s = /* @__PURE__ */ new Float32Array(16);
|
|
1737
|
+
Object.entries(Bt).forEach(([e, t]) => {
|
|
1738
|
+
let r = n[e];
|
|
1739
|
+
t && r && (a.set($(r.fill), t * 4), o.set($(r.ring), t * 4), s.set([
|
|
1740
|
+
r.fillR,
|
|
1741
|
+
r.ringR,
|
|
1742
|
+
r.ringWidth,
|
|
1712
1743
|
0
|
|
1713
1744
|
], t * 4));
|
|
1714
1745
|
});
|
|
1715
|
-
let
|
|
1716
|
-
return Object.entries(
|
|
1746
|
+
let c = /* @__PURE__ */ new Float32Array(20), l = /* @__PURE__ */ new Float32Array(20);
|
|
1747
|
+
return Object.entries(Ut).forEach(([e, t]) => {
|
|
1717
1748
|
if (!t) return;
|
|
1718
|
-
let n =
|
|
1719
|
-
|
|
1720
|
-
let [
|
|
1721
|
-
|
|
1749
|
+
let n = r[e];
|
|
1750
|
+
c.set($(n.color), t * 4);
|
|
1751
|
+
let [i, a] = n.ringDash || [0, 0];
|
|
1752
|
+
l.set([
|
|
1722
1753
|
n.ringR,
|
|
1723
1754
|
n.ringWidth,
|
|
1724
|
-
|
|
1755
|
+
i,
|
|
1725
1756
|
a
|
|
1726
1757
|
], t * 4);
|
|
1727
1758
|
}), {
|
|
1728
|
-
haloFill:
|
|
1729
|
-
haloRing:
|
|
1730
|
-
haloGeom:
|
|
1731
|
-
markColor:
|
|
1732
|
-
markGeom:
|
|
1759
|
+
haloFill: a,
|
|
1760
|
+
haloRing: o,
|
|
1761
|
+
haloGeom: s,
|
|
1762
|
+
markColor: c,
|
|
1763
|
+
markGeom: l,
|
|
1733
1764
|
markMin: new Float32Array([
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1765
|
+
q.ring,
|
|
1766
|
+
q.edge,
|
|
1767
|
+
q.gap
|
|
1737
1768
|
]),
|
|
1738
|
-
core: new Float32Array($(
|
|
1739
|
-
coreRatio:
|
|
1769
|
+
core: new Float32Array($(i)),
|
|
1770
|
+
coreRatio: F
|
|
1740
1771
|
};
|
|
1741
1772
|
}
|
|
1742
|
-
var
|
|
1773
|
+
var Qt = [
|
|
1743
1774
|
{
|
|
1744
1775
|
name: "grid",
|
|
1745
|
-
vert:
|
|
1746
|
-
frag:
|
|
1776
|
+
vert: St,
|
|
1777
|
+
frag: Ct,
|
|
1747
1778
|
stride: 8,
|
|
1748
1779
|
attribs: [[
|
|
1749
1780
|
1,
|
|
@@ -1757,8 +1788,8 @@ var Yt = [
|
|
|
1757
1788
|
},
|
|
1758
1789
|
{
|
|
1759
1790
|
name: "lanes",
|
|
1760
|
-
vert:
|
|
1761
|
-
frag:
|
|
1791
|
+
vert: wt,
|
|
1792
|
+
frag: Tt,
|
|
1762
1793
|
stride: 14,
|
|
1763
1794
|
attribs: [
|
|
1764
1795
|
[
|
|
@@ -1785,8 +1816,8 @@ var Yt = [
|
|
|
1785
1816
|
},
|
|
1786
1817
|
{
|
|
1787
1818
|
name: "rings",
|
|
1788
|
-
vert:
|
|
1789
|
-
frag:
|
|
1819
|
+
vert: Et,
|
|
1820
|
+
frag: Dt,
|
|
1790
1821
|
stride: 10,
|
|
1791
1822
|
attribs: [
|
|
1792
1823
|
[
|
|
@@ -1808,8 +1839,8 @@ var Yt = [
|
|
|
1808
1839
|
},
|
|
1809
1840
|
{
|
|
1810
1841
|
name: "straight",
|
|
1811
|
-
vert:
|
|
1812
|
-
frag:
|
|
1842
|
+
vert: Mt(1),
|
|
1843
|
+
frag: Nt,
|
|
1813
1844
|
stride: 19,
|
|
1814
1845
|
verts: 8,
|
|
1815
1846
|
attribs: [
|
|
@@ -1848,8 +1879,8 @@ var Yt = [
|
|
|
1848
1879
|
},
|
|
1849
1880
|
{
|
|
1850
1881
|
name: "curved",
|
|
1851
|
-
vert:
|
|
1852
|
-
frag:
|
|
1882
|
+
vert: Mt(24),
|
|
1883
|
+
frag: Nt,
|
|
1853
1884
|
stride: 19,
|
|
1854
1885
|
verts: 54,
|
|
1855
1886
|
attribs: [
|
|
@@ -1888,8 +1919,8 @@ var Yt = [
|
|
|
1888
1919
|
},
|
|
1889
1920
|
{
|
|
1890
1921
|
name: "tips",
|
|
1891
|
-
vert:
|
|
1892
|
-
frag:
|
|
1922
|
+
vert: Pt,
|
|
1923
|
+
frag: Ft,
|
|
1893
1924
|
stride: 9,
|
|
1894
1925
|
attribs: [
|
|
1895
1926
|
[
|
|
@@ -1912,8 +1943,8 @@ var Yt = [
|
|
|
1912
1943
|
},
|
|
1913
1944
|
{
|
|
1914
1945
|
name: "packets",
|
|
1915
|
-
vert:
|
|
1916
|
-
frag:
|
|
1946
|
+
vert: It,
|
|
1947
|
+
frag: Lt,
|
|
1917
1948
|
stride: 18,
|
|
1918
1949
|
attribs: [
|
|
1919
1950
|
[
|
|
@@ -1946,8 +1977,8 @@ var Yt = [
|
|
|
1946
1977
|
},
|
|
1947
1978
|
{
|
|
1948
1979
|
name: "nodes",
|
|
1949
|
-
vert:
|
|
1950
|
-
frag:
|
|
1980
|
+
vert: Ot,
|
|
1981
|
+
frag: kt,
|
|
1951
1982
|
stride: 12,
|
|
1952
1983
|
attribs: [
|
|
1953
1984
|
[
|
|
@@ -1968,17 +1999,17 @@ var Yt = [
|
|
|
1968
1999
|
],
|
|
1969
2000
|
constants: "nodes"
|
|
1970
2001
|
}
|
|
1971
|
-
],
|
|
2002
|
+
], $t = {
|
|
1972
2003
|
nodes(e, t, n) {
|
|
1973
|
-
e.uniform4fv(t("u_haloFill"), n.haloFill), e.uniform4fv(t("u_haloRing"), n.haloRing), e.uniform4fv(t("u_haloGeom"), n.haloGeom), e.uniform4fv(t("u_markColor"), n.markColor), e.uniform4fv(t("u_markGeom"), n.markGeom), e.uniform3fv(t("u_markMin"), n.markMin), e.uniform4fv(t("u_core"), n.core), e.uniform1f(t("u_coreRatio"), n.coreRatio), e.uniform4f(t("u_shape"),
|
|
2004
|
+
e.uniform4fv(t("u_haloFill"), n.haloFill), e.uniform4fv(t("u_haloRing"), n.haloRing), e.uniform4fv(t("u_haloGeom"), n.haloGeom), e.uniform4fv(t("u_markColor"), n.markColor), e.uniform4fv(t("u_markGeom"), n.markGeom), e.uniform3fv(t("u_markMin"), n.markMin), e.uniform4fv(t("u_core"), n.core), e.uniform1f(t("u_coreRatio"), n.coreRatio), e.uniform4f(t("u_shape"), J.roundedHalf, J.roundedCorner, J.hexInradius, J.squareHalf), e.uniform2f(t("u_shape2"), J.squareCorner, J.diamondHalf), e.uniform1f(t("u_glyphMin"), 14);
|
|
1974
2005
|
},
|
|
1975
2006
|
edges(e, t, n) {
|
|
1976
2007
|
e.uniform3fv(t("u_markMin"), n.markMin);
|
|
1977
2008
|
},
|
|
1978
2009
|
tips(e, t) {
|
|
1979
|
-
e.uniform4f(t("u_tip"),
|
|
2010
|
+
e.uniform4f(t("u_tip"), N.length, N.spread, W.halfLength, W.width), e.uniform4f(t("u_end"), V.strokeWidth, V.barHalf, V.diamondHalf, V.diamondAcross), e.uniform2f(t("u_tick"), V.tickHalf, V.tickWidth);
|
|
1980
2011
|
}
|
|
1981
|
-
},
|
|
2012
|
+
}, en = {
|
|
1982
2013
|
alpha: !0,
|
|
1983
2014
|
premultipliedAlpha: !0,
|
|
1984
2015
|
antialias: !1,
|
|
@@ -1987,7 +2018,7 @@ var Yt = [
|
|
|
1987
2018
|
preserveDrawingBuffer: !1,
|
|
1988
2019
|
powerPreference: "high-performance"
|
|
1989
2020
|
};
|
|
1990
|
-
function
|
|
2021
|
+
function tn(e, t, n, r) {
|
|
1991
2022
|
let i = e.createShader(t);
|
|
1992
2023
|
if (e.shaderSource(i, n), e.compileShader(i), !e.getShaderParameter(i, e.COMPILE_STATUS)) {
|
|
1993
2024
|
let t = e.getShaderInfoLog(i);
|
|
@@ -1995,23 +2026,23 @@ function Qt(e, t, n, r) {
|
|
|
1995
2026
|
}
|
|
1996
2027
|
return i;
|
|
1997
2028
|
}
|
|
1998
|
-
function
|
|
1999
|
-
let i =
|
|
2029
|
+
function nn(e, t, n, r) {
|
|
2030
|
+
let i = tn(e, e.VERTEX_SHADER, t, `${r} vertex`), a = tn(e, e.FRAGMENT_SHADER, n, `${r} fragment`), o = e.createProgram();
|
|
2000
2031
|
if (e.attachShader(o, i), e.attachShader(o, a), e.linkProgram(o), e.deleteShader(i), e.deleteShader(a), !e.getProgramParameter(o, e.LINK_STATUS)) {
|
|
2001
2032
|
let t = e.getProgramInfoLog(o);
|
|
2002
2033
|
throw e.deleteProgram(o), Error(`${r} program did not link: ${t}`);
|
|
2003
2034
|
}
|
|
2004
2035
|
return o;
|
|
2005
2036
|
}
|
|
2006
|
-
var
|
|
2007
|
-
function
|
|
2008
|
-
let i =
|
|
2037
|
+
var rn = (e) => !e || e.plain ? 0 : e.version;
|
|
2038
|
+
function an(e, t, n, r = null) {
|
|
2039
|
+
let i = Zt(n, r);
|
|
2009
2040
|
t.passes.forEach((t) => {
|
|
2010
|
-
t.spec.constants && (e.useProgram(t.program),
|
|
2011
|
-
}), t.theme = n, t.styleKey =
|
|
2041
|
+
t.spec.constants && (e.useProgram(t.program), $t[t.spec.constants](e, t.at, i));
|
|
2042
|
+
}), t.theme = n, t.styleKey = rn(r);
|
|
2012
2043
|
}
|
|
2013
|
-
function
|
|
2014
|
-
let r =
|
|
2044
|
+
function on(e, t, n) {
|
|
2045
|
+
let r = nn(e, t.vert, t.frag, t.name), i = e.createVertexArray(), a = e.createBuffer();
|
|
2015
2046
|
e.bindVertexArray(i), t.verts || (e.bindBuffer(e.ARRAY_BUFFER, n), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 2, e.FLOAT, !1, 0, 0), e.vertexAttribDivisor(0, 0)), e.bindBuffer(e.ARRAY_BUFFER, a), t.attribs.forEach(([n, r, i]) => {
|
|
2016
2047
|
e.enableVertexAttribArray(n), e.vertexAttribPointer(n, r, e.FLOAT, !1, t.stride * 4, i * 4), e.vertexAttribDivisor(n, 1);
|
|
2017
2048
|
}), e.bindVertexArray(null);
|
|
@@ -2031,11 +2062,11 @@ function nn(e, t, n) {
|
|
|
2031
2062
|
}
|
|
2032
2063
|
};
|
|
2033
2064
|
}
|
|
2034
|
-
var
|
|
2065
|
+
var sn = {
|
|
2035
2066
|
strokes: {
|
|
2036
2067
|
name: "strokes",
|
|
2037
|
-
vert:
|
|
2038
|
-
frag:
|
|
2068
|
+
vert: Et,
|
|
2069
|
+
frag: Dt,
|
|
2039
2070
|
stride: 10,
|
|
2040
2071
|
attribs: [
|
|
2041
2072
|
[
|
|
@@ -2057,8 +2088,8 @@ var rn = {
|
|
|
2057
2088
|
},
|
|
2058
2089
|
icons: {
|
|
2059
2090
|
name: "icons",
|
|
2060
|
-
vert:
|
|
2061
|
-
frag:
|
|
2091
|
+
vert: Rt,
|
|
2092
|
+
frag: zt,
|
|
2062
2093
|
stride: 4,
|
|
2063
2094
|
attribs: [[
|
|
2064
2095
|
1,
|
|
@@ -2067,7 +2098,7 @@ var rn = {
|
|
|
2067
2098
|
]]
|
|
2068
2099
|
}
|
|
2069
2100
|
};
|
|
2070
|
-
function
|
|
2101
|
+
function cn(e, t = "dark", n = null) {
|
|
2071
2102
|
let r = e.createBuffer();
|
|
2072
2103
|
e.bindBuffer(e.ARRAY_BUFFER, r), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
2073
2104
|
-1,
|
|
@@ -2081,7 +2112,7 @@ function an(e, t = "dark", n = null) {
|
|
|
2081
2112
|
]), e.STATIC_DRAW);
|
|
2082
2113
|
let i = {
|
|
2083
2114
|
corners: r,
|
|
2084
|
-
passes:
|
|
2115
|
+
passes: Qt.map((t) => on(e, t, r)),
|
|
2085
2116
|
theme: t,
|
|
2086
2117
|
styleKey: 0,
|
|
2087
2118
|
extras: {
|
|
@@ -2091,40 +2122,40 @@ function an(e, t = "dark", n = null) {
|
|
|
2091
2122
|
textures: /* @__PURE__ */ new Map(),
|
|
2092
2123
|
iconStore: null
|
|
2093
2124
|
};
|
|
2094
|
-
return
|
|
2125
|
+
return an(e, i, t, n), i;
|
|
2095
2126
|
}
|
|
2096
|
-
function
|
|
2127
|
+
function ln(e, t) {
|
|
2097
2128
|
e.deleteBuffer(t.corners), t.textures.forEach(({ texture: t }) => e.deleteTexture(t)), [...t.passes, ...Object.values(t.extras).filter(Boolean)].forEach((t) => {
|
|
2098
2129
|
e.deleteProgram(t.program), e.deleteVertexArray(t.vao), e.deleteBuffer(t.buffer);
|
|
2099
2130
|
});
|
|
2100
2131
|
}
|
|
2101
|
-
function
|
|
2102
|
-
let n = t.gl || e.getContext("webgl2",
|
|
2132
|
+
function un(e, t = {}) {
|
|
2133
|
+
let n = t.gl || e.getContext("webgl2", en);
|
|
2103
2134
|
if (!n) throw Error("WebGL2 is not available");
|
|
2104
2135
|
let r = t.mapStyle || (() => L), i = {
|
|
2105
2136
|
uploads: 0,
|
|
2106
2137
|
draws: 0
|
|
2107
|
-
}, a =
|
|
2108
|
-
function
|
|
2109
|
-
return a.extras[e] || (a.extras[e] =
|
|
2138
|
+
}, a = cn(n), s = !1, u = 0, d = 0, f = null, p = null, m, h = null, g = null;
|
|
2139
|
+
function _(e) {
|
|
2140
|
+
return a.extras[e] || (a.extras[e] = on(n, sn[e], a.corners)), a.extras[e];
|
|
2110
2141
|
}
|
|
2111
|
-
function
|
|
2142
|
+
function v() {
|
|
2112
2143
|
a.passes.forEach((e) => {
|
|
2113
|
-
let t =
|
|
2144
|
+
let t = f[e.spec.name];
|
|
2114
2145
|
e.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, e.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
|
|
2115
2146
|
});
|
|
2116
|
-
for (let e of Object.keys(
|
|
2117
|
-
let t =
|
|
2147
|
+
for (let e of Object.keys(sn)) {
|
|
2148
|
+
let t = f[e];
|
|
2118
2149
|
if (!t.count && !a.extras[e]) continue;
|
|
2119
|
-
let r =
|
|
2150
|
+
let r = _(e);
|
|
2120
2151
|
r.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, r.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
|
|
2121
2152
|
}
|
|
2122
2153
|
i.uploads++;
|
|
2123
2154
|
}
|
|
2124
|
-
function
|
|
2155
|
+
function y(e, t) {
|
|
2125
2156
|
n.bindTexture(n.TEXTURE_2D, e), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, t ? n.NEAREST : n.LINEAR_MIPMAP_LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, t ? n.NEAREST : n.LINEAR);
|
|
2126
2157
|
}
|
|
2127
|
-
function
|
|
2158
|
+
function b(e, t, r) {
|
|
2128
2159
|
let i = a.textures.get(e);
|
|
2129
2160
|
if (!i || i.image !== t) {
|
|
2130
2161
|
i && n.deleteTexture(i.texture);
|
|
@@ -2135,90 +2166,90 @@ function sn(e, t = {}) {
|
|
|
2135
2166
|
pixelated: null
|
|
2136
2167
|
}, a.textures.set(e, i);
|
|
2137
2168
|
}
|
|
2138
|
-
return i.pixelated !== r && (
|
|
2169
|
+
return i.pixelated !== r && (y(i.texture, r), i.pixelated = r), i.texture;
|
|
2139
2170
|
}
|
|
2140
|
-
function
|
|
2141
|
-
if (
|
|
2171
|
+
function x(t, _, y) {
|
|
2172
|
+
if (g = [
|
|
2142
2173
|
t,
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
],
|
|
2146
|
-
let
|
|
2147
|
-
(a.iconStore !==
|
|
2148
|
-
...
|
|
2149
|
-
strokes:
|
|
2150
|
-
icons:
|
|
2151
|
-
},
|
|
2152
|
-
let
|
|
2153
|
-
(a.theme !==
|
|
2154
|
-
t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport,
|
|
2174
|
+
_,
|
|
2175
|
+
y
|
|
2176
|
+
], s || !a || !u || !d) return;
|
|
2177
|
+
let x = r(), S = ae(t, x), w = x.values ? x.values[H] : void 0;
|
|
2178
|
+
(a.iconStore !== x.icons || a.glyphInk !== w) && (a.textures.forEach(({ texture: e }) => n.deleteTexture(e)), a.textures.clear(), a.iconStore = x.icons, a.glyphInk = w, p = null), h !== x.ground && (h = x.ground, p = null), (S !== p || S.version !== m) && (f = {
|
|
2179
|
+
...Jt(S),
|
|
2180
|
+
strokes: Yt(S),
|
|
2181
|
+
icons: Xt(S, (e) => fe(e) ? !!ge(pe(e), w) : C(e) ? !!o(l(e).type, l(e).ink) : !!(x.icons && x.icons.get(e)), x)
|
|
2182
|
+
}, p = S, m = S.version, v());
|
|
2183
|
+
let T = S.theme || "dark";
|
|
2184
|
+
(a.theme !== T || a.styleKey !== rn(x)) && an(n, a, T, x), n.viewport(0, 0, e.width, e.height), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.enable(n.BLEND), n.blendFunc(n.ONE, n.ONE_MINUS_SRC_ALPHA), a.passes.forEach((t) => {
|
|
2185
|
+
t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport, u, d), n.uniform3f(t.uniforms.cam, _.x, _.y, _.zoom), n.uniform1f(t.uniforms.dpr, e.width / u), n.bindVertexArray(t.vao), t.uniforms.time && n.uniform1f(t.uniforms.time, (y || 0) / 1e3), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, t.spec.verts || 4, t.count), i.draws++);
|
|
2155
2186
|
});
|
|
2156
|
-
let
|
|
2157
|
-
|
|
2158
|
-
let
|
|
2159
|
-
if (
|
|
2160
|
-
n.useProgram(
|
|
2161
|
-
for (let e of
|
|
2162
|
-
let t =
|
|
2163
|
-
if (a && e.maxR * 2 *
|
|
2164
|
-
n.uniform1f(
|
|
2165
|
-
let
|
|
2166
|
-
|
|
2187
|
+
let E = a.extras.strokes;
|
|
2188
|
+
E && E.count && (n.useProgram(E.program), n.uniform2f(E.uniforms.viewport, u, d), n.uniform3f(E.uniforms.cam, _.x, _.y, _.zoom), n.uniform1f(E.uniforms.dpr, e.width / u), n.bindVertexArray(E.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, E.count), i.draws++);
|
|
2189
|
+
let D = a.extras.icons;
|
|
2190
|
+
if (D && D.count) {
|
|
2191
|
+
n.useProgram(D.program), n.uniform2f(D.uniforms.viewport, u, d), n.uniform3f(D.uniforms.cam, _.x, _.y, _.zoom), n.uniform1f(D.uniforms.dpr, e.width / u), n.uniform1i(D.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(D.vao), n.bindBuffer(n.ARRAY_BUFFER, D.buffer);
|
|
2192
|
+
for (let e of f.icons.groups) {
|
|
2193
|
+
let t = fe(e.kind), r = C(e.kind), a = t || r ? 14 : 0;
|
|
2194
|
+
if (a && e.maxR * 2 * _.zoom < a) continue;
|
|
2195
|
+
n.uniform1f(D.at("u_minR"), a / 2), n.uniform1f(D.at("u_sideRatio"), t ? 1 : r ? c : 1);
|
|
2196
|
+
let s = t ? ge(pe(e.kind), x.values && x.values["--corn-map-glyph"]) : r ? o(l(e.kind).type, l(e.kind).ink) : x.icons && x.icons.get(e.kind);
|
|
2197
|
+
s && (n.bindTexture(n.TEXTURE_2D, b(e.kind, s, !!x.pixelated && !t && !r)), n.vertexAttribPointer(1, 4, n.FLOAT, !1, 16, e.first * 4 * 4), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, e.count), i.draws++);
|
|
2167
2198
|
}
|
|
2168
2199
|
}
|
|
2169
2200
|
n.bindVertexArray(null);
|
|
2170
2201
|
}
|
|
2171
|
-
let
|
|
2172
|
-
e.preventDefault(),
|
|
2173
|
-
},
|
|
2202
|
+
let S = (e) => {
|
|
2203
|
+
e.preventDefault(), s = !0, a = null;
|
|
2204
|
+
}, w = () => {
|
|
2174
2205
|
try {
|
|
2175
|
-
a =
|
|
2206
|
+
a = cn(n, g && g[0].theme || "dark", r()), s = !1, f && v(), g && x(...g);
|
|
2176
2207
|
} catch (e) {
|
|
2177
2208
|
console.warn("WebGL2 context restored but the renderer could not be rebuilt:", e.message);
|
|
2178
2209
|
}
|
|
2179
2210
|
};
|
|
2180
|
-
return e.addEventListener("webglcontextlost",
|
|
2211
|
+
return e.addEventListener("webglcontextlost", S), e.addEventListener("webglcontextrestored", w), {
|
|
2181
2212
|
kind: "webgl2",
|
|
2182
2213
|
stats: i,
|
|
2183
2214
|
resize(t, n, r) {
|
|
2184
|
-
|
|
2215
|
+
u = t, d = n, e.width = Math.round(t * r), e.height = Math.round(n * r), g && x(...g);
|
|
2185
2216
|
},
|
|
2186
|
-
draw:
|
|
2187
|
-
destroy:
|
|
2217
|
+
draw: x,
|
|
2218
|
+
destroy: T,
|
|
2188
2219
|
release() {
|
|
2189
|
-
let e =
|
|
2190
|
-
|
|
2220
|
+
let e = s;
|
|
2221
|
+
T();
|
|
2191
2222
|
try {
|
|
2192
2223
|
let t = !e && n.getExtension ? n.getExtension("WEBGL_lose_context") : null;
|
|
2193
2224
|
t && t.loseContext();
|
|
2194
2225
|
} catch {}
|
|
2195
2226
|
}
|
|
2196
2227
|
};
|
|
2197
|
-
function
|
|
2198
|
-
e.removeEventListener("webglcontextlost",
|
|
2228
|
+
function T() {
|
|
2229
|
+
e.removeEventListener("webglcontextlost", S), e.removeEventListener("webglcontextrestored", w), a && !s && ln(n, a), a = null, s = !0;
|
|
2199
2230
|
}
|
|
2200
2231
|
}
|
|
2201
2232
|
// ../explorer/renderer.js
|
|
2202
|
-
function
|
|
2233
|
+
function dn(e) {
|
|
2203
2234
|
let t = e.ownerDocument.createElement("canvas");
|
|
2204
2235
|
return t.className = "hx-overlay", t.setAttribute("data-corn", "map-overlay"), t.setAttribute("part", "map-overlay"), t.setAttribute("aria-hidden", "true"), e.after(t), t;
|
|
2205
2236
|
}
|
|
2206
|
-
function
|
|
2237
|
+
function fn(e, t = {}) {
|
|
2207
2238
|
let n = t.prefer || null, r = t.mapStyle ? { mapStyle: t.mapStyle } : {};
|
|
2208
|
-
if (n === "canvas2d") return
|
|
2239
|
+
if (n === "canvas2d") return Fe(e, r);
|
|
2209
2240
|
let i = null;
|
|
2210
2241
|
try {
|
|
2211
|
-
i = e.getContext("webgl2",
|
|
2242
|
+
i = e.getContext("webgl2", en);
|
|
2212
2243
|
} catch {}
|
|
2213
|
-
if (!i) return
|
|
2244
|
+
if (!i) return Fe(e, r);
|
|
2214
2245
|
try {
|
|
2215
|
-
return
|
|
2246
|
+
return un(e, {
|
|
2216
2247
|
gl: i,
|
|
2217
2248
|
...r
|
|
2218
2249
|
});
|
|
2219
2250
|
} catch (n) {
|
|
2220
2251
|
console.warn(`WebGL2 renderer unavailable, drawing with Canvas 2D: ${n.message}`);
|
|
2221
|
-
let i = (t.makeStandIn ||
|
|
2252
|
+
let i = (t.makeStandIn || dn)(e), a = Fe(i, r);
|
|
2222
2253
|
return {
|
|
2223
2254
|
...a,
|
|
2224
2255
|
destroy() {
|
|
@@ -2228,7 +2259,7 @@ function ln(e, t = {}) {
|
|
|
2228
2259
|
}
|
|
2229
2260
|
}
|
|
2230
2261
|
// ../explorer/cluster.js
|
|
2231
|
-
function
|
|
2262
|
+
function pn(e, t) {
|
|
2232
2263
|
let n = /* @__PURE__ */ new Map();
|
|
2233
2264
|
for (let e of t) !e.kind && !e.dashed && e.from && e.to && (n.get(e.from) || n.set(e.from, []).get(e.from)).push(e.to);
|
|
2234
2265
|
let r = /* @__PURE__ */ new Set([e]), i = [e];
|
|
@@ -2236,19 +2267,19 @@ function un(e, t) {
|
|
|
2236
2267
|
return r;
|
|
2237
2268
|
}
|
|
2238
2269
|
// ../explorer/input.js
|
|
2239
|
-
function
|
|
2240
|
-
let { state:
|
|
2270
|
+
function mn(e) {
|
|
2271
|
+
let { state: t } = e, { render: r, getSpatialIndex: i, queueFrameWork: a, screenToWorld: o, getMinZoom: s, setHoverNode: c, labelNodeAt: l, fitGraphToViewport: u, fitPadding: d } = e.map, f = (t) => e.emit("select", t), p = () => e.emit("background"), m = () => e.emit("grab"), h = !1, g = null, _ = {
|
|
2241
2272
|
x: 0,
|
|
2242
2273
|
y: 0
|
|
2243
2274
|
}, y = {
|
|
2244
2275
|
x: 0,
|
|
2245
2276
|
y: 0
|
|
2246
|
-
}, b = !1, x = null, S = null, C = 0, w = null, T = !1, E = null, D = null, O = null, A = !1, j = "", M = () =>
|
|
2277
|
+
}, b = !1, x = null, S = null, C = 0, w = null, T = !1, E = null, D = null, O = null, A = !1, j = "", M = () => t.isFreeform && t.view === "orbit";
|
|
2247
2278
|
function N(e) {
|
|
2248
|
-
let
|
|
2279
|
+
let n = t.canvas.getBoundingClientRect(), r = e.touches ? e.touches[0] : e, i = n.width && t.width ? t.width / n.width : 1, a = n.height && t.height ? t.height / n.height : 1;
|
|
2249
2280
|
return {
|
|
2250
|
-
x: (r.clientX -
|
|
2251
|
-
y: (r.clientY -
|
|
2281
|
+
x: (r.clientX - n.left) * i,
|
|
2282
|
+
y: (r.clientY - n.top) * a
|
|
2252
2283
|
};
|
|
2253
2284
|
}
|
|
2254
2285
|
let P = {
|
|
@@ -2256,78 +2287,78 @@ function dn(e) {
|
|
|
2256
2287
|
size: -1,
|
|
2257
2288
|
map: null
|
|
2258
2289
|
};
|
|
2259
|
-
function
|
|
2260
|
-
return (P.nodes !==
|
|
2261
|
-
nodes:
|
|
2262
|
-
size:
|
|
2263
|
-
map: new Map(
|
|
2290
|
+
function ee(e) {
|
|
2291
|
+
return (P.nodes !== t.nodes || P.size !== t.nodes.length) && (P = {
|
|
2292
|
+
nodes: t.nodes,
|
|
2293
|
+
size: t.nodes.length,
|
|
2294
|
+
map: new Map(t.nodes.map((e) => [e.id, e]))
|
|
2264
2295
|
}), P.map.get(e) || null;
|
|
2265
2296
|
}
|
|
2266
|
-
function
|
|
2267
|
-
let a =
|
|
2268
|
-
return a ?
|
|
2297
|
+
function F(e, n, r) {
|
|
2298
|
+
let a = Re(i(), t.camera, e, n, r);
|
|
2299
|
+
return a ? ee(a.id) : null;
|
|
2269
2300
|
}
|
|
2270
|
-
let
|
|
2301
|
+
let I = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
|
|
2271
2302
|
function L(e) {
|
|
2272
|
-
let
|
|
2303
|
+
let n = t.canvas.getBoundingClientRect();
|
|
2273
2304
|
return {
|
|
2274
|
-
x: (e.touches[0].clientX + e.touches[1].clientX) / 2 -
|
|
2275
|
-
y: (e.touches[0].clientY + e.touches[1].clientY) / 2 -
|
|
2305
|
+
x: (e.touches[0].clientX + e.touches[1].clientX) / 2 - n.left,
|
|
2306
|
+
y: (e.touches[0].clientY + e.touches[1].clientY) / 2 - n.top
|
|
2276
2307
|
};
|
|
2277
2308
|
}
|
|
2278
2309
|
function R(e) {
|
|
2279
2310
|
if (T = !0, m(), c(null), e.touches && e.touches.length === 2) {
|
|
2280
|
-
w =
|
|
2311
|
+
w = n(t.camera, I(e), L(e)), E = null, h = !1, g = null, x = null;
|
|
2281
2312
|
return;
|
|
2282
2313
|
}
|
|
2283
|
-
let
|
|
2314
|
+
let r = !!(e.touches && e.touches.length > 0), i = N(e);
|
|
2284
2315
|
y = {
|
|
2285
|
-
x:
|
|
2286
|
-
y:
|
|
2287
|
-
}, b = !1, E = null, x =
|
|
2316
|
+
x: i.x,
|
|
2317
|
+
y: i.y
|
|
2318
|
+
}, b = !1, E = null, x = F(i.x, i.y, r), M() && x ? (g = x, e.cancelable && e.preventDefault()) : (h = !0, _ = i);
|
|
2288
2319
|
}
|
|
2289
2320
|
function z() {
|
|
2290
|
-
D && w && Object.assign(
|
|
2291
|
-
let
|
|
2292
|
-
if (E = null,
|
|
2321
|
+
D && w && Object.assign(t.camera, v(w, D.dist, D.mid, s())), D = null;
|
|
2322
|
+
let n = E;
|
|
2323
|
+
if (E = null, n) {
|
|
2293
2324
|
if (g && M()) {
|
|
2294
|
-
let
|
|
2295
|
-
g.x =
|
|
2296
|
-
x:
|
|
2297
|
-
y:
|
|
2298
|
-
}, e.touchScene(),
|
|
2299
|
-
} else h && (
|
|
2325
|
+
let r = o(n.x, n.y);
|
|
2326
|
+
g.x = r.x, g.y = r.y, t.freeformPositions[g.id] = {
|
|
2327
|
+
x: r.x,
|
|
2328
|
+
y: r.y
|
|
2329
|
+
}, e.touchScene(), K(e);
|
|
2330
|
+
} else h && (t.camera.x += n.x - _.x, t.camera.y += n.y - _.y, _ = n);
|
|
2300
2331
|
}
|
|
2301
2332
|
}
|
|
2302
|
-
function
|
|
2333
|
+
function B() {
|
|
2303
2334
|
let e = O;
|
|
2304
2335
|
if (O = null, !e || h || g) return;
|
|
2305
|
-
let t =
|
|
2306
|
-
|
|
2336
|
+
let t = F(e.x, e.y, !1);
|
|
2337
|
+
te(!!t), c(t ? t.id : null);
|
|
2307
2338
|
}
|
|
2308
|
-
function
|
|
2309
|
-
e !== A &&
|
|
2339
|
+
function te(e) {
|
|
2340
|
+
e !== A && t.canvas && (e && (j = t.canvas.style.cursor), A = e, t.canvas.style.cursor = e ? "pointer" : j);
|
|
2310
2341
|
}
|
|
2311
|
-
function
|
|
2342
|
+
function ne(e) {
|
|
2312
2343
|
if (e.touches && e.touches.length === 2 && w) {
|
|
2313
2344
|
e.cancelable && e.preventDefault(), D = {
|
|
2314
|
-
dist:
|
|
2345
|
+
dist: I(e),
|
|
2315
2346
|
mid: L(e)
|
|
2316
2347
|
}, a(z);
|
|
2317
2348
|
return;
|
|
2318
2349
|
}
|
|
2319
2350
|
let t = N(e);
|
|
2320
|
-
Math.hypot(t.x - y.x, t.y - y.y) > 8 && (b = !0), g && M() || h ? (e.cancelable && e.preventDefault(), E = t, a(z)) : e.touches || (O = t, a(
|
|
2351
|
+
Math.hypot(t.x - y.x, t.y - y.y) > 8 && (b = !0), g && M() || h ? (e.cancelable && e.preventDefault(), E = t, a(z)) : e.touches || (O = t, a(B, { draw: !1 }));
|
|
2321
2352
|
}
|
|
2322
|
-
function
|
|
2353
|
+
function V(e) {
|
|
2323
2354
|
z();
|
|
2324
|
-
let
|
|
2355
|
+
let n = !!(e.changedTouches && e.changedTouches.length > 0), r = t.canvas.getBoundingClientRect(), i = n ? {
|
|
2325
2356
|
x: e.changedTouches[0].clientX - r.left,
|
|
2326
2357
|
y: e.changedTouches[0].clientY - r.top
|
|
2327
2358
|
} : N(e);
|
|
2328
2359
|
if (!b && T) {
|
|
2329
2360
|
if (x) {
|
|
2330
|
-
let e =
|
|
2361
|
+
let e = F(i.x, i.y, n);
|
|
2331
2362
|
if (e && e.id === x.id) {
|
|
2332
2363
|
if (!M()) f(x);
|
|
2333
2364
|
else {
|
|
@@ -2336,71 +2367,71 @@ function dn(e) {
|
|
|
2336
2367
|
}
|
|
2337
2368
|
}
|
|
2338
2369
|
} else {
|
|
2339
|
-
let e =
|
|
2340
|
-
e && k.includes(e.type) && e.id !== "root" ? u(d(),
|
|
2370
|
+
let e = ee(l(i.x, i.y));
|
|
2371
|
+
e && k.includes(e.type) && e.id !== "root" ? u(d(), pn(e.id, t.edges)) : t.selectedNode && p();
|
|
2341
2372
|
}
|
|
2342
2373
|
}
|
|
2343
2374
|
h = !1, g = null, x = null, w = null, D = null, T = !1;
|
|
2344
2375
|
}
|
|
2345
|
-
let { canvas:
|
|
2346
|
-
if (
|
|
2347
|
-
|
|
2348
|
-
let i = N(
|
|
2349
|
-
Object.assign(
|
|
2350
|
-
},
|
|
2351
|
-
e.listen(
|
|
2352
|
-
e.listen(
|
|
2353
|
-
e.listen(
|
|
2354
|
-
O = null,
|
|
2376
|
+
let { canvas: H } = t, U = !(e.root && e.root.nodeType === 9), W = (n) => {
|
|
2377
|
+
if (U && !n.ctrlKey && !n.metaKey && e.active() !== t.canvas) return;
|
|
2378
|
+
n.preventDefault(), m();
|
|
2379
|
+
let i = N(n);
|
|
2380
|
+
Object.assign(t.camera, ce(t.camera, n.deltaY < 0 ? 1.12 : .88, i.x, i.y, s())), r();
|
|
2381
|
+
}, re = e.root || H, G = [
|
|
2382
|
+
e.listen(H, "mousedown", R),
|
|
2383
|
+
e.listen(H, "mousemove", ne),
|
|
2384
|
+
e.listen(H, "mouseleave", () => {
|
|
2385
|
+
O = null, te(!1), c(null);
|
|
2355
2386
|
}),
|
|
2356
|
-
e.listen(
|
|
2357
|
-
e.listen(
|
|
2358
|
-
e.listen(
|
|
2359
|
-
e.listen(
|
|
2360
|
-
e.listen(
|
|
2361
|
-
e.listen(
|
|
2387
|
+
e.listen(re, "mouseup", V),
|
|
2388
|
+
e.listen(H, "touchstart", R, { passive: !1 }),
|
|
2389
|
+
e.listen(H, "touchmove", ne, { passive: !1 }),
|
|
2390
|
+
e.listen(re, "touchend", V, { passive: !1 }),
|
|
2391
|
+
e.listen(re, "touchcancel", V, { passive: !1 }),
|
|
2392
|
+
e.listen(H, "wheel", W, { passive: !1 })
|
|
2362
2393
|
];
|
|
2363
|
-
return () =>
|
|
2394
|
+
return () => G.forEach((e) => e());
|
|
2364
2395
|
}
|
|
2365
2396
|
// ../explorer/pieces/map.js
|
|
2366
|
-
var
|
|
2367
|
-
<p id="map-keys-help" class="hx-sr-only">${
|
|
2397
|
+
var hn = "Arrow keys pan, plus and minus zoom, 0 fits the map. N and P select the next and the previous node, Home and End the first and the last. F frames the selected node and what it lights. Escape clears the selection.", gn = "<canvas id=\"graph-canvas\" data-corn=\"map-canvas\" tabindex=\"0\" role=\"application\" aria-roledescription=\"map\" aria-label=\"Topology map\" aria-describedby=\"map-keys-help\"></canvas>", _n = ({ keysHelp: e = hn } = {}) => ({ stage: `${gn}
|
|
2398
|
+
<p id="map-keys-help" class="hx-sr-only">${d(e)}</p>
|
|
2368
2399
|
<p id="map-announcer" class="hx-sr-only" role="status" aria-live="polite"></p>
|
|
2369
2400
|
<canvas id="label-canvas" data-corn="label-canvas" aria-hidden="true"></canvas>` });
|
|
2370
|
-
function
|
|
2371
|
-
let r =
|
|
2401
|
+
function vn(e, t, n) {
|
|
2402
|
+
let r = a(t, e, "<div data-corn=\"map-stage\"></div>", null, "stage"), i = n.mountStatus(r[0], t, { follow: !1 });
|
|
2372
2403
|
i.refuse("second-map"), t.emit("piece:refused", {
|
|
2373
2404
|
piece: "map",
|
|
2374
2405
|
reason: "second-map",
|
|
2375
2406
|
message: "A scope holds one map.",
|
|
2376
2407
|
host: e.nodeType === 11 ? e.host : e
|
|
2377
2408
|
});
|
|
2378
|
-
let
|
|
2409
|
+
let o = () => {};
|
|
2379
2410
|
return {
|
|
2380
2411
|
inst: t,
|
|
2381
2412
|
refused: !0,
|
|
2382
2413
|
selection: () => null,
|
|
2383
|
-
update:
|
|
2384
|
-
fit:
|
|
2385
|
-
refresh:
|
|
2414
|
+
update: o,
|
|
2415
|
+
fit: o,
|
|
2416
|
+
refresh: o,
|
|
2386
2417
|
focusNode: () => !1,
|
|
2387
|
-
applyTheme:
|
|
2418
|
+
applyTheme: o,
|
|
2388
2419
|
destroy() {
|
|
2389
2420
|
i.destroy();
|
|
2390
2421
|
for (let e of r) e.remove();
|
|
2391
2422
|
}
|
|
2392
2423
|
};
|
|
2393
2424
|
}
|
|
2394
|
-
function
|
|
2425
|
+
function yn(e) {
|
|
2395
2426
|
let t = e.nodeType === 11 ? e.host : e;
|
|
2396
2427
|
return t && typeof t.getRootNode == "function" ? t.getRootNode() : null;
|
|
2397
2428
|
}
|
|
2398
|
-
function
|
|
2399
|
-
return !t && n.src !== void 0 && n.src !== null && n.src !== "" ?
|
|
2429
|
+
function bn(e, t, n = {}) {
|
|
2430
|
+
return !t && n.src !== void 0 && n.src !== null && n.src !== "" ? xn(e, n) : Sn(e, t, n, null);
|
|
2400
2431
|
}
|
|
2401
|
-
function
|
|
2432
|
+
function xn(e, t) {
|
|
2402
2433
|
let n = e.nodeType === 11 ? e.host : e, r = {}, i = null, a = !1;
|
|
2403
|
-
return import("./scope-
|
|
2434
|
+
return import("./scope-CqPbHcKL.js").then((e) => e.n).then(({ mountScope: o }) => {
|
|
2404
2435
|
if (a) return;
|
|
2405
2436
|
let s = o(n, {
|
|
2406
2437
|
src: t.src,
|
|
@@ -2412,7 +2443,7 @@ function vn(e, t) {
|
|
|
2412
2443
|
onAuth: t.onAuth,
|
|
2413
2444
|
onError: t.onError
|
|
2414
2445
|
});
|
|
2415
|
-
i =
|
|
2446
|
+
i = Sn(e, s.instance, {
|
|
2416
2447
|
...t,
|
|
2417
2448
|
...r
|
|
2418
2449
|
}, s);
|
|
@@ -2451,192 +2482,192 @@ function vn(e, t) {
|
|
|
2451
2482
|
}
|
|
2452
2483
|
};
|
|
2453
2484
|
}
|
|
2454
|
-
function
|
|
2455
|
-
let o = !
|
|
2456
|
-
o && (
|
|
2457
|
-
root:
|
|
2458
|
-
base:
|
|
2459
|
-
fetch:
|
|
2460
|
-
strings:
|
|
2485
|
+
function Sn(e, t, n, r) {
|
|
2486
|
+
let o = !t;
|
|
2487
|
+
o && (t = p({
|
|
2488
|
+
root: e,
|
|
2489
|
+
base: n.base || "",
|
|
2490
|
+
fetch: n.fetch,
|
|
2491
|
+
strings: n.strings
|
|
2461
2492
|
}));
|
|
2462
|
-
let
|
|
2463
|
-
if (
|
|
2464
|
-
|
|
2493
|
+
let c = S(t), l = () => {};
|
|
2494
|
+
if (c) try {
|
|
2495
|
+
l = t.attach(e);
|
|
2465
2496
|
} catch {
|
|
2466
|
-
return
|
|
2497
|
+
return r && r.destroy(), vn(e, t, c);
|
|
2467
2498
|
}
|
|
2468
|
-
let { state:
|
|
2469
|
-
if (
|
|
2470
|
-
let
|
|
2471
|
-
|
|
2499
|
+
let { state: u } = t, d = c ? c.source : null;
|
|
2500
|
+
if (n.tokens) {
|
|
2501
|
+
let t = yn(e);
|
|
2502
|
+
t && s(t.nodeType === 9 ? t : t.ownerDocument, n.tokens), t && t.nodeType === 11 && s(t, n.tokens);
|
|
2472
2503
|
}
|
|
2473
|
-
let
|
|
2474
|
-
|
|
2504
|
+
let f = i(t);
|
|
2505
|
+
f.own(l), r && f.own(() => r.destroy());
|
|
2475
2506
|
let m = (e) => e === "canvas2d" ? "canvas2d" : "auto", h = (e) => e === "light" || e === "dark" ? e : "auto", g = {
|
|
2476
|
-
renderer: m(
|
|
2477
|
-
theme: h(
|
|
2507
|
+
renderer: m(n.renderer),
|
|
2508
|
+
theme: h(n.theme),
|
|
2478
2509
|
topology: void 0
|
|
2479
|
-
}, _ =
|
|
2480
|
-
|
|
2481
|
-
for (let e of [...
|
|
2510
|
+
}, _ = n.topology !== void 0 && n.topology !== null, v = !1, y = !1, b = _n({ keysHelp: n.keysHelp }).stage, x = n.slots && n.slots.stage ? n.slots : null, C = a(t, e, x ? b : `<div data-corn="map-stage">${b}</div>`, x, "stage"), T = (e) => C.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
|
|
2511
|
+
f.own(() => {
|
|
2512
|
+
for (let e of [...C, u.canvas]) e && e.remove();
|
|
2482
2513
|
});
|
|
2483
|
-
let
|
|
2484
|
-
if (
|
|
2485
|
-
let e =
|
|
2486
|
-
|
|
2487
|
-
}
|
|
2488
|
-
let
|
|
2489
|
-
if (d &&
|
|
2490
|
-
let e =
|
|
2514
|
+
let D = T("#map-announcer");
|
|
2515
|
+
if (D) {
|
|
2516
|
+
let e = O(t, D);
|
|
2517
|
+
f.on("announce:write", (t) => (e(t), !0));
|
|
2518
|
+
}
|
|
2519
|
+
let k = C.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
|
|
2520
|
+
if (d && k) {
|
|
2521
|
+
let e = c.mountStatus(k, t, {
|
|
2491
2522
|
onRetry: () => d.load(),
|
|
2492
2523
|
focusMap: () => {
|
|
2493
|
-
|
|
2524
|
+
u.canvas && u.canvas.focus();
|
|
2494
2525
|
}
|
|
2495
2526
|
});
|
|
2496
|
-
|
|
2497
|
-
}
|
|
2498
|
-
|
|
2499
|
-
let
|
|
2500
|
-
|
|
2501
|
-
let
|
|
2502
|
-
prefer:
|
|
2503
|
-
mapStyle:
|
|
2504
|
-
})),
|
|
2505
|
-
function
|
|
2527
|
+
f.own(e.destroy);
|
|
2528
|
+
}
|
|
2529
|
+
u.canvas = T("[data-corn=\"map-canvas\"]"), u.labelCanvas = T("[data-corn=\"label-canvas\"]"), u.ctx = t.doc.createElement("canvas").getContext("2d");
|
|
2530
|
+
let A = ft(t, n.measureCovered ? { measureCovered: n.measureCovered } : {}), j = te(t);
|
|
2531
|
+
f.own(j.watch()), f.own(j.onChange(() => A.render()));
|
|
2532
|
+
let M = () => g.renderer === "canvas2d" ? "canvas2d" : null, N = () => A.setRenderer(fn(u.canvas, {
|
|
2533
|
+
prefer: M(),
|
|
2534
|
+
mapStyle: j.get
|
|
2535
|
+
})), P = t.win && t.win.matchMedia ? t.win.matchMedia("(prefers-color-scheme: light)") : null;
|
|
2536
|
+
function F() {
|
|
2506
2537
|
if (g.theme === "light" || g.theme === "dark") return g.theme;
|
|
2507
|
-
if (
|
|
2508
|
-
let
|
|
2509
|
-
return
|
|
2538
|
+
if (c && (c.theme === "light" || c.theme === "dark")) return c.theme;
|
|
2539
|
+
let e = t.doc && t.doc.documentElement, n = e ? e.getAttribute("data-theme") : null;
|
|
2540
|
+
return n === "light" || n === "dark" ? n : ee("system", !!(P && P.matches));
|
|
2510
2541
|
}
|
|
2511
|
-
function
|
|
2542
|
+
function I() {
|
|
2512
2543
|
if (v) return;
|
|
2513
|
-
let e =
|
|
2514
|
-
|
|
2515
|
-
}
|
|
2516
|
-
|
|
2517
|
-
let
|
|
2518
|
-
if (
|
|
2519
|
-
let e = new I
|
|
2520
|
-
e.observe(
|
|
2544
|
+
let e = F();
|
|
2545
|
+
j.refresh(), u.theme !== e && (u.theme = e, t.touchScene()), A.render();
|
|
2546
|
+
}
|
|
2547
|
+
u.theme = F(), c && f.own(c.serverTheme.adopt(e)), c && (f.on("theme", () => I()), f.on("scope:theme", () => I())), P && P.addEventListener && (P.addEventListener("change", I), f.own(() => P.removeEventListener("change", I)));
|
|
2548
|
+
let L = t.win && t.win.MutationObserver;
|
|
2549
|
+
if (L && t.doc && t.doc.documentElement) {
|
|
2550
|
+
let e = new L(I);
|
|
2551
|
+
e.observe(t.doc.documentElement, {
|
|
2521
2552
|
attributes: !0,
|
|
2522
2553
|
attributeFilter: ["data-theme", "class"]
|
|
2523
|
-
}),
|
|
2524
|
-
}
|
|
2525
|
-
|
|
2526
|
-
let
|
|
2527
|
-
|
|
2528
|
-
},
|
|
2529
|
-
|
|
2530
|
-
v || ((e || t) && (
|
|
2554
|
+
}), f.own(() => e.disconnect());
|
|
2555
|
+
}
|
|
2556
|
+
N();
|
|
2557
|
+
let R = () => gt(t), z = () => {
|
|
2558
|
+
u.nodes.length && A.fitGraphToViewport(A.fitPadding());
|
|
2559
|
+
}, B = (e) => u.nodes.find((t) => t.id === e) || null, V = null;
|
|
2560
|
+
f.on("select", (e) => ie(t, e, { source: "tap" })), f.on("background", () => U(t, { source: "tap" })), f.on("grab", () => ne(t)), f.on("selection", ({ node: e, edge: t, source: r }) => {
|
|
2561
|
+
v || ((e || t) && (V = null), n.onSelect && (e ? n.onSelect({
|
|
2531
2562
|
id: e.id,
|
|
2532
2563
|
kind: "node",
|
|
2533
|
-
source:
|
|
2534
|
-
}) : t ?
|
|
2564
|
+
source: r
|
|
2565
|
+
}) : t ? n.onSelect({
|
|
2535
2566
|
id: `${t.from}->${t.to}`,
|
|
2536
2567
|
kind: "edge",
|
|
2537
2568
|
from: t.from,
|
|
2538
2569
|
to: t.to,
|
|
2539
|
-
source:
|
|
2540
|
-
}) :
|
|
2570
|
+
source: r
|
|
2571
|
+
}) : n.onSelect({
|
|
2541
2572
|
id: null,
|
|
2542
2573
|
kind: null,
|
|
2543
|
-
source:
|
|
2574
|
+
source: r
|
|
2544
2575
|
})));
|
|
2545
2576
|
});
|
|
2546
|
-
function
|
|
2547
|
-
let
|
|
2548
|
-
return !
|
|
2577
|
+
function H(e) {
|
|
2578
|
+
let n = B(String(e));
|
|
2579
|
+
return !n || v ? !1 : (ie(t, n, {
|
|
2549
2580
|
frame: !0,
|
|
2550
2581
|
source: "api"
|
|
2551
2582
|
}), !0);
|
|
2552
2583
|
}
|
|
2553
|
-
let
|
|
2554
|
-
function
|
|
2555
|
-
let e =
|
|
2556
|
-
|
|
2584
|
+
let W = () => {}, re = !!t.root && t.root.nodeType === 9;
|
|
2585
|
+
function G() {
|
|
2586
|
+
let e = u.canvas, n = [mn(t)];
|
|
2587
|
+
re || n.push(t.listen(e, "pointerdown", (t) => {
|
|
2557
2588
|
if (t.pointerType === "mouse" && e.setPointerCapture) try {
|
|
2558
2589
|
e.setPointerCapture(t.pointerId);
|
|
2559
2590
|
} catch {}
|
|
2560
|
-
})),
|
|
2591
|
+
})), w(t), E(t), n.push(() => w(t)), W = () => n.forEach((e) => e());
|
|
2561
2592
|
}
|
|
2562
|
-
|
|
2563
|
-
!
|
|
2564
|
-
})),
|
|
2565
|
-
let
|
|
2566
|
-
!_ && d && d.topology && d.topology !== g.topology && (g.topology = d.topology,
|
|
2593
|
+
f.own(A.onPaint(() => {
|
|
2594
|
+
!y && u.nodes.length && (y = !0, n.onReady && n.onReady());
|
|
2595
|
+
})), G(), f.own(() => W());
|
|
2596
|
+
let K = () => {
|
|
2597
|
+
!_ && d && d.topology && d.topology !== g.topology && (g.topology = d.topology, ae(d.topology));
|
|
2567
2598
|
};
|
|
2568
|
-
d &&
|
|
2569
|
-
e.state === "ready" &&
|
|
2570
|
-
}),
|
|
2571
|
-
function
|
|
2572
|
-
let
|
|
2573
|
-
|
|
2574
|
-
let r =
|
|
2575
|
-
|
|
2576
|
-
let i = !r &&
|
|
2577
|
-
i &&
|
|
2578
|
-
}
|
|
2579
|
-
function
|
|
2580
|
-
let
|
|
2581
|
-
|
|
2582
|
-
}
|
|
2583
|
-
function
|
|
2584
|
-
let e =
|
|
2585
|
-
e.release ? e.release() : e.destroy(),
|
|
2586
|
-
let
|
|
2587
|
-
|
|
2588
|
-
let r =
|
|
2599
|
+
d && f.on("source", (e) => {
|
|
2600
|
+
e.state === "ready" && K();
|
|
2601
|
+
}), f.own(A.watchSize()), A.resize();
|
|
2602
|
+
function ae(e) {
|
|
2603
|
+
let n = u.selectedNode ? u.selectedNode.id : null;
|
|
2604
|
+
ht(t, e);
|
|
2605
|
+
let r = n ? B(n) : null;
|
|
2606
|
+
u.nodes.length && (R(), z());
|
|
2607
|
+
let i = !r && V ? B(V) : null;
|
|
2608
|
+
i && ie(t, i, { source: "api" }), A.render(), A.ensureFlowLoop();
|
|
2609
|
+
}
|
|
2610
|
+
function q(e) {
|
|
2611
|
+
let n = e === "dataflow" ? "dataflow" : "orbit";
|
|
2612
|
+
u.view !== n && (u.view = n, t.touchScene(), u.nodes.length && (R(), z(), A.ensureFlowLoop()));
|
|
2613
|
+
}
|
|
2614
|
+
function oe() {
|
|
2615
|
+
let e = A.getRenderer();
|
|
2616
|
+
e.release ? e.release() : e.destroy(), W();
|
|
2617
|
+
let n = t.doc.createElement("template");
|
|
2618
|
+
n.innerHTML = gn;
|
|
2619
|
+
let r = n.content.firstElementChild;
|
|
2589
2620
|
r.setAttribute("part", "map-canvas");
|
|
2590
|
-
let i =
|
|
2591
|
-
|
|
2621
|
+
let i = t.active() === u.canvas;
|
|
2622
|
+
u.canvas.replaceWith(r), u.canvas = r, G(), N(), A.resize(), i && r.focus();
|
|
2592
2623
|
}
|
|
2593
|
-
function
|
|
2624
|
+
function se(e = {}) {
|
|
2594
2625
|
if (!v) {
|
|
2595
2626
|
if ("renderer" in e) {
|
|
2596
2627
|
let t = m(e.renderer);
|
|
2597
|
-
t !== g.renderer && (g.renderer = t,
|
|
2628
|
+
t !== g.renderer && (g.renderer = t, oe());
|
|
2598
2629
|
}
|
|
2599
2630
|
if ("theme" in e) {
|
|
2600
2631
|
let t = h(e.theme);
|
|
2601
|
-
t !== g.theme && (g.theme = t,
|
|
2632
|
+
t !== g.theme && (g.theme = t, I());
|
|
2602
2633
|
}
|
|
2603
|
-
if ("topology" in e && (_ = e.topology !== void 0 && e.topology !== null, _ && e.topology !== g.topology ? (g.topology = e.topology,
|
|
2604
|
-
let
|
|
2605
|
-
if (
|
|
2634
|
+
if ("topology" in e && (_ = e.topology !== void 0 && e.topology !== null, _ && e.topology !== g.topology ? (g.topology = e.topology, ae(e.topology)) : !_ && d && d.topology ? (g.topology = void 0, K()) : !_ && e.topology !== g.topology && (g.topology = e.topology, ae(e.topology))), "view" in e && q(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
|
|
2635
|
+
let n = e.node == null || e.node === "" ? null : String(e.node);
|
|
2636
|
+
if (n === null) V = null, (u.selectedNode || u.selectedEdge) && U(t, { source: "api" });
|
|
2606
2637
|
else {
|
|
2607
|
-
let e =
|
|
2608
|
-
e ?
|
|
2638
|
+
let e = B(n);
|
|
2639
|
+
e ? u.selectedNode && u.selectedNode.id === n || ie(t, e, { source: "api" }) : V = n;
|
|
2609
2640
|
}
|
|
2610
2641
|
}
|
|
2611
2642
|
}
|
|
2612
2643
|
}
|
|
2613
|
-
function
|
|
2614
|
-
v || (v = !0,
|
|
2644
|
+
function ce() {
|
|
2645
|
+
v || (v = !0, f.destroy(), A.destroy(), o && t.destroy());
|
|
2615
2646
|
}
|
|
2616
|
-
let
|
|
2647
|
+
let J = {};
|
|
2617
2648
|
for (let e of [
|
|
2618
2649
|
"topology",
|
|
2619
2650
|
"view",
|
|
2620
2651
|
"node"
|
|
2621
|
-
])
|
|
2622
|
-
return
|
|
2623
|
-
inst:
|
|
2624
|
-
map:
|
|
2652
|
+
]) n[e] !== void 0 && (J[e] = n[e]);
|
|
2653
|
+
return se(J), K(), I(), f.own(() => t.emit("map:gone")), t.emit("map:ready"), {
|
|
2654
|
+
inst: t,
|
|
2655
|
+
map: A,
|
|
2625
2656
|
selection() {
|
|
2626
|
-
return
|
|
2627
|
-
id:
|
|
2657
|
+
return u.selectedNode ? {
|
|
2658
|
+
id: u.selectedNode.id,
|
|
2628
2659
|
kind: "node"
|
|
2629
|
-
} :
|
|
2630
|
-
id: `${
|
|
2660
|
+
} : u.selectedEdge ? {
|
|
2661
|
+
id: `${u.selectedEdge.from}->${u.selectedEdge.to}`,
|
|
2631
2662
|
kind: "edge"
|
|
2632
2663
|
} : null;
|
|
2633
2664
|
},
|
|
2634
|
-
update:
|
|
2635
|
-
destroy:
|
|
2636
|
-
fit:
|
|
2637
|
-
focusNode:
|
|
2638
|
-
refresh:
|
|
2639
|
-
applyTheme: (e) =>
|
|
2665
|
+
update: se,
|
|
2666
|
+
destroy: ce,
|
|
2667
|
+
fit: z,
|
|
2668
|
+
focusNode: H,
|
|
2669
|
+
refresh: I,
|
|
2670
|
+
applyTheme: (e) => j.applyTheme(e)
|
|
2640
2671
|
};
|
|
2641
2672
|
}
|
|
2642
|
-
export {
|
|
2673
|
+
export { ht as i, gt as n, _t as r, bn as t };
|