quixotic-gol 0.1.12 → 0.1.13
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 +5 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1091 -1074
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { jsx as
|
|
1
|
+
import { useRef as ft, useState as He, useCallback as Me, useEffect as Le, forwardRef as Tr, useImperativeHandle as Vr } from "react";
|
|
2
|
+
import { jsx as Nt, jsxs as he } from "react/jsx-runtime";
|
|
3
3
|
const za = 500;
|
|
4
4
|
function ja(t) {
|
|
5
5
|
return JSON.stringify(JSON.stringify(t)).slice(1, -1);
|
|
@@ -19,9 +19,9 @@ function ke() {
|
|
|
19
19
|
if (!(n = arguments[t] + "") || n in r || /[\s.]/.test(n)) throw new Error("illegal type: " + n);
|
|
20
20
|
r[n] = [];
|
|
21
21
|
}
|
|
22
|
-
return new
|
|
22
|
+
return new ce(r);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ce(t) {
|
|
25
25
|
this._ = t;
|
|
26
26
|
}
|
|
27
27
|
function Hr(t, e) {
|
|
@@ -31,8 +31,8 @@ function Hr(t, e) {
|
|
|
31
31
|
return { type: r, name: n };
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
constructor:
|
|
34
|
+
ce.prototype = ke.prototype = {
|
|
35
|
+
constructor: ce,
|
|
36
36
|
on: function(t, e) {
|
|
37
37
|
var r = this._, n = Hr(t + "", r), o, a = -1, i = n.length;
|
|
38
38
|
if (arguments.length < 2) {
|
|
@@ -48,7 +48,7 @@ se.prototype = ke.prototype = {
|
|
|
48
48
|
copy: function() {
|
|
49
49
|
var t = {}, e = this._;
|
|
50
50
|
for (var r in e) t[r] = e[r].slice();
|
|
51
|
-
return new
|
|
51
|
+
return new ce(t);
|
|
52
52
|
},
|
|
53
53
|
call: function(t, e) {
|
|
54
54
|
if ((o = arguments.length - 2) > 0) for (var r = new Array(o), n = 0, o, a; n < o; ++n) r[n] = arguments[n + 2];
|
|
@@ -81,7 +81,7 @@ const Ke = {
|
|
|
81
81
|
xml: "http://www.w3.org/XML/1998/namespace",
|
|
82
82
|
xmlns: "http://www.w3.org/2000/xmlns/"
|
|
83
83
|
};
|
|
84
|
-
function
|
|
84
|
+
function we(t) {
|
|
85
85
|
var e = t += "", r = e.indexOf(":");
|
|
86
86
|
return r >= 0 && (e = t.slice(0, r)) !== "xmlns" && (t = t.slice(r + 1)), Ke.hasOwnProperty(e) ? { space: Ke[e], local: t } : t;
|
|
87
87
|
}
|
|
@@ -97,7 +97,7 @@ function Qr(t) {
|
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
function vr(t) {
|
|
100
|
-
var e =
|
|
100
|
+
var e = we(t);
|
|
101
101
|
return (e.local ? Qr : Kr)(e);
|
|
102
102
|
}
|
|
103
103
|
function Zr() {
|
|
@@ -112,7 +112,7 @@ function Jr(t) {
|
|
|
112
112
|
for (var e = this._groups, r = e.length, n = new Array(r), o = 0; o < r; ++o)
|
|
113
113
|
for (var a = e[o], i = a.length, c = n[o] = new Array(i), l, s, u = 0; u < i; ++u)
|
|
114
114
|
(l = a[u]) && (s = t.call(l, l.__data__, u, a)) && ("__data__" in l && (s.__data__ = l.__data__), c[u] = s);
|
|
115
|
-
return new
|
|
115
|
+
return new gt(n, this._parents);
|
|
116
116
|
}
|
|
117
117
|
function Ar(t) {
|
|
118
118
|
return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
|
|
@@ -120,7 +120,7 @@ function Ar(t) {
|
|
|
120
120
|
function tn() {
|
|
121
121
|
return [];
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function mr(t) {
|
|
124
124
|
return t == null ? tn : function() {
|
|
125
125
|
return this.querySelectorAll(t);
|
|
126
126
|
};
|
|
@@ -131,13 +131,13 @@ function en(t) {
|
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
function rn(t) {
|
|
134
|
-
typeof t == "function" ? t = en(t) : t =
|
|
134
|
+
typeof t == "function" ? t = en(t) : t = mr(t);
|
|
135
135
|
for (var e = this._groups, r = e.length, n = [], o = [], a = 0; a < r; ++a)
|
|
136
136
|
for (var i = e[a], c = i.length, l, s = 0; s < c; ++s)
|
|
137
137
|
(l = i[s]) && (n.push(t.call(l, l.__data__, s, i)), o.push(l));
|
|
138
|
-
return new
|
|
138
|
+
return new gt(n, o);
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function yr(t) {
|
|
141
141
|
return function() {
|
|
142
142
|
return this.matches(t);
|
|
143
143
|
};
|
|
@@ -172,23 +172,23 @@ function fn(t) {
|
|
|
172
172
|
return this.selectAll(t == null ? ln : un(typeof t == "function" ? t : gr(t)));
|
|
173
173
|
}
|
|
174
174
|
function hn(t) {
|
|
175
|
-
typeof t != "function" && (t =
|
|
175
|
+
typeof t != "function" && (t = yr(t));
|
|
176
176
|
for (var e = this._groups, r = e.length, n = new Array(r), o = 0; o < r; ++o)
|
|
177
177
|
for (var a = e[o], i = a.length, c = n[o] = [], l, s = 0; s < i; ++s)
|
|
178
178
|
(l = a[s]) && t.call(l, l.__data__, s, a) && c.push(l);
|
|
179
|
-
return new
|
|
179
|
+
return new gt(n, this._parents);
|
|
180
180
|
}
|
|
181
181
|
function wr(t) {
|
|
182
182
|
return new Array(t.length);
|
|
183
183
|
}
|
|
184
184
|
function dn() {
|
|
185
|
-
return new
|
|
185
|
+
return new gt(this._enter || this._groups.map(wr), this._parents);
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function de(t, e) {
|
|
188
188
|
this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
constructor:
|
|
190
|
+
de.prototype = {
|
|
191
|
+
constructor: de,
|
|
192
192
|
appendChild: function(t) {
|
|
193
193
|
return this._parent.insertBefore(t, this._next);
|
|
194
194
|
},
|
|
@@ -209,42 +209,42 @@ function pn(t) {
|
|
|
209
209
|
}
|
|
210
210
|
function vn(t, e, r, n, o, a) {
|
|
211
211
|
for (var i = 0, c, l = e.length, s = a.length; i < s; ++i)
|
|
212
|
-
(c = e[i]) ? (c.__data__ = a[i], n[i] = c) : r[i] = new
|
|
212
|
+
(c = e[i]) ? (c.__data__ = a[i], n[i] = c) : r[i] = new de(t, a[i]);
|
|
213
213
|
for (; i < l; ++i)
|
|
214
214
|
(c = e[i]) && (o[i] = c);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
var c, l, s = /* @__PURE__ */ new Map(), u = e.length, d = a.length,
|
|
216
|
+
function mn(t, e, r, n, o, a, i) {
|
|
217
|
+
var c, l, s = /* @__PURE__ */ new Map(), u = e.length, d = a.length, m = new Array(u), w;
|
|
218
218
|
for (c = 0; c < u; ++c)
|
|
219
|
-
(l = e[c]) && (
|
|
219
|
+
(l = e[c]) && (m[c] = w = i.call(l, l.__data__, c, e) + "", s.has(w) ? o[c] = l : s.set(w, l));
|
|
220
220
|
for (c = 0; c < d; ++c)
|
|
221
|
-
|
|
221
|
+
w = i.call(t, a[c], c, a) + "", (l = s.get(w)) ? (n[c] = l, l.__data__ = a[c], s.delete(w)) : r[c] = new de(t, a[c]);
|
|
222
222
|
for (c = 0; c < u; ++c)
|
|
223
|
-
(l = e[c]) && s.get(
|
|
223
|
+
(l = e[c]) && s.get(m[c]) === l && (o[c] = l);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function yn(t) {
|
|
226
226
|
return t.__data__;
|
|
227
227
|
}
|
|
228
228
|
function gn(t, e) {
|
|
229
|
-
if (!arguments.length) return Array.from(this,
|
|
230
|
-
var r = e ?
|
|
229
|
+
if (!arguments.length) return Array.from(this, yn);
|
|
230
|
+
var r = e ? mn : 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],
|
|
234
|
-
r(u, d, B,
|
|
235
|
-
for (var
|
|
236
|
-
if (
|
|
237
|
-
for (
|
|
238
|
-
|
|
233
|
+
var u = n[s], d = o[s], m = d.length, w = wn(t.call(u, u && u.__data__, s, n)), _ = w.length, B = c[s] = new Array(_), V = i[s] = new Array(_), x = l[s] = new Array(m);
|
|
234
|
+
r(u, d, B, V, x, w, e);
|
|
235
|
+
for (var Q = 0, Z = 0, et, N; Q < _; ++Q)
|
|
236
|
+
if (et = B[Q]) {
|
|
237
|
+
for (Q >= Z && (Z = Q + 1); !(N = V[Z]) && ++Z < _; ) ;
|
|
238
|
+
et._next = N || null;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
return i = new
|
|
241
|
+
return i = new gt(i, n), i._enter = c, i._exit = l, i;
|
|
242
242
|
}
|
|
243
243
|
function wn(t) {
|
|
244
244
|
return typeof t == "object" && "length" in t ? t : Array.from(t);
|
|
245
245
|
}
|
|
246
246
|
function xn() {
|
|
247
|
-
return new
|
|
247
|
+
return new gt(this._exit || this._groups.map(wr), this._parents);
|
|
248
248
|
}
|
|
249
249
|
function En(t, e, r) {
|
|
250
250
|
var n = this.enter(), o = this, a = this.exit();
|
|
@@ -252,11 +252,11 @@ 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,
|
|
256
|
-
(
|
|
255
|
+
for (var s = r[l], u = n[l], d = s.length, m = c[l] = new Array(d), w, _ = 0; _ < d; ++_)
|
|
256
|
+
(w = s[_] || u[_]) && (m[_] = w);
|
|
257
257
|
for (; l < o; ++l)
|
|
258
258
|
c[l] = r[l];
|
|
259
|
-
return new
|
|
259
|
+
return new gt(c, this._parents);
|
|
260
260
|
}
|
|
261
261
|
function Mn() {
|
|
262
262
|
for (var t = this._groups, e = -1, r = t.length; ++e < r; )
|
|
@@ -266,15 +266,15 @@ function Mn() {
|
|
|
266
266
|
}
|
|
267
267
|
function Fn(t) {
|
|
268
268
|
t || (t = Cn);
|
|
269
|
-
function e(d,
|
|
270
|
-
return d &&
|
|
269
|
+
function e(d, m) {
|
|
270
|
+
return d && m ? t(d.__data__, m.__data__) : !d - !m;
|
|
271
271
|
}
|
|
272
272
|
for (var r = this._groups, n = r.length, o = new Array(n), a = 0; a < n; ++a) {
|
|
273
273
|
for (var i = r[a], c = i.length, l = o[a] = new Array(c), s, u = 0; u < c; ++u)
|
|
274
274
|
(s = i[u]) && (l[u] = s);
|
|
275
275
|
l.sort(e);
|
|
276
276
|
}
|
|
277
|
-
return new
|
|
277
|
+
return new gt(o, this._parents).order();
|
|
278
278
|
}
|
|
279
279
|
function Cn(t, e) {
|
|
280
280
|
return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
|
|
@@ -341,7 +341,7 @@ function Un(t, e) {
|
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
343
|
function In(t, e) {
|
|
344
|
-
var r =
|
|
344
|
+
var r = we(t);
|
|
345
345
|
if (arguments.length < 2) {
|
|
346
346
|
var n = this.node();
|
|
347
347
|
return r.local ? n.getAttributeNS(r.space, r.local) : n.getAttribute(r);
|
|
@@ -368,9 +368,9 @@ function jn(t, e, r) {
|
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
370
|
function Gn(t, e, r) {
|
|
371
|
-
return arguments.length > 1 ? this.each((e == null ? kn : typeof e == "function" ? jn : zn)(t, e, r ?? "")) :
|
|
371
|
+
return arguments.length > 1 ? this.each((e == null ? kn : typeof e == "function" ? jn : zn)(t, e, r ?? "")) : Gt(this.node(), t);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Gt(t, e) {
|
|
374
374
|
return t.style.getPropertyValue(e) || xr(t).getComputedStyle(t, null).getPropertyValue(e);
|
|
375
375
|
}
|
|
376
376
|
function On(t) {
|
|
@@ -515,12 +515,12 @@ function vo() {
|
|
|
515
515
|
var t = this.cloneNode(!1), e = this.parentNode;
|
|
516
516
|
return e ? e.insertBefore(t, this.nextSibling) : t;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function mo() {
|
|
519
519
|
var t = this.cloneNode(!0), e = this.parentNode;
|
|
520
520
|
return e ? e.insertBefore(t, this.nextSibling) : t;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
return this.select(t ?
|
|
522
|
+
function yo(t) {
|
|
523
|
+
return this.select(t ? mo : vo);
|
|
524
524
|
}
|
|
525
525
|
function go(t) {
|
|
526
526
|
return arguments.length ? this.property("__data__", t) : this.node().__data__;
|
|
@@ -597,17 +597,17 @@ function* Ro() {
|
|
|
597
597
|
(i = n[o]) && (yield i);
|
|
598
598
|
}
|
|
599
599
|
var _r = [null];
|
|
600
|
-
function
|
|
600
|
+
function gt(t, e) {
|
|
601
601
|
this._groups = t, this._parents = e;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
return new
|
|
603
|
+
function te() {
|
|
604
|
+
return new gt([[document.documentElement]], _r);
|
|
605
605
|
}
|
|
606
606
|
function Lo() {
|
|
607
607
|
return this;
|
|
608
608
|
}
|
|
609
|
-
|
|
610
|
-
constructor:
|
|
609
|
+
gt.prototype = te.prototype = {
|
|
610
|
+
constructor: gt,
|
|
611
611
|
select: Jr,
|
|
612
612
|
selectAll: rn,
|
|
613
613
|
selectChild: sn,
|
|
@@ -638,21 +638,21 @@ yt.prototype = At.prototype = {
|
|
|
638
638
|
append: lo,
|
|
639
639
|
insert: fo,
|
|
640
640
|
remove: po,
|
|
641
|
-
clone:
|
|
641
|
+
clone: yo,
|
|
642
642
|
datum: go,
|
|
643
643
|
on: Mo,
|
|
644
644
|
dispatch: _o,
|
|
645
645
|
[Symbol.iterator]: Ro
|
|
646
646
|
};
|
|
647
647
|
function at(t) {
|
|
648
|
-
return typeof t == "string" ? new
|
|
648
|
+
return typeof t == "string" ? new gt([[document.querySelector(t)]], [document.documentElement]) : new gt([[t]], _r);
|
|
649
649
|
}
|
|
650
650
|
function Yo(t) {
|
|
651
651
|
let e;
|
|
652
652
|
for (; e = t.sourceEvent; ) t = e;
|
|
653
653
|
return t;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Xt(t, e) {
|
|
656
656
|
if (t = Yo(t), e === void 0 && (e = t.currentTarget), e) {
|
|
657
657
|
var r = e.ownerSVGElement || e;
|
|
658
658
|
if (r.createSVGPoint) {
|
|
@@ -688,9 +688,9 @@ function Rr(t, e) {
|
|
|
688
688
|
for (var n in e) r[n] = e[n];
|
|
689
689
|
return r;
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function ee() {
|
|
692
692
|
}
|
|
693
|
-
var
|
|
693
|
+
var Qt = 0.7, pe = 1 / Qt, jt = "\\s*([+-]?\\d+)\\s*", Zt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Ct = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Po = /^#([0-9a-f]{3,8})$/, No = new RegExp(`^rgb\\(${jt},${jt},${jt}\\)$`), $o = new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`), Xo = new RegExp(`^rgba\\(${jt},${jt},${jt},${Zt}\\)$`), So = new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${Zt}\\)$`), Uo = new RegExp(`^hsl\\(${Zt},${Ct},${Ct}\\)$`), Io = new RegExp(`^hsla\\(${Zt},${Ct},${Ct},${Zt}\\)$`), Qe = {
|
|
694
694
|
aliceblue: 15792383,
|
|
695
695
|
antiquewhite: 16444375,
|
|
696
696
|
aqua: 65535,
|
|
@@ -840,7 +840,7 @@ var Kt = 0.7, de = 1 / Kt, zt = "\\s*([+-]?\\d+)\\s*", Qt = "\\s*([+-]?(?:\\d*\\
|
|
|
840
840
|
yellow: 16776960,
|
|
841
841
|
yellowgreen: 10145074
|
|
842
842
|
};
|
|
843
|
-
Ge(
|
|
843
|
+
Ge(ee, Jt, {
|
|
844
844
|
copy(t) {
|
|
845
845
|
return Object.assign(new this.constructor(), this, t);
|
|
846
846
|
},
|
|
@@ -867,37 +867,37 @@ function zo() {
|
|
|
867
867
|
function Je() {
|
|
868
868
|
return this.rgb().formatRgb();
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function Jt(t) {
|
|
871
871
|
var e, r;
|
|
872
|
-
return t = (t + "").trim().toLowerCase(), (e = Po.exec(t)) ? (r = e[1].length, e = parseInt(e[1], 16), r === 6 ? Ae(e) : r === 3 ? new
|
|
872
|
+
return t = (t + "").trim().toLowerCase(), (e = Po.exec(t)) ? (r = e[1].length, e = parseInt(e[1], 16), r === 6 ? Ae(e) : r === 3 ? new ht(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : r === 8 ? ne(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : r === 4 ? ne(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = No.exec(t)) ? new ht(e[1], e[2], e[3], 1) : (e = $o.exec(t)) ? new ht(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Xo.exec(t)) ? ne(e[1], e[2], e[3], e[4]) : (e = So.exec(t)) ? ne(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Uo.exec(t)) ? rr(e[1], e[2] / 100, e[3] / 100, 1) : (e = Io.exec(t)) ? rr(e[1], e[2] / 100, e[3] / 100, e[4]) : Qe.hasOwnProperty(t) ? Ae(Qe[t]) : t === "transparent" ? new ht(NaN, NaN, NaN, 0) : null;
|
|
873
873
|
}
|
|
874
874
|
function Ae(t) {
|
|
875
|
-
return new
|
|
875
|
+
return new ht(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
|
|
876
876
|
}
|
|
877
|
-
function
|
|
878
|
-
return n <= 0 && (t = e = r = NaN), new
|
|
877
|
+
function ne(t, e, r, n) {
|
|
878
|
+
return n <= 0 && (t = e = r = NaN), new ht(t, e, r, n);
|
|
879
879
|
}
|
|
880
880
|
function jo(t) {
|
|
881
|
-
return t instanceof
|
|
881
|
+
return t instanceof ee || (t = Jt(t)), t ? (t = t.rgb(), new ht(t.r, t.g, t.b, t.opacity)) : new ht();
|
|
882
882
|
}
|
|
883
883
|
function Pe(t, e, r, n) {
|
|
884
|
-
return arguments.length === 1 ? jo(t) : new
|
|
884
|
+
return arguments.length === 1 ? jo(t) : new ht(t, e, r, n ?? 1);
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function ht(t, e, r, n) {
|
|
887
887
|
this.r = +t, this.g = +e, this.b = +r, this.opacity = +n;
|
|
888
888
|
}
|
|
889
|
-
Ge(
|
|
889
|
+
Ge(ht, Pe, Rr(ee, {
|
|
890
890
|
brighter(t) {
|
|
891
|
-
return t = t == null ?
|
|
891
|
+
return t = t == null ? pe : Math.pow(pe, t), new ht(this.r * t, this.g * t, this.b * t, this.opacity);
|
|
892
892
|
},
|
|
893
893
|
darker(t) {
|
|
894
|
-
return t = t == null ?
|
|
894
|
+
return t = t == null ? Qt : Math.pow(Qt, t), new ht(this.r * t, this.g * t, this.b * t, this.opacity);
|
|
895
895
|
},
|
|
896
896
|
rgb() {
|
|
897
897
|
return this;
|
|
898
898
|
},
|
|
899
899
|
clamp() {
|
|
900
|
-
return new
|
|
900
|
+
return new ht(It(this.r), It(this.g), It(this.b), ve(this.opacity));
|
|
901
901
|
},
|
|
902
902
|
displayable() {
|
|
903
903
|
return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
|
|
@@ -910,51 +910,51 @@ Ge(ft, Pe, Rr(te, {
|
|
|
910
910
|
toString: er
|
|
911
911
|
}));
|
|
912
912
|
function tr() {
|
|
913
|
-
return `#${
|
|
913
|
+
return `#${Ut(this.r)}${Ut(this.g)}${Ut(this.b)}`;
|
|
914
914
|
}
|
|
915
915
|
function Go() {
|
|
916
|
-
return `#${
|
|
916
|
+
return `#${Ut(this.r)}${Ut(this.g)}${Ut(this.b)}${Ut((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
917
917
|
}
|
|
918
918
|
function er() {
|
|
919
|
-
const t =
|
|
920
|
-
return `${t === 1 ? "rgb(" : "rgba("}${
|
|
919
|
+
const t = ve(this.opacity);
|
|
920
|
+
return `${t === 1 ? "rgb(" : "rgba("}${It(this.r)}, ${It(this.g)}, ${It(this.b)}${t === 1 ? ")" : `, ${t})`}`;
|
|
921
921
|
}
|
|
922
|
-
function
|
|
922
|
+
function ve(t) {
|
|
923
923
|
return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function It(t) {
|
|
926
926
|
return Math.max(0, Math.min(255, Math.round(t) || 0));
|
|
927
927
|
}
|
|
928
|
-
function
|
|
929
|
-
return t =
|
|
928
|
+
function Ut(t) {
|
|
929
|
+
return t = It(t), (t < 16 ? "0" : "") + t.toString(16);
|
|
930
930
|
}
|
|
931
931
|
function rr(t, e, r, n) {
|
|
932
|
-
return n <= 0 ? t = e = r = NaN : r <= 0 || r >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new
|
|
932
|
+
return n <= 0 ? t = e = r = NaN : r <= 0 || r >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Mt(t, e, r, n);
|
|
933
933
|
}
|
|
934
934
|
function Lr(t) {
|
|
935
|
-
if (t instanceof
|
|
936
|
-
if (t instanceof
|
|
937
|
-
if (t instanceof
|
|
935
|
+
if (t instanceof Mt) return new Mt(t.h, t.s, t.l, t.opacity);
|
|
936
|
+
if (t instanceof ee || (t = Jt(t)), !t) return new Mt();
|
|
937
|
+
if (t instanceof Mt) return t;
|
|
938
938
|
t = t.rgb();
|
|
939
939
|
var e = t.r / 255, r = t.g / 255, n = t.b / 255, o = Math.min(e, r, n), a = Math.max(e, r, n), i = NaN, c = a - o, l = (a + o) / 2;
|
|
940
|
-
return c ? (e === a ? i = (r - n) / c + (r < n) * 6 : r === a ? i = (n - e) / c + 2 : i = (e - r) / c + 4, c /= l < 0.5 ? a + o : 2 - a - o, i *= 60) : c = l > 0 && l < 1 ? 0 : i, new
|
|
940
|
+
return c ? (e === a ? i = (r - n) / c + (r < n) * 6 : r === a ? i = (n - e) / c + 2 : i = (e - r) / c + 4, c /= l < 0.5 ? a + o : 2 - a - o, i *= 60) : c = l > 0 && l < 1 ? 0 : i, new Mt(i, c, l, t.opacity);
|
|
941
941
|
}
|
|
942
942
|
function Oo(t, e, r, n) {
|
|
943
|
-
return arguments.length === 1 ? Lr(t) : new
|
|
943
|
+
return arguments.length === 1 ? Lr(t) : new Mt(t, e, r, n ?? 1);
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function Mt(t, e, r, n) {
|
|
946
946
|
this.h = +t, this.s = +e, this.l = +r, this.opacity = +n;
|
|
947
947
|
}
|
|
948
|
-
Ge(
|
|
948
|
+
Ge(Mt, Oo, Rr(ee, {
|
|
949
949
|
brighter(t) {
|
|
950
|
-
return t = t == null ?
|
|
950
|
+
return t = t == null ? pe : Math.pow(pe, t), new Mt(this.h, this.s, this.l * t, this.opacity);
|
|
951
951
|
},
|
|
952
952
|
darker(t) {
|
|
953
|
-
return t = t == null ?
|
|
953
|
+
return t = t == null ? Qt : Math.pow(Qt, t), new Mt(this.h, this.s, this.l * t, this.opacity);
|
|
954
954
|
},
|
|
955
955
|
rgb() {
|
|
956
956
|
var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, r = this.l, n = r + (r < 0.5 ? r : 1 - r) * e, o = 2 * r - n;
|
|
957
|
-
return new
|
|
957
|
+
return new ht(
|
|
958
958
|
Fe(t >= 240 ? t - 240 : t + 120, o, n),
|
|
959
959
|
Fe(t, o, n),
|
|
960
960
|
Fe(t < 120 ? t + 240 : t - 120, o, n),
|
|
@@ -962,20 +962,20 @@ Ge(wt, Oo, Rr(te, {
|
|
|
962
962
|
);
|
|
963
963
|
},
|
|
964
964
|
clamp() {
|
|
965
|
-
return new
|
|
965
|
+
return new Mt(nr(this.h), oe(this.s), oe(this.l), ve(this.opacity));
|
|
966
966
|
},
|
|
967
967
|
displayable() {
|
|
968
968
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
969
969
|
},
|
|
970
970
|
formatHsl() {
|
|
971
|
-
const t =
|
|
972
|
-
return `${t === 1 ? "hsl(" : "hsla("}${nr(this.h)}, ${
|
|
971
|
+
const t = ve(this.opacity);
|
|
972
|
+
return `${t === 1 ? "hsl(" : "hsla("}${nr(this.h)}, ${oe(this.s) * 100}%, ${oe(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
|
|
973
973
|
}
|
|
974
974
|
}));
|
|
975
975
|
function nr(t) {
|
|
976
976
|
return t = (t || 0) % 360, t < 0 ? t + 360 : t;
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function oe(t) {
|
|
979
979
|
return Math.max(0, Math.min(1, t || 0));
|
|
980
980
|
}
|
|
981
981
|
function Fe(t, e, r) {
|
|
@@ -1011,7 +1011,7 @@ const or = (function t(e) {
|
|
|
1011
1011
|
}
|
|
1012
1012
|
return n.gamma = t, n;
|
|
1013
1013
|
})(1);
|
|
1014
|
-
function
|
|
1014
|
+
function Pt(t, e) {
|
|
1015
1015
|
return t = +t, e = +e, function(r) {
|
|
1016
1016
|
return t * (1 - r) + e * r;
|
|
1017
1017
|
};
|
|
@@ -1030,7 +1030,7 @@ function qo(t) {
|
|
|
1030
1030
|
function Ko(t, e) {
|
|
1031
1031
|
var r = Ne.lastIndex = Ce.lastIndex = 0, n, o, a, i = -1, c = [], l = [];
|
|
1032
1032
|
for (t = t + "", e = e + ""; (n = Ne.exec(t)) && (o = Ce.exec(e)); )
|
|
1033
|
-
(a = o.index) > r && (a = e.slice(r, a), c[i] ? c[i] += a : c[++i] = a), (n = n[0]) === (o = o[0]) ? c[i] ? c[i] += o : c[++i] = o : (c[++i] = null, l.push({ i, x:
|
|
1033
|
+
(a = o.index) > r && (a = e.slice(r, a), c[i] ? c[i] += a : c[++i] = a), (n = n[0]) === (o = o[0]) ? c[i] ? c[i] += o : c[++i] = o : (c[++i] = null, l.push({ i, x: Pt(n, o) })), r = Ce.lastIndex;
|
|
1034
1034
|
return r < e.length && (a = e.slice(r), c[i] ? c[i] += a : c[++i] = a), c.length < 2 ? l[0] ? qo(l[0].x) : Ho(e) : (e = l.length, function(s) {
|
|
1035
1035
|
for (var u = 0, d; u < e; ++u) c[(d = l[u]).i] = d.x(s);
|
|
1036
1036
|
return c.join("");
|
|
@@ -1055,40 +1055,40 @@ function Br(t, e, r, n, o, a) {
|
|
|
1055
1055
|
scaleY: c
|
|
1056
1056
|
};
|
|
1057
1057
|
}
|
|
1058
|
-
var
|
|
1058
|
+
var ie;
|
|
1059
1059
|
function Qo(t) {
|
|
1060
1060
|
const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
|
|
1061
1061
|
return e.isIdentity ? $e : Br(e.a, e.b, e.c, e.d, e.e, e.f);
|
|
1062
1062
|
}
|
|
1063
1063
|
function Zo(t) {
|
|
1064
|
-
return t == null || (
|
|
1064
|
+
return t == null || (ie || (ie = document.createElementNS("http://www.w3.org/2000/svg", "g")), ie.setAttribute("transform", t), !(t = ie.transform.baseVal.consolidate())) ? $e : (t = t.matrix, Br(t.a, t.b, t.c, t.d, t.e, t.f));
|
|
1065
1065
|
}
|
|
1066
1066
|
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,
|
|
1071
|
-
if (s !== d || u !==
|
|
1072
|
-
var B =
|
|
1073
|
-
|
|
1074
|
-
} else (d ||
|
|
1070
|
+
function a(s, u, d, m, w, _) {
|
|
1071
|
+
if (s !== d || u !== m) {
|
|
1072
|
+
var B = w.push("translate(", null, e, null, r);
|
|
1073
|
+
_.push({ i: B - 4, x: Pt(s, d) }, { i: B - 2, x: Pt(u, m) });
|
|
1074
|
+
} else (d || m) && w.push("translate(" + d + e + m + r);
|
|
1075
1075
|
}
|
|
1076
|
-
function i(s, u, d,
|
|
1077
|
-
s !== u ? (s - u > 180 ? u += 360 : u - s > 180 && (s += 360),
|
|
1076
|
+
function i(s, u, d, m) {
|
|
1077
|
+
s !== u ? (s - u > 180 ? u += 360 : u - s > 180 && (s += 360), m.push({ i: d.push(o(d) + "rotate(", null, n) - 2, x: Pt(s, u) })) : u && d.push(o(d) + "rotate(" + u + n);
|
|
1078
1078
|
}
|
|
1079
|
-
function c(s, u, d,
|
|
1080
|
-
s !== u ?
|
|
1079
|
+
function c(s, u, d, m) {
|
|
1080
|
+
s !== u ? m.push({ i: d.push(o(d) + "skewX(", null, n) - 2, x: Pt(s, u) }) : u && d.push(o(d) + "skewX(" + u + n);
|
|
1081
1081
|
}
|
|
1082
|
-
function l(s, u, d,
|
|
1083
|
-
if (s !== d || u !==
|
|
1084
|
-
var B =
|
|
1085
|
-
|
|
1086
|
-
} else (d !== 1 ||
|
|
1082
|
+
function l(s, u, d, m, w, _) {
|
|
1083
|
+
if (s !== d || u !== m) {
|
|
1084
|
+
var B = w.push(o(w) + "scale(", null, ",", null, ")");
|
|
1085
|
+
_.push({ i: B - 4, x: Pt(s, d) }, { i: B - 2, x: Pt(u, m) });
|
|
1086
|
+
} else (d !== 1 || m !== 1) && w.push(o(w) + "scale(" + d + "," + m + ")");
|
|
1087
1087
|
}
|
|
1088
1088
|
return function(s, u) {
|
|
1089
|
-
var d = [],
|
|
1090
|
-
return s = t(s), u = t(u), a(s.translateX, s.translateY, u.translateX, u.translateY, d,
|
|
1091
|
-
for (var
|
|
1089
|
+
var d = [], m = [];
|
|
1090
|
+
return s = t(s), u = t(u), a(s.translateX, s.translateY, u.translateX, u.translateY, d, m), i(s.rotate, u.rotate, d, m), c(s.skewX, u.skewX, d, m), l(s.scaleX, s.scaleY, u.scaleX, u.scaleY, d, m), s = u = null, function(w) {
|
|
1091
|
+
for (var _ = -1, B = m.length, V; ++_ < B; ) d[(V = m[_]).i] = V.x(w);
|
|
1092
1092
|
return d.join("");
|
|
1093
1093
|
};
|
|
1094
1094
|
};
|
|
@@ -1105,97 +1105,97 @@ 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],
|
|
1108
|
+
var c = a[0], l = a[1], s = a[2], u = i[0], d = i[1], m = i[2], w = u - c, _ = d - l, B = w * w + _ * _, V, x;
|
|
1109
1109
|
if (B < ti)
|
|
1110
|
-
|
|
1110
|
+
x = Math.log(m / s) / e, V = function(nt) {
|
|
1111
1111
|
return [
|
|
1112
|
-
c +
|
|
1113
|
-
l +
|
|
1114
|
-
s * Math.exp(e *
|
|
1112
|
+
c + nt * w,
|
|
1113
|
+
l + nt * _,
|
|
1114
|
+
s * Math.exp(e * nt * x)
|
|
1115
1115
|
];
|
|
1116
1116
|
};
|
|
1117
1117
|
else {
|
|
1118
|
-
var
|
|
1119
|
-
|
|
1120
|
-
var
|
|
1118
|
+
var Q = Math.sqrt(B), Z = (m * m - s * s + n * B) / (2 * s * r * Q), et = (m * m - s * s - n * B) / (2 * m * r * Q), N = Math.log(Math.sqrt(Z * Z + 1) - Z), $ = Math.log(Math.sqrt(et * et + 1) - et);
|
|
1119
|
+
x = ($ - N) / e, V = function(nt) {
|
|
1120
|
+
var it = nt * x, A = ar(N), R = s / (r * Q) * (A * ri(e * it + N) - ei(N));
|
|
1121
1121
|
return [
|
|
1122
|
-
c +
|
|
1123
|
-
l +
|
|
1124
|
-
s *
|
|
1122
|
+
c + R * w,
|
|
1123
|
+
l + R * _,
|
|
1124
|
+
s * A / ar(e * it + N)
|
|
1125
1125
|
];
|
|
1126
1126
|
};
|
|
1127
1127
|
}
|
|
1128
|
-
return
|
|
1128
|
+
return V.duration = x * 1e3 * e / Math.SQRT2, V;
|
|
1129
1129
|
}
|
|
1130
1130
|
return o.rho = function(a) {
|
|
1131
1131
|
var i = Math.max(1e-3, +a), c = i * i, l = c * c;
|
|
1132
1132
|
return t(i, c, l);
|
|
1133
1133
|
}, o;
|
|
1134
1134
|
})(Math.SQRT2, 2, 4);
|
|
1135
|
-
var
|
|
1135
|
+
var Ot = 0, Ht = 0, Vt = 0, Nr = 1e3, me, qt, ye = 0, kt = 0, xe = 0, At = typeof performance == "object" && performance.now ? performance : Date, $r = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
|
|
1136
1136
|
setTimeout(t, 17);
|
|
1137
1137
|
};
|
|
1138
1138
|
function Oe() {
|
|
1139
|
-
return
|
|
1139
|
+
return kt || ($r(oi), kt = At.now() + xe);
|
|
1140
1140
|
}
|
|
1141
1141
|
function oi() {
|
|
1142
|
-
|
|
1142
|
+
kt = 0;
|
|
1143
1143
|
}
|
|
1144
|
-
function
|
|
1144
|
+
function ge() {
|
|
1145
1145
|
this._call = this._time = this._next = null;
|
|
1146
1146
|
}
|
|
1147
|
-
|
|
1148
|
-
constructor:
|
|
1147
|
+
ge.prototype = Xr.prototype = {
|
|
1148
|
+
constructor: ge,
|
|
1149
1149
|
restart: function(t, e, r) {
|
|
1150
1150
|
if (typeof t != "function") throw new TypeError("callback is not a function");
|
|
1151
|
-
r = (r == null ? Oe() : +r) + (e == null ? 0 : +e), !this._next &&
|
|
1151
|
+
r = (r == null ? Oe() : +r) + (e == null ? 0 : +e), !this._next && qt !== this && (qt ? qt._next = this : me = this, qt = this), this._call = t, this._time = r, Xe();
|
|
1152
1152
|
},
|
|
1153
1153
|
stop: function() {
|
|
1154
1154
|
this._call && (this._call = null, this._time = 1 / 0, Xe());
|
|
1155
1155
|
}
|
|
1156
1156
|
};
|
|
1157
1157
|
function Xr(t, e, r) {
|
|
1158
|
-
var n = new
|
|
1158
|
+
var n = new ge();
|
|
1159
1159
|
return n.restart(t, e, r), n;
|
|
1160
1160
|
}
|
|
1161
1161
|
function ii() {
|
|
1162
|
-
Oe(), ++
|
|
1163
|
-
for (var t =
|
|
1164
|
-
(e =
|
|
1165
|
-
--
|
|
1162
|
+
Oe(), ++Ot;
|
|
1163
|
+
for (var t = me, e; t; )
|
|
1164
|
+
(e = kt - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
|
|
1165
|
+
--Ot;
|
|
1166
1166
|
}
|
|
1167
1167
|
function sr() {
|
|
1168
|
-
|
|
1168
|
+
kt = (ye = At.now()) + xe, Ot = Ht = 0;
|
|
1169
1169
|
try {
|
|
1170
1170
|
ii();
|
|
1171
1171
|
} finally {
|
|
1172
|
-
|
|
1172
|
+
Ot = 0, si(), kt = 0;
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
1175
|
function ai() {
|
|
1176
|
-
var t =
|
|
1177
|
-
e > Nr && (
|
|
1176
|
+
var t = At.now(), e = t - ye;
|
|
1177
|
+
e > Nr && (xe -= e, ye = t);
|
|
1178
1178
|
}
|
|
1179
1179
|
function si() {
|
|
1180
|
-
for (var t, e =
|
|
1181
|
-
e._call ? (n > e._time && (n = e._time), t = e, e = e._next) : (r = e._next, e._next = null, e = t ? t._next = r :
|
|
1182
|
-
|
|
1180
|
+
for (var t, e = me, r, n = 1 / 0; e; )
|
|
1181
|
+
e._call ? (n > e._time && (n = e._time), t = e, e = e._next) : (r = e._next, e._next = null, e = t ? t._next = r : me = r);
|
|
1182
|
+
qt = t, Xe(n);
|
|
1183
1183
|
}
|
|
1184
1184
|
function Xe(t) {
|
|
1185
|
-
if (!
|
|
1186
|
-
|
|
1187
|
-
var e = t -
|
|
1188
|
-
e > 24 ? (t < 1 / 0 && (
|
|
1185
|
+
if (!Ot) {
|
|
1186
|
+
Ht && (Ht = clearTimeout(Ht));
|
|
1187
|
+
var e = t - kt;
|
|
1188
|
+
e > 24 ? (t < 1 / 0 && (Ht = setTimeout(sr, t - At.now() - xe)), Vt && (Vt = clearInterval(Vt))) : (Vt || (ye = At.now(), Vt = setInterval(ai, Nr)), Ot = 1, $r(sr));
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
1191
|
function cr(t, e, r) {
|
|
1192
|
-
var n = new
|
|
1192
|
+
var n = new ge();
|
|
1193
1193
|
return e = e == null ? 0 : +e, n.restart((o) => {
|
|
1194
1194
|
n.stop(), t(o + e);
|
|
1195
1195
|
}, e, r), n;
|
|
1196
1196
|
}
|
|
1197
|
-
var ci = ke("start", "end", "cancel", "interrupt"), li = [], Sr = 0, lr = 1, Se = 2,
|
|
1198
|
-
function
|
|
1197
|
+
var ci = ke("start", "end", "cancel", "interrupt"), li = [], Sr = 0, lr = 1, Se = 2, le = 3, ur = 4, Ue = 5, ue = 6;
|
|
1198
|
+
function Ee(t, e, r, n, o, a) {
|
|
1199
1199
|
var i = t.__transition;
|
|
1200
1200
|
if (!i) t.__transition = {};
|
|
1201
1201
|
else if (r in i) return;
|
|
@@ -1216,16 +1216,16 @@ function xe(t, e, r, n, o, a) {
|
|
|
1216
1216
|
});
|
|
1217
1217
|
}
|
|
1218
1218
|
function Te(t, e) {
|
|
1219
|
-
var r =
|
|
1219
|
+
var r = Ft(t, e);
|
|
1220
1220
|
if (r.state > Sr) throw new Error("too late; already scheduled");
|
|
1221
1221
|
return r;
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
var r =
|
|
1225
|
-
if (r.state >
|
|
1223
|
+
function _t(t, e) {
|
|
1224
|
+
var r = Ft(t, e);
|
|
1225
|
+
if (r.state > le) throw new Error("too late; already running");
|
|
1226
1226
|
return r;
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1228
|
+
function Ft(t, e) {
|
|
1229
1229
|
var r = t.__transition;
|
|
1230
1230
|
if (!r || !(r = r[e])) throw new Error("transition not found");
|
|
1231
1231
|
return r;
|
|
@@ -1237,33 +1237,33 @@ function ui(t, e, r) {
|
|
|
1237
1237
|
r.state = lr, r.timer.restart(i, r.delay, r.time), r.delay <= s && i(s - r.delay);
|
|
1238
1238
|
}
|
|
1239
1239
|
function i(s) {
|
|
1240
|
-
var u, d,
|
|
1240
|
+
var u, d, m, w;
|
|
1241
1241
|
if (r.state !== lr) return l();
|
|
1242
1242
|
for (u in n)
|
|
1243
|
-
if (
|
|
1244
|
-
if (
|
|
1245
|
-
|
|
1243
|
+
if (w = n[u], w.name === r.name) {
|
|
1244
|
+
if (w.state === le) return cr(i);
|
|
1245
|
+
w.state === ur ? (w.state = ue, w.timer.stop(), w.on.call("interrupt", t, t.__data__, w.index, w.group), delete n[u]) : +u < e && (w.state = ue, w.timer.stop(), w.on.call("cancel", t, t.__data__, w.index, w.group), delete n[u]);
|
|
1246
1246
|
}
|
|
1247
1247
|
if (cr(function() {
|
|
1248
|
-
r.state ===
|
|
1248
|
+
r.state === le && (r.state = ur, r.timer.restart(c, r.delay, r.time), c(s));
|
|
1249
1249
|
}), r.state = Se, r.on.call("start", t, t.__data__, r.index, r.group), r.state === Se) {
|
|
1250
|
-
for (r.state =
|
|
1251
|
-
(
|
|
1250
|
+
for (r.state = le, o = new Array(m = r.tween.length), u = 0, d = -1; u < m; ++u)
|
|
1251
|
+
(w = r.tween[u].value.call(t, t.__data__, r.index, r.group)) && (o[++d] = w);
|
|
1252
1252
|
o.length = d + 1;
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
1255
|
function c(s) {
|
|
1256
|
-
for (var u = s < r.duration ? r.ease.call(null, s / r.duration) : (r.timer.restart(l), r.state = Ue, 1), d = -1,
|
|
1256
|
+
for (var u = s < r.duration ? r.ease.call(null, s / r.duration) : (r.timer.restart(l), r.state = Ue, 1), d = -1, m = o.length; ++d < m; )
|
|
1257
1257
|
o[d].call(t, u);
|
|
1258
1258
|
r.state === Ue && (r.on.call("end", t, t.__data__, r.index, r.group), l());
|
|
1259
1259
|
}
|
|
1260
1260
|
function l() {
|
|
1261
|
-
r.state =
|
|
1261
|
+
r.state = ue, r.timer.stop(), delete n[e];
|
|
1262
1262
|
for (var s in n) return;
|
|
1263
1263
|
delete t.__transition;
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function fe(t, e) {
|
|
1267
1267
|
var r = t.__transition, n, o, a = !0, i;
|
|
1268
1268
|
if (r) {
|
|
1269
1269
|
e = e == null ? null : e + "";
|
|
@@ -1272,20 +1272,20 @@ function ue(t, e) {
|
|
|
1272
1272
|
a = !1;
|
|
1273
1273
|
continue;
|
|
1274
1274
|
}
|
|
1275
|
-
o = n.state > Se && n.state < Ue, n.state =
|
|
1275
|
+
o = n.state > Se && n.state < Ue, n.state = ue, n.timer.stop(), n.on.call(o ? "interrupt" : "cancel", t, t.__data__, n.index, n.group), delete r[i];
|
|
1276
1276
|
}
|
|
1277
1277
|
a && delete t.__transition;
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
1280
|
function fi(t) {
|
|
1281
1281
|
return this.each(function() {
|
|
1282
|
-
|
|
1282
|
+
fe(this, t);
|
|
1283
1283
|
});
|
|
1284
1284
|
}
|
|
1285
1285
|
function hi(t, e) {
|
|
1286
1286
|
var r, n;
|
|
1287
1287
|
return function() {
|
|
1288
|
-
var o =
|
|
1288
|
+
var o = _t(this, t), a = o.tween;
|
|
1289
1289
|
if (a !== r) {
|
|
1290
1290
|
n = r = a;
|
|
1291
1291
|
for (var i = 0, c = n.length; i < c; ++i)
|
|
@@ -1301,7 +1301,7 @@ function di(t, e, r) {
|
|
|
1301
1301
|
var n, o;
|
|
1302
1302
|
if (typeof r != "function") throw new Error();
|
|
1303
1303
|
return function() {
|
|
1304
|
-
var a =
|
|
1304
|
+
var a = _t(this, t), i = a.tween;
|
|
1305
1305
|
if (i !== n) {
|
|
1306
1306
|
o = (n = i).slice();
|
|
1307
1307
|
for (var c = { name: e, value: r }, l = 0, s = o.length; l < s; ++l)
|
|
@@ -1317,7 +1317,7 @@ function di(t, e, r) {
|
|
|
1317
1317
|
function pi(t, e) {
|
|
1318
1318
|
var r = this._id;
|
|
1319
1319
|
if (t += "", arguments.length < 2) {
|
|
1320
|
-
for (var n =
|
|
1320
|
+
for (var n = Ft(this.node(), r).tween, o = 0, a = n.length, i; o < a; ++o)
|
|
1321
1321
|
if ((i = n[o]).name === t)
|
|
1322
1322
|
return i.value;
|
|
1323
1323
|
return null;
|
|
@@ -1327,27 +1327,27 @@ function pi(t, e) {
|
|
|
1327
1327
|
function Ve(t, e, r) {
|
|
1328
1328
|
var n = t._id;
|
|
1329
1329
|
return t.each(function() {
|
|
1330
|
-
var o =
|
|
1330
|
+
var o = _t(this, n);
|
|
1331
1331
|
(o.value || (o.value = {}))[e] = r.apply(this, arguments);
|
|
1332
1332
|
}), function(o) {
|
|
1333
|
-
return
|
|
1333
|
+
return Ft(o, n).value[e];
|
|
1334
1334
|
};
|
|
1335
1335
|
}
|
|
1336
1336
|
function Ur(t, e) {
|
|
1337
1337
|
var r;
|
|
1338
|
-
return (typeof e == "number" ?
|
|
1338
|
+
return (typeof e == "number" ? Pt : e instanceof Jt ? or : (r = Jt(e)) ? (e = r, or) : Ko)(t, e);
|
|
1339
1339
|
}
|
|
1340
1340
|
function vi(t) {
|
|
1341
1341
|
return function() {
|
|
1342
1342
|
this.removeAttribute(t);
|
|
1343
1343
|
};
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1345
|
+
function mi(t) {
|
|
1346
1346
|
return function() {
|
|
1347
1347
|
this.removeAttributeNS(t.space, t.local);
|
|
1348
1348
|
};
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1350
|
+
function yi(t, e, r) {
|
|
1351
1351
|
var n, o = r + "", a;
|
|
1352
1352
|
return function() {
|
|
1353
1353
|
var i = this.getAttribute(t);
|
|
@@ -1376,8 +1376,8 @@ function xi(t, e, r) {
|
|
|
1376
1376
|
};
|
|
1377
1377
|
}
|
|
1378
1378
|
function Ei(t, e) {
|
|
1379
|
-
var r =
|
|
1380
|
-
return this.attrTween(t, typeof e == "function" ? (r.local ? xi : wi)(r, n, Ve(this, "attr." + t, e)) : e == null ? (r.local ?
|
|
1379
|
+
var r = we(t), n = r === "transform" ? Ao : Ur;
|
|
1380
|
+
return this.attrTween(t, typeof e == "function" ? (r.local ? xi : wi)(r, n, Ve(this, "attr." + t, e)) : e == null ? (r.local ? mi : vi)(r) : (r.local ? gi : yi)(r, n, e));
|
|
1381
1381
|
}
|
|
1382
1382
|
function bi(t, e) {
|
|
1383
1383
|
return function(r) {
|
|
@@ -1410,7 +1410,7 @@ function _i(t, e) {
|
|
|
1410
1410
|
if (arguments.length < 2) return (r = this.tween(r)) && r._value;
|
|
1411
1411
|
if (e == null) return this.tween(r, null);
|
|
1412
1412
|
if (typeof e != "function") throw new Error();
|
|
1413
|
-
var n =
|
|
1413
|
+
var n = we(t);
|
|
1414
1414
|
return this.tween(r, (n.local ? Fi : Ci)(n, e));
|
|
1415
1415
|
}
|
|
1416
1416
|
function Ri(t, e) {
|
|
@@ -1425,37 +1425,37 @@ function Li(t, e) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
function Yi(t) {
|
|
1427
1427
|
var e = this._id;
|
|
1428
|
-
return arguments.length ? this.each((typeof t == "function" ? Ri : Li)(e, t)) :
|
|
1428
|
+
return arguments.length ? this.each((typeof t == "function" ? Ri : Li)(e, t)) : Ft(this.node(), e).delay;
|
|
1429
1429
|
}
|
|
1430
1430
|
function Di(t, e) {
|
|
1431
1431
|
return function() {
|
|
1432
|
-
|
|
1432
|
+
_t(this, t).duration = +e.apply(this, arguments);
|
|
1433
1433
|
};
|
|
1434
1434
|
}
|
|
1435
1435
|
function Bi(t, e) {
|
|
1436
1436
|
return e = +e, function() {
|
|
1437
|
-
|
|
1437
|
+
_t(this, t).duration = e;
|
|
1438
1438
|
};
|
|
1439
1439
|
}
|
|
1440
1440
|
function Pi(t) {
|
|
1441
1441
|
var e = this._id;
|
|
1442
|
-
return arguments.length ? this.each((typeof t == "function" ? Di : Bi)(e, t)) :
|
|
1442
|
+
return arguments.length ? this.each((typeof t == "function" ? Di : Bi)(e, t)) : Ft(this.node(), e).duration;
|
|
1443
1443
|
}
|
|
1444
1444
|
function Ni(t, e) {
|
|
1445
1445
|
if (typeof e != "function") throw new Error();
|
|
1446
1446
|
return function() {
|
|
1447
|
-
|
|
1447
|
+
_t(this, t).ease = e;
|
|
1448
1448
|
};
|
|
1449
1449
|
}
|
|
1450
1450
|
function $i(t) {
|
|
1451
1451
|
var e = this._id;
|
|
1452
|
-
return arguments.length ? this.each(Ni(e, t)) :
|
|
1452
|
+
return arguments.length ? this.each(Ni(e, t)) : Ft(this.node(), e).ease;
|
|
1453
1453
|
}
|
|
1454
1454
|
function Xi(t, e) {
|
|
1455
1455
|
return function() {
|
|
1456
1456
|
var r = e.apply(this, arguments);
|
|
1457
1457
|
if (typeof r != "function") throw new Error();
|
|
1458
|
-
|
|
1458
|
+
_t(this, t).ease = r;
|
|
1459
1459
|
};
|
|
1460
1460
|
}
|
|
1461
1461
|
function Si(t) {
|
|
@@ -1463,20 +1463,20 @@ function Si(t) {
|
|
|
1463
1463
|
return this.each(Xi(this._id, t));
|
|
1464
1464
|
}
|
|
1465
1465
|
function Ui(t) {
|
|
1466
|
-
typeof t != "function" && (t =
|
|
1466
|
+
typeof t != "function" && (t = yr(t));
|
|
1467
1467
|
for (var e = this._groups, r = e.length, n = new Array(r), o = 0; o < r; ++o)
|
|
1468
1468
|
for (var a = e[o], i = a.length, c = n[o] = [], l, s = 0; s < i; ++s)
|
|
1469
1469
|
(l = a[s]) && t.call(l, l.__data__, s, a) && c.push(l);
|
|
1470
|
-
return new
|
|
1470
|
+
return new Dt(n, this._parents, this._name, this._id);
|
|
1471
1471
|
}
|
|
1472
1472
|
function Ii(t) {
|
|
1473
1473
|
if (t._id !== this._id) throw new Error();
|
|
1474
1474
|
for (var e = this._groups, r = t._groups, n = e.length, o = r.length, a = Math.min(n, o), i = new Array(n), c = 0; c < a; ++c)
|
|
1475
|
-
for (var l = e[c], s = r[c], u = l.length, d = i[c] = new Array(u),
|
|
1476
|
-
(
|
|
1475
|
+
for (var l = e[c], s = r[c], u = l.length, d = i[c] = new Array(u), m, w = 0; w < u; ++w)
|
|
1476
|
+
(m = l[w] || s[w]) && (d[w] = m);
|
|
1477
1477
|
for (; c < n; ++c)
|
|
1478
1478
|
i[c] = e[c];
|
|
1479
|
-
return new
|
|
1479
|
+
return new Dt(i, this._parents, this._name, this._id);
|
|
1480
1480
|
}
|
|
1481
1481
|
function ki(t) {
|
|
1482
1482
|
return (t + "").trim().split(/^|\s+/).every(function(e) {
|
|
@@ -1485,7 +1485,7 @@ function ki(t) {
|
|
|
1485
1485
|
});
|
|
1486
1486
|
}
|
|
1487
1487
|
function zi(t, e, r) {
|
|
1488
|
-
var n, o, a = ki(e) ? Te :
|
|
1488
|
+
var n, o, a = ki(e) ? Te : _t;
|
|
1489
1489
|
return function() {
|
|
1490
1490
|
var i = a(this, t), c = i.on;
|
|
1491
1491
|
c !== n && (o = (n = c).copy()).on(e, r), i.on = o;
|
|
@@ -1493,7 +1493,7 @@ function zi(t, e, r) {
|
|
|
1493
1493
|
}
|
|
1494
1494
|
function ji(t, e) {
|
|
1495
1495
|
var r = this._id;
|
|
1496
|
-
return arguments.length < 2 ?
|
|
1496
|
+
return arguments.length < 2 ? Ft(this.node(), r).on.on(t) : this.each(zi(r, t, e));
|
|
1497
1497
|
}
|
|
1498
1498
|
function Gi(t) {
|
|
1499
1499
|
return function() {
|
|
@@ -1509,30 +1509,30 @@ function Ti(t) {
|
|
|
1509
1509
|
var e = this._name, r = this._id;
|
|
1510
1510
|
typeof t != "function" && (t = ze(t));
|
|
1511
1511
|
for (var n = this._groups, o = n.length, a = new Array(o), i = 0; i < o; ++i)
|
|
1512
|
-
for (var c = n[i], l = c.length, s = a[i] = new Array(l), u, d,
|
|
1513
|
-
(u = c[
|
|
1514
|
-
return new
|
|
1512
|
+
for (var c = n[i], l = c.length, s = a[i] = new Array(l), u, d, m = 0; m < l; ++m)
|
|
1513
|
+
(u = c[m]) && (d = t.call(u, u.__data__, m, c)) && ("__data__" in u && (d.__data__ = u.__data__), s[m] = d, Ee(s[m], e, r, m, s, Ft(u, r)));
|
|
1514
|
+
return new Dt(a, this._parents, e, r);
|
|
1515
1515
|
}
|
|
1516
1516
|
function Vi(t) {
|
|
1517
1517
|
var e = this._name, r = this._id;
|
|
1518
|
-
typeof t != "function" && (t =
|
|
1518
|
+
typeof t != "function" && (t = mr(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
|
|
1523
|
-
(
|
|
1524
|
-
a.push(
|
|
1522
|
+
for (var m = t.call(u, u.__data__, d, l), w, _ = Ft(u, r), B = 0, V = m.length; B < V; ++B)
|
|
1523
|
+
(w = m[B]) && Ee(w, e, r, B, m, _);
|
|
1524
|
+
a.push(m), i.push(u);
|
|
1525
1525
|
}
|
|
1526
|
-
return new
|
|
1526
|
+
return new Dt(a, i, e, r);
|
|
1527
1527
|
}
|
|
1528
|
-
var Wi =
|
|
1528
|
+
var Wi = te.prototype.constructor;
|
|
1529
1529
|
function Hi() {
|
|
1530
1530
|
return new Wi(this._groups, this._parents);
|
|
1531
1531
|
}
|
|
1532
1532
|
function qi(t, e) {
|
|
1533
1533
|
var r, n, o;
|
|
1534
1534
|
return function() {
|
|
1535
|
-
var a =
|
|
1535
|
+
var a = Gt(this, t), i = (this.style.removeProperty(t), Gt(this, t));
|
|
1536
1536
|
return a === i ? null : a === r && i === n ? o : o = e(r = a, n = i);
|
|
1537
1537
|
};
|
|
1538
1538
|
}
|
|
@@ -1544,21 +1544,21 @@ function Ir(t) {
|
|
|
1544
1544
|
function Ki(t, e, r) {
|
|
1545
1545
|
var n, o = r + "", a;
|
|
1546
1546
|
return function() {
|
|
1547
|
-
var i =
|
|
1547
|
+
var i = Gt(this, t);
|
|
1548
1548
|
return i === o ? null : i === n ? a : a = e(n = i, r);
|
|
1549
1549
|
};
|
|
1550
1550
|
}
|
|
1551
1551
|
function Qi(t, e, r) {
|
|
1552
1552
|
var n, o, a;
|
|
1553
1553
|
return function() {
|
|
1554
|
-
var i =
|
|
1555
|
-
return c == null && (l = c = (this.style.removeProperty(t),
|
|
1554
|
+
var i = Gt(this, t), c = r(this), l = c + "";
|
|
1555
|
+
return c == null && (l = c = (this.style.removeProperty(t), Gt(this, t))), i === l ? null : i === n && l === o ? a : (o = l, a = e(n = i, c));
|
|
1556
1556
|
};
|
|
1557
1557
|
}
|
|
1558
1558
|
function Zi(t, e) {
|
|
1559
1559
|
var r, n, o, a = "style." + e, i = "end." + a, c;
|
|
1560
1560
|
return function() {
|
|
1561
|
-
var l =
|
|
1561
|
+
var l = _t(this, t), s = l.on, u = l.value[a] == null ? c || (c = Ir(e)) : void 0;
|
|
1562
1562
|
(s !== r || o !== u) && (n = (r = s).copy()).on(i, o = u), l.on = n;
|
|
1563
1563
|
};
|
|
1564
1564
|
}
|
|
@@ -1624,15 +1624,15 @@ function ca() {
|
|
|
1624
1624
|
for (var t = this._name, e = this._id, r = kr(), n = this._groups, o = n.length, a = 0; a < o; ++a)
|
|
1625
1625
|
for (var i = n[a], c = i.length, l, s = 0; s < c; ++s)
|
|
1626
1626
|
if (l = i[s]) {
|
|
1627
|
-
var u =
|
|
1628
|
-
|
|
1627
|
+
var u = Ft(l, e);
|
|
1628
|
+
Ee(l, t, r, s, i, {
|
|
1629
1629
|
time: u.time + u.delay + u.duration,
|
|
1630
1630
|
delay: 0,
|
|
1631
1631
|
duration: u.duration,
|
|
1632
1632
|
ease: u.ease
|
|
1633
1633
|
});
|
|
1634
1634
|
}
|
|
1635
|
-
return new
|
|
1635
|
+
return new Dt(n, this._parents, t, r);
|
|
1636
1636
|
}
|
|
1637
1637
|
function la() {
|
|
1638
1638
|
var t, e, r = this, n = r._id, o = r.size();
|
|
@@ -1641,35 +1641,35 @@ function la() {
|
|
|
1641
1641
|
--o === 0 && a();
|
|
1642
1642
|
} };
|
|
1643
1643
|
r.each(function() {
|
|
1644
|
-
var s =
|
|
1644
|
+
var s = _t(this, n), u = s.on;
|
|
1645
1645
|
u !== t && (e = (t = u).copy(), e._.cancel.push(c), e._.interrupt.push(c), e._.end.push(l)), s.on = e;
|
|
1646
1646
|
}), o === 0 && a();
|
|
1647
1647
|
});
|
|
1648
1648
|
}
|
|
1649
1649
|
var ua = 0;
|
|
1650
|
-
function
|
|
1650
|
+
function Dt(t, e, r, n) {
|
|
1651
1651
|
this._groups = t, this._parents = e, this._name = r, this._id = n;
|
|
1652
1652
|
}
|
|
1653
1653
|
function kr() {
|
|
1654
1654
|
return ++ua;
|
|
1655
1655
|
}
|
|
1656
|
-
var
|
|
1657
|
-
|
|
1658
|
-
constructor:
|
|
1656
|
+
var Lt = te.prototype;
|
|
1657
|
+
Dt.prototype = {
|
|
1658
|
+
constructor: Dt,
|
|
1659
1659
|
select: Ti,
|
|
1660
1660
|
selectAll: Vi,
|
|
1661
|
-
selectChild:
|
|
1662
|
-
selectChildren:
|
|
1661
|
+
selectChild: Lt.selectChild,
|
|
1662
|
+
selectChildren: Lt.selectChildren,
|
|
1663
1663
|
filter: Ui,
|
|
1664
1664
|
merge: Ii,
|
|
1665
1665
|
selection: Hi,
|
|
1666
1666
|
transition: ca,
|
|
1667
|
-
call:
|
|
1668
|
-
nodes:
|
|
1669
|
-
node:
|
|
1670
|
-
size:
|
|
1671
|
-
empty:
|
|
1672
|
-
each:
|
|
1667
|
+
call: Lt.call,
|
|
1668
|
+
nodes: Lt.nodes,
|
|
1669
|
+
node: Lt.node,
|
|
1670
|
+
size: Lt.size,
|
|
1671
|
+
empty: Lt.empty,
|
|
1672
|
+
each: Lt.each,
|
|
1673
1673
|
on: ji,
|
|
1674
1674
|
attr: Ei,
|
|
1675
1675
|
attrTween: _i,
|
|
@@ -1684,7 +1684,7 @@ Yt.prototype = {
|
|
|
1684
1684
|
ease: $i,
|
|
1685
1685
|
easeVarying: Si,
|
|
1686
1686
|
end: la,
|
|
1687
|
-
[Symbol.iterator]:
|
|
1687
|
+
[Symbol.iterator]: Lt[Symbol.iterator]
|
|
1688
1688
|
};
|
|
1689
1689
|
function fa(t) {
|
|
1690
1690
|
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
|
|
@@ -1704,15 +1704,15 @@ function da(t, e) {
|
|
|
1704
1704
|
}
|
|
1705
1705
|
function pa(t) {
|
|
1706
1706
|
var e, r;
|
|
1707
|
-
t instanceof
|
|
1707
|
+
t instanceof Dt ? (e = t._id, t = t._name) : (e = kr(), (r = ha).time = Oe(), t = t == null ? null : t + "");
|
|
1708
1708
|
for (var n = this._groups, o = n.length, a = 0; a < o; ++a)
|
|
1709
1709
|
for (var i = n[a], c = i.length, l, s = 0; s < c; ++s)
|
|
1710
|
-
(l = i[s]) &&
|
|
1711
|
-
return new
|
|
1710
|
+
(l = i[s]) && Ee(l, t, e, s, i, r || da(l, e));
|
|
1711
|
+
return new Dt(n, this._parents, t, e);
|
|
1712
1712
|
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
const
|
|
1713
|
+
te.prototype.interrupt = fi;
|
|
1714
|
+
te.prototype.transition = pa;
|
|
1715
|
+
const ae = (t) => () => t;
|
|
1716
1716
|
function va(t, {
|
|
1717
1717
|
sourceEvent: e,
|
|
1718
1718
|
target: r,
|
|
@@ -1727,16 +1727,16 @@ function va(t, {
|
|
|
1727
1727
|
_: { value: o }
|
|
1728
1728
|
});
|
|
1729
1729
|
}
|
|
1730
|
-
function
|
|
1730
|
+
function Yt(t, e, r) {
|
|
1731
1731
|
this.k = t, this.x = e, this.y = r;
|
|
1732
1732
|
}
|
|
1733
|
-
|
|
1734
|
-
constructor:
|
|
1733
|
+
Yt.prototype = {
|
|
1734
|
+
constructor: Yt,
|
|
1735
1735
|
scale: function(t) {
|
|
1736
|
-
return t === 1 ? this : new
|
|
1736
|
+
return t === 1 ? this : new Yt(this.k * t, this.x, this.y);
|
|
1737
1737
|
},
|
|
1738
1738
|
translate: function(t, e) {
|
|
1739
|
-
return t === 0 & e === 0 ? this : new
|
|
1739
|
+
return t === 0 & e === 0 ? this : new Yt(this.k, this.x + this.k * t, this.y + this.k * e);
|
|
1740
1740
|
},
|
|
1741
1741
|
apply: function(t) {
|
|
1742
1742
|
return [t[0] * this.k + this.x, t[1] * this.k + this.y];
|
|
@@ -1766,27 +1766,27 @@ Lt.prototype = {
|
|
|
1766
1766
|
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
1767
1767
|
}
|
|
1768
1768
|
};
|
|
1769
|
-
var
|
|
1770
|
-
|
|
1771
|
-
function
|
|
1772
|
-
for (; !t.__zoom; ) if (!(t = t.parentNode)) return
|
|
1769
|
+
var $t = new Yt(1, 0, 0);
|
|
1770
|
+
Kt.prototype = Yt.prototype;
|
|
1771
|
+
function Kt(t) {
|
|
1772
|
+
for (; !t.__zoom; ) if (!(t = t.parentNode)) return $t;
|
|
1773
1773
|
return t.__zoom;
|
|
1774
1774
|
}
|
|
1775
1775
|
function _e(t) {
|
|
1776
1776
|
t.stopImmediatePropagation();
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1778
|
+
function Wt(t) {
|
|
1779
1779
|
t.preventDefault(), t.stopImmediatePropagation();
|
|
1780
1780
|
}
|
|
1781
|
-
function
|
|
1781
|
+
function ma(t) {
|
|
1782
1782
|
return (!t.ctrlKey || t.type === "wheel") && !t.button;
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1784
|
+
function ya() {
|
|
1785
1785
|
var t = this;
|
|
1786
1786
|
return t instanceof SVGElement ? (t = t.ownerSVGElement || t, t.hasAttribute("viewBox") ? (t = t.viewBox.baseVal, [[t.x, t.y], [t.x + t.width, t.y + t.height]]) : [[0, 0], [t.width.baseVal.value, t.height.baseVal.value]]) : [[0, 0], [t.clientWidth, t.clientHeight]];
|
|
1787
1787
|
}
|
|
1788
1788
|
function fr() {
|
|
1789
|
-
return this.__zoom ||
|
|
1789
|
+
return this.__zoom || $t;
|
|
1790
1790
|
}
|
|
1791
1791
|
function ga(t) {
|
|
1792
1792
|
return -t.deltaY * (t.deltaMode === 1 ? 0.05 : t.deltaMode ? 1 : 2e-3) * (t.ctrlKey ? 10 : 1);
|
|
@@ -1802,202 +1802,202 @@ function xa(t, e, r) {
|
|
|
1802
1802
|
);
|
|
1803
1803
|
}
|
|
1804
1804
|
function We() {
|
|
1805
|
-
var t =
|
|
1806
|
-
function
|
|
1807
|
-
f.property("__zoom", fr).on("wheel.zoom",
|
|
1805
|
+
var t = ma, e = ya, 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, m, w = 500, _ = 150, B = 0, V = 10;
|
|
1806
|
+
function x(f) {
|
|
1807
|
+
f.property("__zoom", fr).on("wheel.zoom", it, { passive: !1 }).on("mousedown.zoom", A).on("dblclick.zoom", R).filter(o).on("touchstart.zoom", U).on("touchmove.zoom", W).on("touchend.zoom touchcancel.zoom", P).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
1808
1808
|
}
|
|
1809
|
-
|
|
1809
|
+
x.transform = function(f, b, y, D) {
|
|
1810
1810
|
var X = f.selection ? f.selection() : f;
|
|
1811
|
-
X.property("__zoom", fr), f !== X ?
|
|
1812
|
-
|
|
1811
|
+
X.property("__zoom", fr), f !== X ? N(f, b, y, D) : X.interrupt().each(function() {
|
|
1812
|
+
$(this, arguments).event(D).start().zoom(null, typeof b == "function" ? b.apply(this, arguments) : b).end();
|
|
1813
1813
|
});
|
|
1814
|
-
},
|
|
1815
|
-
|
|
1816
|
-
var X = this.__zoom.k,
|
|
1817
|
-
return X *
|
|
1818
|
-
},
|
|
1819
|
-
},
|
|
1820
|
-
|
|
1821
|
-
var X = e.apply(this, arguments),
|
|
1822
|
-
return r(
|
|
1823
|
-
},
|
|
1824
|
-
},
|
|
1825
|
-
|
|
1814
|
+
}, x.scaleBy = function(f, b, y, D) {
|
|
1815
|
+
x.scaleTo(f, function() {
|
|
1816
|
+
var X = this.__zoom.k, S = typeof b == "function" ? b.apply(this, arguments) : b;
|
|
1817
|
+
return X * S;
|
|
1818
|
+
}, y, D);
|
|
1819
|
+
}, x.scaleTo = function(f, b, y, D) {
|
|
1820
|
+
x.transform(f, function() {
|
|
1821
|
+
var X = e.apply(this, arguments), S = this.__zoom, z = y == null ? et(X) : typeof y == "function" ? y.apply(this, arguments) : y, G = S.invert(z), p = typeof b == "function" ? b.apply(this, arguments) : b;
|
|
1822
|
+
return r(Z(Q(S, p), z, G), X, i);
|
|
1823
|
+
}, y, D);
|
|
1824
|
+
}, x.translateBy = function(f, b, y, D) {
|
|
1825
|
+
x.transform(f, function() {
|
|
1826
1826
|
return r(this.__zoom.translate(
|
|
1827
|
-
typeof
|
|
1828
|
-
typeof
|
|
1827
|
+
typeof b == "function" ? b.apply(this, arguments) : b,
|
|
1828
|
+
typeof y == "function" ? y.apply(this, arguments) : y
|
|
1829
1829
|
), e.apply(this, arguments), i);
|
|
1830
1830
|
}, null, D);
|
|
1831
|
-
},
|
|
1832
|
-
|
|
1833
|
-
var
|
|
1834
|
-
return r(
|
|
1835
|
-
typeof
|
|
1836
|
-
typeof
|
|
1837
|
-
),
|
|
1831
|
+
}, x.translateTo = function(f, b, y, D, X) {
|
|
1832
|
+
x.transform(f, function() {
|
|
1833
|
+
var S = e.apply(this, arguments), z = this.__zoom, G = D == null ? et(S) : typeof D == "function" ? D.apply(this, arguments) : D;
|
|
1834
|
+
return r($t.translate(G[0], G[1]).scale(z.k).translate(
|
|
1835
|
+
typeof b == "function" ? -b.apply(this, arguments) : -b,
|
|
1836
|
+
typeof y == "function" ? -y.apply(this, arguments) : -y
|
|
1837
|
+
), S, i);
|
|
1838
1838
|
}, D, X);
|
|
1839
1839
|
};
|
|
1840
|
-
function
|
|
1841
|
-
return
|
|
1840
|
+
function Q(f, b) {
|
|
1841
|
+
return b = Math.max(a[0], Math.min(a[1], b)), b === f.k ? f : new Yt(b, f.x, f.y);
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1844
|
-
var D =
|
|
1845
|
-
return D === f.x && X === f.y ? f : new
|
|
1843
|
+
function Z(f, b, y) {
|
|
1844
|
+
var D = b[0] - y[0] * f.k, X = b[1] - y[1] * f.k;
|
|
1845
|
+
return D === f.x && X === f.y ? f : new Yt(f.k, D, X);
|
|
1846
1846
|
}
|
|
1847
|
-
function
|
|
1847
|
+
function et(f) {
|
|
1848
1848
|
return [(+f[0][0] + +f[1][0]) / 2, (+f[0][1] + +f[1][1]) / 2];
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function N(f, b, y, D) {
|
|
1851
1851
|
f.on("start.zoom", function() {
|
|
1852
|
-
|
|
1852
|
+
$(this, arguments).event(D).start();
|
|
1853
1853
|
}).on("interrupt.zoom end.zoom", function() {
|
|
1854
|
-
|
|
1854
|
+
$(this, arguments).event(D).end();
|
|
1855
1855
|
}).tween("zoom", function() {
|
|
1856
|
-
var X = this,
|
|
1857
|
-
return function(
|
|
1858
|
-
if (
|
|
1856
|
+
var X = this, S = arguments, z = $(X, S).event(D), G = e.apply(X, S), p = y == null ? et(G) : typeof y == "function" ? y.apply(X, S) : y, h = Math.max(G[1][0] - G[0][0], G[1][1] - G[0][1]), C = X.__zoom, E = typeof b == "function" ? b.apply(X, S) : b, Y = l(C.invert(p).concat(h / C.k), E.invert(p).concat(h / E.k));
|
|
1857
|
+
return function(g) {
|
|
1858
|
+
if (g === 1) g = E;
|
|
1859
1859
|
else {
|
|
1860
|
-
var
|
|
1861
|
-
|
|
1860
|
+
var v = Y(g), L = h / v[2];
|
|
1861
|
+
g = new Yt(L, p[0] - v[0] * L, p[1] - v[1] * L);
|
|
1862
1862
|
}
|
|
1863
|
-
|
|
1863
|
+
z.zoom(null, g);
|
|
1864
1864
|
};
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
1867
|
-
function
|
|
1868
|
-
return !
|
|
1867
|
+
function $(f, b, y) {
|
|
1868
|
+
return !y && f.__zooming || new nt(f, b);
|
|
1869
1869
|
}
|
|
1870
|
-
function
|
|
1871
|
-
this.that = f, this.args =
|
|
1870
|
+
function nt(f, b) {
|
|
1871
|
+
this.that = f, this.args = b, this.active = 0, this.sourceEvent = null, this.extent = e.apply(f, b), this.taps = 0;
|
|
1872
1872
|
}
|
|
1873
|
-
|
|
1873
|
+
nt.prototype = {
|
|
1874
1874
|
event: function(f) {
|
|
1875
1875
|
return f && (this.sourceEvent = f), this;
|
|
1876
1876
|
},
|
|
1877
1877
|
start: function() {
|
|
1878
1878
|
return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
|
|
1879
1879
|
},
|
|
1880
|
-
zoom: function(f,
|
|
1881
|
-
return this.mouse && f !== "mouse" && (this.mouse[1] =
|
|
1880
|
+
zoom: function(f, b) {
|
|
1881
|
+
return this.mouse && f !== "mouse" && (this.mouse[1] = b.invert(this.mouse[0])), this.touch0 && f !== "touch" && (this.touch0[1] = b.invert(this.touch0[0])), this.touch1 && f !== "touch" && (this.touch1[1] = b.invert(this.touch1[0])), this.that.__zoom = b, this.emit("zoom"), this;
|
|
1882
1882
|
},
|
|
1883
1883
|
end: function() {
|
|
1884
1884
|
return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
|
|
1885
1885
|
},
|
|
1886
1886
|
emit: function(f) {
|
|
1887
|
-
var
|
|
1887
|
+
var b = at(this.that).datum();
|
|
1888
1888
|
s.call(
|
|
1889
1889
|
f,
|
|
1890
1890
|
this.that,
|
|
1891
1891
|
new va(f, {
|
|
1892
1892
|
sourceEvent: this.sourceEvent,
|
|
1893
|
-
target:
|
|
1893
|
+
target: x,
|
|
1894
1894
|
transform: this.that.__zoom,
|
|
1895
1895
|
dispatch: s
|
|
1896
1896
|
}),
|
|
1897
|
-
|
|
1897
|
+
b
|
|
1898
1898
|
);
|
|
1899
1899
|
}
|
|
1900
1900
|
};
|
|
1901
|
-
function
|
|
1901
|
+
function it(f, ...b) {
|
|
1902
1902
|
if (!t.apply(this, arguments)) return;
|
|
1903
|
-
var
|
|
1904
|
-
if (
|
|
1905
|
-
(
|
|
1903
|
+
var y = $(this, b).event(f), D = this.__zoom, X = Math.max(a[0], Math.min(a[1], D.k * Math.pow(2, n.apply(this, arguments)))), S = Xt(f);
|
|
1904
|
+
if (y.wheel)
|
|
1905
|
+
(y.mouse[0][0] !== S[0] || y.mouse[0][1] !== S[1]) && (y.mouse[1] = D.invert(y.mouse[0] = S)), clearTimeout(y.wheel);
|
|
1906
1906
|
else {
|
|
1907
1907
|
if (D.k === X) return;
|
|
1908
|
-
|
|
1908
|
+
y.mouse = [S, D.invert(S)], fe(this), y.start();
|
|
1909
1909
|
}
|
|
1910
|
-
|
|
1911
|
-
function
|
|
1912
|
-
|
|
1910
|
+
Wt(f), y.wheel = setTimeout(z, _), y.zoom("mouse", r(Z(Q(D, X), y.mouse[0], y.mouse[1]), y.extent, i));
|
|
1911
|
+
function z() {
|
|
1912
|
+
y.wheel = null, y.end();
|
|
1913
1913
|
}
|
|
1914
1914
|
}
|
|
1915
|
-
function
|
|
1916
|
-
if (
|
|
1917
|
-
var
|
|
1918
|
-
Do(f.view), _e(f), D.mouse = [
|
|
1919
|
-
function
|
|
1920
|
-
if (
|
|
1921
|
-
var
|
|
1922
|
-
D.moved =
|
|
1915
|
+
function A(f, ...b) {
|
|
1916
|
+
if (m || !t.apply(this, arguments)) return;
|
|
1917
|
+
var y = f.currentTarget, D = $(this, b, !0).event(f), X = at(f.view).on("mousemove.zoom", p, !0).on("mouseup.zoom", h, !0), S = Xt(f, y), z = f.clientX, G = f.clientY;
|
|
1918
|
+
Do(f.view), _e(f), D.mouse = [S, this.__zoom.invert(S)], fe(this), D.start();
|
|
1919
|
+
function p(C) {
|
|
1920
|
+
if (Wt(C), !D.moved) {
|
|
1921
|
+
var E = C.clientX - z, Y = C.clientY - G;
|
|
1922
|
+
D.moved = E * E + Y * Y > B;
|
|
1923
1923
|
}
|
|
1924
|
-
D.event(
|
|
1924
|
+
D.event(C).zoom("mouse", r(Z(D.that.__zoom, D.mouse[0] = Xt(C, y), D.mouse[1]), D.extent, i));
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1927
|
-
X.on("mousemove.zoom mouseup.zoom", null), Bo(
|
|
1926
|
+
function h(C) {
|
|
1927
|
+
X.on("mousemove.zoom mouseup.zoom", null), Bo(C.view, D.moved), Wt(C), D.event(C).end();
|
|
1928
1928
|
}
|
|
1929
1929
|
}
|
|
1930
|
-
function
|
|
1930
|
+
function R(f, ...b) {
|
|
1931
1931
|
if (t.apply(this, arguments)) {
|
|
1932
|
-
var
|
|
1933
|
-
|
|
1932
|
+
var y = this.__zoom, D = Xt(f.changedTouches ? f.changedTouches[0] : f, this), X = y.invert(D), S = y.k * (f.shiftKey ? 0.5 : 2), z = r(Z(Q(y, S), D, X), e.apply(this, b), i);
|
|
1933
|
+
Wt(f), c > 0 ? at(this).transition().duration(c).call(N, z, D, f) : at(this).call(x.transform, z, D, f);
|
|
1934
1934
|
}
|
|
1935
1935
|
}
|
|
1936
|
-
function
|
|
1936
|
+
function U(f, ...b) {
|
|
1937
1937
|
if (t.apply(this, arguments)) {
|
|
1938
|
-
var
|
|
1939
|
-
for (_e(f),
|
|
1940
|
-
|
|
1941
|
-
u && (u = clearTimeout(u)),
|
|
1938
|
+
var y = f.touches, D = y.length, X = $(this, b, f.changedTouches.length === D).event(f), S, z, G, p;
|
|
1939
|
+
for (_e(f), z = 0; z < D; ++z)
|
|
1940
|
+
G = y[z], p = Xt(G, this), p = [p, this.__zoom.invert(p), G.identifier], X.touch0 ? !X.touch1 && X.touch0[2] !== p[2] && (X.touch1 = p, X.taps = 0) : (X.touch0 = p, S = !0, X.taps = 1 + !!u);
|
|
1941
|
+
u && (u = clearTimeout(u)), S && (X.taps < 2 && (d = p[0], u = setTimeout(function() {
|
|
1942
1942
|
u = null;
|
|
1943
|
-
},
|
|
1943
|
+
}, w)), fe(this), X.start());
|
|
1944
1944
|
}
|
|
1945
1945
|
}
|
|
1946
|
-
function
|
|
1946
|
+
function W(f, ...b) {
|
|
1947
1947
|
if (this.__zooming) {
|
|
1948
|
-
var
|
|
1949
|
-
for (
|
|
1950
|
-
|
|
1951
|
-
if (
|
|
1952
|
-
var
|
|
1953
|
-
|
|
1954
|
-
} else if (
|
|
1948
|
+
var y = $(this, b).event(f), D = f.changedTouches, X = D.length, S, z, G, p;
|
|
1949
|
+
for (Wt(f), S = 0; S < X; ++S)
|
|
1950
|
+
z = D[S], G = Xt(z, this), y.touch0 && y.touch0[2] === z.identifier ? y.touch0[0] = G : y.touch1 && y.touch1[2] === z.identifier && (y.touch1[0] = G);
|
|
1951
|
+
if (z = y.that.__zoom, y.touch1) {
|
|
1952
|
+
var h = y.touch0[0], C = y.touch0[1], E = y.touch1[0], Y = y.touch1[1], g = (g = E[0] - h[0]) * g + (g = E[1] - h[1]) * g, v = (v = Y[0] - C[0]) * v + (v = Y[1] - C[1]) * v;
|
|
1953
|
+
z = Q(z, Math.sqrt(g / v)), G = [(h[0] + E[0]) / 2, (h[1] + E[1]) / 2], p = [(C[0] + Y[0]) / 2, (C[1] + Y[1]) / 2];
|
|
1954
|
+
} else if (y.touch0) G = y.touch0[0], p = y.touch0[1];
|
|
1955
1955
|
else return;
|
|
1956
|
-
|
|
1956
|
+
y.zoom("touch", r(Z(z, G, p), y.extent, i));
|
|
1957
1957
|
}
|
|
1958
1958
|
}
|
|
1959
|
-
function
|
|
1959
|
+
function P(f, ...b) {
|
|
1960
1960
|
if (this.__zooming) {
|
|
1961
|
-
var
|
|
1962
|
-
for (_e(f),
|
|
1963
|
-
|
|
1964
|
-
},
|
|
1965
|
-
|
|
1966
|
-
if (
|
|
1967
|
-
else if (
|
|
1968
|
-
var
|
|
1969
|
-
|
|
1961
|
+
var y = $(this, b).event(f), D = f.changedTouches, X = D.length, S, z;
|
|
1962
|
+
for (_e(f), m && clearTimeout(m), m = setTimeout(function() {
|
|
1963
|
+
m = null;
|
|
1964
|
+
}, w), S = 0; S < X; ++S)
|
|
1965
|
+
z = D[S], y.touch0 && y.touch0[2] === z.identifier ? delete y.touch0 : y.touch1 && y.touch1[2] === z.identifier && delete y.touch1;
|
|
1966
|
+
if (y.touch1 && !y.touch0 && (y.touch0 = y.touch1, delete y.touch1), y.touch0) y.touch0[1] = this.__zoom.invert(y.touch0[0]);
|
|
1967
|
+
else if (y.end(), y.taps === 2 && (z = Xt(z, this), Math.hypot(d[0] - z[0], d[1] - z[1]) < V)) {
|
|
1968
|
+
var G = at(this).on("dblclick.zoom");
|
|
1969
|
+
G && G.apply(this, arguments);
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
|
-
return
|
|
1974
|
-
return arguments.length ? (n = typeof f == "function" ? f :
|
|
1975
|
-
},
|
|
1976
|
-
return arguments.length ? (t = typeof f == "function" ? f :
|
|
1977
|
-
},
|
|
1978
|
-
return arguments.length ? (o = typeof f == "function" ? f :
|
|
1979
|
-
},
|
|
1980
|
-
return arguments.length ? (e = typeof f == "function" ? f :
|
|
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 x.wheelDelta = function(f) {
|
|
1974
|
+
return arguments.length ? (n = typeof f == "function" ? f : ae(+f), x) : n;
|
|
1975
|
+
}, x.filter = function(f) {
|
|
1976
|
+
return arguments.length ? (t = typeof f == "function" ? f : ae(!!f), x) : t;
|
|
1977
|
+
}, x.touchable = function(f) {
|
|
1978
|
+
return arguments.length ? (o = typeof f == "function" ? f : ae(!!f), x) : o;
|
|
1979
|
+
}, x.extent = function(f) {
|
|
1980
|
+
return arguments.length ? (e = typeof f == "function" ? f : ae([[+f[0][0], +f[0][1]], [+f[1][0], +f[1][1]]]), x) : e;
|
|
1981
|
+
}, x.scaleExtent = function(f) {
|
|
1982
|
+
return arguments.length ? (a[0] = +f[0], a[1] = +f[1], x) : [a[0], a[1]];
|
|
1983
|
+
}, x.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], x) : [[i[0][0], i[0][1]], [i[1][0], i[1][1]]];
|
|
1985
|
+
}, x.constrain = function(f) {
|
|
1986
|
+
return arguments.length ? (r = f, x) : r;
|
|
1987
|
+
}, x.duration = function(f) {
|
|
1988
|
+
return arguments.length ? (c = +f, x) : c;
|
|
1989
|
+
}, x.interpolate = function(f) {
|
|
1990
|
+
return arguments.length ? (l = f, x) : l;
|
|
1991
|
+
}, x.on = function() {
|
|
1992
1992
|
var f = s.on.apply(s, arguments);
|
|
1993
|
-
return f === s ?
|
|
1994
|
-
},
|
|
1995
|
-
return arguments.length ? (B = (f = +f) * f,
|
|
1996
|
-
},
|
|
1997
|
-
return arguments.length ? (
|
|
1998
|
-
},
|
|
1999
|
-
}
|
|
2000
|
-
const
|
|
1993
|
+
return f === s ? x : f;
|
|
1994
|
+
}, x.clickDistance = function(f) {
|
|
1995
|
+
return arguments.length ? (B = (f = +f) * f, x) : Math.sqrt(B);
|
|
1996
|
+
}, x.tapDistance = function(f) {
|
|
1997
|
+
return arguments.length ? (V = +f, x) : V;
|
|
1998
|
+
}, x;
|
|
1999
|
+
}
|
|
2000
|
+
const be = {
|
|
2001
2001
|
// Edge Routing
|
|
2002
2002
|
horizontalExtension: 30,
|
|
2003
2003
|
minEdgeDistance: 50,
|
|
@@ -2021,7 +2021,7 @@ const Ee = {
|
|
|
2021
2021
|
};
|
|
2022
2022
|
function Ea(t) {
|
|
2023
2023
|
return {
|
|
2024
|
-
...
|
|
2024
|
+
...be,
|
|
2025
2025
|
...t
|
|
2026
2026
|
};
|
|
2027
2027
|
}
|
|
@@ -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,
|
|
2336
|
-
l / 2 -
|
|
2337
|
-
s / 2 -
|
|
2335
|
+
const l = c.clientWidth, s = c.clientHeight, u = i.width, d = i.height, m = i.x + u / 2, w = i.y + d / 2, _ = 0.8 / Math.max(u / l, d / s), B = [
|
|
2336
|
+
l / 2 - _ * m,
|
|
2337
|
+
s / 2 - _ * w
|
|
2338
2338
|
];
|
|
2339
2339
|
e.call(
|
|
2340
2340
|
n.transform,
|
|
2341
|
-
|
|
2341
|
+
$t.translate(B[0], B[1]).scale(_)
|
|
2342
2342
|
);
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
@@ -2375,10 +2375,10 @@ function Ya(t, e) {
|
|
|
2375
2375
|
const u = s.getPosition();
|
|
2376
2376
|
if (!u) return;
|
|
2377
2377
|
const d = u[0];
|
|
2378
|
-
let
|
|
2379
|
-
(
|
|
2378
|
+
let m = n.findIndex(
|
|
2379
|
+
(w) => Math.abs(d - w) <= 20
|
|
2380
2380
|
);
|
|
2381
|
-
|
|
2381
|
+
m === -1 && (m = n.length, n.push(d)), o.set(s._gvid, m);
|
|
2382
2382
|
});
|
|
2383
2383
|
const a = n.map((s, u) => ({ x: s, i: u })).sort((s, u) => s.x - u.x).map((s, u) => ({ oldIndex: s.i, newIndex: u })), i = /* @__PURE__ */ new Map();
|
|
2384
2384
|
a.forEach(({ oldIndex: s, newIndex: u }) => {
|
|
@@ -2396,8 +2396,8 @@ function Ya(t, e) {
|
|
|
2396
2396
|
if (u === void 0) return;
|
|
2397
2397
|
const d = c.get(u);
|
|
2398
2398
|
if (!d) return;
|
|
2399
|
-
const
|
|
2400
|
-
|
|
2399
|
+
const m = Ra(s);
|
|
2400
|
+
m && La(m, d, s.sourceNode);
|
|
2401
2401
|
});
|
|
2402
2402
|
const l = /* @__PURE__ */ new Map();
|
|
2403
2403
|
return e.forEach((s) => {
|
|
@@ -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
|
|
2409
|
-
l.has(
|
|
2408
|
+
const m = Math.min(u, d), w = Math.max(u, d), _ = `${m}-${w}`;
|
|
2409
|
+
l.has(_) || l.set(_, new Ca(u, d, 0)), l.get(_).addEdge(s);
|
|
2410
2410
|
}), l.forEach((s) => {
|
|
2411
2411
|
s.edges.sort((u, d) => {
|
|
2412
|
-
const
|
|
2413
|
-
return (B &&
|
|
2412
|
+
const m = u.getStartPoint(), w = u.getEndPoint(), _ = m && w ? (m.y + w.y) / 2 : 0, B = d.getStartPoint(), V = d.getEndPoint();
|
|
2413
|
+
return (B && V ? (B.y + V.y) / 2 : 0) - _;
|
|
2414
2414
|
});
|
|
2415
2415
|
}), { nodeColumnMap: o, nodeColumns: c, edgeColumns: l };
|
|
2416
2416
|
}
|
|
@@ -2437,175 +2437,175 @@ function Ba(t, e) {
|
|
|
2437
2437
|
const c = n.indexOf(i);
|
|
2438
2438
|
r.setBaseEdge(i, c);
|
|
2439
2439
|
const l = i.getStartPoint(), s = i.getEndPoint(), u = l && s ? (l.y + s.y) / 2 : 0;
|
|
2440
|
-
o.forEach((d,
|
|
2440
|
+
o.forEach((d, m) => {
|
|
2441
2441
|
if (d === i) return;
|
|
2442
|
-
const
|
|
2443
|
-
(
|
|
2442
|
+
const w = d.getStartPoint(), _ = d.getEndPoint();
|
|
2443
|
+
(w && _ ? (w.y + _.y) / 2 : 0) > u ? d.baseDirection = "above" : d.baseDirection = "below";
|
|
2444
2444
|
});
|
|
2445
2445
|
});
|
|
2446
2446
|
}
|
|
2447
|
-
function
|
|
2447
|
+
function se(t, e, r, n = be) {
|
|
2448
2448
|
const o = t.getStartPoint(), a = t.getEndPoint(), i = t.getDirection();
|
|
2449
2449
|
if (!o || !a || !i || i === "self")
|
|
2450
2450
|
return;
|
|
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,
|
|
2455
|
-
if (
|
|
2456
|
-
const
|
|
2457
|
-
for (let
|
|
2458
|
-
const
|
|
2459
|
-
(Math.abs(
|
|
2454
|
+
const u = n.horizontalExtension, d = n.minEdgeDistance, m = n.minVerticalSegment, w = (N) => {
|
|
2455
|
+
if (N.length < 2) return N;
|
|
2456
|
+
const $ = [N[0]];
|
|
2457
|
+
for (let nt = 1; nt < N.length; nt++) {
|
|
2458
|
+
const it = $[$.length - 1];
|
|
2459
|
+
(Math.abs(N[nt].x - it.x) > 0.1 || Math.abs(N[nt].y - it.y) > 0.1) && $.push(N[nt]);
|
|
2460
2460
|
}
|
|
2461
|
-
return
|
|
2461
|
+
return $;
|
|
2462
2462
|
};
|
|
2463
|
-
let
|
|
2463
|
+
let _;
|
|
2464
2464
|
const B = t.baseDirection === void 0;
|
|
2465
|
-
t.baseDirection === "above" ?
|
|
2466
|
-
let
|
|
2465
|
+
t.baseDirection === "above" ? _ = Math.min(c.y, s.y) : t.baseDirection === "below" ? _ = Math.max(c.y, s.y) : _ = (c.y + s.y) / 2;
|
|
2466
|
+
let V = _;
|
|
2467
2467
|
if (!B && r && r.midY !== void 0) {
|
|
2468
2468
|
if (t.baseDirection === "above") {
|
|
2469
|
-
const
|
|
2470
|
-
|
|
2469
|
+
const N = r.midY - d;
|
|
2470
|
+
V > N && (V = N);
|
|
2471
2471
|
} else if (t.baseDirection === "below") {
|
|
2472
|
-
const
|
|
2473
|
-
|
|
2472
|
+
const N = r.midY + d;
|
|
2473
|
+
V < N && (V = N);
|
|
2474
2474
|
}
|
|
2475
2475
|
}
|
|
2476
|
-
const
|
|
2477
|
-
const
|
|
2478
|
-
let
|
|
2479
|
-
switch (
|
|
2476
|
+
const x = Math.abs(c.y - s.y) < 5, Q = (N, $) => {
|
|
2477
|
+
const nt = Math.abs(c.y - $), it = Math.abs($ - s.y), A = i === "right" ? c.x + u : c.x - u, R = i === "right" ? s.x - u : s.x + u;
|
|
2478
|
+
let U = [], W = $;
|
|
2479
|
+
switch (N) {
|
|
2480
2480
|
case "straight":
|
|
2481
|
-
if (
|
|
2482
|
-
const
|
|
2483
|
-
Math.abs(
|
|
2481
|
+
if (x) {
|
|
2482
|
+
const b = (c.y + s.y) / 2;
|
|
2483
|
+
Math.abs($ - b) < m ? (U = [c, s], W = b) : (U = [
|
|
2484
2484
|
c,
|
|
2485
|
-
{ x:
|
|
2485
|
+
{ x: A, y: c.y },
|
|
2486
2486
|
// H: horizontal extension
|
|
2487
|
-
{ x:
|
|
2487
|
+
{ x: A, y: $ },
|
|
2488
2488
|
// V: vertical to midY
|
|
2489
|
-
{ x:
|
|
2489
|
+
{ x: R, y: $ },
|
|
2490
2490
|
// H: horizontal at midY
|
|
2491
|
-
{ x:
|
|
2491
|
+
{ x: R, y: s.y },
|
|
2492
2492
|
// V: vertical to end
|
|
2493
2493
|
s
|
|
2494
2494
|
// H: horizontal to end
|
|
2495
|
-
],
|
|
2495
|
+
], W = $);
|
|
2496
2496
|
} else
|
|
2497
2497
|
return null;
|
|
2498
2498
|
break;
|
|
2499
2499
|
case "2seg":
|
|
2500
|
-
|
|
2500
|
+
nt < it ? Math.abs($ - c.y) < m ? (U = [c, { x: s.x, y: c.y }, s], W = c.y) : (U = [
|
|
2501
2501
|
c,
|
|
2502
|
-
{ x:
|
|
2502
|
+
{ x: A, y: c.y },
|
|
2503
2503
|
// H: horizontal extension
|
|
2504
|
-
{ x:
|
|
2504
|
+
{ x: A, y: $ },
|
|
2505
2505
|
// V: vertical to midY
|
|
2506
|
-
{ x:
|
|
2506
|
+
{ x: R, y: $ },
|
|
2507
2507
|
// H: horizontal at midY
|
|
2508
|
-
{ x:
|
|
2508
|
+
{ x: R, y: s.y },
|
|
2509
2509
|
// V: vertical to end
|
|
2510
2510
|
s
|
|
2511
2511
|
// H: horizontal to end
|
|
2512
|
-
],
|
|
2512
|
+
], W = $) : Math.abs($ - s.y) < m ? (U = [
|
|
2513
2513
|
c,
|
|
2514
|
-
{ x:
|
|
2514
|
+
{ x: A, y: c.y },
|
|
2515
2515
|
// H: horizontal extension
|
|
2516
|
-
{ x:
|
|
2516
|
+
{ x: A, y: s.y },
|
|
2517
2517
|
// V: vertical to end.y
|
|
2518
2518
|
s
|
|
2519
2519
|
// H: horizontal to end
|
|
2520
|
-
],
|
|
2520
|
+
], W = s.y) : (U = [
|
|
2521
2521
|
c,
|
|
2522
|
-
{ x:
|
|
2522
|
+
{ x: A, y: c.y },
|
|
2523
2523
|
// H: horizontal extension
|
|
2524
|
-
{ x:
|
|
2524
|
+
{ x: A, y: $ },
|
|
2525
2525
|
// V: vertical to midY
|
|
2526
|
-
{ x:
|
|
2526
|
+
{ x: R, y: $ },
|
|
2527
2527
|
// H: horizontal at midY
|
|
2528
|
-
{ x:
|
|
2528
|
+
{ x: R, y: s.y },
|
|
2529
2529
|
// V: vertical to end
|
|
2530
2530
|
s
|
|
2531
2531
|
// H: horizontal to end
|
|
2532
|
-
],
|
|
2532
|
+
], W = $);
|
|
2533
2533
|
break;
|
|
2534
2534
|
case "3seg":
|
|
2535
|
-
const f =
|
|
2536
|
-
|
|
2535
|
+
const f = $;
|
|
2536
|
+
U = [
|
|
2537
2537
|
c,
|
|
2538
|
-
{ x:
|
|
2539
|
-
{ x:
|
|
2540
|
-
{ x:
|
|
2541
|
-
{ x:
|
|
2538
|
+
{ x: A, y: c.y },
|
|
2539
|
+
{ x: A, y: f },
|
|
2540
|
+
{ x: R, y: f },
|
|
2541
|
+
{ x: R, y: s.y },
|
|
2542
2542
|
s
|
|
2543
|
-
],
|
|
2543
|
+
], W = f;
|
|
2544
2544
|
break;
|
|
2545
2545
|
case "4seg":
|
|
2546
|
-
|
|
2546
|
+
U = [
|
|
2547
2547
|
c,
|
|
2548
|
-
{ x:
|
|
2548
|
+
{ x: A, y: c.y },
|
|
2549
2549
|
// H: horizontal extension from start
|
|
2550
|
-
{ x:
|
|
2550
|
+
{ x: A, y: $ },
|
|
2551
2551
|
// V: vertical to midY
|
|
2552
|
-
{ x:
|
|
2552
|
+
{ x: R, y: $ },
|
|
2553
2553
|
// H: horizontal at midY to end extension
|
|
2554
2554
|
s
|
|
2555
2555
|
// Final segment (may be H or V depending on pathEnd.y vs testMidY)
|
|
2556
|
-
],
|
|
2556
|
+
], W = $;
|
|
2557
2557
|
break;
|
|
2558
2558
|
case "5seg":
|
|
2559
|
-
if (
|
|
2560
|
-
|
|
2559
|
+
if (nt < m)
|
|
2560
|
+
U = [
|
|
2561
2561
|
c,
|
|
2562
|
-
{ x:
|
|
2562
|
+
{ x: A, y: c.y },
|
|
2563
2563
|
// H: horizontal extension
|
|
2564
|
-
{ x:
|
|
2564
|
+
{ x: R, y: $ },
|
|
2565
2565
|
// H: horizontal at midY (skip V since start.y ≈ testMidY)
|
|
2566
|
-
{ x:
|
|
2566
|
+
{ x: R, y: s.y },
|
|
2567
2567
|
// V: vertical to end Y
|
|
2568
2568
|
s
|
|
2569
2569
|
// H: horizontal to end
|
|
2570
|
-
],
|
|
2571
|
-
else if (
|
|
2572
|
-
|
|
2570
|
+
], W = $;
|
|
2571
|
+
else if (it < m)
|
|
2572
|
+
U = [
|
|
2573
2573
|
c,
|
|
2574
|
-
{ x:
|
|
2574
|
+
{ x: A, y: c.y },
|
|
2575
2575
|
// H: horizontal extension
|
|
2576
|
-
{ x:
|
|
2576
|
+
{ x: A, y: $ },
|
|
2577
2577
|
// V: vertical to midY
|
|
2578
|
-
{ x:
|
|
2578
|
+
{ x: R, y: $ },
|
|
2579
2579
|
// H: horizontal at midY
|
|
2580
2580
|
s
|
|
2581
2581
|
// H: horizontal to end (skip V since testMidY ≈ pathEnd.y)
|
|
2582
|
-
],
|
|
2582
|
+
], W = $;
|
|
2583
2583
|
else
|
|
2584
2584
|
return null;
|
|
2585
2585
|
break;
|
|
2586
2586
|
case "6seg":
|
|
2587
|
-
|
|
2587
|
+
U = [
|
|
2588
2588
|
c,
|
|
2589
|
-
{ x:
|
|
2590
|
-
{ x:
|
|
2591
|
-
{ x:
|
|
2592
|
-
{ x:
|
|
2589
|
+
{ x: A, y: c.y },
|
|
2590
|
+
{ x: A, y: $ },
|
|
2591
|
+
{ x: R, y: $ },
|
|
2592
|
+
{ x: R, y: s.y },
|
|
2593
2593
|
s
|
|
2594
|
-
],
|
|
2594
|
+
], W = $;
|
|
2595
2595
|
break;
|
|
2596
2596
|
}
|
|
2597
|
-
const
|
|
2598
|
-
return
|
|
2597
|
+
const P = w(U);
|
|
2598
|
+
return P.length > 0 ? { points: P, actualMidY: W } : null;
|
|
2599
2599
|
};
|
|
2600
|
-
let
|
|
2601
|
-
B ?
|
|
2602
|
-
for (const
|
|
2603
|
-
const
|
|
2604
|
-
if (
|
|
2605
|
-
return { midY:
|
|
2600
|
+
let Z;
|
|
2601
|
+
B ? Z = x ? ["straight", "3seg"] : ["3seg"] : Z = x ? ["straight", "3seg", "4seg", "5seg", "6seg"] : ["3seg", "4seg", "5seg", "6seg"];
|
|
2602
|
+
for (const N of Z) {
|
|
2603
|
+
const $ = Q(N, V);
|
|
2604
|
+
if ($)
|
|
2605
|
+
return { midY: $.actualMidY, points: $.points };
|
|
2606
2606
|
}
|
|
2607
|
-
const
|
|
2608
|
-
return
|
|
2607
|
+
const et = Q("6seg", V);
|
|
2608
|
+
return et ? { midY: et.actualMidY, points: et.points } : void 0;
|
|
2609
2609
|
}
|
|
2610
2610
|
function hr(t, e) {
|
|
2611
2611
|
if (t.length < 2) return "";
|
|
@@ -2616,239 +2616,239 @@ 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
|
|
2620
|
-
x: i.x - (i.x - a.x) *
|
|
2621
|
-
y: i.y - (i.y - a.y) *
|
|
2619
|
+
const m = d / l, w = d / s, _ = {
|
|
2620
|
+
x: i.x - (i.x - a.x) * m,
|
|
2621
|
+
y: i.y - (i.y - a.y) * m
|
|
2622
2622
|
}, B = {
|
|
2623
|
-
x: i.x + (c.x - i.x) *
|
|
2624
|
-
y: i.y + (c.y - i.y) *
|
|
2623
|
+
x: i.x + (c.x - i.x) * w,
|
|
2624
|
+
y: i.y + (c.y - i.y) * w
|
|
2625
2625
|
};
|
|
2626
|
-
r.push(`L${
|
|
2626
|
+
r.push(`L${_.x},${_.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 =
|
|
2634
|
-
var
|
|
2635
|
-
const B =
|
|
2633
|
+
function Pa(t, e, r, n = be, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, m, w, _ = !1) {
|
|
2634
|
+
var $, nt, it, A;
|
|
2635
|
+
const B = m != null && t.edgeIndex === m, V = t.getColor(), x = 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", V), Q = t.getStartPoint(), Z = t.getEndPoint(), et = t.getDirection();
|
|
2636
2636
|
console.log(
|
|
2637
|
-
`Edge ${t._gvid}: direction=${
|
|
2637
|
+
`Edge ${t._gvid}: direction=${et}, isBase=${t.isBaseEdge}, depth=${t.depth}`,
|
|
2638
2638
|
{
|
|
2639
|
-
start:
|
|
2640
|
-
end:
|
|
2641
|
-
sourceNode: (
|
|
2642
|
-
targetNode: (
|
|
2639
|
+
start: Q,
|
|
2640
|
+
end: Z,
|
|
2641
|
+
sourceNode: ($ = t.sourceNode) == null ? void 0 : $.name,
|
|
2642
|
+
targetNode: (nt = t.targetNode) == null ? void 0 : nt.name
|
|
2643
2643
|
}
|
|
2644
2644
|
);
|
|
2645
|
-
const
|
|
2646
|
-
if (n.arrowHeight,
|
|
2647
|
-
const
|
|
2648
|
-
let
|
|
2649
|
-
|
|
2645
|
+
const N = n.arrowWidth;
|
|
2646
|
+
if (n.arrowHeight, Q && Z && et) {
|
|
2647
|
+
const R = { x: Q.x, y: r - Q.y }, U = { x: Z.x, y: r - Z.y }, W = { x: U.x, y: U.y };
|
|
2648
|
+
let P = { x: U.x, y: U.y };
|
|
2649
|
+
et === "right" ? P = { x: U.x - N, y: U.y } : et === "left" ? P = { x: U.x + N, y: U.y } : et === "self" && (P = { x: U.x + N, y: U.y });
|
|
2650
2650
|
let f;
|
|
2651
|
-
const
|
|
2651
|
+
const b = n.loopRadius, y = n.horizontalExtension, D = n.cornerRadius;
|
|
2652
2652
|
if (o)
|
|
2653
|
-
if (
|
|
2653
|
+
if (et === "self")
|
|
2654
2654
|
if (t.virtualNode) {
|
|
2655
|
-
const
|
|
2656
|
-
if (
|
|
2657
|
-
const
|
|
2658
|
-
t.midY =
|
|
2659
|
-
const
|
|
2660
|
-
|
|
2655
|
+
const h = t.virtualNode.getPosition();
|
|
2656
|
+
if (h) {
|
|
2657
|
+
const C = r - h[1];
|
|
2658
|
+
t.midY = C;
|
|
2659
|
+
const E = [
|
|
2660
|
+
R,
|
|
2661
2661
|
// leftOut of source node
|
|
2662
|
-
{ x:
|
|
2662
|
+
{ x: R.x - y, y: R.y },
|
|
2663
2663
|
// Extend left
|
|
2664
|
-
{ x:
|
|
2664
|
+
{ x: R.x - y, y: C },
|
|
2665
2665
|
// Go to virtual node height
|
|
2666
|
-
{ x:
|
|
2666
|
+
{ x: P.x + y, y: C },
|
|
2667
2667
|
// Horizontal segment through virtual node
|
|
2668
|
-
{ x:
|
|
2668
|
+
{ x: P.x + y, y: P.y },
|
|
2669
2669
|
// Go down to rightIn
|
|
2670
|
-
|
|
2670
|
+
P
|
|
2671
2671
|
// rightIn of source node
|
|
2672
2672
|
];
|
|
2673
|
-
f = hr(
|
|
2673
|
+
f = hr(E, D);
|
|
2674
2674
|
} else {
|
|
2675
|
-
const
|
|
2676
|
-
f = `M${
|
|
2675
|
+
const C = R.x - b, E = R.y - b, Y = P.x + b, g = P.y - b;
|
|
2676
|
+
f = `M${R.x},${R.y} C${C},${E} ${Y},${g} ${P.x},${P.y}`;
|
|
2677
2677
|
}
|
|
2678
2678
|
} else {
|
|
2679
|
-
const
|
|
2680
|
-
f = `M${
|
|
2679
|
+
const h = R.x - b, C = R.y - b, E = P.x + b, Y = P.y - b;
|
|
2680
|
+
f = `M${R.x},${R.y} C${h},${C} ${E},${Y} ${P.x},${P.y}`;
|
|
2681
2681
|
}
|
|
2682
2682
|
else {
|
|
2683
|
-
let
|
|
2683
|
+
let h;
|
|
2684
2684
|
if (t.orthogonalPathPoints && t.orthogonalPathPoints.length > 0)
|
|
2685
|
-
|
|
2685
|
+
h = t.orthogonalPathPoints;
|
|
2686
2686
|
else {
|
|
2687
|
-
const
|
|
2688
|
-
if (
|
|
2689
|
-
const
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
{ x:
|
|
2693
|
-
{ x:
|
|
2694
|
-
|
|
2687
|
+
const C = Math.abs(R.y - t.midY), E = Math.abs(t.midY - P.y), Y = 20, g = C >= Y, v = E >= Y, L = et === "right" ? R.x + y : R.x - y, M = et === "right" ? P.x - y : P.x + y;
|
|
2688
|
+
if (h = [], !g && !v) {
|
|
2689
|
+
const F = (R.y + P.y) / 2;
|
|
2690
|
+
h.push(
|
|
2691
|
+
R,
|
|
2692
|
+
{ x: L, y: F },
|
|
2693
|
+
{ x: M, y: F },
|
|
2694
|
+
P
|
|
2695
2695
|
);
|
|
2696
|
-
} else
|
|
2697
|
-
|
|
2698
|
-
{ x:
|
|
2699
|
-
{ x: _, y: t.midY },
|
|
2696
|
+
} else g ? v ? h.push(
|
|
2697
|
+
R,
|
|
2698
|
+
{ x: L, y: R.y },
|
|
2700
2699
|
{ x: L, y: t.midY },
|
|
2701
|
-
{ x:
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
{ x:
|
|
2700
|
+
{ x: M, y: t.midY },
|
|
2701
|
+
{ x: M, y: P.y },
|
|
2702
|
+
P
|
|
2703
|
+
) : h.push(
|
|
2704
|
+
R,
|
|
2705
|
+
{ x: L, y: R.y },
|
|
2707
2706
|
{ x: L, y: t.midY },
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2707
|
+
{ x: M, y: t.midY },
|
|
2708
|
+
P
|
|
2709
|
+
) : h.push(
|
|
2710
|
+
R,
|
|
2712
2711
|
{ x: L, y: t.midY },
|
|
2713
|
-
{ x:
|
|
2714
|
-
|
|
2712
|
+
{ x: M, y: t.midY },
|
|
2713
|
+
{ x: M, y: P.y },
|
|
2714
|
+
P
|
|
2715
2715
|
);
|
|
2716
2716
|
}
|
|
2717
|
-
f = hr(
|
|
2717
|
+
f = hr(h, D);
|
|
2718
2718
|
}
|
|
2719
|
-
else if (
|
|
2720
|
-
const
|
|
2721
|
-
f = `M${
|
|
2719
|
+
else if (et === "self") {
|
|
2720
|
+
const h = R.x - b, C = R.y - b, E = P.x + b, Y = P.y - b;
|
|
2721
|
+
f = `M${R.x},${R.y} C${h},${C} ${E},${Y} ${P.x},${P.y}`;
|
|
2722
2722
|
} else {
|
|
2723
|
-
const
|
|
2724
|
-
|
|
2725
|
-
const
|
|
2726
|
-
f = `M${
|
|
2723
|
+
const h = P.x - R.x;
|
|
2724
|
+
P.y - R.y;
|
|
2725
|
+
const C = 0.4, E = R.x + h * C, Y = R.y, g = P.x - h * C, v = P.y;
|
|
2726
|
+
f = `M${R.x},${R.y} C${E},${Y} ${g},${v} ${P.x},${P.y}`;
|
|
2727
2727
|
}
|
|
2728
|
-
const X =
|
|
2729
|
-
|
|
2728
|
+
const X = _ && t.isBaseEdge ? "#000000" : t.getColor(), S = _ && t.isBaseEdge ? 4 : 1.5;
|
|
2729
|
+
x.append("path").attr("d", f).attr("fill", "none").attr("stroke", "transparent").attr("stroke-width", 10).attr("class", "edge-hit-area").style("cursor", "pointer"), x.append("path").attr("d", f).attr("fill", "none").attr("stroke", X).attr("stroke-width", S).attr("class", "edge-path").style("pointer-events", "none"), x.on("mouseenter", function() {
|
|
2730
2730
|
at(this).raise();
|
|
2731
2731
|
});
|
|
2732
|
-
const
|
|
2733
|
-
let
|
|
2734
|
-
|
|
2735
|
-
const
|
|
2736
|
-
x: (
|
|
2732
|
+
const z = 12;
|
|
2733
|
+
let G = "";
|
|
2734
|
+
et === "right" ? G = `translate(${W.x - z}, ${W.y - z / 2})` : et === "left" ? G = `translate(${W.x + z}, ${W.y + z / 2}) rotate(180)` : et === "self" && (G = `translate(${W.x + z}, ${W.y + z / 2}) rotate(180)`), x.append("use").attr("class", "edge-arrow").attr("href", "#arrow-right").attr("width", z).attr("height", z).attr("transform", G).attr("fill", X).attr("stroke", X).style("stroke-width", 0);
|
|
2735
|
+
const p = {
|
|
2736
|
+
x: (R.x + P.x) / 2,
|
|
2737
2737
|
y: t.midY
|
|
2738
2738
|
};
|
|
2739
2739
|
if (t.label) {
|
|
2740
|
-
let
|
|
2741
|
-
(
|
|
2742
|
-
const
|
|
2743
|
-
|
|
2744
|
-
const
|
|
2745
|
-
if (
|
|
2746
|
-
|
|
2747
|
-
}), (
|
|
2748
|
-
const
|
|
2749
|
-
const
|
|
2750
|
-
return { textWidth:
|
|
2751
|
-
}),
|
|
2752
|
-
let
|
|
2753
|
-
t.edgeContent.elems.forEach((
|
|
2754
|
-
const
|
|
2755
|
-
|
|
2740
|
+
let h = "";
|
|
2741
|
+
(it = t.edgeContent) != null && it.elems && t.edgeContent.elems.length > 0 && (h = t.edgeContent.elems.map((st) => st.text).join(" ")), h || (h = _a(t.label).map((pt) => pt.length > 20 ? pt.slice(0, 20) + "..." : pt).join(" "));
|
|
2742
|
+
const C = h.length > 60 ? h.slice(0, 60) + "..." : h, E = n.labelFontSize, Y = E * 0.6, g = C.length * Y, v = E, L = n.labelPadding, M = 16, F = B ? 16 : 0, q = t.edgeIndex !== void 0, ot = q && t.edgeIndex > a, K = q && t.edgeIndex < i, I = (ot ? M : 0) + (K ? M : 0) + F, k = g + L * 2 + I, O = v + L * 2, j = n.labelCornerRadius, tt = p.y, rt = p.x, J = (st) => at(`g.edge[data-edge-id="${st}"]`), H = 12, T = x.append("g").attr("class", "label-area");
|
|
2743
|
+
T.append("rect").attr("class", "label-bg").attr("x", rt - k / 2).attr("y", tt - O / 2).attr("width", k).attr("height", O).attr("rx", j).attr("ry", j).attr("fill", "white").attr("stroke", X).attr("stroke-width", 1);
|
|
2744
|
+
const lt = rt - k / 2 + M / 2, dt = rt + k / 2 - M / 2 - F, bt = rt + k / 2 - F / 2, ut = rt + (ot ? M / 2 : 0) - (K ? M / 2 : 0) - (B ? F / 2 : 0);
|
|
2745
|
+
if (q && w && x.style("cursor", "pointer").on("click", function(st) {
|
|
2746
|
+
st.stopPropagation(), !B && w(t.edgeIndex);
|
|
2747
|
+
}), (A = t.edgeContent) != null && A.elems && t.edgeContent.elems.length > 0) {
|
|
2748
|
+
const vt = t.edgeContent.elems.map((ct) => {
|
|
2749
|
+
const mt = ct.text.length * 6.2, yt = ct.background && ct.background !== "transparent", Tt = mt + 2;
|
|
2750
|
+
return { textWidth: mt, hasBackground: yt, totalWidth: Tt };
|
|
2751
|
+
}), Rt = vt.reduce((ct, mt, yt) => ct + mt.totalWidth + (yt > 0, 0), 0);
|
|
2752
|
+
let Et = ut - Rt / 2;
|
|
2753
|
+
t.edgeContent.elems.forEach((ct, mt) => {
|
|
2754
|
+
const yt = vt[mt];
|
|
2755
|
+
mt > 0 && (Et += 0), yt.hasBackground && T.append("rect").attr("x", Et).attr("y", tt - 10 / 2 - 2).attr("width", yt.totalWidth).attr("height", 14).attr("rx", 2).attr("ry", 2).attr("fill", ct.background).style("pointer-events", "none"), T.append("text").attr("class", "label-text-elem").attr("x", Et + 1).attr("y", tt).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "Inter, Helvetica, Arial").attr("font-size", "10px").attr("font-weight", "500").attr("fill", ct.color && ct.color.length > 0 ? ct.color : X).style("pointer-events", "none").text(ct.text), Et += yt.totalWidth;
|
|
2756
2756
|
});
|
|
2757
2757
|
} else
|
|
2758
|
-
|
|
2759
|
-
if (
|
|
2760
|
-
const
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
const
|
|
2764
|
-
if (!
|
|
2758
|
+
T.append("text").attr("class", "label-text").attr("x", ut).attr("y", tt).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(C);
|
|
2759
|
+
if (_ && x.append("circle").attr("cx", ut).attr("cy", tt).attr("r", 4).attr("fill", "blue").attr("opacity", 0.8).style("pointer-events", "none").attr("class", "debug-label-center"), ot) {
|
|
2760
|
+
const st = t.edgeIndex - 1, pt = T.append("g").attr("class", "nav-btn-group prev-btn-group");
|
|
2761
|
+
pt.append("rect").attr("class", "nav-btn-area prev-btn-area").attr("x", rt - k / 2).attr("y", tt - O / 2).attr("width", M).attr("height", O).attr("fill", "transparent").attr("rx", j).style("cursor", "pointer").style("pointer-events", "all"), pt.append("use").attr("class", "nav-icon prev-icon").attr("href", "#nav-left").attr("x", lt - H / 2).attr("y", tt - H / 2).attr("width", H).attr("height", H).attr("fill", "#888"), pt.on("click", function(Bt) {
|
|
2762
|
+
Bt.stopPropagation();
|
|
2763
|
+
const wt = J(st);
|
|
2764
|
+
if (!wt.empty()) {
|
|
2765
2765
|
if (c && l && s && u && d) {
|
|
2766
|
-
const
|
|
2767
|
-
if (
|
|
2768
|
-
const
|
|
2769
|
-
let
|
|
2770
|
-
if (
|
|
2771
|
-
|
|
2766
|
+
const xt = wt.node();
|
|
2767
|
+
if (xt) {
|
|
2768
|
+
const vt = at(xt).select(".label-text").node();
|
|
2769
|
+
let Rt, Et;
|
|
2770
|
+
if (vt)
|
|
2771
|
+
Rt = parseFloat(vt.getAttribute("x") || "0"), Et = parseFloat(vt.getAttribute("y") || "0");
|
|
2772
2772
|
else {
|
|
2773
|
-
const
|
|
2774
|
-
|
|
2773
|
+
const zt = xt.getBBox();
|
|
2774
|
+
Rt = zt.x + zt.width / 2, Et = zt.y + zt.height / 2;
|
|
2775
2775
|
}
|
|
2776
|
-
const
|
|
2776
|
+
const ct = s.clientWidth, mt = 1.2 * u / ct, yt = u / 2 - Rt * mt, Tt = d / 2 - Et * mt;
|
|
2777
2777
|
l.transition().duration(500).call(
|
|
2778
2778
|
c.transform,
|
|
2779
|
-
|
|
2779
|
+
$t.translate(yt, Tt).scale(mt)
|
|
2780
2780
|
);
|
|
2781
2781
|
}
|
|
2782
2782
|
}
|
|
2783
|
-
|
|
2783
|
+
w && w(st);
|
|
2784
2784
|
}
|
|
2785
2785
|
});
|
|
2786
2786
|
}
|
|
2787
|
-
if (
|
|
2788
|
-
const
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
const
|
|
2792
|
-
if (!
|
|
2787
|
+
if (K && t.edgeIndex !== void 0) {
|
|
2788
|
+
const st = t.edgeIndex + 1, pt = B ? dt : rt + k / 2 - M / 2, Bt = T.append("g").attr("class", "nav-btn-group next-btn-group");
|
|
2789
|
+
Bt.append("rect").attr("class", "nav-btn-area next-btn-area").attr("x", rt + k / 2 - M - F).attr("y", tt - O / 2).attr("width", M).attr("height", O).attr("fill", "transparent").attr("rx", j).style("cursor", "pointer").style("pointer-events", "all"), Bt.append("use").attr("class", "nav-icon next-icon").attr("href", "#nav-right").attr("x", pt - H / 2).attr("y", tt - H / 2).attr("width", H).attr("height", H).attr("fill", "#888"), Bt.on("click", function(wt) {
|
|
2790
|
+
wt.stopPropagation();
|
|
2791
|
+
const xt = J(st);
|
|
2792
|
+
if (!xt.empty()) {
|
|
2793
2793
|
if (c && l && s && u && d) {
|
|
2794
|
-
const
|
|
2795
|
-
if (
|
|
2796
|
-
const
|
|
2797
|
-
let
|
|
2798
|
-
if (
|
|
2799
|
-
|
|
2794
|
+
const vt = xt.node();
|
|
2795
|
+
if (vt) {
|
|
2796
|
+
const Rt = at(vt).select(".label-text").node();
|
|
2797
|
+
let Et, ct;
|
|
2798
|
+
if (Rt)
|
|
2799
|
+
Et = parseFloat(Rt.getAttribute("x") || "0"), ct = parseFloat(Rt.getAttribute("y") || "0");
|
|
2800
2800
|
else {
|
|
2801
|
-
const
|
|
2802
|
-
|
|
2801
|
+
const re = vt.getBBox();
|
|
2802
|
+
Et = re.x + re.width / 2, ct = re.y + re.height / 2;
|
|
2803
2803
|
}
|
|
2804
|
-
const
|
|
2804
|
+
const mt = s.clientWidth, yt = 1.2 * u / mt, Tt = u / 2 - Et * yt, zt = d / 2 - ct * yt;
|
|
2805
2805
|
l.transition().duration(500).call(
|
|
2806
2806
|
c.transform,
|
|
2807
|
-
|
|
2807
|
+
$t.translate(Tt, zt).scale(yt)
|
|
2808
2808
|
);
|
|
2809
2809
|
}
|
|
2810
2810
|
}
|
|
2811
|
-
|
|
2811
|
+
w && w(st);
|
|
2812
2812
|
}
|
|
2813
2813
|
});
|
|
2814
2814
|
}
|
|
2815
|
-
B &&
|
|
2815
|
+
B && q && w && x.append("text").attr("class", "close-btn").attr("x", bt).attr("y", tt).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");
|
|
2819
|
-
}).on("click", function(
|
|
2820
|
-
|
|
2819
|
+
}).on("click", function(st) {
|
|
2820
|
+
st.stopPropagation(), w(null);
|
|
2821
2821
|
});
|
|
2822
|
-
} else t._ldraw_ && t._ldraw_.forEach((
|
|
2823
|
-
if (
|
|
2824
|
-
const
|
|
2825
|
-
|
|
2822
|
+
} else t._ldraw_ && t._ldraw_.forEach((h) => {
|
|
2823
|
+
if (h.op === "T" && h.text) {
|
|
2824
|
+
const C = h.size || 10, E = C * 0.6, Y = h.text.length * E, g = C, v = 6, L = Y + v * 2, M = g + v * 2, F = 4, q = p.y;
|
|
2825
|
+
x.append("rect").attr("x", p.x - L / 2).attr("y", q - M / 2).attr("width", L).attr("height", M).attr("rx", F).attr("ry", F).attr("fill", "white").attr("stroke", "#d0d0d0").attr("stroke-width", 0.5), x.append("text").attr("x", p.x).attr("y", q).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", h.face || "Inter, Helvetica, Arial").attr("font-size", `${C}px`).attr("fill", h.color || "#666").text(h.text);
|
|
2826
2826
|
}
|
|
2827
2827
|
});
|
|
2828
|
-
if (
|
|
2829
|
-
let
|
|
2830
|
-
t.depth === 0 ?
|
|
2828
|
+
if (_) {
|
|
2829
|
+
let h;
|
|
2830
|
+
t.depth === 0 ? h = `d:0 dir:${t.baseDirection || "base"} off:${t.baseOffset} id:${t._gvid}` : h = `d:${t.depth} dir:${t.baseDirection || "?"} midY:${Math.round(t.midY)} id:${t._gvid}`, x.append("text").attr("x", p.x).attr("y", p.y + 15).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "monospace").attr("font-size", "9px").attr("fill", "#999").text(h);
|
|
2831
2831
|
}
|
|
2832
2832
|
} else
|
|
2833
|
-
t._draw_ && t._draw_.forEach((
|
|
2834
|
-
if (
|
|
2835
|
-
const
|
|
2836
|
-
|
|
2833
|
+
t._draw_ && t._draw_.forEach((R) => {
|
|
2834
|
+
if (R.op === "b" && R.points) {
|
|
2835
|
+
const U = R.points.map(([P, f]) => [P, r - f]), W = `M${U[0][0]},${U[0][1]} C${U.slice(1).map((P) => `${P[0]},${P[1]}`).join(" ")}`;
|
|
2836
|
+
x.append("path").attr("d", W).attr("fill", "none").attr("stroke", R.color || "#9AA4B2").attr("stroke-width", 2);
|
|
2837
2837
|
}
|
|
2838
|
-
}), t._hdraw_ && t._hdraw_.forEach((
|
|
2839
|
-
if (
|
|
2840
|
-
const
|
|
2841
|
-
|
|
2838
|
+
}), t._hdraw_ && t._hdraw_.forEach((R) => {
|
|
2839
|
+
if (R.op === "P" && R.points) {
|
|
2840
|
+
const U = R.points.map(([W, P]) => [W, r - P]);
|
|
2841
|
+
x.append("polygon").attr("points", U.map((W) => W.join(",")).join(" ")).attr("fill", R.color || "#9AA4B2");
|
|
2842
2842
|
}
|
|
2843
|
-
}), t._ldraw_ &&
|
|
2843
|
+
}), t._ldraw_ && St(x, t._ldraw_, r);
|
|
2844
2844
|
}
|
|
2845
|
-
function Na(t, e, r, n, o = !0, a =
|
|
2846
|
-
var
|
|
2845
|
+
function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _ = !0) {
|
|
2846
|
+
var G;
|
|
2847
2847
|
t.innerHTML = "";
|
|
2848
|
-
const
|
|
2849
|
-
let [, ,
|
|
2850
|
-
const
|
|
2851
|
-
|
|
2848
|
+
const B = ((G = e.bb) == null ? void 0 : G.split(",").map(Number)) || [0, 0, 1e3, 800];
|
|
2849
|
+
let [, , V, x] = B;
|
|
2850
|
+
const Q = at(t).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${V} ${x}`).style("background", "white");
|
|
2851
|
+
Q.append("defs").html(`
|
|
2852
2852
|
<style>
|
|
2853
2853
|
@keyframes selected-pulse {
|
|
2854
2854
|
0%, 100% {
|
|
@@ -2920,386 +2920,386 @@ 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
|
|
2924
|
-
l &&
|
|
2925
|
-
const
|
|
2926
|
-
(
|
|
2927
|
-
_gvid:
|
|
2928
|
-
name:
|
|
2929
|
-
_draw_:
|
|
2930
|
-
_ldraw_:
|
|
2931
|
-
bb:
|
|
2932
|
-
pos:
|
|
2923
|
+
const Z = Q.append("g").attr("id", "graph0");
|
|
2924
|
+
l && Q.append("circle").attr("cx", V / 2).attr("cy", x / 2).attr("r", 8).attr("fill", "red").attr("opacity", 0.9).style("pointer-events", "none").attr("class", "debug-center-marker");
|
|
2925
|
+
const N = (e.objects || []).map(
|
|
2926
|
+
(p) => new jr({
|
|
2927
|
+
_gvid: p._gvid,
|
|
2928
|
+
name: p.name,
|
|
2929
|
+
_draw_: p._draw_,
|
|
2930
|
+
_ldraw_: p._ldraw_,
|
|
2931
|
+
bb: p.bb,
|
|
2932
|
+
pos: p.pos,
|
|
2933
2933
|
// Apply custom node dimensions if provided (convert points to inches)
|
|
2934
|
-
width: d !== void 0 ? String(d / 72) :
|
|
2935
|
-
height:
|
|
2936
|
-
label:
|
|
2934
|
+
width: d !== void 0 ? String(d / 72) : p.width,
|
|
2935
|
+
height: m !== void 0 ? String(m / 72) : p.height,
|
|
2936
|
+
label: p.label
|
|
2937
2937
|
})
|
|
2938
|
-
),
|
|
2939
|
-
|
|
2940
|
-
|
|
2938
|
+
), $ = /* @__PURE__ */ new Map();
|
|
2939
|
+
N.forEach((p) => {
|
|
2940
|
+
$.set(p._gvid, p);
|
|
2941
2941
|
});
|
|
2942
|
-
const
|
|
2943
|
-
const
|
|
2944
|
-
_gvid:
|
|
2945
|
-
name:
|
|
2946
|
-
_draw_:
|
|
2947
|
-
_ldraw_:
|
|
2948
|
-
_hdraw_:
|
|
2949
|
-
_tdraw_:
|
|
2950
|
-
head:
|
|
2951
|
-
tail:
|
|
2952
|
-
label:
|
|
2953
|
-
}),
|
|
2954
|
-
return
|
|
2955
|
-
}), { nodeColumnMap:
|
|
2956
|
-
|
|
2957
|
-
|
|
2942
|
+
const it = (e.edges || []).map((p) => {
|
|
2943
|
+
const h = new Ma({
|
|
2944
|
+
_gvid: p._gvid,
|
|
2945
|
+
name: p.name,
|
|
2946
|
+
_draw_: p._draw_,
|
|
2947
|
+
_ldraw_: p._ldraw_,
|
|
2948
|
+
_hdraw_: p._hdraw_,
|
|
2949
|
+
_tdraw_: p._tdraw_,
|
|
2950
|
+
head: p.head,
|
|
2951
|
+
tail: p.tail,
|
|
2952
|
+
label: p.label
|
|
2953
|
+
}), C = p.tail !== void 0 ? $.get(p.tail) : void 0, E = p.head !== void 0 ? $.get(p.head) : void 0;
|
|
2954
|
+
return C && E && h.setNodes(C, E), h;
|
|
2955
|
+
}), { nodeColumnMap: A, nodeColumns: R, edgeColumns: U } = Ya(
|
|
2956
|
+
N,
|
|
2957
|
+
it
|
|
2958
2958
|
);
|
|
2959
|
-
console.log("debug:", { nodeColumnMap:
|
|
2959
|
+
console.log("debug:", { nodeColumnMap: A, nodeColumns: R, edgeColumns: U }), console.log(
|
|
2960
2960
|
"debug: edges sorted by midpoint Y:",
|
|
2961
2961
|
Object.fromEntries(
|
|
2962
|
-
Array.from(
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
const
|
|
2962
|
+
Array.from(U.entries()).map(([p, h]) => [
|
|
2963
|
+
p,
|
|
2964
|
+
h.edges.map((C) => {
|
|
2965
|
+
const E = C.getStartPoint(), Y = C.getEndPoint(), g = E && Y ? (E.y + Y.y) / 2 : 0;
|
|
2966
2966
|
return {
|
|
2967
|
-
name:
|
|
2968
|
-
edgeIndex:
|
|
2969
|
-
direction:
|
|
2970
|
-
startPoint:
|
|
2971
|
-
endPoint:
|
|
2972
|
-
midpointY:
|
|
2967
|
+
name: C.name,
|
|
2968
|
+
edgeIndex: C.edgeIndex,
|
|
2969
|
+
direction: C.getDirection(),
|
|
2970
|
+
startPoint: C.getStartPoint(),
|
|
2971
|
+
endPoint: C.getEndPoint(),
|
|
2972
|
+
midpointY: g.toFixed(2)
|
|
2973
2973
|
};
|
|
2974
2974
|
})
|
|
2975
2975
|
])
|
|
2976
2976
|
)
|
|
2977
2977
|
);
|
|
2978
|
-
const
|
|
2979
|
-
let
|
|
2980
|
-
if (
|
|
2981
|
-
|
|
2978
|
+
const W = Array.from(R.keys()).sort((p, h) => p - h), P = W.length, f = 80;
|
|
2979
|
+
let b;
|
|
2980
|
+
if (w !== void 0)
|
|
2981
|
+
b = w, V = (P > 1 ? (P - 1) * b : 0) + 2 * f;
|
|
2982
2982
|
else {
|
|
2983
|
-
const
|
|
2984
|
-
|
|
2985
|
-
}
|
|
2986
|
-
if (
|
|
2987
|
-
const
|
|
2988
|
-
if (!
|
|
2989
|
-
const
|
|
2990
|
-
if (
|
|
2983
|
+
const p = V - 2 * f;
|
|
2984
|
+
b = P > 1 ? p / (P - 1) : 0;
|
|
2985
|
+
}
|
|
2986
|
+
if (W.forEach((p, h) => {
|
|
2987
|
+
const C = R.get(p);
|
|
2988
|
+
if (!C) return;
|
|
2989
|
+
const E = C.nodes;
|
|
2990
|
+
if (E.length === 0) return;
|
|
2991
2991
|
console.log(
|
|
2992
|
-
`Column ${
|
|
2993
|
-
|
|
2994
|
-
name:
|
|
2995
|
-
isVirtual:
|
|
2996
|
-
pos:
|
|
2992
|
+
`Column ${p} before sort:`,
|
|
2993
|
+
E.map((I) => ({
|
|
2994
|
+
name: I.name,
|
|
2995
|
+
isVirtual: I.virtualNode,
|
|
2996
|
+
pos: I.pos
|
|
2997
2997
|
}))
|
|
2998
2998
|
);
|
|
2999
|
-
const
|
|
3000
|
-
|
|
3001
|
-
const
|
|
3002
|
-
return !
|
|
2999
|
+
const Y = P > 1 ? f + h * b : V / 2;
|
|
3000
|
+
E.sort((I, k) => {
|
|
3001
|
+
const O = I.getPosition(), j = k.getPosition();
|
|
3002
|
+
return !O || !j ? 0 : j[1] - O[1];
|
|
3003
3003
|
}), console.log(
|
|
3004
|
-
`Column ${
|
|
3005
|
-
|
|
3006
|
-
name:
|
|
3007
|
-
isVirtual:
|
|
3008
|
-
pos:
|
|
3004
|
+
`Column ${p} after sort:`,
|
|
3005
|
+
E.map((I) => ({
|
|
3006
|
+
name: I.name,
|
|
3007
|
+
isVirtual: I.virtualNode,
|
|
3008
|
+
pos: I.pos
|
|
3009
3009
|
}))
|
|
3010
3010
|
);
|
|
3011
|
-
const
|
|
3012
|
-
if (
|
|
3013
|
-
let
|
|
3014
|
-
|
|
3015
|
-
const
|
|
3016
|
-
|
|
3011
|
+
const g = 50, v = E.filter((I) => !I.virtualNode), L = v.length;
|
|
3012
|
+
if (L === 0) {
|
|
3013
|
+
let I = (x + E.reduce((k, O) => k + O.getHeightPoints(), 0)) / 2;
|
|
3014
|
+
E.forEach((k) => {
|
|
3015
|
+
const O = k.getHeightPoints();
|
|
3016
|
+
I -= O / 2, k.pos = `${Y},${I}`, I -= O / 2;
|
|
3017
3017
|
});
|
|
3018
3018
|
return;
|
|
3019
3019
|
}
|
|
3020
|
-
let
|
|
3021
|
-
if (
|
|
3022
|
-
const
|
|
3023
|
-
|
|
3020
|
+
let M, F;
|
|
3021
|
+
if (L % 2 === 1) {
|
|
3022
|
+
const I = Math.floor(L / 2), k = v[I];
|
|
3023
|
+
F = E.indexOf(k), M = x / 2;
|
|
3024
3024
|
} else {
|
|
3025
|
-
const
|
|
3026
|
-
|
|
3025
|
+
const I = L / 2 - 1, k = L / 2, O = v[I];
|
|
3026
|
+
v[k], F = E.indexOf(O), M = x / 2;
|
|
3027
3027
|
}
|
|
3028
|
-
const q =
|
|
3029
|
-
q.pos = `${
|
|
3028
|
+
const q = E[F], ot = q.getHeightPoints();
|
|
3029
|
+
q.pos = `${Y},${M}`, console.log(
|
|
3030
3030
|
`Positioned center ${q.name} (virtual: ${q.virtualNode}) at ${q.pos}`
|
|
3031
3031
|
);
|
|
3032
|
-
let
|
|
3033
|
-
for (let
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3036
|
-
`Positioned ${
|
|
3037
|
-
),
|
|
3032
|
+
let K = M + ot / 2;
|
|
3033
|
+
for (let I = F - 1; I >= 0; I--) {
|
|
3034
|
+
const k = E[I], O = E[I + 1], j = k.getHeightPoints(), tt = k.virtualNode || O.virtualNode ? 0 : g;
|
|
3035
|
+
K += tt + j / 2, k.pos = `${Y},${K}`, console.log(
|
|
3036
|
+
`Positioned ${k.name} (virtual: ${k.virtualNode}) at ${k.pos}, spacing: ${tt}`
|
|
3037
|
+
), K += j / 2;
|
|
3038
3038
|
}
|
|
3039
|
-
|
|
3040
|
-
for (let
|
|
3041
|
-
const
|
|
3042
|
-
|
|
3043
|
-
`Positioned ${
|
|
3044
|
-
),
|
|
3039
|
+
K = M - ot / 2;
|
|
3040
|
+
for (let I = F + 1; I < E.length; I++) {
|
|
3041
|
+
const k = E[I], O = E[I - 1], j = k.getHeightPoints(), tt = k.virtualNode || O.virtualNode ? 0 : g;
|
|
3042
|
+
K -= tt + j / 2, k.pos = `${Y},${K}`, console.log(
|
|
3043
|
+
`Positioned ${k.name} (virtual: ${k.virtualNode}) at ${k.pos}, spacing: ${tt}`
|
|
3044
|
+
), K -= j / 2;
|
|
3045
3045
|
}
|
|
3046
|
-
}),
|
|
3047
|
-
|
|
3048
|
-
const
|
|
3049
|
-
if (!
|
|
3050
|
-
const [
|
|
3051
|
-
if (
|
|
3052
|
-
const
|
|
3053
|
-
let
|
|
3046
|
+
}), w !== void 0 && Q.attr("viewBox", `0 0 ${V} ${x}`), R.forEach((p) => {
|
|
3047
|
+
p.nodes.forEach((h) => {
|
|
3048
|
+
const C = h.getPosition();
|
|
3049
|
+
if (!C) return;
|
|
3050
|
+
const [E, Y] = C, g = h.getWidthPoints(), v = h.getHeightPoints(), L = h.virtualNode;
|
|
3051
|
+
if (L && !l) return;
|
|
3052
|
+
const M = Z.append("g").attr("class", L ? "node virtual-node" : "node").attr("id", h.name);
|
|
3053
|
+
let F = null;
|
|
3054
3054
|
try {
|
|
3055
|
-
|
|
3056
|
-
} catch (
|
|
3057
|
-
console.warn(`Failed to decode node label for ${
|
|
3055
|
+
h.label && (F = pr(h.label));
|
|
3056
|
+
} catch (J) {
|
|
3057
|
+
console.warn(`Failed to decode node label for ${h.name}:`, J);
|
|
3058
3058
|
}
|
|
3059
|
-
|
|
3060
|
-
const q = l &&
|
|
3061
|
-
if ((
|
|
3062
|
-
const
|
|
3063
|
-
|
|
3064
|
-
const
|
|
3065
|
-
|
|
3066
|
-
|
|
3059
|
+
F != null && F.key && M.attr("data-key", F.key);
|
|
3060
|
+
const q = l && L, ot = (F == null ? void 0 : F.tags) || [], K = (F == null ? void 0 : F.label) || "", I = (F == null ? void 0 : F.text) || "", k = (F == null ? void 0 : F.color) || "#334155", O = (F == null ? void 0 : F.background) || "white", j = O !== "white", tt = j ? O : "#D5DFEA";
|
|
3061
|
+
if ((ot.length > 0 || K.length > 0) && !L) {
|
|
3062
|
+
const J = v / 2, H = v / 2, T = x - Y - v / 2;
|
|
3063
|
+
M.append("rect").attr("x", E - g / 2).attr("y", T).attr("width", g).attr("height", J).attr("rx", 5).attr("ry", 0).attr("fill", j ? O : "#EDF2F7").attr("stroke", tt).attr("stroke-width", 1), j && M.append("line").attr("x1", E - g / 2).attr("y1", T + J).attr("x2", E + g / 2).attr("y2", T + J).attr("stroke", k).attr("stroke-width", 1), M.append("rect").attr("x", E - g / 2).attr("y", T + J).attr("width", g).attr("height", H).attr("rx", 0).attr("ry", 5).attr("fill", O).attr("stroke", tt).attr("stroke-width", 1);
|
|
3064
|
+
const lt = M.append("rect").attr("x", E - g / 2 - 4).attr("y", T - 4).attr("width", g + 8).attr("height", v + 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
|
+
M.style("cursor", "pointer").on("mouseenter", function() {
|
|
3066
|
+
lt.attr("opacity", 1);
|
|
3067
3067
|
}).on("mouseleave", function() {
|
|
3068
|
-
|
|
3068
|
+
lt.attr("opacity", 0);
|
|
3069
3069
|
});
|
|
3070
|
-
let
|
|
3071
|
-
const
|
|
3072
|
-
if (
|
|
3073
|
-
const
|
|
3074
|
-
|
|
3075
|
-
}),
|
|
3076
|
-
const
|
|
3077
|
-
Re(
|
|
3070
|
+
let dt = E - g / 2 + 8;
|
|
3071
|
+
const bt = T + J / 2, ut = 7.2, st = 6, pt = 18, Bt = 4;
|
|
3072
|
+
if (ot.forEach((wt) => {
|
|
3073
|
+
const vt = wt.length * ut + st * 2;
|
|
3074
|
+
M.append("rect").attr("x", dt).attr("y", bt - pt / 2).attr("width", vt).attr("height", pt).attr("rx", 5).attr("ry", 5).attr("fill", "#FFF8E1").attr("stroke", "#FFD66D").attr("stroke-width", 1), M.append("text").attr("x", dt + st).attr("y", bt).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(wt), dt += vt + Bt;
|
|
3075
|
+
}), K) {
|
|
3076
|
+
const wt = E + g / 2 - 8 - dt, xt = M.append("text").attr("x", dt).attr("y", bt).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", k);
|
|
3077
|
+
Re(xt, wt, K);
|
|
3078
3078
|
}
|
|
3079
|
-
if (
|
|
3080
|
-
const
|
|
3081
|
-
Re(
|
|
3079
|
+
if (I) {
|
|
3080
|
+
const wt = g - 16, xt = M.append("text").attr("x", E - g / 2 + 8).attr("y", T + J + H / 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", k);
|
|
3081
|
+
Re(xt, wt, I);
|
|
3082
3082
|
}
|
|
3083
3083
|
} else {
|
|
3084
|
-
const
|
|
3085
|
-
if (!
|
|
3086
|
-
const
|
|
3087
|
-
|
|
3088
|
-
|
|
3084
|
+
const J = M.append("rect").attr("x", E - g / 2).attr("y", x - Y - v / 2).attr("width", g).attr("height", v).attr("rx", 5).attr("ry", 5).attr("fill", O).attr("stroke", q ? "#EF4444" : "#D5DFEA").attr("stroke-width", q ? 2 : 1);
|
|
3085
|
+
if (!L) {
|
|
3086
|
+
const H = M.append("rect").attr("x", E - g / 2 - 4).attr("y", x - Y - v / 2 - 4).attr("width", g + 8).attr("height", v + 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
|
+
J.style("cursor", "pointer").on("mouseenter", function() {
|
|
3088
|
+
H.attr("opacity", 1);
|
|
3089
3089
|
}).on("mouseleave", function() {
|
|
3090
|
-
|
|
3090
|
+
H.attr("opacity", 0);
|
|
3091
3091
|
});
|
|
3092
3092
|
}
|
|
3093
|
-
if (
|
|
3094
|
-
if (
|
|
3095
|
-
const
|
|
3096
|
-
|
|
3097
|
-
|
|
3093
|
+
if (F)
|
|
3094
|
+
if (L) {
|
|
3095
|
+
const H = K || I;
|
|
3096
|
+
M.append("text").attr("x", E).attr("y", x - Y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Inter, Helvetica, Arial").attr("font-size", "10px").attr("fill", "#991B1B").text(
|
|
3097
|
+
H.length > 20 ? H.slice(0, 20) + "..." : H
|
|
3098
3098
|
);
|
|
3099
3099
|
} else {
|
|
3100
|
-
const
|
|
3101
|
-
Re(
|
|
3100
|
+
const H = I || K, T = g - 16, lt = M.append("text").attr("x", E - g / 2 + 8).attr("y", x - Y).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", k);
|
|
3101
|
+
Re(lt, T, H);
|
|
3102
3102
|
}
|
|
3103
3103
|
}
|
|
3104
|
-
!
|
|
3105
|
-
|
|
3104
|
+
!h.label && h._ldraw_ && h._ldraw_.length > 0 && !L && h._ldraw_.forEach((J) => {
|
|
3105
|
+
J.op === "T" && J.text && M.append("text").attr("x", E - g / 2 + 8).attr("y", x - Y).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", J.face || "Inter, Helvetica, Arial").attr("font-size", `${J.size || 11}px`).attr("fill", J.color || "#334155").text(J.text);
|
|
3106
3106
|
});
|
|
3107
3107
|
});
|
|
3108
3108
|
}), i) {
|
|
3109
|
-
Da(
|
|
3109
|
+
Da(R, x), Ba(it, U), console.log(
|
|
3110
3110
|
"debug: base edges selected:",
|
|
3111
3111
|
Object.fromEntries(
|
|
3112
|
-
Array.from(
|
|
3113
|
-
var
|
|
3112
|
+
Array.from(U.entries()).map(([v, L]) => {
|
|
3113
|
+
var M, F;
|
|
3114
3114
|
return [
|
|
3115
|
-
|
|
3115
|
+
v,
|
|
3116
3116
|
{
|
|
3117
|
-
baseEdge: (
|
|
3118
|
-
baseEdgeId: (
|
|
3119
|
-
baseEdgeIndex:
|
|
3120
|
-
totalEdges:
|
|
3121
|
-
depth0Edges:
|
|
3117
|
+
baseEdge: (M = L.baseEdge) == null ? void 0 : M.name,
|
|
3118
|
+
baseEdgeId: (F = L.baseEdge) == null ? void 0 : F.edgeIndex,
|
|
3119
|
+
baseEdgeIndex: L.baseEdgeIndex,
|
|
3120
|
+
totalEdges: L.edges.length,
|
|
3121
|
+
depth0Edges: L.edges.filter((q) => q.depth === 0).length
|
|
3122
3122
|
}
|
|
3123
3123
|
];
|
|
3124
3124
|
})
|
|
3125
3125
|
)
|
|
3126
3126
|
);
|
|
3127
|
-
const
|
|
3128
|
-
|
|
3129
|
-
const
|
|
3130
|
-
if (
|
|
3131
|
-
const
|
|
3132
|
-
if (!
|
|
3133
|
-
const q =
|
|
3134
|
-
if (!q || !
|
|
3135
|
-
const
|
|
3136
|
-
|
|
3137
|
-
const
|
|
3138
|
-
|
|
3139
|
-
|
|
3127
|
+
const p = a.loopRadius, h = a.edgeSpacing, C = a.labelHeight;
|
|
3128
|
+
U.forEach((v) => {
|
|
3129
|
+
const L = v.edges;
|
|
3130
|
+
if (L.length === 0) return;
|
|
3131
|
+
const M = v.baseEdge, F = v.baseEdgeIndex;
|
|
3132
|
+
if (!M || F < 0) return;
|
|
3133
|
+
const q = M.getStartPoint(), ot = M.getEndPoint();
|
|
3134
|
+
if (!q || !ot) return;
|
|
3135
|
+
const K = x - q.y, I = x - ot.y;
|
|
3136
|
+
M.midY = (K + I) / 2;
|
|
3137
|
+
const k = se(
|
|
3138
|
+
M,
|
|
3139
|
+
x,
|
|
3140
3140
|
void 0,
|
|
3141
3141
|
a
|
|
3142
3142
|
);
|
|
3143
|
-
|
|
3144
|
-
for (let
|
|
3145
|
-
const
|
|
3146
|
-
if (
|
|
3147
|
-
if (
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3143
|
+
k && (M.midY = k.midY, M.orthogonalPathPoints = k.points), v.aboveY = M.midY, v.belowY = M.midY;
|
|
3144
|
+
for (let O = F - 1; O >= 0; O--) {
|
|
3145
|
+
const j = L[O];
|
|
3146
|
+
if (j.depth !== 0) continue;
|
|
3147
|
+
if (j.getDirection() === "self") {
|
|
3148
|
+
const T = j.getStartPoint();
|
|
3149
|
+
T && (j.midY = x - T.y - p);
|
|
3150
3150
|
continue;
|
|
3151
3151
|
}
|
|
3152
|
-
const
|
|
3153
|
-
|
|
3154
|
-
const
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3152
|
+
const rt = j.label ? h + C : h;
|
|
3153
|
+
j.midY = v.aboveY - rt, v.aboveY = j.midY, j.baseDirection = "above", j.baseOffset = -(F - O);
|
|
3154
|
+
const J = O < L.length - 1 ? L[O + 1] : void 0, H = se(
|
|
3155
|
+
j,
|
|
3156
|
+
x,
|
|
3157
|
+
J,
|
|
3158
3158
|
a
|
|
3159
3159
|
);
|
|
3160
|
-
|
|
3160
|
+
H && (j.midY = H.midY, j.orthogonalPathPoints = H.points, v.aboveY = j.midY);
|
|
3161
3161
|
}
|
|
3162
|
-
for (let
|
|
3163
|
-
const
|
|
3164
|
-
if (
|
|
3165
|
-
if (
|
|
3166
|
-
const
|
|
3167
|
-
|
|
3162
|
+
for (let O = F + 1; O < L.length; O++) {
|
|
3163
|
+
const j = L[O];
|
|
3164
|
+
if (j.depth !== 0) continue;
|
|
3165
|
+
if (j.getDirection() === "self") {
|
|
3166
|
+
const T = j.getStartPoint();
|
|
3167
|
+
T && (j.midY = x - T.y - p);
|
|
3168
3168
|
continue;
|
|
3169
3169
|
}
|
|
3170
|
-
const
|
|
3171
|
-
|
|
3172
|
-
const
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3170
|
+
const rt = j.label ? h + C : h;
|
|
3171
|
+
j.midY = v.belowY + rt, v.belowY = j.midY, j.baseDirection = "below", j.baseOffset = O - F;
|
|
3172
|
+
const J = O > 0 ? L[O - 1] : void 0, H = se(
|
|
3173
|
+
j,
|
|
3174
|
+
x,
|
|
3175
|
+
J,
|
|
3176
3176
|
a
|
|
3177
3177
|
);
|
|
3178
|
-
|
|
3178
|
+
H && (j.midY = H.midY, j.orthogonalPathPoints = H.points, v.belowY = j.midY);
|
|
3179
3179
|
}
|
|
3180
3180
|
});
|
|
3181
|
-
const
|
|
3182
|
-
|
|
3183
|
-
const
|
|
3184
|
-
|
|
3185
|
-
if (
|
|
3186
|
-
|
|
3181
|
+
const E = [];
|
|
3182
|
+
U.forEach((v) => {
|
|
3183
|
+
const L = v.edges;
|
|
3184
|
+
L.length === 0 || v.baseEdge || !L.every((F) => F.depth > 0) || L.forEach((F) => {
|
|
3185
|
+
if (F.getDirection() !== "self")
|
|
3186
|
+
E.push(F);
|
|
3187
3187
|
else {
|
|
3188
|
-
const q =
|
|
3189
|
-
q && (
|
|
3188
|
+
const q = F.getStartPoint();
|
|
3189
|
+
q && (F.midY = x - q.y - p);
|
|
3190
3190
|
}
|
|
3191
3191
|
});
|
|
3192
|
-
}),
|
|
3193
|
-
totalEdges:
|
|
3194
|
-
depths: [...new Set(
|
|
3192
|
+
}), E.sort((v, L) => v.depth - L.depth), console.log("Processing deep edges by depth:", {
|
|
3193
|
+
totalEdges: E.length,
|
|
3194
|
+
depths: [...new Set(E.map((v) => v.depth))].sort((v, L) => v - L)
|
|
3195
3195
|
});
|
|
3196
|
-
let
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
}),
|
|
3200
|
-
|
|
3196
|
+
let Y = 1 / 0, g = -1 / 0;
|
|
3197
|
+
U.forEach((v) => {
|
|
3198
|
+
v.aboveY !== 0 && (Y = Math.min(Y, v.aboveY)), v.belowY !== 0 && (g = Math.max(g, v.belowY));
|
|
3199
|
+
}), R.forEach((v) => {
|
|
3200
|
+
v.aboveY !== 0 && (Y = Math.min(Y, v.aboveY)), v.belowY !== 0 && (g = Math.max(g, v.belowY));
|
|
3201
3201
|
}), console.log("Global bounds before deep edges:", {
|
|
3202
|
-
globalAboveY:
|
|
3203
|
-
globalBelowY:
|
|
3204
|
-
}),
|
|
3205
|
-
if (!
|
|
3206
|
-
const
|
|
3207
|
-
if (
|
|
3208
|
-
const
|
|
3209
|
-
for (let
|
|
3210
|
-
const
|
|
3211
|
-
|
|
3202
|
+
globalAboveY: Y,
|
|
3203
|
+
globalBelowY: g
|
|
3204
|
+
}), E.forEach((v) => {
|
|
3205
|
+
if (!v.sourceNode || !v.targetNode) return;
|
|
3206
|
+
const L = A.get(v.sourceNode._gvid), M = A.get(v.targetNode._gvid);
|
|
3207
|
+
if (L === void 0 || M === void 0) return;
|
|
3208
|
+
const F = Math.min(L, M), q = Math.max(L, M), ot = [];
|
|
3209
|
+
for (let T = F; T <= q; T++) {
|
|
3210
|
+
const lt = R.get(T);
|
|
3211
|
+
lt && ot.push(...lt.nodes);
|
|
3212
3212
|
}
|
|
3213
|
-
const
|
|
3214
|
-
const
|
|
3215
|
-
if (!
|
|
3216
|
-
const
|
|
3217
|
-
return { y:
|
|
3213
|
+
const K = ot.map((T) => {
|
|
3214
|
+
const lt = T.getPosition();
|
|
3215
|
+
if (!lt) return null;
|
|
3216
|
+
const dt = x - lt[1], bt = T.height ? parseFloat(T.height) * 72 : 40;
|
|
3217
|
+
return { y: dt, height: bt, bottomY: dt + bt / 2 };
|
|
3218
3218
|
}).filter(
|
|
3219
|
-
(
|
|
3220
|
-
).sort((
|
|
3221
|
-
let
|
|
3222
|
-
if (
|
|
3223
|
-
|
|
3224
|
-
else if (
|
|
3225
|
-
|
|
3219
|
+
(T) => T !== null
|
|
3220
|
+
).sort((T, lt) => T.y - lt.y);
|
|
3221
|
+
let I;
|
|
3222
|
+
if (K.length === 0)
|
|
3223
|
+
I = (Y + g) / 2;
|
|
3224
|
+
else if (K.length % 2 === 1)
|
|
3225
|
+
I = K[Math.floor(K.length / 2)].bottomY;
|
|
3226
3226
|
else {
|
|
3227
|
-
const
|
|
3228
|
-
|
|
3227
|
+
const T = K.length / 2;
|
|
3228
|
+
I = (K[T - 1].bottomY + K[T].bottomY) / 2;
|
|
3229
3229
|
}
|
|
3230
|
-
const
|
|
3231
|
-
|
|
3232
|
-
const
|
|
3233
|
-
let
|
|
3234
|
-
tt === "above" ? (
|
|
3235
|
-
edgeIndex:
|
|
3236
|
-
depth:
|
|
3230
|
+
const k = v.getStartPoint(), O = v.getEndPoint(), tt = (k && O ? x - (k.y + O.y) / 2 : I) < I ? "above" : "below";
|
|
3231
|
+
v.baseDirection = tt;
|
|
3232
|
+
const rt = v.label ? h + C : h;
|
|
3233
|
+
let J;
|
|
3234
|
+
tt === "above" ? (v.midY = Y - rt, J = Y, Y = v.midY) : (v.midY = g + rt, J = g, g = v.midY), console.log("Placed deep edge:", {
|
|
3235
|
+
edgeIndex: v.edgeIndex,
|
|
3236
|
+
depth: v.depth,
|
|
3237
3237
|
direction: tt,
|
|
3238
|
-
midY:
|
|
3239
|
-
centerNodeBottomY:
|
|
3240
|
-
globalAboveY:
|
|
3241
|
-
globalBelowY:
|
|
3238
|
+
midY: v.midY,
|
|
3239
|
+
centerNodeBottomY: I,
|
|
3240
|
+
globalAboveY: Y,
|
|
3241
|
+
globalBelowY: g
|
|
3242
3242
|
});
|
|
3243
|
-
const
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
{ midY:
|
|
3243
|
+
const H = se(
|
|
3244
|
+
v,
|
|
3245
|
+
x,
|
|
3246
|
+
{ midY: J },
|
|
3247
3247
|
a
|
|
3248
3248
|
);
|
|
3249
|
-
|
|
3249
|
+
H && (v.midY = H.midY, v.orthogonalPathPoints = H.points, tt === "above" ? Y = Math.min(Y, H.midY) : g = Math.max(g, H.midY));
|
|
3250
3250
|
});
|
|
3251
3251
|
}
|
|
3252
|
-
const
|
|
3253
|
-
const
|
|
3254
|
-
console.log("zoom event:", { x:
|
|
3252
|
+
const y = it.map((p) => p.edgeIndex).filter((p) => p !== void 0), D = y.length > 0 ? Math.min(...y) : 0, X = y.length > 0 ? Math.max(...y) : 0, S = We().scaleExtent([0.1, ba(t, V, c)]).on("zoom", (p) => {
|
|
3253
|
+
const h = p.transform;
|
|
3254
|
+
console.log("zoom event:", { x: h.x, y: h.y, k: h.k, isNaN: isNaN(h.x) || isNaN(h.y) || isNaN(h.k) }), !isNaN(h.x) && !isNaN(h.y) && !isNaN(h.k) && Z.attr("transform", h.toString());
|
|
3255
3255
|
});
|
|
3256
|
-
if (
|
|
3256
|
+
if (Q.call(S), _ || Q.on("wheel.zoom", null), it.forEach((p) => {
|
|
3257
3257
|
if (n != null) {
|
|
3258
3258
|
if (o) {
|
|
3259
|
-
if (
|
|
3260
|
-
} else if (
|
|
3259
|
+
if (p.depth > n) return;
|
|
3260
|
+
} else if (p.depth !== n) return;
|
|
3261
3261
|
}
|
|
3262
3262
|
Pa(
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3263
|
+
p,
|
|
3264
|
+
Z,
|
|
3265
|
+
x,
|
|
3266
3266
|
a,
|
|
3267
3267
|
i,
|
|
3268
|
-
v,
|
|
3269
3268
|
D,
|
|
3270
3269
|
X,
|
|
3271
|
-
|
|
3270
|
+
S,
|
|
3271
|
+
Q,
|
|
3272
3272
|
t,
|
|
3273
|
-
|
|
3274
|
-
|
|
3273
|
+
V,
|
|
3274
|
+
x,
|
|
3275
3275
|
s,
|
|
3276
3276
|
u,
|
|
3277
3277
|
l
|
|
3278
3278
|
);
|
|
3279
3279
|
}), l) {
|
|
3280
|
-
const
|
|
3281
|
-
if (
|
|
3282
|
-
const
|
|
3283
|
-
|
|
3280
|
+
const p = Z.node();
|
|
3281
|
+
if (p) {
|
|
3282
|
+
const h = p.getBBox(), C = h.x + h.width / 2, E = h.y + h.height / 2;
|
|
3283
|
+
Z.append("rect").attr("x", h.x).attr("y", h.y).attr("width", h.width).attr("height", h.height).attr("fill", "none").attr("stroke", "yellow").attr("stroke-width", 3).attr("opacity", 0.8).style("pointer-events", "none").attr("class", "debug-root-border"), Z.append("circle").attr("cx", C).attr("cy", E).attr("r", 10).attr("fill", "yellow").attr("stroke", "orange").attr("stroke-width", 2).attr("opacity", 0.9).style("pointer-events", "none").attr("class", "debug-geometric-center");
|
|
3284
3284
|
}
|
|
3285
3285
|
}
|
|
3286
|
-
const
|
|
3287
|
-
if (
|
|
3288
|
-
const
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3286
|
+
const z = Z.node();
|
|
3287
|
+
if (z) {
|
|
3288
|
+
const p = z.getBBox(), h = 0.9 * V / p.width, C = p.x + p.width / 2, E = p.y + p.height / 2, Y = V / 2 - C * h, g = x / 2 - E * h;
|
|
3289
|
+
Q.call(
|
|
3290
|
+
S.transform,
|
|
3291
|
+
$t.translate(Y, g).scale(h)
|
|
3292
3292
|
);
|
|
3293
3293
|
}
|
|
3294
3294
|
return {
|
|
3295
|
-
zoomBehavior:
|
|
3296
|
-
svgElement:
|
|
3297
|
-
gElement:
|
|
3295
|
+
zoomBehavior: S,
|
|
3296
|
+
svgElement: Q.node(),
|
|
3297
|
+
gElement: Z.node(),
|
|
3298
3298
|
baseFontSize: c,
|
|
3299
|
-
viewBoxWidth:
|
|
3299
|
+
viewBoxWidth: V
|
|
3300
3300
|
};
|
|
3301
3301
|
}
|
|
3302
|
-
function
|
|
3302
|
+
function St(t, e, r) {
|
|
3303
3303
|
let n = "#000000", o = "#000000", a = "#000000";
|
|
3304
3304
|
e.forEach((i) => {
|
|
3305
3305
|
switch (i.op) {
|
|
@@ -3364,9 +3364,9 @@ function $t(t, e, r) {
|
|
|
3364
3364
|
});
|
|
3365
3365
|
}
|
|
3366
3366
|
function $a(t, e, r = 14) {
|
|
3367
|
-
var
|
|
3367
|
+
var w;
|
|
3368
3368
|
t.innerHTML = "";
|
|
3369
|
-
const n = ((
|
|
3369
|
+
const n = ((w = e.bb) == null ? void 0 : w.split(",").map(Number)) || [0, 0, 1e3, 800], [, , o, a] = n, i = at(t).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${o} ${a}`).style("background", "white");
|
|
3370
3370
|
i.append("defs").html(`
|
|
3371
3371
|
<style>
|
|
3372
3372
|
.node rect, .node ellipse, .node polygon {
|
|
@@ -3378,23 +3378,23 @@ function $a(t, e, r = 14) {
|
|
|
3378
3378
|
</style>
|
|
3379
3379
|
`);
|
|
3380
3380
|
const c = i.append("g").attr("id", "graph0");
|
|
3381
|
-
(e.objects || []).forEach((
|
|
3382
|
-
const B = c.append("g").attr("class", "node").attr("id",
|
|
3383
|
-
|
|
3384
|
-
}), (e.edges || []).forEach((
|
|
3385
|
-
const B = c.append("g").attr("class", "edge").attr("id", `edge_${
|
|
3386
|
-
|
|
3381
|
+
(e.objects || []).forEach((_) => {
|
|
3382
|
+
const B = c.append("g").attr("class", "node").attr("id", _.name);
|
|
3383
|
+
_._draw_ && St(B, _._draw_, a), _._ldraw_ && St(B, _._ldraw_, a);
|
|
3384
|
+
}), (e.edges || []).forEach((_) => {
|
|
3385
|
+
const B = c.append("g").attr("class", "edge").attr("id", `edge_${_._gvid}`);
|
|
3386
|
+
_._draw_ && St(B, _._draw_, a), _._hdraw_ && St(B, _._hdraw_, a), _._tdraw_ && St(B, _._tdraw_, a), _._ldraw_ && St(B, _._ldraw_, a);
|
|
3387
3387
|
});
|
|
3388
|
-
const u = We().scaleExtent([0.1, 10]).on("zoom", (
|
|
3389
|
-
c.attr("transform",
|
|
3388
|
+
const u = We().scaleExtent([0.1, 10]).on("zoom", (_) => {
|
|
3389
|
+
c.attr("transform", _.transform.toString());
|
|
3390
3390
|
});
|
|
3391
3391
|
i.call(u);
|
|
3392
|
-
const d = t.clientWidth || 800,
|
|
3392
|
+
const d = t.clientWidth || 800, m = r * (d / o);
|
|
3393
3393
|
return {
|
|
3394
3394
|
zoomBehavior: u,
|
|
3395
3395
|
svgElement: i.node(),
|
|
3396
3396
|
gElement: c.node(),
|
|
3397
|
-
baseFontSize:
|
|
3397
|
+
baseFontSize: m,
|
|
3398
3398
|
viewBoxWidth: o
|
|
3399
3399
|
};
|
|
3400
3400
|
}
|
|
@@ -3423,15 +3423,15 @@ function Xa(t) {
|
|
|
3423
3423
|
let Ie = null;
|
|
3424
3424
|
Ie = Xa;
|
|
3425
3425
|
function Sa() {
|
|
3426
|
-
const t =
|
|
3426
|
+
const t = ft(null), e = ft(null), [r, n] = He(!1), [o, a] = He(null), i = Me(() => {
|
|
3427
3427
|
let s;
|
|
3428
3428
|
return Ie && (s = new Ie()), s.onmessage = (u) => {
|
|
3429
|
-
const { id: d, success:
|
|
3429
|
+
const { id: d, success: m, json: w, error: _ } = u.data;
|
|
3430
3430
|
if (e.current && e.current.id === d) {
|
|
3431
|
-
if (n(!1),
|
|
3432
|
-
e.current.resolve(
|
|
3431
|
+
if (n(!1), m && w)
|
|
3432
|
+
e.current.resolve(w);
|
|
3433
3433
|
else {
|
|
3434
|
-
const B = new Error(
|
|
3434
|
+
const B = new Error(_ || "Unknown worker error");
|
|
3435
3435
|
a(B.message), e.current.reject(B);
|
|
3436
3436
|
}
|
|
3437
3437
|
e.current = null;
|
|
@@ -3452,23 +3452,23 @@ function Sa() {
|
|
|
3452
3452
|
return;
|
|
3453
3453
|
}
|
|
3454
3454
|
e.current && e.current.reject(new Error("Request cancelled"));
|
|
3455
|
-
const
|
|
3456
|
-
e.current = { id:
|
|
3457
|
-
const
|
|
3458
|
-
t.current.postMessage(
|
|
3455
|
+
const m = Math.random().toString(36).slice(2);
|
|
3456
|
+
e.current = { id: m, resolve: u, reject: d }, n(!0), a(null);
|
|
3457
|
+
const w = { id: m, dot: s };
|
|
3458
|
+
t.current.postMessage(w);
|
|
3459
3459
|
}), []), l = Me(() => {
|
|
3460
3460
|
e.current && (console.warn("Graphviz worker: Request cancelled by user"), e.current.reject(new Error("Cancelled by user")), e.current = null, n(!1)), t.current && (t.current.terminate(), t.current = i());
|
|
3461
3461
|
}, [i]);
|
|
3462
3462
|
return { layout: c, cancel: l, isLoading: r, error: o };
|
|
3463
3463
|
}
|
|
3464
3464
|
function Ua({ onCancel: t }) {
|
|
3465
|
-
return /* @__PURE__ */
|
|
3466
|
-
/* @__PURE__ */
|
|
3467
|
-
/* @__PURE__ */
|
|
3468
|
-
/* @__PURE__ */
|
|
3469
|
-
/* @__PURE__ */
|
|
3465
|
+
return /* @__PURE__ */ Nt("div", { className: "absolute inset-0 bg-gray-900/80 flex flex-col items-center justify-center z-40", children: /* @__PURE__ */ he("div", { className: "flex flex-col items-center gap-4", children: [
|
|
3466
|
+
/* @__PURE__ */ Nt("div", { className: "w-12 h-12 border-4 border-blue-500/30 border-t-blue-500 rounded-full animate-spin" }),
|
|
3467
|
+
/* @__PURE__ */ he("div", { className: "text-center", children: [
|
|
3468
|
+
/* @__PURE__ */ Nt("p", { className: "text-white font-medium mb-1", children: "Processing layout..." }),
|
|
3469
|
+
/* @__PURE__ */ Nt("p", { className: "text-gray-400 text-sm", children: "This may take a while for large graphs" })
|
|
3470
3470
|
] }),
|
|
3471
|
-
/* @__PURE__ */
|
|
3471
|
+
/* @__PURE__ */ Nt(
|
|
3472
3472
|
"button",
|
|
3473
3473
|
{
|
|
3474
3474
|
onClick: t,
|
|
@@ -3490,108 +3490,110 @@ const Oa = Tr(function({
|
|
|
3490
3490
|
className: s = "",
|
|
3491
3491
|
showLoading: u = !0,
|
|
3492
3492
|
debug: d = !1,
|
|
3493
|
-
selectedEdgeId:
|
|
3494
|
-
onEdgeSelect:
|
|
3495
|
-
useNativeRendering:
|
|
3493
|
+
selectedEdgeId: m = null,
|
|
3494
|
+
onEdgeSelect: w,
|
|
3495
|
+
useNativeRendering: _ = !1,
|
|
3496
3496
|
nodeWidth: B = 240,
|
|
3497
|
-
nodeHeight:
|
|
3498
|
-
nodeColumnSpacing:
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3497
|
+
nodeHeight: V = 64,
|
|
3498
|
+
nodeColumnSpacing: x = 800,
|
|
3499
|
+
clickPassthrough: Q = !1,
|
|
3500
|
+
enableWheelZoom: Z = !0
|
|
3501
|
+
}, et) {
|
|
3502
|
+
const N = ft(null), { layout: $, cancel: nt, isLoading: it, error: A } = Sa(), R = ft(null), U = ft(null), W = ft(null), P = ft(14), f = ft(1e3), b = ft(!1), y = ft(null), D = ft(null), X = ft(null), S = ft(null), z = ft(w);
|
|
3503
|
+
return z.current = w, Vr(et, () => ({
|
|
3504
|
+
zoomIn: (G = 10) => {
|
|
3505
|
+
var v, L;
|
|
3506
|
+
if (!R.current || !U.current || !W.current) return;
|
|
3507
|
+
const p = Kt(W.current), h = 1 + G / 100, C = p.k * h, E = at(U.current), Y = ((v = N.current) == null ? void 0 : v.clientWidth) || 1, g = ((L = N.current) == null ? void 0 : L.clientHeight) || 1;
|
|
3506
3508
|
E.transition().duration(300).call(
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
[
|
|
3509
|
+
R.current.scaleTo,
|
|
3510
|
+
C,
|
|
3511
|
+
[Y / 2, g / 2]
|
|
3510
3512
|
);
|
|
3511
3513
|
},
|
|
3512
|
-
zoomOut: (
|
|
3513
|
-
var
|
|
3514
|
-
if (!
|
|
3515
|
-
const
|
|
3514
|
+
zoomOut: (G = 10) => {
|
|
3515
|
+
var v, L;
|
|
3516
|
+
if (!R.current || !U.current || !W.current) return;
|
|
3517
|
+
const p = Kt(W.current), h = 1 - G / 100, C = Math.max(0.1, p.k * h), E = at(U.current), Y = ((v = N.current) == null ? void 0 : v.clientWidth) || 1, g = ((L = N.current) == null ? void 0 : L.clientHeight) || 1;
|
|
3516
3518
|
E.transition().duration(300).call(
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
[
|
|
3519
|
+
R.current.scaleTo,
|
|
3520
|
+
C,
|
|
3521
|
+
[Y / 2, g / 2]
|
|
3520
3522
|
);
|
|
3521
3523
|
},
|
|
3522
3524
|
toggleZoom: () => {
|
|
3523
|
-
var
|
|
3524
|
-
if (!
|
|
3525
|
-
const
|
|
3526
|
-
(
|
|
3527
|
-
const h =
|
|
3528
|
-
if (!
|
|
3529
|
-
const [, , E,
|
|
3530
|
-
if (isNaN(E) || isNaN(
|
|
3525
|
+
var dt, bt;
|
|
3526
|
+
if (!R.current || !U.current || !W.current) return;
|
|
3527
|
+
const G = at(U.current), p = ((dt = N.current) == null ? void 0 : dt.clientWidth) || 1;
|
|
3528
|
+
(bt = N.current) != null && bt.clientHeight;
|
|
3529
|
+
const h = P.current, C = U.current.getAttribute("viewBox");
|
|
3530
|
+
if (!C) return;
|
|
3531
|
+
const [, , E, Y] = C.split(" ").map(Number);
|
|
3532
|
+
if (isNaN(E) || isNaN(Y))
|
|
3531
3533
|
return;
|
|
3532
|
-
if (!
|
|
3533
|
-
const
|
|
3534
|
-
|
|
3534
|
+
if (!D.current) {
|
|
3535
|
+
const ut = W.current.getBBox();
|
|
3536
|
+
D.current = { x: ut.x, y: ut.y, width: ut.width, height: ut.height };
|
|
3535
3537
|
}
|
|
3536
|
-
const
|
|
3537
|
-
if (console.log("rootBBox:",
|
|
3538
|
+
const g = D.current;
|
|
3539
|
+
if (console.log("rootBBox:", g), isNaN(g.x) || isNaN(g.y) || isNaN(g.width) || isNaN(g.height)) {
|
|
3538
3540
|
console.error("rootBBox contains NaN values, recalculating...");
|
|
3539
|
-
const
|
|
3540
|
-
|
|
3541
|
+
const ut = W.current.getBBox();
|
|
3542
|
+
D.current = { x: ut.x, y: ut.y, width: ut.width, height: ut.height };
|
|
3541
3543
|
}
|
|
3542
|
-
const
|
|
3544
|
+
const v = g.x + g.width / 2, L = g.y + g.height / 2, M = p / E, F = 0.9 * E / g.width, q = h * M * F, K = 16 / (h * M), I = h * M * K, k = Math.min(F, K), O = Math.max(F, K), j = Kt(U.current), tt = h * M * j.k;
|
|
3543
3545
|
console.log("toggleZoom debug:", {
|
|
3544
|
-
currentState:
|
|
3545
|
-
currentScale:
|
|
3546
|
-
currentFontSize:
|
|
3547
|
-
overviewScale:
|
|
3548
|
-
overviewFontSize:
|
|
3549
|
-
detailScale:
|
|
3550
|
-
detailFontSize:
|
|
3551
|
-
zoomOutScale:
|
|
3552
|
-
zoomInScale:
|
|
3546
|
+
currentState: b.current ? "zoomedIn" : "zoomedOut",
|
|
3547
|
+
currentScale: j.k,
|
|
3548
|
+
currentFontSize: tt,
|
|
3549
|
+
overviewScale: F,
|
|
3550
|
+
overviewFontSize: q,
|
|
3551
|
+
detailScale: K,
|
|
3552
|
+
detailFontSize: I,
|
|
3553
|
+
zoomOutScale: k,
|
|
3554
|
+
zoomInScale: O
|
|
3553
3555
|
});
|
|
3554
|
-
let
|
|
3555
|
-
|
|
3556
|
-
targetScale:
|
|
3557
|
-
targetFontSize: h *
|
|
3558
|
-
newState:
|
|
3556
|
+
let rt;
|
|
3557
|
+
b.current ? (rt = k, b.current = !1) : (rt = O, y.current = Kt(U.current), b.current = !0), console.log("toggleZoom target:", {
|
|
3558
|
+
targetScale: rt,
|
|
3559
|
+
targetFontSize: h * M * rt,
|
|
3560
|
+
newState: b.current ? "zoomedIn" : "zoomedOut"
|
|
3559
3561
|
});
|
|
3560
|
-
const
|
|
3561
|
-
console.log("newTransform:", { x:
|
|
3562
|
-
|
|
3562
|
+
const J = E / 2 - v * rt, H = Y / 2 - L * rt, T = $t.translate(J, H).scale(rt);
|
|
3563
|
+
console.log("newTransform:", { x: T.x, y: T.y, k: T.k }), at(W.current).transition().duration(500).attr("transform", T.toString()).on("end", () => {
|
|
3564
|
+
G.call(R.current.transform, T);
|
|
3563
3565
|
});
|
|
3564
3566
|
},
|
|
3565
3567
|
stopRendering: () => {
|
|
3566
|
-
|
|
3568
|
+
S.current && (clearInterval(S.current), S.current = null), X.current = null, nt(), N.current && (N.current.innerHTML = ""), b.current = !1, y.current = null;
|
|
3567
3569
|
}
|
|
3568
|
-
}), [
|
|
3569
|
-
if (!e || !
|
|
3570
|
-
let
|
|
3571
|
-
return
|
|
3572
|
-
if (
|
|
3573
|
-
const
|
|
3574
|
-
l(
|
|
3570
|
+
}), [nt]), Le(() => {
|
|
3571
|
+
if (!e || !N.current) return;
|
|
3572
|
+
let G = !1;
|
|
3573
|
+
return X.current = Date.now(), l && (S.current = setInterval(() => {
|
|
3574
|
+
if (X.current) {
|
|
3575
|
+
const p = Date.now() - X.current;
|
|
3576
|
+
l(p);
|
|
3575
3577
|
}
|
|
3576
|
-
}, 100)),
|
|
3577
|
-
var
|
|
3578
|
-
if (
|
|
3579
|
-
const h = JSON.parse(
|
|
3580
|
-
if (
|
|
3578
|
+
}, 100)), $(e).then((p) => {
|
|
3579
|
+
var C;
|
|
3580
|
+
if (G) return;
|
|
3581
|
+
const h = JSON.parse(p);
|
|
3582
|
+
if (N.current) {
|
|
3581
3583
|
let E = n;
|
|
3582
3584
|
if (h.objects) {
|
|
3583
|
-
for (const
|
|
3584
|
-
if (
|
|
3585
|
-
for (const
|
|
3586
|
-
|
|
3585
|
+
for (const g of h.objects)
|
|
3586
|
+
if (g._ldraw_)
|
|
3587
|
+
for (const v of g._ldraw_)
|
|
3588
|
+
v.size && v.size > E && (E = v.size);
|
|
3587
3589
|
}
|
|
3588
|
-
let
|
|
3589
|
-
if (
|
|
3590
|
-
|
|
3590
|
+
let Y;
|
|
3591
|
+
if (_ ? Y = $a(
|
|
3592
|
+
N.current,
|
|
3591
3593
|
h,
|
|
3592
3594
|
E
|
|
3593
|
-
) :
|
|
3594
|
-
|
|
3595
|
+
) : Y = Na(
|
|
3596
|
+
N.current,
|
|
3595
3597
|
h,
|
|
3596
3598
|
r,
|
|
3597
3599
|
null,
|
|
@@ -3606,67 +3608,82 @@ const Oa = Tr(function({
|
|
|
3606
3608
|
d,
|
|
3607
3609
|
null,
|
|
3608
3610
|
// selectedEdgeId - handle selection separately via useEffect
|
|
3609
|
-
(
|
|
3610
|
-
var
|
|
3611
|
-
return (
|
|
3611
|
+
(g) => {
|
|
3612
|
+
var v;
|
|
3613
|
+
return (v = z.current) == null ? void 0 : v.call(z, g);
|
|
3612
3614
|
},
|
|
3613
3615
|
// Use ref for callback
|
|
3614
3616
|
B,
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3617
|
+
V,
|
|
3618
|
+
x,
|
|
3619
|
+
Z
|
|
3620
|
+
), R.current = Y.zoomBehavior, U.current = Y.svgElement, W.current = Y.gElement, P.current = Y.baseFontSize, f.current = Y.viewBoxWidth, Q && U.current && U.current.addEventListener("click", (g) => {
|
|
3621
|
+
const L = document.elementsFromPoint(g.clientX, g.clientY).find((M) => {
|
|
3622
|
+
var F;
|
|
3623
|
+
return !((F = U.current) != null && F.contains(M)) && M !== U.current;
|
|
3624
|
+
});
|
|
3625
|
+
if (L) {
|
|
3626
|
+
const M = new MouseEvent("click", {
|
|
3627
|
+
bubbles: !0,
|
|
3628
|
+
cancelable: !0,
|
|
3629
|
+
clientX: g.clientX,
|
|
3630
|
+
clientY: g.clientY
|
|
3631
|
+
});
|
|
3632
|
+
L.dispatchEvent(M);
|
|
3633
|
+
}
|
|
3634
|
+
}), W.current) {
|
|
3635
|
+
const g = W.current.getBBox();
|
|
3636
|
+
D.current = { x: g.x, y: g.y, width: g.width, height: g.height };
|
|
3637
|
+
const v = f.current, L = ((C = N.current) == null ? void 0 : C.clientWidth) || 1, M = P.current, F = L / v, q = 0.9 * v / g.width, ot = 16 / (M * F);
|
|
3638
|
+
b.current = q >= ot;
|
|
3622
3639
|
}
|
|
3623
|
-
if (
|
|
3624
|
-
const
|
|
3625
|
-
if (
|
|
3626
|
-
const
|
|
3627
|
-
let
|
|
3628
|
-
if (
|
|
3629
|
-
const [, ,
|
|
3630
|
-
|
|
3640
|
+
if (y.current = null, S.current && (clearInterval(S.current), S.current = null), X.current = null, c) {
|
|
3641
|
+
const g = N.current.querySelector("svg"), v = g == null ? void 0 : g.querySelector("#graph0");
|
|
3642
|
+
if (g && v) {
|
|
3643
|
+
const L = E, M = g.getAttribute("viewBox");
|
|
3644
|
+
let F = 1e3;
|
|
3645
|
+
if (M) {
|
|
3646
|
+
const [, , I] = M.split(" ").map(Number);
|
|
3647
|
+
I && (F = I);
|
|
3631
3648
|
}
|
|
3632
|
-
const
|
|
3633
|
-
var
|
|
3634
|
-
const
|
|
3635
|
-
let
|
|
3636
|
-
if (
|
|
3637
|
-
const
|
|
3638
|
-
if (
|
|
3639
|
-
const
|
|
3640
|
-
isNaN(
|
|
3649
|
+
const q = () => {
|
|
3650
|
+
var rt;
|
|
3651
|
+
const I = v.getAttribute("transform");
|
|
3652
|
+
let k = 1;
|
|
3653
|
+
if (I) {
|
|
3654
|
+
const J = I.match(/scale\(([^,)]+)/);
|
|
3655
|
+
if (J) {
|
|
3656
|
+
const H = parseFloat(J[1]);
|
|
3657
|
+
isNaN(H) || (k = H);
|
|
3641
3658
|
} else {
|
|
3642
|
-
const
|
|
3643
|
-
if (
|
|
3644
|
-
const
|
|
3645
|
-
isNaN(
|
|
3659
|
+
const H = I.match(/matrix\(([^,)]+)/);
|
|
3660
|
+
if (H) {
|
|
3661
|
+
const T = parseFloat(H[1]);
|
|
3662
|
+
isNaN(T) || (k = T);
|
|
3646
3663
|
}
|
|
3647
3664
|
}
|
|
3648
3665
|
}
|
|
3649
|
-
const
|
|
3650
|
-
!isNaN(
|
|
3666
|
+
const j = (((rt = N.current) == null ? void 0 : rt.clientWidth) || 1) / F, tt = L * j * k;
|
|
3667
|
+
!isNaN(tt) && !isNaN(k) && c({ baseFontSize: L, actualFontSize: tt, scale: k });
|
|
3651
3668
|
};
|
|
3652
|
-
|
|
3653
|
-
const
|
|
3654
|
-
|
|
3669
|
+
q();
|
|
3670
|
+
const ot = new MutationObserver(q);
|
|
3671
|
+
ot.observe(v, {
|
|
3655
3672
|
attributes: !0,
|
|
3656
3673
|
attributeFilter: ["transform"]
|
|
3657
3674
|
});
|
|
3658
|
-
const
|
|
3659
|
-
return window.addEventListener("resize",
|
|
3660
|
-
|
|
3675
|
+
const K = () => q();
|
|
3676
|
+
return window.addEventListener("resize", K), () => {
|
|
3677
|
+
ot.disconnect(), window.removeEventListener("resize", K);
|
|
3661
3678
|
};
|
|
3662
3679
|
}
|
|
3663
3680
|
}
|
|
3664
3681
|
}
|
|
3665
|
-
a == null || a({ json: h, svgElement:
|
|
3666
|
-
}).catch((
|
|
3667
|
-
|
|
3682
|
+
a == null || a({ json: h, svgElement: U.current });
|
|
3683
|
+
}).catch((p) => {
|
|
3684
|
+
G || (S.current && (clearInterval(S.current), S.current = null), X.current = null, p.message !== "Cancelled by user" && p.message !== "Request cancelled" && (console.error("GraphvizRenderer error:", p), N.current && (N.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)))));
|
|
3668
3685
|
}), () => {
|
|
3669
|
-
|
|
3686
|
+
G = !0, S.current && (clearInterval(S.current), S.current = null), X.current = null, nt();
|
|
3670
3687
|
};
|
|
3671
3688
|
}, [
|
|
3672
3689
|
e,
|
|
@@ -3674,52 +3691,52 @@ const Oa = Tr(function({
|
|
|
3674
3691
|
n,
|
|
3675
3692
|
l,
|
|
3676
3693
|
d,
|
|
3677
|
-
|
|
3694
|
+
_,
|
|
3678
3695
|
B,
|
|
3679
|
-
|
|
3680
|
-
|
|
3696
|
+
V,
|
|
3697
|
+
x
|
|
3681
3698
|
]), Le(() => {
|
|
3682
|
-
var
|
|
3683
|
-
if (
|
|
3684
|
-
const
|
|
3685
|
-
if (
|
|
3686
|
-
h.classList.remove("selected"), h.querySelectorAll(".close-btn, .close-btn-bg").forEach((
|
|
3687
|
-
}),
|
|
3688
|
-
const h =
|
|
3699
|
+
var p;
|
|
3700
|
+
if (_ || !N.current) return;
|
|
3701
|
+
const G = N.current.querySelector("svg");
|
|
3702
|
+
if (G && (G.querySelectorAll("g.edge.selected").forEach((h) => {
|
|
3703
|
+
h.classList.remove("selected"), h.querySelectorAll(".close-btn, .close-btn-bg").forEach((C) => C.remove());
|
|
3704
|
+
}), m != null)) {
|
|
3705
|
+
const h = G.querySelector(`g.edge[data-edge-id="${m}"]`);
|
|
3689
3706
|
if (h) {
|
|
3690
|
-
h.classList.add("selected"), (
|
|
3691
|
-
const
|
|
3692
|
-
if (
|
|
3693
|
-
|
|
3707
|
+
h.classList.add("selected"), (p = h.parentNode) == null || p.appendChild(h);
|
|
3708
|
+
const C = h.querySelector(".label-bg");
|
|
3709
|
+
if (C && w) {
|
|
3710
|
+
C.getBoundingClientRect();
|
|
3694
3711
|
const E = h.querySelector(".label-text-elem") || h.querySelector(".label-text");
|
|
3695
3712
|
if (E) {
|
|
3696
|
-
const
|
|
3713
|
+
const Y = E.getAttribute("y"), g = parseFloat(C.getAttribute("x") || "0"), v = parseFloat(C.getAttribute("width") || "0"), L = g + v + 16;
|
|
3697
3714
|
if (!h.querySelector(".close-btn")) {
|
|
3698
|
-
const
|
|
3699
|
-
|
|
3700
|
-
const
|
|
3701
|
-
|
|
3702
|
-
const
|
|
3703
|
-
|
|
3715
|
+
const M = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
3716
|
+
M.setAttribute("class", "close-btn-bg"), M.setAttribute("cx", String(L)), M.setAttribute("cy", Y || "0"), M.setAttribute("r", "8"), M.setAttribute("fill", "white"), M.setAttribute("stroke", "#d0d0d0"), M.setAttribute("stroke-width", "1"), M.style.cursor = "pointer";
|
|
3717
|
+
const F = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
3718
|
+
F.setAttribute("class", "close-btn"), F.setAttribute("x", String(L)), F.setAttribute("y", Y || "0"), F.setAttribute("text-anchor", "middle"), F.setAttribute("dominant-baseline", "central"), F.setAttribute("font-family", "Arial"), F.setAttribute("font-size", "12px"), F.setAttribute("font-weight", "bold"), F.setAttribute("fill", "#888"), F.style.cursor = "pointer", F.textContent = "✕";
|
|
3719
|
+
const q = (ot) => {
|
|
3720
|
+
ot.stopPropagation(), w(null);
|
|
3704
3721
|
};
|
|
3705
|
-
|
|
3722
|
+
M.addEventListener("click", q), F.addEventListener("click", q), h.appendChild(M), h.appendChild(F);
|
|
3706
3723
|
}
|
|
3707
3724
|
}
|
|
3708
3725
|
}
|
|
3709
3726
|
}
|
|
3710
3727
|
}
|
|
3711
|
-
}, [
|
|
3712
|
-
/* @__PURE__ */
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
/* @__PURE__ */
|
|
3728
|
+
}, [m, w, _]), /* @__PURE__ */ he("div", { className: `graphviz-renderer ${s}`.trim(), style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
3729
|
+
/* @__PURE__ */ Nt("div", { ref: N, style: { width: "100%", height: "100%" } }),
|
|
3730
|
+
it && u && (o ?? /* @__PURE__ */ Nt(Ua, { onCancel: nt })),
|
|
3731
|
+
A && !it && /* @__PURE__ */ he("div", { style: { padding: "1rem", color: "#ef4444" }, children: [
|
|
3732
|
+
/* @__PURE__ */ Nt("strong", { children: "Error:" }),
|
|
3716
3733
|
" ",
|
|
3717
|
-
|
|
3734
|
+
A
|
|
3718
3735
|
] })
|
|
3719
3736
|
] });
|
|
3720
3737
|
});
|
|
3721
3738
|
export {
|
|
3722
|
-
|
|
3739
|
+
be as DEFAULT_LAYOUT_CONFIG,
|
|
3723
3740
|
Oa as GraphvizRenderer,
|
|
3724
3741
|
za as LARGE_GRAPH_THRESHOLD,
|
|
3725
3742
|
Ua as WorkerLoadingIndicator,
|