quixotic-gol 0.1.11 → 0.1.12
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/index.d.ts +2 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +482 -481
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -230,12 +230,12 @@ function gn(t, e) {
|
|
|
230
230
|
var r = e ? yn : vn, n = this._parents, o = this._groups;
|
|
231
231
|
typeof t != "function" && (t = pn(t));
|
|
232
232
|
for (var a = o.length, i = new Array(a), c = new Array(a), l = new Array(a), s = 0; s < a; ++s) {
|
|
233
|
-
var u = n[s], d = o[s], p = d.length, g = wn(t.call(u, u && u.__data__, s, n)),
|
|
234
|
-
r(u, d,
|
|
235
|
-
for (var J = 0,
|
|
236
|
-
if (A =
|
|
237
|
-
for (J >=
|
|
238
|
-
A._next =
|
|
233
|
+
var u = n[s], d = o[s], p = d.length, g = wn(t.call(u, u && u.__data__, s, n)), R = g.length, B = c[s] = new Array(R), $ = i[s] = new Array(R), Y = l[s] = new Array(p);
|
|
234
|
+
r(u, d, B, $, Y, g, e);
|
|
235
|
+
for (var J = 0, j = 0, A, O; J < R; ++J)
|
|
236
|
+
if (A = B[J]) {
|
|
237
|
+
for (J >= j && (j = J + 1); !(O = $[j]) && ++j < R; ) ;
|
|
238
|
+
A._next = O || null;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
return i = new yt(i, n), i._enter = c, i._exit = l, i;
|
|
@@ -252,8 +252,8 @@ function En(t, e, r) {
|
|
|
252
252
|
}
|
|
253
253
|
function bn(t) {
|
|
254
254
|
for (var e = t.selection ? t.selection() : t, r = this._groups, n = e._groups, o = r.length, a = n.length, i = Math.min(o, a), c = new Array(o), l = 0; l < i; ++l)
|
|
255
|
-
for (var s = r[l], u = n[l], d = s.length, p = c[l] = new Array(d), g,
|
|
256
|
-
(g = s[
|
|
255
|
+
for (var s = r[l], u = n[l], d = s.length, p = c[l] = new Array(d), g, R = 0; R < d; ++R)
|
|
256
|
+
(g = s[R] || u[R]) && (p[R] = g);
|
|
257
257
|
for (; l < o; ++l)
|
|
258
258
|
c[l] = r[l];
|
|
259
259
|
return new yt(c, this._parents);
|
|
@@ -1067,10 +1067,10 @@ function Pr(t, e, r, n) {
|
|
|
1067
1067
|
function o(s) {
|
|
1068
1068
|
return s.length ? s.pop() + " " : "";
|
|
1069
1069
|
}
|
|
1070
|
-
function a(s, u, d, p, g,
|
|
1070
|
+
function a(s, u, d, p, g, R) {
|
|
1071
1071
|
if (s !== d || u !== p) {
|
|
1072
|
-
var
|
|
1073
|
-
|
|
1072
|
+
var B = g.push("translate(", null, e, null, r);
|
|
1073
|
+
R.push({ i: B - 4, x: Dt(s, d) }, { i: B - 2, x: Dt(u, p) });
|
|
1074
1074
|
} else (d || p) && g.push("translate(" + d + e + p + r);
|
|
1075
1075
|
}
|
|
1076
1076
|
function i(s, u, d, p) {
|
|
@@ -1079,16 +1079,16 @@ function Pr(t, e, r, n) {
|
|
|
1079
1079
|
function c(s, u, d, p) {
|
|
1080
1080
|
s !== u ? p.push({ i: d.push(o(d) + "skewX(", null, n) - 2, x: Dt(s, u) }) : u && d.push(o(d) + "skewX(" + u + n);
|
|
1081
1081
|
}
|
|
1082
|
-
function l(s, u, d, p, g,
|
|
1082
|
+
function l(s, u, d, p, g, R) {
|
|
1083
1083
|
if (s !== d || u !== p) {
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1084
|
+
var B = g.push(o(g) + "scale(", null, ",", null, ")");
|
|
1085
|
+
R.push({ i: B - 4, x: Dt(s, d) }, { i: B - 2, x: Dt(u, p) });
|
|
1086
1086
|
} else (d !== 1 || p !== 1) && g.push(o(g) + "scale(" + d + "," + p + ")");
|
|
1087
1087
|
}
|
|
1088
1088
|
return function(s, u) {
|
|
1089
1089
|
var d = [], p = [];
|
|
1090
1090
|
return s = t(s), u = t(u), a(s.translateX, s.translateY, u.translateX, u.translateY, d, p), i(s.rotate, u.rotate, d, p), c(s.skewX, u.skewX, d, p), l(s.scaleX, s.scaleY, u.scaleX, u.scaleY, d, p), s = u = null, function(g) {
|
|
1091
|
-
for (var
|
|
1091
|
+
for (var R = -1, B = p.length, $; ++R < B; ) d[($ = p[R]).i] = $.x(g);
|
|
1092
1092
|
return d.join("");
|
|
1093
1093
|
};
|
|
1094
1094
|
};
|
|
@@ -1105,27 +1105,27 @@ function ri(t) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
const ni = (function t(e, r, n) {
|
|
1107
1107
|
function o(a, i) {
|
|
1108
|
-
var c = a[0], l = a[1], s = a[2], u = i[0], d = i[1], p = i[2], g = u - c,
|
|
1109
|
-
if (
|
|
1110
|
-
|
|
1108
|
+
var c = a[0], l = a[1], s = a[2], u = i[0], d = i[1], p = i[2], g = u - c, R = d - l, B = g * g + R * R, $, Y;
|
|
1109
|
+
if (B < ti)
|
|
1110
|
+
Y = Math.log(p / s) / e, $ = function(et) {
|
|
1111
1111
|
return [
|
|
1112
1112
|
c + et * g,
|
|
1113
|
-
l + et *
|
|
1114
|
-
s * Math.exp(e * et *
|
|
1113
|
+
l + et * R,
|
|
1114
|
+
s * Math.exp(e * et * Y)
|
|
1115
1115
|
];
|
|
1116
1116
|
};
|
|
1117
1117
|
else {
|
|
1118
|
-
var J = Math.sqrt(
|
|
1119
|
-
|
|
1120
|
-
var nt = et *
|
|
1118
|
+
var J = Math.sqrt(B), j = (p * p - s * s + n * B) / (2 * s * r * J), A = (p * p - s * s - n * B) / (2 * p * r * J), O = Math.log(Math.sqrt(j * j + 1) - j), U = Math.log(Math.sqrt(A * A + 1) - A);
|
|
1119
|
+
Y = (U - O) / e, $ = function(et) {
|
|
1120
|
+
var nt = et * Y, G = ar(O), F = s / (r * J) * (G * ri(e * nt + O) - ei(O));
|
|
1121
1121
|
return [
|
|
1122
1122
|
c + F * g,
|
|
1123
|
-
l + F *
|
|
1124
|
-
s *
|
|
1123
|
+
l + F * R,
|
|
1124
|
+
s * G / ar(e * nt + O)
|
|
1125
1125
|
];
|
|
1126
1126
|
};
|
|
1127
1127
|
}
|
|
1128
|
-
return
|
|
1128
|
+
return $.duration = Y * 1e3 * e / Math.SQRT2, $;
|
|
1129
1129
|
}
|
|
1130
1130
|
return o.rho = function(a) {
|
|
1131
1131
|
var i = Math.max(1e-3, +a), c = i * i, l = c * c;
|
|
@@ -1519,8 +1519,8 @@ function Vi(t) {
|
|
|
1519
1519
|
for (var n = this._groups, o = n.length, a = [], i = [], c = 0; c < o; ++c)
|
|
1520
1520
|
for (var l = n[c], s = l.length, u, d = 0; d < s; ++d)
|
|
1521
1521
|
if (u = l[d]) {
|
|
1522
|
-
for (var p = t.call(u, u.__data__, d, l), g,
|
|
1523
|
-
(g = p[
|
|
1522
|
+
for (var p = t.call(u, u.__data__, d, l), g, R = xt(u, r), B = 0, $ = p.length; B < $; ++B)
|
|
1523
|
+
(g = p[B]) && xe(g, e, r, B, p, R);
|
|
1524
1524
|
a.push(p), i.push(u);
|
|
1525
1525
|
}
|
|
1526
1526
|
return new Yt(a, i, e, r);
|
|
@@ -1802,65 +1802,65 @@ function xa(t, e, r) {
|
|
|
1802
1802
|
);
|
|
1803
1803
|
}
|
|
1804
1804
|
function We() {
|
|
1805
|
-
var t = ya, e = ma, r = xa, n = ga, o = wa, a = [0, 1 / 0], i = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], c = 250, l = ni, s = ke("start", "zoom", "end"), u, d, p, g = 500,
|
|
1806
|
-
function
|
|
1807
|
-
f.property("__zoom", fr).on("wheel.zoom", nt, { passive: !1 }).on("mousedown.zoom",
|
|
1805
|
+
var t = ya, e = ma, r = xa, n = ga, o = wa, a = [0, 1 / 0], i = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], c = 250, l = ni, s = ke("start", "zoom", "end"), u, d, p, g = 500, R = 150, B = 0, $ = 10;
|
|
1806
|
+
function Y(f) {
|
|
1807
|
+
f.property("__zoom", fr).on("wheel.zoom", nt, { passive: !1 }).on("mousedown.zoom", G).on("dblclick.zoom", F).filter(o).on("touchstart.zoom", H).on("touchmove.zoom", Q).on("touchend.zoom touchcancel.zoom", N).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
1808
1808
|
}
|
|
1809
|
-
|
|
1809
|
+
Y.transform = function(f, M, v, D) {
|
|
1810
1810
|
var X = f.selection ? f.selection() : f;
|
|
1811
|
-
X.property("__zoom", fr), f !== X ?
|
|
1812
|
-
U(this, arguments).event(
|
|
1811
|
+
X.property("__zoom", fr), f !== X ? O(f, M, v, D) : X.interrupt().each(function() {
|
|
1812
|
+
U(this, arguments).event(D).start().zoom(null, typeof M == "function" ? M.apply(this, arguments) : M).end();
|
|
1813
1813
|
});
|
|
1814
|
-
},
|
|
1815
|
-
|
|
1814
|
+
}, Y.scaleBy = function(f, M, v, D) {
|
|
1815
|
+
Y.scaleTo(f, function() {
|
|
1816
1816
|
var X = this.__zoom.k, I = typeof M == "function" ? M.apply(this, arguments) : M;
|
|
1817
1817
|
return X * I;
|
|
1818
|
-
}, v,
|
|
1819
|
-
},
|
|
1820
|
-
|
|
1821
|
-
var X = e.apply(this, arguments), I = this.__zoom,
|
|
1822
|
-
return r(
|
|
1823
|
-
}, v,
|
|
1824
|
-
},
|
|
1825
|
-
|
|
1818
|
+
}, v, D);
|
|
1819
|
+
}, Y.scaleTo = function(f, M, v, D) {
|
|
1820
|
+
Y.transform(f, function() {
|
|
1821
|
+
var X = e.apply(this, arguments), I = this.__zoom, P = v == null ? A(X) : typeof v == "function" ? v.apply(this, arguments) : v, h = I.invert(P), w = typeof M == "function" ? M.apply(this, arguments) : M;
|
|
1822
|
+
return r(j(J(I, w), P, h), X, i);
|
|
1823
|
+
}, v, D);
|
|
1824
|
+
}, Y.translateBy = function(f, M, v, D) {
|
|
1825
|
+
Y.transform(f, function() {
|
|
1826
1826
|
return r(this.__zoom.translate(
|
|
1827
1827
|
typeof M == "function" ? M.apply(this, arguments) : M,
|
|
1828
1828
|
typeof v == "function" ? v.apply(this, arguments) : v
|
|
1829
1829
|
), e.apply(this, arguments), i);
|
|
1830
|
-
}, null,
|
|
1831
|
-
},
|
|
1832
|
-
|
|
1833
|
-
var I = e.apply(this, arguments),
|
|
1834
|
-
return r(Pt.translate(h[0], h[1]).scale(
|
|
1830
|
+
}, null, D);
|
|
1831
|
+
}, Y.translateTo = function(f, M, v, D, X) {
|
|
1832
|
+
Y.transform(f, function() {
|
|
1833
|
+
var I = e.apply(this, arguments), P = this.__zoom, h = D == null ? A(I) : typeof D == "function" ? D.apply(this, arguments) : D;
|
|
1834
|
+
return r(Pt.translate(h[0], h[1]).scale(P.k).translate(
|
|
1835
1835
|
typeof M == "function" ? -M.apply(this, arguments) : -M,
|
|
1836
1836
|
typeof v == "function" ? -v.apply(this, arguments) : -v
|
|
1837
1837
|
), I, i);
|
|
1838
|
-
},
|
|
1838
|
+
}, D, X);
|
|
1839
1839
|
};
|
|
1840
1840
|
function J(f, M) {
|
|
1841
1841
|
return M = Math.max(a[0], Math.min(a[1], M)), M === f.k ? f : new Lt(M, f.x, f.y);
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1844
|
-
var
|
|
1845
|
-
return
|
|
1843
|
+
function j(f, M, v) {
|
|
1844
|
+
var D = M[0] - v[0] * f.k, X = M[1] - v[1] * f.k;
|
|
1845
|
+
return D === f.x && X === f.y ? f : new Lt(f.k, D, X);
|
|
1846
1846
|
}
|
|
1847
1847
|
function A(f) {
|
|
1848
1848
|
return [(+f[0][0] + +f[1][0]) / 2, (+f[0][1] + +f[1][1]) / 2];
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function O(f, M, v, D) {
|
|
1851
1851
|
f.on("start.zoom", function() {
|
|
1852
|
-
U(this, arguments).event(
|
|
1852
|
+
U(this, arguments).event(D).start();
|
|
1853
1853
|
}).on("interrupt.zoom end.zoom", function() {
|
|
1854
|
-
U(this, arguments).event(
|
|
1854
|
+
U(this, arguments).event(D).end();
|
|
1855
1855
|
}).tween("zoom", function() {
|
|
1856
|
-
var X = this, I = arguments,
|
|
1856
|
+
var X = this, I = arguments, P = U(X, I).event(D), h = e.apply(X, I), w = v == null ? A(h) : typeof v == "function" ? v.apply(X, I) : v, E = Math.max(h[1][0] - h[0][0], h[1][1] - h[0][1]), m = X.__zoom, x = typeof M == "function" ? M.apply(X, I) : M, b = l(m.invert(w).concat(E / m.k), x.invert(w).concat(E / x.k));
|
|
1857
1857
|
return function(y) {
|
|
1858
1858
|
if (y === 1) y = x;
|
|
1859
1859
|
else {
|
|
1860
|
-
var C = b(y),
|
|
1861
|
-
y = new Lt(
|
|
1860
|
+
var C = b(y), _ = E / C[2];
|
|
1861
|
+
y = new Lt(_, w[0] - C[0] * _, w[1] - C[1] * _);
|
|
1862
1862
|
}
|
|
1863
|
-
|
|
1863
|
+
P.zoom(null, y);
|
|
1864
1864
|
};
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
@@ -1890,7 +1890,7 @@ function We() {
|
|
|
1890
1890
|
this.that,
|
|
1891
1891
|
new va(f, {
|
|
1892
1892
|
sourceEvent: this.sourceEvent,
|
|
1893
|
-
target:
|
|
1893
|
+
target: Y,
|
|
1894
1894
|
transform: this.that.__zoom,
|
|
1895
1895
|
dispatch: s
|
|
1896
1896
|
}),
|
|
@@ -1900,44 +1900,44 @@ function We() {
|
|
|
1900
1900
|
};
|
|
1901
1901
|
function nt(f, ...M) {
|
|
1902
1902
|
if (!t.apply(this, arguments)) return;
|
|
1903
|
-
var v = U(this, M).event(f),
|
|
1903
|
+
var v = U(this, M).event(f), D = this.__zoom, X = Math.max(a[0], Math.min(a[1], D.k * Math.pow(2, n.apply(this, arguments)))), I = Nt(f);
|
|
1904
1904
|
if (v.wheel)
|
|
1905
|
-
(v.mouse[0][0] !== I[0] || v.mouse[0][1] !== I[1]) && (v.mouse[1] =
|
|
1905
|
+
(v.mouse[0][0] !== I[0] || v.mouse[0][1] !== I[1]) && (v.mouse[1] = D.invert(v.mouse[0] = I)), clearTimeout(v.wheel);
|
|
1906
1906
|
else {
|
|
1907
|
-
if (
|
|
1908
|
-
v.mouse = [I,
|
|
1907
|
+
if (D.k === X) return;
|
|
1908
|
+
v.mouse = [I, D.invert(I)], ue(this), v.start();
|
|
1909
1909
|
}
|
|
1910
|
-
Vt(f), v.wheel = setTimeout(
|
|
1911
|
-
function
|
|
1910
|
+
Vt(f), v.wheel = setTimeout(P, R), v.zoom("mouse", r(j(J(D, X), v.mouse[0], v.mouse[1]), v.extent, i));
|
|
1911
|
+
function P() {
|
|
1912
1912
|
v.wheel = null, v.end();
|
|
1913
1913
|
}
|
|
1914
1914
|
}
|
|
1915
|
-
function
|
|
1915
|
+
function G(f, ...M) {
|
|
1916
1916
|
if (p || !t.apply(this, arguments)) return;
|
|
1917
|
-
var v = f.currentTarget,
|
|
1918
|
-
Do(f.view), _e(f),
|
|
1917
|
+
var v = f.currentTarget, D = U(this, M, !0).event(f), X = at(f.view).on("mousemove.zoom", w, !0).on("mouseup.zoom", E, !0), I = Nt(f, v), P = f.clientX, h = f.clientY;
|
|
1918
|
+
Do(f.view), _e(f), D.mouse = [I, this.__zoom.invert(I)], ue(this), D.start();
|
|
1919
1919
|
function w(m) {
|
|
1920
|
-
if (Vt(m), !
|
|
1921
|
-
var x = m.clientX -
|
|
1922
|
-
|
|
1920
|
+
if (Vt(m), !D.moved) {
|
|
1921
|
+
var x = m.clientX - P, b = m.clientY - h;
|
|
1922
|
+
D.moved = x * x + b * b > B;
|
|
1923
1923
|
}
|
|
1924
|
-
|
|
1924
|
+
D.event(m).zoom("mouse", r(j(D.that.__zoom, D.mouse[0] = Nt(m, v), D.mouse[1]), D.extent, i));
|
|
1925
1925
|
}
|
|
1926
1926
|
function E(m) {
|
|
1927
|
-
X.on("mousemove.zoom mouseup.zoom", null), Bo(m.view,
|
|
1927
|
+
X.on("mousemove.zoom mouseup.zoom", null), Bo(m.view, D.moved), Vt(m), D.event(m).end();
|
|
1928
1928
|
}
|
|
1929
1929
|
}
|
|
1930
1930
|
function F(f, ...M) {
|
|
1931
1931
|
if (t.apply(this, arguments)) {
|
|
1932
|
-
var v = this.__zoom,
|
|
1933
|
-
Vt(f), c > 0 ? at(this).transition().duration(c).call(
|
|
1932
|
+
var v = this.__zoom, D = Nt(f.changedTouches ? f.changedTouches[0] : f, this), X = v.invert(D), I = v.k * (f.shiftKey ? 0.5 : 2), P = r(j(J(v, I), D, X), e.apply(this, M), i);
|
|
1933
|
+
Vt(f), c > 0 ? at(this).transition().duration(c).call(O, P, D, f) : at(this).call(Y.transform, P, D, f);
|
|
1934
1934
|
}
|
|
1935
1935
|
}
|
|
1936
|
-
function
|
|
1936
|
+
function H(f, ...M) {
|
|
1937
1937
|
if (t.apply(this, arguments)) {
|
|
1938
|
-
var v = f.touches,
|
|
1939
|
-
for (_e(f),
|
|
1940
|
-
h = v[
|
|
1938
|
+
var v = f.touches, D = v.length, X = U(this, M, f.changedTouches.length === D).event(f), I, P, h, w;
|
|
1939
|
+
for (_e(f), P = 0; P < D; ++P)
|
|
1940
|
+
h = v[P], w = Nt(h, this), w = [w, this.__zoom.invert(w), h.identifier], X.touch0 ? !X.touch1 && X.touch0[2] !== w[2] && (X.touch1 = w, X.taps = 0) : (X.touch0 = w, I = !0, X.taps = 1 + !!u);
|
|
1941
1941
|
u && (u = clearTimeout(u)), I && (X.taps < 2 && (d = w[0], u = setTimeout(function() {
|
|
1942
1942
|
u = null;
|
|
1943
1943
|
}, g)), ue(this), X.start());
|
|
@@ -1945,57 +1945,57 @@ function We() {
|
|
|
1945
1945
|
}
|
|
1946
1946
|
function Q(f, ...M) {
|
|
1947
1947
|
if (this.__zooming) {
|
|
1948
|
-
var v = U(this, M).event(f),
|
|
1948
|
+
var v = U(this, M).event(f), D = f.changedTouches, X = D.length, I, P, h, w;
|
|
1949
1949
|
for (Vt(f), I = 0; I < X; ++I)
|
|
1950
|
-
|
|
1951
|
-
if (
|
|
1950
|
+
P = D[I], h = Nt(P, this), v.touch0 && v.touch0[2] === P.identifier ? v.touch0[0] = h : v.touch1 && v.touch1[2] === P.identifier && (v.touch1[0] = h);
|
|
1951
|
+
if (P = v.that.__zoom, v.touch1) {
|
|
1952
1952
|
var E = v.touch0[0], m = v.touch0[1], x = v.touch1[0], b = v.touch1[1], y = (y = x[0] - E[0]) * y + (y = x[1] - E[1]) * y, C = (C = b[0] - m[0]) * C + (C = b[1] - m[1]) * C;
|
|
1953
|
-
|
|
1953
|
+
P = J(P, Math.sqrt(y / C)), h = [(E[0] + x[0]) / 2, (E[1] + x[1]) / 2], w = [(m[0] + b[0]) / 2, (m[1] + b[1]) / 2];
|
|
1954
1954
|
} else if (v.touch0) h = v.touch0[0], w = v.touch0[1];
|
|
1955
1955
|
else return;
|
|
1956
|
-
v.zoom("touch", r(
|
|
1956
|
+
v.zoom("touch", r(j(P, h, w), v.extent, i));
|
|
1957
1957
|
}
|
|
1958
1958
|
}
|
|
1959
|
-
function
|
|
1959
|
+
function N(f, ...M) {
|
|
1960
1960
|
if (this.__zooming) {
|
|
1961
|
-
var v = U(this, M).event(f),
|
|
1961
|
+
var v = U(this, M).event(f), D = f.changedTouches, X = D.length, I, P;
|
|
1962
1962
|
for (_e(f), p && clearTimeout(p), p = setTimeout(function() {
|
|
1963
1963
|
p = null;
|
|
1964
1964
|
}, g), I = 0; I < X; ++I)
|
|
1965
|
-
|
|
1965
|
+
P = D[I], v.touch0 && v.touch0[2] === P.identifier ? delete v.touch0 : v.touch1 && v.touch1[2] === P.identifier && delete v.touch1;
|
|
1966
1966
|
if (v.touch1 && !v.touch0 && (v.touch0 = v.touch1, delete v.touch1), v.touch0) v.touch0[1] = this.__zoom.invert(v.touch0[0]);
|
|
1967
|
-
else if (v.end(), v.taps === 2 && (
|
|
1967
|
+
else if (v.end(), v.taps === 2 && (P = Nt(P, this), Math.hypot(d[0] - P[0], d[1] - P[1]) < $)) {
|
|
1968
1968
|
var h = at(this).on("dblclick.zoom");
|
|
1969
1969
|
h && h.apply(this, arguments);
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
|
-
return
|
|
1974
|
-
return arguments.length ? (n = typeof f == "function" ? f : ie(+f),
|
|
1975
|
-
},
|
|
1976
|
-
return arguments.length ? (t = typeof f == "function" ? f : ie(!!f),
|
|
1977
|
-
},
|
|
1978
|
-
return arguments.length ? (o = typeof f == "function" ? f : ie(!!f),
|
|
1979
|
-
},
|
|
1980
|
-
return arguments.length ? (e = typeof f == "function" ? f : ie([[+f[0][0], +f[0][1]], [+f[1][0], +f[1][1]]]),
|
|
1981
|
-
},
|
|
1982
|
-
return arguments.length ? (a[0] = +f[0], a[1] = +f[1],
|
|
1983
|
-
},
|
|
1984
|
-
return arguments.length ? (i[0][0] = +f[0][0], i[1][0] = +f[1][0], i[0][1] = +f[0][1], i[1][1] = +f[1][1],
|
|
1985
|
-
},
|
|
1986
|
-
return arguments.length ? (r = f,
|
|
1987
|
-
},
|
|
1988
|
-
return arguments.length ? (c = +f,
|
|
1989
|
-
},
|
|
1990
|
-
return arguments.length ? (l = f,
|
|
1991
|
-
},
|
|
1973
|
+
return Y.wheelDelta = function(f) {
|
|
1974
|
+
return arguments.length ? (n = typeof f == "function" ? f : ie(+f), Y) : n;
|
|
1975
|
+
}, Y.filter = function(f) {
|
|
1976
|
+
return arguments.length ? (t = typeof f == "function" ? f : ie(!!f), Y) : t;
|
|
1977
|
+
}, Y.touchable = function(f) {
|
|
1978
|
+
return arguments.length ? (o = typeof f == "function" ? f : ie(!!f), Y) : o;
|
|
1979
|
+
}, Y.extent = function(f) {
|
|
1980
|
+
return arguments.length ? (e = typeof f == "function" ? f : ie([[+f[0][0], +f[0][1]], [+f[1][0], +f[1][1]]]), Y) : e;
|
|
1981
|
+
}, Y.scaleExtent = function(f) {
|
|
1982
|
+
return arguments.length ? (a[0] = +f[0], a[1] = +f[1], Y) : [a[0], a[1]];
|
|
1983
|
+
}, Y.translateExtent = function(f) {
|
|
1984
|
+
return arguments.length ? (i[0][0] = +f[0][0], i[1][0] = +f[1][0], i[0][1] = +f[0][1], i[1][1] = +f[1][1], Y) : [[i[0][0], i[0][1]], [i[1][0], i[1][1]]];
|
|
1985
|
+
}, Y.constrain = function(f) {
|
|
1986
|
+
return arguments.length ? (r = f, Y) : r;
|
|
1987
|
+
}, Y.duration = function(f) {
|
|
1988
|
+
return arguments.length ? (c = +f, Y) : c;
|
|
1989
|
+
}, Y.interpolate = function(f) {
|
|
1990
|
+
return arguments.length ? (l = f, Y) : l;
|
|
1991
|
+
}, Y.on = function() {
|
|
1992
1992
|
var f = s.on.apply(s, arguments);
|
|
1993
|
-
return f === s ?
|
|
1994
|
-
},
|
|
1995
|
-
return arguments.length ? (
|
|
1996
|
-
},
|
|
1997
|
-
return arguments.length ? (
|
|
1998
|
-
},
|
|
1993
|
+
return f === s ? Y : f;
|
|
1994
|
+
}, Y.clickDistance = function(f) {
|
|
1995
|
+
return arguments.length ? (B = (f = +f) * f, Y) : Math.sqrt(B);
|
|
1996
|
+
}, Y.tapDistance = function(f) {
|
|
1997
|
+
return arguments.length ? ($ = +f, Y) : $;
|
|
1998
|
+
}, Y;
|
|
1999
1999
|
}
|
|
2000
2000
|
const Ee = {
|
|
2001
2001
|
// Edge Routing
|
|
@@ -2332,13 +2332,13 @@ function Ga(t) {
|
|
|
2332
2332
|
if (o && a) {
|
|
2333
2333
|
const i = a.getBBox(), c = o.parentElement;
|
|
2334
2334
|
if (c) {
|
|
2335
|
-
const l = c.clientWidth, s = c.clientHeight, u = i.width, d = i.height, p = i.x + u / 2, g = i.y + d / 2,
|
|
2336
|
-
l / 2 -
|
|
2337
|
-
s / 2 -
|
|
2335
|
+
const l = c.clientWidth, s = c.clientHeight, u = i.width, d = i.height, p = i.x + u / 2, g = i.y + d / 2, R = 0.8 / Math.max(u / l, d / s), B = [
|
|
2336
|
+
l / 2 - R * p,
|
|
2337
|
+
s / 2 - R * g
|
|
2338
2338
|
];
|
|
2339
2339
|
e.call(
|
|
2340
2340
|
n.transform,
|
|
2341
|
-
Pt.translate(
|
|
2341
|
+
Pt.translate(B[0], B[1]).scale(R)
|
|
2342
2342
|
);
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
@@ -2405,12 +2405,12 @@ function Ya(t, e) {
|
|
|
2405
2405
|
const u = o.get(s.sourceNode._gvid), d = o.get(s.targetNode._gvid);
|
|
2406
2406
|
if (u === void 0 || d === void 0) return;
|
|
2407
2407
|
s.depth = Math.abs(d - u) - 1, s.depth < 0 && (s.depth = 0);
|
|
2408
|
-
const p = Math.min(u, d), g = Math.max(u, d),
|
|
2409
|
-
l.has(
|
|
2408
|
+
const p = Math.min(u, d), g = Math.max(u, d), R = `${p}-${g}`;
|
|
2409
|
+
l.has(R) || l.set(R, new Ca(u, d, 0)), l.get(R).addEdge(s);
|
|
2410
2410
|
}), l.forEach((s) => {
|
|
2411
2411
|
s.edges.sort((u, d) => {
|
|
2412
|
-
const p = u.getStartPoint(), g = u.getEndPoint(),
|
|
2413
|
-
return (
|
|
2412
|
+
const p = u.getStartPoint(), g = u.getEndPoint(), R = p && g ? (p.y + g.y) / 2 : 0, B = d.getStartPoint(), $ = d.getEndPoint();
|
|
2413
|
+
return (B && $ ? (B.y + $.y) / 2 : 0) - R;
|
|
2414
2414
|
});
|
|
2415
2415
|
}), { nodeColumnMap: o, nodeColumns: c, edgeColumns: l };
|
|
2416
2416
|
}
|
|
@@ -2439,8 +2439,8 @@ function Ba(t, e) {
|
|
|
2439
2439
|
const l = i.getStartPoint(), s = i.getEndPoint(), u = l && s ? (l.y + s.y) / 2 : 0;
|
|
2440
2440
|
o.forEach((d, p) => {
|
|
2441
2441
|
if (d === i) return;
|
|
2442
|
-
const g = d.getStartPoint(),
|
|
2443
|
-
(g &&
|
|
2442
|
+
const g = d.getStartPoint(), R = d.getEndPoint();
|
|
2443
|
+
(g && R ? (g.y + R.y) / 2 : 0) > u ? d.baseDirection = "above" : d.baseDirection = "below";
|
|
2444
2444
|
});
|
|
2445
2445
|
});
|
|
2446
2446
|
}
|
|
@@ -2451,40 +2451,40 @@ function ae(t, e, r, n = Ee) {
|
|
|
2451
2451
|
const c = { x: o.x, y: e - o.y }, l = { x: a.x, y: e - a.y };
|
|
2452
2452
|
let s = { x: l.x, y: l.y };
|
|
2453
2453
|
i === "right" ? s = { x: l.x - n.arrowWidth, y: l.y } : i === "left" && (s = { x: l.x + n.arrowWidth, y: l.y });
|
|
2454
|
-
const u = n.horizontalExtension, d = n.minEdgeDistance, p = n.minVerticalSegment, g = (
|
|
2455
|
-
if (
|
|
2456
|
-
const U = [
|
|
2457
|
-
for (let et = 1; et <
|
|
2454
|
+
const u = n.horizontalExtension, d = n.minEdgeDistance, p = n.minVerticalSegment, g = (O) => {
|
|
2455
|
+
if (O.length < 2) return O;
|
|
2456
|
+
const U = [O[0]];
|
|
2457
|
+
for (let et = 1; et < O.length; et++) {
|
|
2458
2458
|
const nt = U[U.length - 1];
|
|
2459
|
-
(Math.abs(
|
|
2459
|
+
(Math.abs(O[et].x - nt.x) > 0.1 || Math.abs(O[et].y - nt.y) > 0.1) && U.push(O[et]);
|
|
2460
2460
|
}
|
|
2461
2461
|
return U;
|
|
2462
2462
|
};
|
|
2463
|
-
let
|
|
2464
|
-
const
|
|
2465
|
-
t.baseDirection === "above" ?
|
|
2466
|
-
let
|
|
2467
|
-
if (!
|
|
2463
|
+
let R;
|
|
2464
|
+
const B = t.baseDirection === void 0;
|
|
2465
|
+
t.baseDirection === "above" ? R = Math.min(c.y, s.y) : t.baseDirection === "below" ? R = Math.max(c.y, s.y) : R = (c.y + s.y) / 2;
|
|
2466
|
+
let $ = R;
|
|
2467
|
+
if (!B && r && r.midY !== void 0) {
|
|
2468
2468
|
if (t.baseDirection === "above") {
|
|
2469
|
-
const
|
|
2470
|
-
|
|
2469
|
+
const O = r.midY - d;
|
|
2470
|
+
$ > O && ($ = O);
|
|
2471
2471
|
} else if (t.baseDirection === "below") {
|
|
2472
|
-
const
|
|
2473
|
-
|
|
2472
|
+
const O = r.midY + d;
|
|
2473
|
+
$ < O && ($ = O);
|
|
2474
2474
|
}
|
|
2475
2475
|
}
|
|
2476
|
-
const
|
|
2477
|
-
const et = Math.abs(c.y - U), nt = Math.abs(U - s.y),
|
|
2478
|
-
let
|
|
2479
|
-
switch (
|
|
2476
|
+
const Y = Math.abs(c.y - s.y) < 5, J = (O, U) => {
|
|
2477
|
+
const et = Math.abs(c.y - U), nt = Math.abs(U - s.y), G = i === "right" ? c.x + u : c.x - u, F = i === "right" ? s.x - u : s.x + u;
|
|
2478
|
+
let H = [], Q = U;
|
|
2479
|
+
switch (O) {
|
|
2480
2480
|
case "straight":
|
|
2481
|
-
if (
|
|
2481
|
+
if (Y) {
|
|
2482
2482
|
const M = (c.y + s.y) / 2;
|
|
2483
|
-
Math.abs(U - M) < p ? (
|
|
2483
|
+
Math.abs(U - M) < p ? (H = [c, s], Q = M) : (H = [
|
|
2484
2484
|
c,
|
|
2485
|
-
{ x:
|
|
2485
|
+
{ x: G, y: c.y },
|
|
2486
2486
|
// H: horizontal extension
|
|
2487
|
-
{ x:
|
|
2487
|
+
{ x: G, y: U },
|
|
2488
2488
|
// V: vertical to midY
|
|
2489
2489
|
{ x: F, y: U },
|
|
2490
2490
|
// H: horizontal at midY
|
|
@@ -2497,11 +2497,11 @@ function ae(t, e, r, n = Ee) {
|
|
|
2497
2497
|
return null;
|
|
2498
2498
|
break;
|
|
2499
2499
|
case "2seg":
|
|
2500
|
-
et < nt ? Math.abs(U - c.y) < p ? (
|
|
2500
|
+
et < nt ? Math.abs(U - c.y) < p ? (H = [c, { x: s.x, y: c.y }, s], Q = c.y) : (H = [
|
|
2501
2501
|
c,
|
|
2502
|
-
{ x:
|
|
2502
|
+
{ x: G, y: c.y },
|
|
2503
2503
|
// H: horizontal extension
|
|
2504
|
-
{ x:
|
|
2504
|
+
{ x: G, y: U },
|
|
2505
2505
|
// V: vertical to midY
|
|
2506
2506
|
{ x: F, y: U },
|
|
2507
2507
|
// H: horizontal at midY
|
|
@@ -2509,19 +2509,19 @@ function ae(t, e, r, n = Ee) {
|
|
|
2509
2509
|
// V: vertical to end
|
|
2510
2510
|
s
|
|
2511
2511
|
// H: horizontal to end
|
|
2512
|
-
], Q = U) : Math.abs(U - s.y) < p ? (
|
|
2512
|
+
], Q = U) : Math.abs(U - s.y) < p ? (H = [
|
|
2513
2513
|
c,
|
|
2514
|
-
{ x:
|
|
2514
|
+
{ x: G, y: c.y },
|
|
2515
2515
|
// H: horizontal extension
|
|
2516
|
-
{ x:
|
|
2516
|
+
{ x: G, y: s.y },
|
|
2517
2517
|
// V: vertical to end.y
|
|
2518
2518
|
s
|
|
2519
2519
|
// H: horizontal to end
|
|
2520
|
-
], Q = s.y) : (
|
|
2520
|
+
], Q = s.y) : (H = [
|
|
2521
2521
|
c,
|
|
2522
|
-
{ x:
|
|
2522
|
+
{ x: G, y: c.y },
|
|
2523
2523
|
// H: horizontal extension
|
|
2524
|
-
{ x:
|
|
2524
|
+
{ x: G, y: U },
|
|
2525
2525
|
// V: vertical to midY
|
|
2526
2526
|
{ x: F, y: U },
|
|
2527
2527
|
// H: horizontal at midY
|
|
@@ -2533,21 +2533,21 @@ function ae(t, e, r, n = Ee) {
|
|
|
2533
2533
|
break;
|
|
2534
2534
|
case "3seg":
|
|
2535
2535
|
const f = U;
|
|
2536
|
-
|
|
2536
|
+
H = [
|
|
2537
2537
|
c,
|
|
2538
|
-
{ x:
|
|
2539
|
-
{ x:
|
|
2538
|
+
{ x: G, y: c.y },
|
|
2539
|
+
{ x: G, y: f },
|
|
2540
2540
|
{ x: F, y: f },
|
|
2541
2541
|
{ x: F, y: s.y },
|
|
2542
2542
|
s
|
|
2543
2543
|
], Q = f;
|
|
2544
2544
|
break;
|
|
2545
2545
|
case "4seg":
|
|
2546
|
-
|
|
2546
|
+
H = [
|
|
2547
2547
|
c,
|
|
2548
|
-
{ x:
|
|
2548
|
+
{ x: G, y: c.y },
|
|
2549
2549
|
// H: horizontal extension from start
|
|
2550
|
-
{ x:
|
|
2550
|
+
{ x: G, y: U },
|
|
2551
2551
|
// V: vertical to midY
|
|
2552
2552
|
{ x: F, y: U },
|
|
2553
2553
|
// H: horizontal at midY to end extension
|
|
@@ -2557,9 +2557,9 @@ function ae(t, e, r, n = Ee) {
|
|
|
2557
2557
|
break;
|
|
2558
2558
|
case "5seg":
|
|
2559
2559
|
if (et < p)
|
|
2560
|
-
|
|
2560
|
+
H = [
|
|
2561
2561
|
c,
|
|
2562
|
-
{ x:
|
|
2562
|
+
{ x: G, y: c.y },
|
|
2563
2563
|
// H: horizontal extension
|
|
2564
2564
|
{ x: F, y: U },
|
|
2565
2565
|
// H: horizontal at midY (skip V since start.y ≈ testMidY)
|
|
@@ -2569,11 +2569,11 @@ function ae(t, e, r, n = Ee) {
|
|
|
2569
2569
|
// H: horizontal to end
|
|
2570
2570
|
], Q = U;
|
|
2571
2571
|
else if (nt < p)
|
|
2572
|
-
|
|
2572
|
+
H = [
|
|
2573
2573
|
c,
|
|
2574
|
-
{ x:
|
|
2574
|
+
{ x: G, y: c.y },
|
|
2575
2575
|
// H: horizontal extension
|
|
2576
|
-
{ x:
|
|
2576
|
+
{ x: G, y: U },
|
|
2577
2577
|
// V: vertical to midY
|
|
2578
2578
|
{ x: F, y: U },
|
|
2579
2579
|
// H: horizontal at midY
|
|
@@ -2584,27 +2584,27 @@ function ae(t, e, r, n = Ee) {
|
|
|
2584
2584
|
return null;
|
|
2585
2585
|
break;
|
|
2586
2586
|
case "6seg":
|
|
2587
|
-
|
|
2587
|
+
H = [
|
|
2588
2588
|
c,
|
|
2589
|
-
{ x:
|
|
2590
|
-
{ x:
|
|
2589
|
+
{ x: G, y: c.y },
|
|
2590
|
+
{ x: G, y: U },
|
|
2591
2591
|
{ x: F, y: U },
|
|
2592
2592
|
{ x: F, y: s.y },
|
|
2593
2593
|
s
|
|
2594
2594
|
], Q = U;
|
|
2595
2595
|
break;
|
|
2596
2596
|
}
|
|
2597
|
-
const
|
|
2598
|
-
return
|
|
2597
|
+
const N = g(H);
|
|
2598
|
+
return N.length > 0 ? { points: N, actualMidY: Q } : null;
|
|
2599
2599
|
};
|
|
2600
|
-
let
|
|
2601
|
-
|
|
2602
|
-
for (const
|
|
2603
|
-
const U = J(
|
|
2600
|
+
let j;
|
|
2601
|
+
B ? j = Y ? ["straight", "3seg"] : ["3seg"] : j = Y ? ["straight", "3seg", "4seg", "5seg", "6seg"] : ["3seg", "4seg", "5seg", "6seg"];
|
|
2602
|
+
for (const O of j) {
|
|
2603
|
+
const U = J(O, $);
|
|
2604
2604
|
if (U)
|
|
2605
2605
|
return { midY: U.actualMidY, points: U.points };
|
|
2606
2606
|
}
|
|
2607
|
-
const A = J("6seg",
|
|
2607
|
+
const A = J("6seg", $);
|
|
2608
2608
|
return A ? { midY: A.actualMidY, points: A.points } : void 0;
|
|
2609
2609
|
}
|
|
2610
2610
|
function hr(t, e) {
|
|
@@ -2616,39 +2616,39 @@ function hr(t, e) {
|
|
|
2616
2616
|
for (let o = 1; o < t.length - 1; o++) {
|
|
2617
2617
|
const a = t[o - 1], i = t[o], c = t[o + 1], l = Math.sqrt((i.x - a.x) ** 2 + (i.y - a.y) ** 2), s = Math.sqrt((c.x - i.x) ** 2 + (c.y - i.y) ** 2), u = Math.min(l, s) / 2, d = Math.min(e, u);
|
|
2618
2618
|
if (d > 0) {
|
|
2619
|
-
const p = d / l, g = d / s,
|
|
2619
|
+
const p = d / l, g = d / s, R = {
|
|
2620
2620
|
x: i.x - (i.x - a.x) * p,
|
|
2621
2621
|
y: i.y - (i.y - a.y) * p
|
|
2622
|
-
},
|
|
2622
|
+
}, B = {
|
|
2623
2623
|
x: i.x + (c.x - i.x) * g,
|
|
2624
2624
|
y: i.y + (c.y - i.y) * g
|
|
2625
2625
|
};
|
|
2626
|
-
r.push(`L${
|
|
2626
|
+
r.push(`L${R.x},${R.y}`), r.push(`Q${i.x},${i.y} ${B.x},${B.y}`);
|
|
2627
2627
|
} else
|
|
2628
2628
|
r.push(`L${i.x},${i.y}`);
|
|
2629
2629
|
}
|
|
2630
2630
|
const n = t[t.length - 1];
|
|
2631
2631
|
return r.push(`L${n.x},${n.y}`), r.join(" ");
|
|
2632
2632
|
}
|
|
2633
|
-
function Pa(t, e, r, n = Ee, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, p, g,
|
|
2634
|
-
var U, et, nt,
|
|
2635
|
-
const
|
|
2633
|
+
function Pa(t, e, r, n = Ee, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, p, g, R = !1) {
|
|
2634
|
+
var U, et, nt, G;
|
|
2635
|
+
const B = p != null && t.edgeIndex === p, $ = t.getColor(), Y = e.append("g").attr("class", B ? "edge selected" : "edge").attr("id", `edge_${t._gvid}`).attr("data-edge-id", t.edgeIndex !== void 0 ? String(t.edgeIndex) : "").attr("data-is-base", t.isBaseEdge ? "true" : "false").attr("data-color", $), J = t.getStartPoint(), j = t.getEndPoint(), A = t.getDirection();
|
|
2636
2636
|
console.log(
|
|
2637
2637
|
`Edge ${t._gvid}: direction=${A}, isBase=${t.isBaseEdge}, depth=${t.depth}`,
|
|
2638
2638
|
{
|
|
2639
2639
|
start: J,
|
|
2640
|
-
end:
|
|
2640
|
+
end: j,
|
|
2641
2641
|
sourceNode: (U = t.sourceNode) == null ? void 0 : U.name,
|
|
2642
2642
|
targetNode: (et = t.targetNode) == null ? void 0 : et.name
|
|
2643
2643
|
}
|
|
2644
2644
|
);
|
|
2645
|
-
const
|
|
2646
|
-
if (n.arrowHeight, J &&
|
|
2647
|
-
const F = { x: J.x, y: r - J.y },
|
|
2648
|
-
let
|
|
2649
|
-
A === "right" ?
|
|
2645
|
+
const O = n.arrowWidth;
|
|
2646
|
+
if (n.arrowHeight, J && j && A) {
|
|
2647
|
+
const F = { x: J.x, y: r - J.y }, H = { x: j.x, y: r - j.y }, Q = { x: H.x, y: H.y };
|
|
2648
|
+
let N = { x: H.x, y: H.y };
|
|
2649
|
+
A === "right" ? N = { x: H.x - O, y: H.y } : A === "left" ? N = { x: H.x + O, y: H.y } : A === "self" && (N = { x: H.x + O, y: H.y });
|
|
2650
2650
|
let f;
|
|
2651
|
-
const M = n.loopRadius, v = n.horizontalExtension,
|
|
2651
|
+
const M = n.loopRadius, v = n.horizontalExtension, D = n.cornerRadius;
|
|
2652
2652
|
if (o)
|
|
2653
2653
|
if (A === "self")
|
|
2654
2654
|
if (t.virtualNode) {
|
|
@@ -2663,88 +2663,88 @@ function Pa(t, e, r, n = Ee, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, p, g, _ =
|
|
|
2663
2663
|
// Extend left
|
|
2664
2664
|
{ x: F.x - v, y: m },
|
|
2665
2665
|
// Go to virtual node height
|
|
2666
|
-
{ x:
|
|
2666
|
+
{ x: N.x + v, y: m },
|
|
2667
2667
|
// Horizontal segment through virtual node
|
|
2668
|
-
{ x:
|
|
2668
|
+
{ x: N.x + v, y: N.y },
|
|
2669
2669
|
// Go down to rightIn
|
|
2670
|
-
|
|
2670
|
+
N
|
|
2671
2671
|
// rightIn of source node
|
|
2672
2672
|
];
|
|
2673
|
-
f = hr(x,
|
|
2673
|
+
f = hr(x, D);
|
|
2674
2674
|
} else {
|
|
2675
|
-
const m = F.x - M, x = F.y - M, b =
|
|
2676
|
-
f = `M${F.x},${F.y} C${m},${x} ${b},${y} ${
|
|
2675
|
+
const m = F.x - M, x = F.y - M, b = N.x + M, y = N.y - M;
|
|
2676
|
+
f = `M${F.x},${F.y} C${m},${x} ${b},${y} ${N.x},${N.y}`;
|
|
2677
2677
|
}
|
|
2678
2678
|
} else {
|
|
2679
|
-
const E = F.x - M, m = F.y - M, x =
|
|
2680
|
-
f = `M${F.x},${F.y} C${E},${m} ${x},${b} ${
|
|
2679
|
+
const E = F.x - M, m = F.y - M, x = N.x + M, b = N.y - M;
|
|
2680
|
+
f = `M${F.x},${F.y} C${E},${m} ${x},${b} ${N.x},${N.y}`;
|
|
2681
2681
|
}
|
|
2682
2682
|
else {
|
|
2683
2683
|
let E;
|
|
2684
2684
|
if (t.orthogonalPathPoints && t.orthogonalPathPoints.length > 0)
|
|
2685
2685
|
E = t.orthogonalPathPoints;
|
|
2686
2686
|
else {
|
|
2687
|
-
const m = Math.abs(F.y - t.midY), x = Math.abs(t.midY -
|
|
2687
|
+
const m = Math.abs(F.y - t.midY), x = Math.abs(t.midY - N.y), b = 20, y = m >= b, C = x >= b, _ = A === "right" ? F.x + v : F.x - v, L = A === "right" ? N.x - v : N.x + v;
|
|
2688
2688
|
if (E = [], !y && !C) {
|
|
2689
|
-
const
|
|
2689
|
+
const q = (F.y + N.y) / 2;
|
|
2690
2690
|
E.push(
|
|
2691
2691
|
F,
|
|
2692
|
-
{ x:
|
|
2693
|
-
{ x:
|
|
2694
|
-
|
|
2692
|
+
{ x: _, y: q },
|
|
2693
|
+
{ x: L, y: q },
|
|
2694
|
+
N
|
|
2695
2695
|
);
|
|
2696
2696
|
} else y ? C ? E.push(
|
|
2697
2697
|
F,
|
|
2698
|
-
{ x:
|
|
2699
|
-
{ x:
|
|
2700
|
-
{ x:
|
|
2701
|
-
{ x:
|
|
2702
|
-
|
|
2698
|
+
{ x: _, y: F.y },
|
|
2699
|
+
{ x: _, y: t.midY },
|
|
2700
|
+
{ x: L, y: t.midY },
|
|
2701
|
+
{ x: L, y: N.y },
|
|
2702
|
+
N
|
|
2703
2703
|
) : E.push(
|
|
2704
2704
|
F,
|
|
2705
|
-
{ x:
|
|
2706
|
-
{ x:
|
|
2707
|
-
{ x:
|
|
2708
|
-
|
|
2705
|
+
{ x: _, y: F.y },
|
|
2706
|
+
{ x: _, y: t.midY },
|
|
2707
|
+
{ x: L, y: t.midY },
|
|
2708
|
+
N
|
|
2709
2709
|
) : E.push(
|
|
2710
2710
|
F,
|
|
2711
|
-
{ x:
|
|
2712
|
-
{ x:
|
|
2713
|
-
{ x:
|
|
2714
|
-
|
|
2711
|
+
{ x: _, y: t.midY },
|
|
2712
|
+
{ x: L, y: t.midY },
|
|
2713
|
+
{ x: L, y: N.y },
|
|
2714
|
+
N
|
|
2715
2715
|
);
|
|
2716
2716
|
}
|
|
2717
|
-
f = hr(E,
|
|
2717
|
+
f = hr(E, D);
|
|
2718
2718
|
}
|
|
2719
2719
|
else if (A === "self") {
|
|
2720
|
-
const E = F.x - M, m = F.y - M, x =
|
|
2721
|
-
f = `M${F.x},${F.y} C${E},${m} ${x},${b} ${
|
|
2720
|
+
const E = F.x - M, m = F.y - M, x = N.x + M, b = N.y - M;
|
|
2721
|
+
f = `M${F.x},${F.y} C${E},${m} ${x},${b} ${N.x},${N.y}`;
|
|
2722
2722
|
} else {
|
|
2723
|
-
const E =
|
|
2724
|
-
|
|
2725
|
-
const m = 0.4, x = F.x + E * m, b = F.y, y =
|
|
2726
|
-
f = `M${F.x},${F.y} C${x},${b} ${y},${C} ${
|
|
2723
|
+
const E = N.x - F.x;
|
|
2724
|
+
N.y - F.y;
|
|
2725
|
+
const m = 0.4, x = F.x + E * m, b = F.y, y = N.x - E * m, C = N.y;
|
|
2726
|
+
f = `M${F.x},${F.y} C${x},${b} ${y},${C} ${N.x},${N.y}`;
|
|
2727
2727
|
}
|
|
2728
|
-
const X =
|
|
2729
|
-
|
|
2728
|
+
const X = R && t.isBaseEdge ? "#000000" : t.getColor(), I = R && t.isBaseEdge ? 4 : 1.5;
|
|
2729
|
+
Y.append("path").attr("d", f).attr("fill", "none").attr("stroke", "transparent").attr("stroke-width", 10).attr("class", "edge-hit-area").style("cursor", "pointer"), Y.append("path").attr("d", f).attr("fill", "none").attr("stroke", X).attr("stroke-width", I).attr("class", "edge-path").style("pointer-events", "none"), Y.on("mouseenter", function() {
|
|
2730
2730
|
at(this).raise();
|
|
2731
2731
|
});
|
|
2732
|
-
const
|
|
2732
|
+
const P = 12;
|
|
2733
2733
|
let h = "";
|
|
2734
|
-
A === "right" ? h = `translate(${Q.x -
|
|
2734
|
+
A === "right" ? h = `translate(${Q.x - P}, ${Q.y - P / 2})` : A === "left" ? h = `translate(${Q.x + P}, ${Q.y + P / 2}) rotate(180)` : A === "self" && (h = `translate(${Q.x + P}, ${Q.y + P / 2}) rotate(180)`), Y.append("use").attr("class", "edge-arrow").attr("href", "#arrow-right").attr("width", P).attr("height", P).attr("transform", h).attr("fill", X).attr("stroke", X).style("stroke-width", 0);
|
|
2735
2735
|
const w = {
|
|
2736
|
-
x: (F.x +
|
|
2736
|
+
x: (F.x + N.x) / 2,
|
|
2737
2737
|
y: t.midY
|
|
2738
2738
|
};
|
|
2739
2739
|
if (t.label) {
|
|
2740
2740
|
let E = "";
|
|
2741
2741
|
(nt = t.edgeContent) != null && nt.elems && t.edgeContent.elems.length > 0 && (E = t.edgeContent.elems.map((ct) => ct.text).join(" ")), E || (E = _a(t.label).map((mt) => mt.length > 20 ? mt.slice(0, 20) + "..." : mt).join(" "));
|
|
2742
|
-
const m = E.length > 60 ? E.slice(0, 60) + "..." : E, x = n.labelFontSize, b = x * 0.6, y = m.length * b, C = x,
|
|
2743
|
-
it.append("rect").attr("class", "label-bg").attr("x",
|
|
2744
|
-
const ht =
|
|
2745
|
-
if (rt && g &&
|
|
2746
|
-
ct.stopPropagation(), !
|
|
2747
|
-
}), (
|
|
2742
|
+
const m = E.length > 60 ? E.slice(0, 60) + "..." : E, x = n.labelFontSize, b = x * 0.6, y = m.length * b, C = x, _ = n.labelPadding, L = 16, q = B ? 16 : 0, rt = t.edgeIndex !== void 0, Z = rt && t.edgeIndex > a, S = rt && t.edgeIndex < i, T = (Z ? L : 0) + (S ? L : 0) + q, z = y + _ * 2 + T, k = C + _ * 2, tt = n.labelCornerRadius, ot = w.y, V = w.x, K = (ct) => at(`g.edge[data-edge-id="${ct}"]`), W = 12, it = Y.append("g").attr("class", "label-area");
|
|
2743
|
+
it.append("rect").attr("class", "label-bg").attr("x", V - z / 2).attr("y", ot - k / 2).attr("width", z).attr("height", k).attr("rx", tt).attr("ry", tt).attr("fill", "white").attr("stroke", X).attr("stroke-width", 1);
|
|
2744
|
+
const ht = V - z / 2 + L / 2, st = V + z / 2 - L / 2 - q, be = V + z / 2 - q / 2, It = V + (Z ? L / 2 : 0) - (S ? L / 2 : 0) - (B ? q / 2 : 0);
|
|
2745
|
+
if (rt && g && Y.style("cursor", "pointer").on("click", function(ct) {
|
|
2746
|
+
ct.stopPropagation(), !B && g(t.edgeIndex);
|
|
2747
|
+
}), (G = t.edgeContent) != null && G.elems && t.edgeContent.elems.length > 0) {
|
|
2748
2748
|
const Mt = t.edgeContent.elems.map((lt) => {
|
|
2749
2749
|
const pt = lt.text.length * 6.2, vt = lt.background && lt.background !== "transparent", Ot = pt + 2;
|
|
2750
2750
|
return { textWidth: pt, hasBackground: vt, totalWidth: Ot };
|
|
@@ -2756,9 +2756,9 @@ function Pa(t, e, r, n = Ee, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, p, g, _ =
|
|
|
2756
2756
|
});
|
|
2757
2757
|
} else
|
|
2758
2758
|
it.append("text").attr("class", "label-text").attr("x", It).attr("y", ot).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Inter, Helvetica, Arial").attr("font-size", "10px").attr("fill", X).style("pointer-events", "none").text(m);
|
|
2759
|
-
if (
|
|
2759
|
+
if (R && Y.append("circle").attr("cx", It).attr("cy", ot).attr("r", 4).attr("fill", "blue").attr("opacity", 0.8).style("pointer-events", "none").attr("class", "debug-label-center"), Z) {
|
|
2760
2760
|
const ct = t.edgeIndex - 1, mt = it.append("g").attr("class", "nav-btn-group prev-btn-group");
|
|
2761
|
-
mt.append("rect").attr("class", "nav-btn-area prev-btn-area").attr("x",
|
|
2761
|
+
mt.append("rect").attr("class", "nav-btn-area prev-btn-area").attr("x", V - z / 2).attr("y", ot - k / 2).attr("width", L).attr("height", k).attr("fill", "transparent").attr("rx", tt).style("cursor", "pointer").style("pointer-events", "all"), mt.append("use").attr("class", "nav-icon prev-icon").attr("href", "#nav-left").attr("x", ht - W / 2).attr("y", ot - W / 2).attr("width", W).attr("height", W).attr("fill", "#888"), mt.on("click", function(dt) {
|
|
2762
2762
|
dt.stopPropagation();
|
|
2763
2763
|
const Et = K(ct);
|
|
2764
2764
|
if (!Et.empty()) {
|
|
@@ -2785,8 +2785,8 @@ function Pa(t, e, r, n = Ee, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, p, g, _ =
|
|
|
2785
2785
|
});
|
|
2786
2786
|
}
|
|
2787
2787
|
if (S && t.edgeIndex !== void 0) {
|
|
2788
|
-
const ct = t.edgeIndex + 1, mt =
|
|
2789
|
-
dt.append("rect").attr("class", "nav-btn-area next-btn-area").attr("x",
|
|
2788
|
+
const ct = t.edgeIndex + 1, mt = B ? st : V + z / 2 - L / 2, dt = it.append("g").attr("class", "nav-btn-group next-btn-group");
|
|
2789
|
+
dt.append("rect").attr("class", "nav-btn-area next-btn-area").attr("x", V + z / 2 - L - q).attr("y", ot - k / 2).attr("width", L).attr("height", k).attr("fill", "transparent").attr("rx", tt).style("cursor", "pointer").style("pointer-events", "all"), dt.append("use").attr("class", "nav-icon next-icon").attr("href", "#nav-right").attr("x", mt - W / 2).attr("y", ot - W / 2).attr("width", W).attr("height", W).attr("fill", "#888"), dt.on("click", function(Et) {
|
|
2790
2790
|
Et.stopPropagation();
|
|
2791
2791
|
const bt = K(ct);
|
|
2792
2792
|
if (!bt.empty()) {
|
|
@@ -2812,7 +2812,7 @@ function Pa(t, e, r, n = Ee, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, p, g, _ =
|
|
|
2812
2812
|
}
|
|
2813
2813
|
});
|
|
2814
2814
|
}
|
|
2815
|
-
|
|
2815
|
+
B && rt && g && Y.append("text").attr("class", "close-btn").attr("x", be).attr("y", ot).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Arial").attr("font-size", "12px").attr("font-weight", "bold").attr("fill", "#888").style("cursor", "pointer").text("✕").on("mouseenter", function() {
|
|
2816
2816
|
at(this).attr("fill", "#EF4444");
|
|
2817
2817
|
}).on("mouseleave", function() {
|
|
2818
2818
|
at(this).attr("fill", "#888");
|
|
@@ -2821,34 +2821,34 @@ function Pa(t, e, r, n = Ee, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, p, g, _ =
|
|
|
2821
2821
|
});
|
|
2822
2822
|
} else t._ldraw_ && t._ldraw_.forEach((E) => {
|
|
2823
2823
|
if (E.op === "T" && E.text) {
|
|
2824
|
-
const m = E.size || 10, x = m * 0.6, b = E.text.length * x, y = m, C = 6,
|
|
2825
|
-
|
|
2824
|
+
const m = E.size || 10, x = m * 0.6, b = E.text.length * x, y = m, C = 6, _ = b + C * 2, L = y + C * 2, q = 4, rt = w.y;
|
|
2825
|
+
Y.append("rect").attr("x", w.x - _ / 2).attr("y", rt - L / 2).attr("width", _).attr("height", L).attr("rx", q).attr("ry", q).attr("fill", "white").attr("stroke", "#d0d0d0").attr("stroke-width", 0.5), Y.append("text").attr("x", w.x).attr("y", rt).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", E.face || "Inter, Helvetica, Arial").attr("font-size", `${m}px`).attr("fill", E.color || "#666").text(E.text);
|
|
2826
2826
|
}
|
|
2827
2827
|
});
|
|
2828
|
-
if (
|
|
2828
|
+
if (R) {
|
|
2829
2829
|
let E;
|
|
2830
|
-
t.depth === 0 ? E = `d:0 dir:${t.baseDirection || "base"} off:${t.baseOffset} id:${t._gvid}` : E = `d:${t.depth} dir:${t.baseDirection || "?"} midY:${Math.round(t.midY)} id:${t._gvid}`,
|
|
2830
|
+
t.depth === 0 ? E = `d:0 dir:${t.baseDirection || "base"} off:${t.baseOffset} id:${t._gvid}` : E = `d:${t.depth} dir:${t.baseDirection || "?"} midY:${Math.round(t.midY)} id:${t._gvid}`, Y.append("text").attr("x", w.x).attr("y", w.y + 15).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "monospace").attr("font-size", "9px").attr("fill", "#999").text(E);
|
|
2831
2831
|
}
|
|
2832
2832
|
} else
|
|
2833
2833
|
t._draw_ && t._draw_.forEach((F) => {
|
|
2834
2834
|
if (F.op === "b" && F.points) {
|
|
2835
|
-
const
|
|
2836
|
-
|
|
2835
|
+
const H = F.points.map(([N, f]) => [N, r - f]), Q = `M${H[0][0]},${H[0][1]} C${H.slice(1).map((N) => `${N[0]},${N[1]}`).join(" ")}`;
|
|
2836
|
+
Y.append("path").attr("d", Q).attr("fill", "none").attr("stroke", F.color || "#9AA4B2").attr("stroke-width", 2);
|
|
2837
2837
|
}
|
|
2838
2838
|
}), t._hdraw_ && t._hdraw_.forEach((F) => {
|
|
2839
2839
|
if (F.op === "P" && F.points) {
|
|
2840
|
-
const
|
|
2841
|
-
|
|
2840
|
+
const H = F.points.map(([Q, N]) => [Q, r - N]);
|
|
2841
|
+
Y.append("polygon").attr("points", H.map((Q) => Q.join(",")).join(" ")).attr("fill", F.color || "#9AA4B2");
|
|
2842
2842
|
}
|
|
2843
|
-
}), t._ldraw_ && $t(
|
|
2843
|
+
}), t._ldraw_ && $t(Y, t._ldraw_, r);
|
|
2844
2844
|
}
|
|
2845
2845
|
function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
2846
|
-
var
|
|
2846
|
+
var P;
|
|
2847
2847
|
t.innerHTML = "";
|
|
2848
|
-
const
|
|
2849
|
-
let [, ,
|
|
2850
|
-
const
|
|
2851
|
-
|
|
2848
|
+
const R = ((P = e.bb) == null ? void 0 : P.split(",").map(Number)) || [0, 0, 1e3, 800];
|
|
2849
|
+
let [, , B, $] = R;
|
|
2850
|
+
const Y = at(t).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${B} ${$}`).style("background", "white");
|
|
2851
|
+
Y.append("defs").html(`
|
|
2852
2852
|
<style>
|
|
2853
2853
|
@keyframes selected-pulse {
|
|
2854
2854
|
0%, 100% {
|
|
@@ -2920,8 +2920,8 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
2920
2920
|
<path d="M22.7076 16.7071L12.7076 26.7071C12.6147 26.8 12.5044 26.8737 12.383 26.924C12.2616 26.9743 12.1315 27.0001 12.0001 27.0001C11.8687 27.0001 11.7386 26.9743 11.6172 26.924C11.4958 26.8737 11.3855 26.8 11.2926 26.7071C11.1997 26.6142 11.126 26.5039 11.0757 26.3825C11.0254 26.2611 10.9995 26.131 10.9995 25.9996C10.9995 25.8682 11.0254 25.7381 11.0757 25.6167C11.126 25.4953 11.1997 25.385 11.2926 25.2921L20.5863 15.9996L11.2926 6.70708C11.1049 6.51944 10.9995 6.26494 10.9995 5.99958C10.9995 5.73422 11.1049 5.47972 11.2926 5.29208C11.4802 5.10444 11.7347 4.99902 12.0001 4.99902C12.2654 4.99902 12.5199 5.10444 12.7076 5.29208L22.7076 15.2921C22.8005 15.385 22.8743 15.4952 22.9246 15.6166C22.975 15.738 23.0009 15.8682 23.0009 15.9996C23.0009 16.131 22.975 16.2611 22.9246 16.3825C22.8743 16.5039 22.8005 16.6142 22.7076 16.7071Z"/>
|
|
2921
2921
|
</symbol>
|
|
2922
2922
|
`);
|
|
2923
|
-
const J =
|
|
2924
|
-
l &&
|
|
2923
|
+
const J = Y.append("g").attr("id", "graph0");
|
|
2924
|
+
l && Y.append("circle").attr("cx", B / 2).attr("cy", $ / 2).attr("r", 8).attr("fill", "red").attr("opacity", 0.9).style("pointer-events", "none").attr("class", "debug-center-marker");
|
|
2925
2925
|
const A = (e.objects || []).map(
|
|
2926
2926
|
(h) => new jr({
|
|
2927
2927
|
_gvid: h._gvid,
|
|
@@ -2935,9 +2935,9 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
2935
2935
|
height: p !== void 0 ? String(p / 72) : h.height,
|
|
2936
2936
|
label: h.label
|
|
2937
2937
|
})
|
|
2938
|
-
),
|
|
2938
|
+
), O = /* @__PURE__ */ new Map();
|
|
2939
2939
|
A.forEach((h) => {
|
|
2940
|
-
|
|
2940
|
+
O.set(h._gvid, h);
|
|
2941
2941
|
});
|
|
2942
2942
|
const et = (e.edges || []).map((h) => {
|
|
2943
2943
|
const w = new Ma({
|
|
@@ -2950,13 +2950,13 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
2950
2950
|
head: h.head,
|
|
2951
2951
|
tail: h.tail,
|
|
2952
2952
|
label: h.label
|
|
2953
|
-
}), E = h.tail !== void 0 ?
|
|
2953
|
+
}), E = h.tail !== void 0 ? O.get(h.tail) : void 0, m = h.head !== void 0 ? O.get(h.head) : void 0;
|
|
2954
2954
|
return E && m && w.setNodes(E, m), w;
|
|
2955
|
-
}), { nodeColumnMap: nt, nodeColumns:
|
|
2955
|
+
}), { nodeColumnMap: nt, nodeColumns: G, edgeColumns: F } = Ya(
|
|
2956
2956
|
A,
|
|
2957
2957
|
et
|
|
2958
2958
|
);
|
|
2959
|
-
console.log("debug:", { nodeColumnMap: nt, nodeColumns:
|
|
2959
|
+
console.log("debug:", { nodeColumnMap: nt, nodeColumns: G, edgeColumns: F }), console.log(
|
|
2960
2960
|
"debug: edges sorted by midpoint Y:",
|
|
2961
2961
|
Object.fromEntries(
|
|
2962
2962
|
Array.from(F.entries()).map(([h, w]) => [
|
|
@@ -2975,16 +2975,16 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
2975
2975
|
])
|
|
2976
2976
|
)
|
|
2977
2977
|
);
|
|
2978
|
-
const
|
|
2978
|
+
const H = Array.from(G.keys()).sort((h, w) => h - w), Q = H.length, N = 80;
|
|
2979
2979
|
let f;
|
|
2980
2980
|
if (g !== void 0)
|
|
2981
|
-
f = g,
|
|
2981
|
+
f = g, B = (Q > 1 ? (Q - 1) * f : 0) + 2 * N;
|
|
2982
2982
|
else {
|
|
2983
|
-
const h =
|
|
2983
|
+
const h = B - 2 * N;
|
|
2984
2984
|
f = Q > 1 ? h / (Q - 1) : 0;
|
|
2985
2985
|
}
|
|
2986
|
-
if (
|
|
2987
|
-
const E =
|
|
2986
|
+
if (H.forEach((h, w) => {
|
|
2987
|
+
const E = G.get(h);
|
|
2988
2988
|
if (!E) return;
|
|
2989
2989
|
const m = E.nodes;
|
|
2990
2990
|
if (m.length === 0) return;
|
|
@@ -2996,10 +2996,10 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
2996
2996
|
pos: S.pos
|
|
2997
2997
|
}))
|
|
2998
2998
|
);
|
|
2999
|
-
const x = Q > 1 ?
|
|
3000
|
-
m.sort((S,
|
|
3001
|
-
const
|
|
3002
|
-
return !
|
|
2999
|
+
const x = Q > 1 ? N + w * f : B / 2;
|
|
3000
|
+
m.sort((S, T) => {
|
|
3001
|
+
const z = S.getPosition(), k = T.getPosition();
|
|
3002
|
+
return !z || !k ? 0 : k[1] - z[1];
|
|
3003
3003
|
}), console.log(
|
|
3004
3004
|
`Column ${h} after sort:`,
|
|
3005
3005
|
m.map((S) => ({
|
|
@@ -3010,114 +3010,115 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
3010
3010
|
);
|
|
3011
3011
|
const b = 50, y = m.filter((S) => !S.virtualNode), C = y.length;
|
|
3012
3012
|
if (C === 0) {
|
|
3013
|
-
let S = (
|
|
3014
|
-
m.forEach((
|
|
3015
|
-
const
|
|
3016
|
-
S -=
|
|
3013
|
+
let S = ($ + m.reduce((T, z) => T + z.getHeightPoints(), 0)) / 2;
|
|
3014
|
+
m.forEach((T) => {
|
|
3015
|
+
const z = T.getHeightPoints();
|
|
3016
|
+
S -= z / 2, T.pos = `${x},${S}`, S -= z / 2;
|
|
3017
3017
|
});
|
|
3018
3018
|
return;
|
|
3019
3019
|
}
|
|
3020
|
-
let
|
|
3020
|
+
let _, L;
|
|
3021
3021
|
if (C % 2 === 1) {
|
|
3022
|
-
const S = Math.floor(C / 2),
|
|
3023
|
-
|
|
3022
|
+
const S = Math.floor(C / 2), T = y[S];
|
|
3023
|
+
L = m.indexOf(T), _ = $ / 2;
|
|
3024
3024
|
} else {
|
|
3025
|
-
const S = C / 2 - 1,
|
|
3026
|
-
y[
|
|
3025
|
+
const S = C / 2 - 1, T = C / 2, z = y[S];
|
|
3026
|
+
y[T], L = m.indexOf(z), _ = $ / 2;
|
|
3027
3027
|
}
|
|
3028
|
-
const
|
|
3029
|
-
|
|
3030
|
-
`Positioned center ${
|
|
3028
|
+
const q = m[L], rt = q.getHeightPoints();
|
|
3029
|
+
q.pos = `${x},${_}`, console.log(
|
|
3030
|
+
`Positioned center ${q.name} (virtual: ${q.virtualNode}) at ${q.pos}`
|
|
3031
3031
|
);
|
|
3032
|
-
let Z =
|
|
3033
|
-
for (let S =
|
|
3034
|
-
const
|
|
3035
|
-
Z += tt +
|
|
3036
|
-
`Positioned ${
|
|
3037
|
-
), Z +=
|
|
3032
|
+
let Z = _ + rt / 2;
|
|
3033
|
+
for (let S = L - 1; S >= 0; S--) {
|
|
3034
|
+
const T = m[S], z = m[S + 1], k = T.getHeightPoints(), tt = T.virtualNode || z.virtualNode ? 0 : b;
|
|
3035
|
+
Z += tt + k / 2, T.pos = `${x},${Z}`, console.log(
|
|
3036
|
+
`Positioned ${T.name} (virtual: ${T.virtualNode}) at ${T.pos}, spacing: ${tt}`
|
|
3037
|
+
), Z += k / 2;
|
|
3038
3038
|
}
|
|
3039
|
-
Z =
|
|
3040
|
-
for (let S =
|
|
3041
|
-
const
|
|
3042
|
-
Z -= tt +
|
|
3043
|
-
`Positioned ${
|
|
3044
|
-
), Z -=
|
|
3039
|
+
Z = _ - rt / 2;
|
|
3040
|
+
for (let S = L + 1; S < m.length; S++) {
|
|
3041
|
+
const T = m[S], z = m[S - 1], k = T.getHeightPoints(), tt = T.virtualNode || z.virtualNode ? 0 : b;
|
|
3042
|
+
Z -= tt + k / 2, T.pos = `${x},${Z}`, console.log(
|
|
3043
|
+
`Positioned ${T.name} (virtual: ${T.virtualNode}) at ${T.pos}, spacing: ${tt}`
|
|
3044
|
+
), Z -= k / 2;
|
|
3045
3045
|
}
|
|
3046
|
-
}), g !== void 0 &&
|
|
3046
|
+
}), g !== void 0 && Y.attr("viewBox", `0 0 ${B} ${$}`), G.forEach((h) => {
|
|
3047
3047
|
h.nodes.forEach((w) => {
|
|
3048
3048
|
const E = w.getPosition();
|
|
3049
3049
|
if (!E) return;
|
|
3050
3050
|
const [m, x] = E, b = w.getWidthPoints(), y = w.getHeightPoints(), C = w.virtualNode;
|
|
3051
3051
|
if (C && !l) return;
|
|
3052
|
-
const
|
|
3053
|
-
let
|
|
3052
|
+
const _ = J.append("g").attr("class", C ? "node virtual-node" : "node").attr("id", w.name);
|
|
3053
|
+
let L = null;
|
|
3054
3054
|
try {
|
|
3055
|
-
w.label && (
|
|
3056
|
-
} catch (
|
|
3057
|
-
console.warn(`Failed to decode node label for ${w.name}:`,
|
|
3055
|
+
w.label && (L = pr(w.label));
|
|
3056
|
+
} catch (V) {
|
|
3057
|
+
console.warn(`Failed to decode node label for ${w.name}:`, V);
|
|
3058
3058
|
}
|
|
3059
|
-
|
|
3059
|
+
L != null && L.key && _.attr("data-key", L.key);
|
|
3060
|
+
const q = l && C, rt = (L == null ? void 0 : L.tags) || [], Z = (L == null ? void 0 : L.label) || "", S = (L == null ? void 0 : L.text) || "", T = (L == null ? void 0 : L.color) || "#334155", z = (L == null ? void 0 : L.background) || "white", k = z !== "white", tt = k ? z : "#D5DFEA";
|
|
3060
3061
|
if ((rt.length > 0 || Z.length > 0) && !C) {
|
|
3061
|
-
const
|
|
3062
|
-
|
|
3063
|
-
const it =
|
|
3064
|
-
|
|
3062
|
+
const V = y / 2, K = y / 2, W = $ - x - y / 2;
|
|
3063
|
+
_.append("rect").attr("x", m - b / 2).attr("y", W).attr("width", b).attr("height", V).attr("rx", 5).attr("ry", 0).attr("fill", k ? z : "#EDF2F7").attr("stroke", tt).attr("stroke-width", 1), k && _.append("line").attr("x1", m - b / 2).attr("y1", W + V).attr("x2", m + b / 2).attr("y2", W + V).attr("stroke", T).attr("stroke-width", 1), _.append("rect").attr("x", m - b / 2).attr("y", W + V).attr("width", b).attr("height", K).attr("rx", 0).attr("ry", 5).attr("fill", z).attr("stroke", tt).attr("stroke-width", 1);
|
|
3064
|
+
const it = _.append("rect").attr("x", m - b / 2 - 4).attr("y", W - 4).attr("width", b + 8).attr("height", y + 8).attr("rx", 5).attr("ry", 5).attr("fill", "none").attr("stroke", "#000000").attr("stroke-width", 2).attr("opacity", 0).style("pointer-events", "none");
|
|
3065
|
+
_.style("cursor", "pointer").on("mouseenter", function() {
|
|
3065
3066
|
it.attr("opacity", 1);
|
|
3066
3067
|
}).on("mouseleave", function() {
|
|
3067
3068
|
it.attr("opacity", 0);
|
|
3068
3069
|
});
|
|
3069
3070
|
let ht = m - b / 2 + 8;
|
|
3070
|
-
const st =
|
|
3071
|
+
const st = W + V / 2, be = 7.2, It = 6, ct = 18, mt = 4;
|
|
3071
3072
|
if (rt.forEach((dt) => {
|
|
3072
3073
|
const bt = dt.length * be + It * 2;
|
|
3073
|
-
|
|
3074
|
+
_.append("rect").attr("x", ht).attr("y", st - ct / 2).attr("width", bt).attr("height", ct).attr("rx", 5).attr("ry", 5).attr("fill", "#FFF8E1").attr("stroke", "#FFD66D").attr("stroke-width", 1), _.append("text").attr("x", ht + It).attr("y", st).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-inter), Inter, Helvetica, Arial").attr("font-size", "12px").attr("font-weight", "500").attr("fill", "var(--text-warning-primary, #CD7004)").text(dt), ht += bt + mt;
|
|
3074
3075
|
}), Z) {
|
|
3075
|
-
const dt = m + b / 2 - 8 - ht, Et =
|
|
3076
|
+
const dt = m + b / 2 - 8 - ht, Et = _.append("text").attr("x", ht).attr("y", st).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-inter), Inter, Helvetica, Arial").attr("font-size", "12px").attr("font-weight", "600").attr("fill", T);
|
|
3076
3077
|
Re(Et, dt, Z);
|
|
3077
3078
|
}
|
|
3078
3079
|
if (S) {
|
|
3079
|
-
const dt = b - 16, Et =
|
|
3080
|
+
const dt = b - 16, Et = _.append("text").attr("x", m - b / 2 + 8).attr("y", W + V + K / 2).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-fira-code), Fira Code, monospace").attr("font-size", "12px").attr("font-weight", "400").attr("fill", T);
|
|
3080
3081
|
Re(Et, dt, S);
|
|
3081
3082
|
}
|
|
3082
3083
|
} else {
|
|
3083
|
-
const
|
|
3084
|
+
const V = _.append("rect").attr("x", m - b / 2).attr("y", $ - x - y / 2).attr("width", b).attr("height", y).attr("rx", 5).attr("ry", 5).attr("fill", z).attr("stroke", q ? "#EF4444" : "#D5DFEA").attr("stroke-width", q ? 2 : 1);
|
|
3084
3085
|
if (!C) {
|
|
3085
|
-
const K =
|
|
3086
|
-
|
|
3086
|
+
const K = _.append("rect").attr("x", m - b / 2 - 4).attr("y", $ - x - y / 2 - 4).attr("width", b + 8).attr("height", y + 8).attr("rx", 5).attr("ry", 5).attr("fill", "none").attr("stroke", "#000000").attr("stroke-width", 2).attr("opacity", 0).style("pointer-events", "none");
|
|
3087
|
+
V.style("cursor", "pointer").on("mouseenter", function() {
|
|
3087
3088
|
K.attr("opacity", 1);
|
|
3088
3089
|
}).on("mouseleave", function() {
|
|
3089
3090
|
K.attr("opacity", 0);
|
|
3090
3091
|
});
|
|
3091
3092
|
}
|
|
3092
|
-
if (
|
|
3093
|
+
if (L)
|
|
3093
3094
|
if (C) {
|
|
3094
3095
|
const K = Z || S;
|
|
3095
|
-
|
|
3096
|
+
_.append("text").attr("x", m).attr("y", $ - x).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Inter, Helvetica, Arial").attr("font-size", "10px").attr("fill", "#991B1B").text(
|
|
3096
3097
|
K.length > 20 ? K.slice(0, 20) + "..." : K
|
|
3097
3098
|
);
|
|
3098
3099
|
} else {
|
|
3099
|
-
const K = S || Z,
|
|
3100
|
-
Re(it,
|
|
3100
|
+
const K = S || Z, W = b - 16, it = _.append("text").attr("x", m - b / 2 + 8).attr("y", $ - x).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-fira-code), Fira Code, monospace").attr("font-size", "12px").attr("font-weight", "400").attr("fill", T);
|
|
3101
|
+
Re(it, W, K);
|
|
3101
3102
|
}
|
|
3102
3103
|
}
|
|
3103
|
-
!w.label && w._ldraw_ && w._ldraw_.length > 0 && !C && w._ldraw_.forEach((
|
|
3104
|
-
|
|
3104
|
+
!w.label && w._ldraw_ && w._ldraw_.length > 0 && !C && w._ldraw_.forEach((V) => {
|
|
3105
|
+
V.op === "T" && V.text && _.append("text").attr("x", m - b / 2 + 8).attr("y", $ - x).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", V.face || "Inter, Helvetica, Arial").attr("font-size", `${V.size || 11}px`).attr("fill", V.color || "#334155").text(V.text);
|
|
3105
3106
|
});
|
|
3106
3107
|
});
|
|
3107
3108
|
}), i) {
|
|
3108
|
-
Da(
|
|
3109
|
+
Da(G, $), Ba(et, F), console.log(
|
|
3109
3110
|
"debug: base edges selected:",
|
|
3110
3111
|
Object.fromEntries(
|
|
3111
3112
|
Array.from(F.entries()).map(([y, C]) => {
|
|
3112
|
-
var
|
|
3113
|
+
var _, L;
|
|
3113
3114
|
return [
|
|
3114
3115
|
y,
|
|
3115
3116
|
{
|
|
3116
|
-
baseEdge: (
|
|
3117
|
-
baseEdgeId: (
|
|
3117
|
+
baseEdge: (_ = C.baseEdge) == null ? void 0 : _.name,
|
|
3118
|
+
baseEdgeId: (L = C.baseEdge) == null ? void 0 : L.edgeIndex,
|
|
3118
3119
|
baseEdgeIndex: C.baseEdgeIndex,
|
|
3119
3120
|
totalEdges: C.edges.length,
|
|
3120
|
-
depth0Edges: C.edges.filter((
|
|
3121
|
+
depth0Edges: C.edges.filter((q) => q.depth === 0).length
|
|
3121
3122
|
}
|
|
3122
3123
|
];
|
|
3123
3124
|
})
|
|
@@ -3127,65 +3128,65 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
3127
3128
|
F.forEach((y) => {
|
|
3128
3129
|
const C = y.edges;
|
|
3129
3130
|
if (C.length === 0) return;
|
|
3130
|
-
const
|
|
3131
|
-
if (!
|
|
3132
|
-
const
|
|
3133
|
-
if (!
|
|
3134
|
-
const Z =
|
|
3135
|
-
|
|
3136
|
-
const
|
|
3137
|
-
|
|
3138
|
-
|
|
3131
|
+
const _ = y.baseEdge, L = y.baseEdgeIndex;
|
|
3132
|
+
if (!_ || L < 0) return;
|
|
3133
|
+
const q = _.getStartPoint(), rt = _.getEndPoint();
|
|
3134
|
+
if (!q || !rt) return;
|
|
3135
|
+
const Z = $ - q.y, S = $ - rt.y;
|
|
3136
|
+
_.midY = (Z + S) / 2;
|
|
3137
|
+
const T = ae(
|
|
3138
|
+
_,
|
|
3139
|
+
$,
|
|
3139
3140
|
void 0,
|
|
3140
3141
|
a
|
|
3141
3142
|
);
|
|
3142
|
-
|
|
3143
|
-
for (let
|
|
3144
|
-
const
|
|
3145
|
-
if (
|
|
3146
|
-
if (
|
|
3147
|
-
const
|
|
3148
|
-
|
|
3143
|
+
T && (_.midY = T.midY, _.orthogonalPathPoints = T.points), y.aboveY = _.midY, y.belowY = _.midY;
|
|
3144
|
+
for (let z = L - 1; z >= 0; z--) {
|
|
3145
|
+
const k = C[z];
|
|
3146
|
+
if (k.depth !== 0) continue;
|
|
3147
|
+
if (k.getDirection() === "self") {
|
|
3148
|
+
const W = k.getStartPoint();
|
|
3149
|
+
W && (k.midY = $ - W.y - h);
|
|
3149
3150
|
continue;
|
|
3150
3151
|
}
|
|
3151
|
-
const ot =
|
|
3152
|
-
|
|
3153
|
-
const
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3152
|
+
const ot = k.label ? w + E : w;
|
|
3153
|
+
k.midY = y.aboveY - ot, y.aboveY = k.midY, k.baseDirection = "above", k.baseOffset = -(L - z);
|
|
3154
|
+
const V = z < C.length - 1 ? C[z + 1] : void 0, K = ae(
|
|
3155
|
+
k,
|
|
3156
|
+
$,
|
|
3157
|
+
V,
|
|
3157
3158
|
a
|
|
3158
3159
|
);
|
|
3159
|
-
K && (
|
|
3160
|
+
K && (k.midY = K.midY, k.orthogonalPathPoints = K.points, y.aboveY = k.midY);
|
|
3160
3161
|
}
|
|
3161
|
-
for (let
|
|
3162
|
-
const
|
|
3163
|
-
if (
|
|
3164
|
-
if (
|
|
3165
|
-
const
|
|
3166
|
-
|
|
3162
|
+
for (let z = L + 1; z < C.length; z++) {
|
|
3163
|
+
const k = C[z];
|
|
3164
|
+
if (k.depth !== 0) continue;
|
|
3165
|
+
if (k.getDirection() === "self") {
|
|
3166
|
+
const W = k.getStartPoint();
|
|
3167
|
+
W && (k.midY = $ - W.y - h);
|
|
3167
3168
|
continue;
|
|
3168
3169
|
}
|
|
3169
|
-
const ot =
|
|
3170
|
-
|
|
3171
|
-
const
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3170
|
+
const ot = k.label ? w + E : w;
|
|
3171
|
+
k.midY = y.belowY + ot, y.belowY = k.midY, k.baseDirection = "below", k.baseOffset = z - L;
|
|
3172
|
+
const V = z > 0 ? C[z - 1] : void 0, K = ae(
|
|
3173
|
+
k,
|
|
3174
|
+
$,
|
|
3175
|
+
V,
|
|
3175
3176
|
a
|
|
3176
3177
|
);
|
|
3177
|
-
K && (
|
|
3178
|
+
K && (k.midY = K.midY, k.orthogonalPathPoints = K.points, y.belowY = k.midY);
|
|
3178
3179
|
}
|
|
3179
3180
|
});
|
|
3180
3181
|
const m = [];
|
|
3181
3182
|
F.forEach((y) => {
|
|
3182
3183
|
const C = y.edges;
|
|
3183
|
-
C.length === 0 || y.baseEdge || !C.every((
|
|
3184
|
-
if (
|
|
3185
|
-
m.push(
|
|
3184
|
+
C.length === 0 || y.baseEdge || !C.every((L) => L.depth > 0) || C.forEach((L) => {
|
|
3185
|
+
if (L.getDirection() !== "self")
|
|
3186
|
+
m.push(L);
|
|
3186
3187
|
else {
|
|
3187
|
-
const
|
|
3188
|
-
|
|
3188
|
+
const q = L.getStartPoint();
|
|
3189
|
+
q && (L.midY = $ - q.y - h);
|
|
3189
3190
|
}
|
|
3190
3191
|
});
|
|
3191
3192
|
}), m.sort((y, C) => y.depth - C.depth), console.log("Processing deep edges by depth:", {
|
|
@@ -3195,42 +3196,42 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
3195
3196
|
let x = 1 / 0, b = -1 / 0;
|
|
3196
3197
|
F.forEach((y) => {
|
|
3197
3198
|
y.aboveY !== 0 && (x = Math.min(x, y.aboveY)), y.belowY !== 0 && (b = Math.max(b, y.belowY));
|
|
3198
|
-
}),
|
|
3199
|
+
}), G.forEach((y) => {
|
|
3199
3200
|
y.aboveY !== 0 && (x = Math.min(x, y.aboveY)), y.belowY !== 0 && (b = Math.max(b, y.belowY));
|
|
3200
3201
|
}), console.log("Global bounds before deep edges:", {
|
|
3201
3202
|
globalAboveY: x,
|
|
3202
3203
|
globalBelowY: b
|
|
3203
3204
|
}), m.forEach((y) => {
|
|
3204
3205
|
if (!y.sourceNode || !y.targetNode) return;
|
|
3205
|
-
const C = nt.get(y.sourceNode._gvid),
|
|
3206
|
-
if (C === void 0 ||
|
|
3207
|
-
const
|
|
3208
|
-
for (let
|
|
3209
|
-
const it =
|
|
3206
|
+
const C = nt.get(y.sourceNode._gvid), _ = nt.get(y.targetNode._gvid);
|
|
3207
|
+
if (C === void 0 || _ === void 0) return;
|
|
3208
|
+
const L = Math.min(C, _), q = Math.max(C, _), rt = [];
|
|
3209
|
+
for (let W = L; W <= q; W++) {
|
|
3210
|
+
const it = G.get(W);
|
|
3210
3211
|
it && rt.push(...it.nodes);
|
|
3211
3212
|
}
|
|
3212
|
-
const Z = rt.map((
|
|
3213
|
-
const it =
|
|
3213
|
+
const Z = rt.map((W) => {
|
|
3214
|
+
const it = W.getPosition();
|
|
3214
3215
|
if (!it) return null;
|
|
3215
|
-
const ht =
|
|
3216
|
+
const ht = $ - it[1], st = W.height ? parseFloat(W.height) * 72 : 40;
|
|
3216
3217
|
return { y: ht, height: st, bottomY: ht + st / 2 };
|
|
3217
3218
|
}).filter(
|
|
3218
|
-
(
|
|
3219
|
-
).sort((
|
|
3219
|
+
(W) => W !== null
|
|
3220
|
+
).sort((W, it) => W.y - it.y);
|
|
3220
3221
|
let S;
|
|
3221
3222
|
if (Z.length === 0)
|
|
3222
3223
|
S = (x + b) / 2;
|
|
3223
3224
|
else if (Z.length % 2 === 1)
|
|
3224
3225
|
S = Z[Math.floor(Z.length / 2)].bottomY;
|
|
3225
3226
|
else {
|
|
3226
|
-
const
|
|
3227
|
-
S = (Z[
|
|
3227
|
+
const W = Z.length / 2;
|
|
3228
|
+
S = (Z[W - 1].bottomY + Z[W].bottomY) / 2;
|
|
3228
3229
|
}
|
|
3229
|
-
const
|
|
3230
|
+
const T = y.getStartPoint(), z = y.getEndPoint(), tt = (T && z ? $ - (T.y + z.y) / 2 : S) < S ? "above" : "below";
|
|
3230
3231
|
y.baseDirection = tt;
|
|
3231
3232
|
const ot = y.label ? w + E : w;
|
|
3232
|
-
let
|
|
3233
|
-
tt === "above" ? (y.midY = x - ot,
|
|
3233
|
+
let V;
|
|
3234
|
+
tt === "above" ? (y.midY = x - ot, V = x, x = y.midY) : (y.midY = b + ot, V = b, b = y.midY), console.log("Placed deep edge:", {
|
|
3234
3235
|
edgeIndex: y.edgeIndex,
|
|
3235
3236
|
depth: y.depth,
|
|
3236
3237
|
direction: tt,
|
|
@@ -3241,18 +3242,18 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
3241
3242
|
});
|
|
3242
3243
|
const K = ae(
|
|
3243
3244
|
y,
|
|
3244
|
-
|
|
3245
|
-
{ midY:
|
|
3245
|
+
$,
|
|
3246
|
+
{ midY: V },
|
|
3246
3247
|
a
|
|
3247
3248
|
);
|
|
3248
3249
|
K && (y.midY = K.midY, y.orthogonalPathPoints = K.points, tt === "above" ? x = Math.min(x, K.midY) : b = Math.max(b, K.midY));
|
|
3249
3250
|
});
|
|
3250
3251
|
}
|
|
3251
|
-
const M = et.map((h) => h.edgeIndex).filter((h) => h !== void 0), v = M.length > 0 ? Math.min(...M) : 0,
|
|
3252
|
+
const M = et.map((h) => h.edgeIndex).filter((h) => h !== void 0), v = M.length > 0 ? Math.min(...M) : 0, D = M.length > 0 ? Math.max(...M) : 0, X = We().scaleExtent([0.1, ba(t, B, c)]).on("zoom", (h) => {
|
|
3252
3253
|
const w = h.transform;
|
|
3253
3254
|
console.log("zoom event:", { x: w.x, y: w.y, k: w.k, isNaN: isNaN(w.x) || isNaN(w.y) || isNaN(w.k) }), !isNaN(w.x) && !isNaN(w.y) && !isNaN(w.k) && J.attr("transform", w.toString());
|
|
3254
3255
|
});
|
|
3255
|
-
if (
|
|
3256
|
+
if (Y.call(X), et.forEach((h) => {
|
|
3256
3257
|
if (n != null) {
|
|
3257
3258
|
if (o) {
|
|
3258
3259
|
if (h.depth > n) return;
|
|
@@ -3261,16 +3262,16 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
3261
3262
|
Pa(
|
|
3262
3263
|
h,
|
|
3263
3264
|
J,
|
|
3264
|
-
|
|
3265
|
+
$,
|
|
3265
3266
|
a,
|
|
3266
3267
|
i,
|
|
3267
3268
|
v,
|
|
3268
|
-
|
|
3269
|
+
D,
|
|
3269
3270
|
X,
|
|
3270
|
-
|
|
3271
|
+
Y,
|
|
3271
3272
|
t,
|
|
3272
|
-
|
|
3273
|
-
|
|
3273
|
+
B,
|
|
3274
|
+
$,
|
|
3274
3275
|
s,
|
|
3275
3276
|
u,
|
|
3276
3277
|
l
|
|
@@ -3284,18 +3285,18 @@ function Na(t, e, r, n, o = !0, a = Ee, i = !0, c = 14, l = !1, s, u, d, p, g) {
|
|
|
3284
3285
|
}
|
|
3285
3286
|
const I = J.node();
|
|
3286
3287
|
if (I) {
|
|
3287
|
-
const h = I.getBBox(), w = 0.9 *
|
|
3288
|
-
|
|
3288
|
+
const h = I.getBBox(), w = 0.9 * B / h.width, E = h.x + h.width / 2, m = h.y + h.height / 2, x = B / 2 - E * w, b = $ / 2 - m * w;
|
|
3289
|
+
Y.call(
|
|
3289
3290
|
X.transform,
|
|
3290
3291
|
Pt.translate(x, b).scale(w)
|
|
3291
3292
|
);
|
|
3292
3293
|
}
|
|
3293
3294
|
return {
|
|
3294
3295
|
zoomBehavior: X,
|
|
3295
|
-
svgElement:
|
|
3296
|
+
svgElement: Y.node(),
|
|
3296
3297
|
gElement: J.node(),
|
|
3297
3298
|
baseFontSize: c,
|
|
3298
|
-
viewBoxWidth:
|
|
3299
|
+
viewBoxWidth: B
|
|
3299
3300
|
};
|
|
3300
3301
|
}
|
|
3301
3302
|
function $t(t, e, r) {
|
|
@@ -3377,15 +3378,15 @@ function $a(t, e, r = 14) {
|
|
|
3377
3378
|
</style>
|
|
3378
3379
|
`);
|
|
3379
3380
|
const c = i.append("g").attr("id", "graph0");
|
|
3380
|
-
(e.objects || []).forEach((
|
|
3381
|
-
const
|
|
3382
|
-
|
|
3383
|
-
}), (e.edges || []).forEach((
|
|
3384
|
-
const
|
|
3385
|
-
|
|
3381
|
+
(e.objects || []).forEach((R) => {
|
|
3382
|
+
const B = c.append("g").attr("class", "node").attr("id", R.name);
|
|
3383
|
+
R._draw_ && $t(B, R._draw_, a), R._ldraw_ && $t(B, R._ldraw_, a);
|
|
3384
|
+
}), (e.edges || []).forEach((R) => {
|
|
3385
|
+
const B = c.append("g").attr("class", "edge").attr("id", `edge_${R._gvid}`);
|
|
3386
|
+
R._draw_ && $t(B, R._draw_, a), R._hdraw_ && $t(B, R._hdraw_, a), R._tdraw_ && $t(B, R._tdraw_, a), R._ldraw_ && $t(B, R._ldraw_, a);
|
|
3386
3387
|
});
|
|
3387
|
-
const u = We().scaleExtent([0.1, 10]).on("zoom", (
|
|
3388
|
-
c.attr("transform",
|
|
3388
|
+
const u = We().scaleExtent([0.1, 10]).on("zoom", (R) => {
|
|
3389
|
+
c.attr("transform", R.transform.toString());
|
|
3389
3390
|
});
|
|
3390
3391
|
i.call(u);
|
|
3391
3392
|
const d = t.clientWidth || 800, p = r * (d / o);
|
|
@@ -3425,13 +3426,13 @@ function Sa() {
|
|
|
3425
3426
|
const t = ut(null), e = ut(null), [r, n] = He(!1), [o, a] = He(null), i = Me(() => {
|
|
3426
3427
|
let s;
|
|
3427
3428
|
return Ie && (s = new Ie()), s.onmessage = (u) => {
|
|
3428
|
-
const { id: d, success: p, json: g, error:
|
|
3429
|
+
const { id: d, success: p, json: g, error: R } = u.data;
|
|
3429
3430
|
if (e.current && e.current.id === d) {
|
|
3430
3431
|
if (n(!1), p && g)
|
|
3431
3432
|
e.current.resolve(g);
|
|
3432
3433
|
else {
|
|
3433
|
-
const
|
|
3434
|
-
a(
|
|
3434
|
+
const B = new Error(R || "Unknown worker error");
|
|
3435
|
+
a(B.message), e.current.reject(B);
|
|
3435
3436
|
}
|
|
3436
3437
|
e.current = null;
|
|
3437
3438
|
}
|
|
@@ -3491,17 +3492,17 @@ const Oa = Tr(function({
|
|
|
3491
3492
|
debug: d = !1,
|
|
3492
3493
|
selectedEdgeId: p = null,
|
|
3493
3494
|
onEdgeSelect: g,
|
|
3494
|
-
useNativeRendering:
|
|
3495
|
-
nodeWidth:
|
|
3496
|
-
nodeHeight:
|
|
3497
|
-
nodeColumnSpacing:
|
|
3495
|
+
useNativeRendering: R = !1,
|
|
3496
|
+
nodeWidth: B = 240,
|
|
3497
|
+
nodeHeight: $ = 64,
|
|
3498
|
+
nodeColumnSpacing: Y = 800
|
|
3498
3499
|
}, J) {
|
|
3499
|
-
const
|
|
3500
|
+
const j = ut(null), { layout: A, cancel: O, isLoading: U, error: et } = Sa(), nt = ut(null), G = ut(null), F = ut(null), H = ut(14), Q = ut(1e3), N = ut(!1), f = ut(null), M = ut(null), v = ut(null), D = ut(null), X = ut(g);
|
|
3500
3501
|
return X.current = g, Vr(J, () => ({
|
|
3501
3502
|
zoomIn: (I = 10) => {
|
|
3502
3503
|
var b, y;
|
|
3503
|
-
if (!nt.current || !
|
|
3504
|
-
const
|
|
3504
|
+
if (!nt.current || !G.current || !F.current) return;
|
|
3505
|
+
const P = qt(F.current), h = 1 + I / 100, w = P.k * h, E = at(G.current), m = ((b = j.current) == null ? void 0 : b.clientWidth) || 1, x = ((y = j.current) == null ? void 0 : y.clientHeight) || 1;
|
|
3505
3506
|
E.transition().duration(300).call(
|
|
3506
3507
|
nt.current.scaleTo,
|
|
3507
3508
|
w,
|
|
@@ -3510,8 +3511,8 @@ const Oa = Tr(function({
|
|
|
3510
3511
|
},
|
|
3511
3512
|
zoomOut: (I = 10) => {
|
|
3512
3513
|
var b, y;
|
|
3513
|
-
if (!nt.current || !
|
|
3514
|
-
const
|
|
3514
|
+
if (!nt.current || !G.current || !F.current) return;
|
|
3515
|
+
const P = qt(F.current), h = 1 - I / 100, w = Math.max(0.1, P.k * h), E = at(G.current), m = ((b = j.current) == null ? void 0 : b.clientWidth) || 1, x = ((y = j.current) == null ? void 0 : y.clientHeight) || 1;
|
|
3515
3516
|
E.transition().duration(300).call(
|
|
3516
3517
|
nt.current.scaleTo,
|
|
3517
3518
|
w,
|
|
@@ -3520,10 +3521,10 @@ const Oa = Tr(function({
|
|
|
3520
3521
|
},
|
|
3521
3522
|
toggleZoom: () => {
|
|
3522
3523
|
var it, ht;
|
|
3523
|
-
if (!nt.current || !
|
|
3524
|
-
const I = at(
|
|
3525
|
-
(ht =
|
|
3526
|
-
const h =
|
|
3524
|
+
if (!nt.current || !G.current || !F.current) return;
|
|
3525
|
+
const I = at(G.current), P = ((it = j.current) == null ? void 0 : it.clientWidth) || 1;
|
|
3526
|
+
(ht = j.current) != null && ht.clientHeight;
|
|
3527
|
+
const h = H.current, w = G.current.getAttribute("viewBox");
|
|
3527
3528
|
if (!w) return;
|
|
3528
3529
|
const [, , E, m] = w.split(" ").map(Number);
|
|
3529
3530
|
if (isNaN(E) || isNaN(m))
|
|
@@ -3538,45 +3539,45 @@ const Oa = Tr(function({
|
|
|
3538
3539
|
const st = F.current.getBBox();
|
|
3539
3540
|
M.current = { x: st.x, y: st.y, width: st.width, height: st.height };
|
|
3540
3541
|
}
|
|
3541
|
-
const b = x.x + x.width / 2, y = x.y + x.height / 2, C =
|
|
3542
|
+
const b = x.x + x.width / 2, y = x.y + x.height / 2, C = P / E, _ = 0.9 * E / x.width, L = h * C * _, rt = 16 / (h * C), Z = h * C * rt, S = Math.min(_, rt), T = Math.max(_, rt), z = qt(G.current), k = h * C * z.k;
|
|
3542
3543
|
console.log("toggleZoom debug:", {
|
|
3543
|
-
currentState:
|
|
3544
|
-
currentScale:
|
|
3545
|
-
currentFontSize:
|
|
3546
|
-
overviewScale:
|
|
3547
|
-
overviewFontSize:
|
|
3544
|
+
currentState: N.current ? "zoomedIn" : "zoomedOut",
|
|
3545
|
+
currentScale: z.k,
|
|
3546
|
+
currentFontSize: k,
|
|
3547
|
+
overviewScale: _,
|
|
3548
|
+
overviewFontSize: L,
|
|
3548
3549
|
detailScale: rt,
|
|
3549
3550
|
detailFontSize: Z,
|
|
3550
3551
|
zoomOutScale: S,
|
|
3551
|
-
zoomInScale:
|
|
3552
|
+
zoomInScale: T
|
|
3552
3553
|
});
|
|
3553
3554
|
let tt;
|
|
3554
|
-
|
|
3555
|
+
N.current ? (tt = S, N.current = !1) : (tt = T, f.current = qt(G.current), N.current = !0), console.log("toggleZoom target:", {
|
|
3555
3556
|
targetScale: tt,
|
|
3556
3557
|
targetFontSize: h * C * tt,
|
|
3557
|
-
newState:
|
|
3558
|
+
newState: N.current ? "zoomedIn" : "zoomedOut"
|
|
3558
3559
|
});
|
|
3559
|
-
const ot = E / 2 - b * tt,
|
|
3560
|
+
const ot = E / 2 - b * tt, V = m / 2 - y * tt, K = Pt.translate(ot, V).scale(tt);
|
|
3560
3561
|
console.log("newTransform:", { x: K.x, y: K.y, k: K.k }), at(F.current).transition().duration(500).attr("transform", K.toString()).on("end", () => {
|
|
3561
3562
|
I.call(nt.current.transform, K);
|
|
3562
3563
|
});
|
|
3563
3564
|
},
|
|
3564
3565
|
stopRendering: () => {
|
|
3565
|
-
|
|
3566
|
+
D.current && (clearInterval(D.current), D.current = null), v.current = null, O(), j.current && (j.current.innerHTML = ""), N.current = !1, f.current = null;
|
|
3566
3567
|
}
|
|
3567
|
-
}), [
|
|
3568
|
-
if (!e || !
|
|
3568
|
+
}), [O]), Le(() => {
|
|
3569
|
+
if (!e || !j.current) return;
|
|
3569
3570
|
let I = !1;
|
|
3570
|
-
return v.current = Date.now(), l && (
|
|
3571
|
+
return v.current = Date.now(), l && (D.current = setInterval(() => {
|
|
3571
3572
|
if (v.current) {
|
|
3572
|
-
const
|
|
3573
|
-
l(
|
|
3573
|
+
const P = Date.now() - v.current;
|
|
3574
|
+
l(P);
|
|
3574
3575
|
}
|
|
3575
|
-
}, 100)), A(e).then((
|
|
3576
|
+
}, 100)), A(e).then((P) => {
|
|
3576
3577
|
var w;
|
|
3577
3578
|
if (I) return;
|
|
3578
|
-
const h = JSON.parse(
|
|
3579
|
-
if (
|
|
3579
|
+
const h = JSON.parse(P);
|
|
3580
|
+
if (j.current) {
|
|
3580
3581
|
let E = n;
|
|
3581
3582
|
if (h.objects) {
|
|
3582
3583
|
for (const x of h.objects)
|
|
@@ -3585,12 +3586,12 @@ const Oa = Tr(function({
|
|
|
3585
3586
|
b.size && b.size > E && (E = b.size);
|
|
3586
3587
|
}
|
|
3587
3588
|
let m;
|
|
3588
|
-
if (
|
|
3589
|
-
|
|
3589
|
+
if (R ? m = $a(
|
|
3590
|
+
j.current,
|
|
3590
3591
|
h,
|
|
3591
3592
|
E
|
|
3592
3593
|
) : m = Na(
|
|
3593
|
-
|
|
3594
|
+
j.current,
|
|
3594
3595
|
h,
|
|
3595
3596
|
r,
|
|
3596
3597
|
null,
|
|
@@ -3610,62 +3611,62 @@ const Oa = Tr(function({
|
|
|
3610
3611
|
return (b = X.current) == null ? void 0 : b.call(X, x);
|
|
3611
3612
|
},
|
|
3612
3613
|
// Use ref for callback
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
), nt.current = m.zoomBehavior,
|
|
3614
|
+
B,
|
|
3615
|
+
$,
|
|
3616
|
+
Y
|
|
3617
|
+
), nt.current = m.zoomBehavior, G.current = m.svgElement, F.current = m.gElement, H.current = m.baseFontSize, Q.current = m.viewBoxWidth, F.current) {
|
|
3617
3618
|
const x = F.current.getBBox();
|
|
3618
3619
|
M.current = { x: x.x, y: x.y, width: x.width, height: x.height };
|
|
3619
|
-
const b = Q.current, y = ((w =
|
|
3620
|
-
|
|
3620
|
+
const b = Q.current, y = ((w = j.current) == null ? void 0 : w.clientWidth) || 1, C = H.current, _ = y / b, L = 0.9 * b / x.width, q = 16 / (C * _);
|
|
3621
|
+
N.current = L >= q;
|
|
3621
3622
|
}
|
|
3622
|
-
if (f.current = null,
|
|
3623
|
-
const x =
|
|
3623
|
+
if (f.current = null, D.current && (clearInterval(D.current), D.current = null), v.current = null, c) {
|
|
3624
|
+
const x = j.current.querySelector("svg"), b = x == null ? void 0 : x.querySelector("#graph0");
|
|
3624
3625
|
if (x && b) {
|
|
3625
3626
|
const y = E, C = x.getAttribute("viewBox");
|
|
3626
|
-
let
|
|
3627
|
+
let _ = 1e3;
|
|
3627
3628
|
if (C) {
|
|
3628
3629
|
const [, , Z] = C.split(" ").map(Number);
|
|
3629
|
-
Z && (
|
|
3630
|
+
Z && (_ = Z);
|
|
3630
3631
|
}
|
|
3631
|
-
const
|
|
3632
|
+
const L = () => {
|
|
3632
3633
|
var tt;
|
|
3633
3634
|
const Z = b.getAttribute("transform");
|
|
3634
3635
|
let S = 1;
|
|
3635
3636
|
if (Z) {
|
|
3636
3637
|
const ot = Z.match(/scale\(([^,)]+)/);
|
|
3637
3638
|
if (ot) {
|
|
3638
|
-
const
|
|
3639
|
-
isNaN(
|
|
3639
|
+
const V = parseFloat(ot[1]);
|
|
3640
|
+
isNaN(V) || (S = V);
|
|
3640
3641
|
} else {
|
|
3641
|
-
const
|
|
3642
|
-
if (
|
|
3643
|
-
const K = parseFloat(
|
|
3642
|
+
const V = Z.match(/matrix\(([^,)]+)/);
|
|
3643
|
+
if (V) {
|
|
3644
|
+
const K = parseFloat(V[1]);
|
|
3644
3645
|
isNaN(K) || (S = K);
|
|
3645
3646
|
}
|
|
3646
3647
|
}
|
|
3647
3648
|
}
|
|
3648
|
-
const
|
|
3649
|
-
!isNaN(
|
|
3649
|
+
const z = (((tt = j.current) == null ? void 0 : tt.clientWidth) || 1) / _, k = y * z * S;
|
|
3650
|
+
!isNaN(k) && !isNaN(S) && c({ baseFontSize: y, actualFontSize: k, scale: S });
|
|
3650
3651
|
};
|
|
3651
|
-
|
|
3652
|
-
const
|
|
3653
|
-
|
|
3652
|
+
L();
|
|
3653
|
+
const q = new MutationObserver(L);
|
|
3654
|
+
q.observe(b, {
|
|
3654
3655
|
attributes: !0,
|
|
3655
3656
|
attributeFilter: ["transform"]
|
|
3656
3657
|
});
|
|
3657
|
-
const rt = () =>
|
|
3658
|
+
const rt = () => L();
|
|
3658
3659
|
return window.addEventListener("resize", rt), () => {
|
|
3659
|
-
|
|
3660
|
+
q.disconnect(), window.removeEventListener("resize", rt);
|
|
3660
3661
|
};
|
|
3661
3662
|
}
|
|
3662
3663
|
}
|
|
3663
3664
|
}
|
|
3664
|
-
a == null || a({ json: h, svgElement:
|
|
3665
|
-
}).catch((
|
|
3666
|
-
I || (
|
|
3665
|
+
a == null || a({ json: h, svgElement: G.current });
|
|
3666
|
+
}).catch((P) => {
|
|
3667
|
+
I || (D.current && (clearInterval(D.current), D.current = null), v.current = null, P.message !== "Cancelled by user" && P.message !== "Request cancelled" && (console.error("GraphvizRenderer error:", P), j.current && (j.current.innerHTML = `<div style="padding: 1rem; color: #ef4444"><strong>Error rendering graph:</strong> ${P.message}</div>`), i == null || i(P instanceof Error ? P : new Error(String(P)))));
|
|
3667
3668
|
}), () => {
|
|
3668
|
-
I = !0,
|
|
3669
|
+
I = !0, D.current && (clearInterval(D.current), D.current = null), v.current = null, O();
|
|
3669
3670
|
};
|
|
3670
3671
|
}, [
|
|
3671
3672
|
e,
|
|
@@ -3673,20 +3674,20 @@ const Oa = Tr(function({
|
|
|
3673
3674
|
n,
|
|
3674
3675
|
l,
|
|
3675
3676
|
d,
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3677
|
+
R,
|
|
3678
|
+
B,
|
|
3679
|
+
$,
|
|
3680
|
+
Y
|
|
3680
3681
|
]), Le(() => {
|
|
3681
|
-
var
|
|
3682
|
-
if (
|
|
3683
|
-
const I =
|
|
3682
|
+
var P;
|
|
3683
|
+
if (R || !j.current) return;
|
|
3684
|
+
const I = j.current.querySelector("svg");
|
|
3684
3685
|
if (I && (I.querySelectorAll("g.edge.selected").forEach((h) => {
|
|
3685
3686
|
h.classList.remove("selected"), h.querySelectorAll(".close-btn, .close-btn-bg").forEach((w) => w.remove());
|
|
3686
3687
|
}), p != null)) {
|
|
3687
3688
|
const h = I.querySelector(`g.edge[data-edge-id="${p}"]`);
|
|
3688
3689
|
if (h) {
|
|
3689
|
-
h.classList.add("selected"), (
|
|
3690
|
+
h.classList.add("selected"), (P = h.parentNode) == null || P.appendChild(h);
|
|
3690
3691
|
const w = h.querySelector(".label-bg");
|
|
3691
3692
|
if (w && g) {
|
|
3692
3693
|
w.getBoundingClientRect();
|
|
@@ -3696,20 +3697,20 @@ const Oa = Tr(function({
|
|
|
3696
3697
|
if (!h.querySelector(".close-btn")) {
|
|
3697
3698
|
const C = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
3698
3699
|
C.setAttribute("class", "close-btn-bg"), C.setAttribute("cx", String(y)), C.setAttribute("cy", m || "0"), C.setAttribute("r", "8"), C.setAttribute("fill", "white"), C.setAttribute("stroke", "#d0d0d0"), C.setAttribute("stroke-width", "1"), C.style.cursor = "pointer";
|
|
3699
|
-
const
|
|
3700
|
-
|
|
3701
|
-
const
|
|
3702
|
-
|
|
3700
|
+
const _ = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
3701
|
+
_.setAttribute("class", "close-btn"), _.setAttribute("x", String(y)), _.setAttribute("y", m || "0"), _.setAttribute("text-anchor", "middle"), _.setAttribute("dominant-baseline", "central"), _.setAttribute("font-family", "Arial"), _.setAttribute("font-size", "12px"), _.setAttribute("font-weight", "bold"), _.setAttribute("fill", "#888"), _.style.cursor = "pointer", _.textContent = "✕";
|
|
3702
|
+
const L = (q) => {
|
|
3703
|
+
q.stopPropagation(), g(null);
|
|
3703
3704
|
};
|
|
3704
|
-
C.addEventListener("click",
|
|
3705
|
+
C.addEventListener("click", L), _.addEventListener("click", L), h.appendChild(C), h.appendChild(_);
|
|
3705
3706
|
}
|
|
3706
3707
|
}
|
|
3707
3708
|
}
|
|
3708
3709
|
}
|
|
3709
3710
|
}
|
|
3710
|
-
}, [p, g,
|
|
3711
|
-
/* @__PURE__ */ Bt("div", { ref:
|
|
3712
|
-
U && u && (o ?? /* @__PURE__ */ Bt(Ua, { onCancel:
|
|
3711
|
+
}, [p, g, R]), /* @__PURE__ */ fe("div", { className: `graphviz-renderer ${s}`.trim(), style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
3712
|
+
/* @__PURE__ */ Bt("div", { ref: j, style: { width: "100%", height: "100%" } }),
|
|
3713
|
+
U && u && (o ?? /* @__PURE__ */ Bt(Ua, { onCancel: O })),
|
|
3713
3714
|
et && !U && /* @__PURE__ */ fe("div", { style: { padding: "1rem", color: "#ef4444" }, children: [
|
|
3714
3715
|
/* @__PURE__ */ Bt("strong", { children: "Error:" }),
|
|
3715
3716
|
" ",
|