@dpuse/dpuse-tool-d3-visualiser 1.0.118 → 1.0.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +205 -243
- package/dist/chordDiagram-Cm91Tmgo.js +1729 -0
- package/dist/d3-hierarchy-Dtx4jD78.js +269 -0
- package/dist/{linear-CNetDix0.js → d3-scale-BYykLEPO.js} +238 -177
- package/dist/{select-SZKizDc7.js → d3-selection-CL8c_tE2.js} +230 -232
- package/dist/d3-shape-gf8U18pS.js +1133 -0
- package/dist/dpuse-tool-d3-visualiser.es.js +6 -6
- package/dist/{erdDiagram-DKsqCN08.js → erdDiagram-DmYSx8Dh.js} +1 -1
- package/dist/{networkDiagram-BiCPMNf8.js → networkDiagram-UdFs1ySs.js} +385 -368
- package/dist/{sankeyDiagram-DcI-D1uh.js → sankeyDiagram-Dbl1-v5p.js} +31 -31
- package/dist/shipped-packages.json +11 -20
- package/dist/{src-DAMkWOaT.js → src-YHHReglY.js} +32 -32
- package/dist/{tanStackCharts-5HHGfe6p.js → tanStackCharts-DEINbmRi.js} +1041 -1096
- package/dist/treeDiagram-t0oFwi1c.js +49 -0
- package/dist/types/src/networkDiagram.d.ts +4 -0
- package/package.json +25 -23
- package/dist/array-CpxKKsZm.js +0 -12
- package/dist/array-CpxKKsZm.js.map +0 -1
- package/dist/chordDiagram-Dbu2uT_s.js +0 -3588
- package/dist/chordDiagram-Dbu2uT_s.js.map +0 -1
- package/dist/dpuse-tool-d3-visualiser.es.js.map +0 -1
- package/dist/erdDiagram-DKsqCN08.js.map +0 -1
- package/dist/hierarchy-DU9LihDu.js +0 -135
- package/dist/hierarchy-DU9LihDu.js.map +0 -1
- package/dist/linear-CNetDix0.js.map +0 -1
- package/dist/link-CAkrxHYd.js +0 -62
- package/dist/link-CAkrxHYd.js.map +0 -1
- package/dist/networkDiagram-BiCPMNf8.js.map +0 -1
- package/dist/palette-D5DTPmuA.js.map +0 -1
- package/dist/point-_U9MxSuk.js +0 -85
- package/dist/point-_U9MxSuk.js.map +0 -1
- package/dist/sankeyDiagram-DcI-D1uh.js.map +0 -1
- package/dist/select-SZKizDc7.js.map +0 -1
- package/dist/src-DAMkWOaT.js.map +0 -1
- package/dist/string-BzfQLSds.js.map +0 -1
- package/dist/tanStackCharts-5HHGfe6p.js.map +0 -1
- package/dist/treeDiagram-fmrYqvXl.js +0 -126
- package/dist/treeDiagram-fmrYqvXl.js.map +0 -1
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
// node_modules/d3-force/src/center.js
|
|
4
|
-
function i(e, t) {
|
|
5
|
-
var n, r = 1;
|
|
6
|
-
e ??= 0, t ??= 0;
|
|
7
|
-
function i() {
|
|
8
|
-
var i, a = n.length, o, s = 0, c = 0;
|
|
9
|
-
for (i = 0; i < a; ++i) o = n[i], s += o.x, c += o.y;
|
|
10
|
-
for (s = (s / a - e) * r, c = (c / a - t) * r, i = 0; i < a; ++i) o = n[i], o.x -= s, o.y -= c;
|
|
11
|
-
}
|
|
12
|
-
return i.initialize = function(e) {
|
|
13
|
-
n = e;
|
|
14
|
-
}, i.x = function(t) {
|
|
15
|
-
return arguments.length ? (e = +t, i) : e;
|
|
16
|
-
}, i.y = function(e) {
|
|
17
|
-
return arguments.length ? (t = +e, i) : t;
|
|
18
|
-
}, i.strength = function(e) {
|
|
19
|
-
return arguments.length ? (r = +e, i) : r;
|
|
20
|
-
}, i;
|
|
21
|
-
}
|
|
1
|
+
import { i as e, r as t } from "./d3-selection-CL8c_tE2.js";
|
|
2
|
+
import { n, r, t as i } from "./src-YHHReglY.js";
|
|
22
3
|
// node_modules/d3-quadtree/src/add.js
|
|
23
4
|
function a(e) {
|
|
24
5
|
let t = +this._x.call(null, e), n = +this._y.call(null, e);
|
|
@@ -216,18 +197,34 @@ E.copy = function() {
|
|
|
216
197
|
}) : t.target[i] = T(r));
|
|
217
198
|
return e;
|
|
218
199
|
}, E.add = a, E.addAll = s, E.cover = c, E.data = l, E.extent = u, E.find = f, E.remove = p, E.removeAll = m, E.root = h, E.size = g, E.visit = _, E.visitAfter = v, E.x = b, E.y = S;
|
|
219
|
-
// node_modules/d3-force/
|
|
220
|
-
function D(e) {
|
|
200
|
+
// node_modules/d3-force/dist/d3-force.mjs
|
|
201
|
+
function D(e, t) {
|
|
202
|
+
var n, r = 1;
|
|
203
|
+
e ??= 0, t ??= 0;
|
|
204
|
+
function i() {
|
|
205
|
+
var i, a = n.length, o, s = 0, c = 0;
|
|
206
|
+
for (i = 0; i < a; ++i) o = n[i], s += o.x, c += o.y;
|
|
207
|
+
for (s = (s / a - e) * r, c = (c / a - t) * r, i = 0; i < a; ++i) o = n[i], o.x -= s, o.y -= c;
|
|
208
|
+
}
|
|
209
|
+
return i.initialize = function(e) {
|
|
210
|
+
n = e;
|
|
211
|
+
}, i.x = function(t) {
|
|
212
|
+
return arguments.length ? (e = +t, i) : e;
|
|
213
|
+
}, i.y = function(e) {
|
|
214
|
+
return arguments.length ? (t = +e, i) : t;
|
|
215
|
+
}, i.strength = function(e) {
|
|
216
|
+
return arguments.length ? (r = +e, i) : r;
|
|
217
|
+
}, i;
|
|
218
|
+
}
|
|
219
|
+
function O(e) {
|
|
221
220
|
return function() {
|
|
222
221
|
return e;
|
|
223
222
|
};
|
|
224
223
|
}
|
|
225
|
-
|
|
226
|
-
function O(e) {
|
|
224
|
+
function k(e) {
|
|
227
225
|
return (e() - .5) * 1e-6;
|
|
228
226
|
}
|
|
229
|
-
|
|
230
|
-
function k(e) {
|
|
227
|
+
function ee(e) {
|
|
231
228
|
return e.index;
|
|
232
229
|
}
|
|
233
230
|
function A(e, t) {
|
|
@@ -236,13 +233,13 @@ function A(e, t) {
|
|
|
236
233
|
return n;
|
|
237
234
|
}
|
|
238
235
|
function j(e) {
|
|
239
|
-
var t =
|
|
236
|
+
var t = ee, n = d, r, i = O(30), a, o, s, c, l, u = 1;
|
|
240
237
|
e ??= [];
|
|
241
238
|
function d(e) {
|
|
242
239
|
return 1 / Math.min(s[e.source.index], s[e.target.index]);
|
|
243
240
|
}
|
|
244
241
|
function f(t) {
|
|
245
|
-
for (var n = 0, i = e.length; n < u; ++n) for (var o = 0, s, d, f, p, m, h, g; o < i; ++o) s = e[o], d = s.source, f = s.target, p = f.x + f.vx - d.x - d.vx ||
|
|
242
|
+
for (var n = 0, i = e.length; n < u; ++n) for (var o = 0, s, d, f, p, m, h, g; o < i; ++o) s = e[o], d = s.source, f = s.target, p = f.x + f.vx - d.x - d.vx || k(l), m = f.y + f.vy - d.y - d.vy || k(l), h = Math.sqrt(p * p + m * m), h = (h - a[o]) / h * t * r[o], p *= h, m *= h, f.vx -= p * (g = c[o]), f.vy -= m * g, d.vx += p * (g = 1 - g), d.vy += m * g;
|
|
246
243
|
}
|
|
247
244
|
function p() {
|
|
248
245
|
if (o) {
|
|
@@ -267,98 +264,95 @@ function j(e) {
|
|
|
267
264
|
}, f.iterations = function(e) {
|
|
268
265
|
return arguments.length ? (u = +e, f) : u;
|
|
269
266
|
}, f.strength = function(e) {
|
|
270
|
-
return arguments.length ? (n = typeof e == "function" ? e :
|
|
267
|
+
return arguments.length ? (n = typeof e == "function" ? e : O(+e), m(), f) : n;
|
|
271
268
|
}, f.distance = function(e) {
|
|
272
|
-
return arguments.length ? (i = typeof e == "function" ? e :
|
|
269
|
+
return arguments.length ? (i = typeof e == "function" ? e : O(+e), h(), f) : i;
|
|
273
270
|
}, f;
|
|
274
271
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
function te() {
|
|
272
|
+
var M = 1664525, te = 1013904223, N = 4294967296;
|
|
273
|
+
function ne() {
|
|
278
274
|
let e = 1;
|
|
279
|
-
return () => (e = (M * e +
|
|
275
|
+
return () => (e = (M * e + te) % N) / N;
|
|
280
276
|
}
|
|
281
|
-
|
|
282
|
-
function ne(e) {
|
|
277
|
+
function re(e) {
|
|
283
278
|
return e.x;
|
|
284
279
|
}
|
|
285
|
-
function
|
|
280
|
+
function ie(e) {
|
|
286
281
|
return e.y;
|
|
287
282
|
}
|
|
288
|
-
var
|
|
289
|
-
function
|
|
290
|
-
var
|
|
291
|
-
|
|
283
|
+
var ae = 10, oe = Math.PI * (3 - Math.sqrt(5));
|
|
284
|
+
function se(e) {
|
|
285
|
+
var t, i = 1, a = .001, o = 1 - a ** (1 / 300), s = 0, c = .6, l = /* @__PURE__ */ new Map(), u = n(p), d = r("tick", "end"), f = ne();
|
|
286
|
+
e ??= [];
|
|
292
287
|
function p() {
|
|
293
|
-
m(), d.call("tick",
|
|
288
|
+
m(), d.call("tick", t), i < a && (u.stop(), d.call("end", t));
|
|
294
289
|
}
|
|
295
|
-
function m(
|
|
296
|
-
var
|
|
297
|
-
|
|
298
|
-
for (var d = 0; d <
|
|
290
|
+
function m(n) {
|
|
291
|
+
var r, a = e.length, u;
|
|
292
|
+
n === void 0 && (n = 1);
|
|
293
|
+
for (var d = 0; d < n; ++d) for (i += (s - i) * o, l.forEach(function(e) {
|
|
299
294
|
e(i);
|
|
300
|
-
}),
|
|
301
|
-
return
|
|
295
|
+
}), r = 0; r < a; ++r) u = e[r], u.fx == null ? u.x += u.vx *= c : (u.x = u.fx, u.vx = 0), u.fy == null ? u.y += u.vy *= c : (u.y = u.fy, u.vy = 0);
|
|
296
|
+
return t;
|
|
302
297
|
}
|
|
303
298
|
function h() {
|
|
304
|
-
for (var
|
|
305
|
-
if (r =
|
|
306
|
-
var i =
|
|
299
|
+
for (var t = 0, n = e.length, r; t < n; ++t) {
|
|
300
|
+
if (r = e[t], r.index = t, r.fx != null && (r.x = r.fx), r.fy != null && (r.y = r.fy), isNaN(r.x) || isNaN(r.y)) {
|
|
301
|
+
var i = ae * Math.sqrt(.5 + t), a = t * oe;
|
|
307
302
|
r.x = i * Math.cos(a), r.y = i * Math.sin(a);
|
|
308
303
|
}
|
|
309
304
|
(isNaN(r.vx) || isNaN(r.vy)) && (r.vx = r.vy = 0);
|
|
310
305
|
}
|
|
311
306
|
}
|
|
312
|
-
function g(
|
|
313
|
-
return
|
|
307
|
+
function g(t) {
|
|
308
|
+
return t.initialize && t.initialize(e, f), t;
|
|
314
309
|
}
|
|
315
|
-
return h(),
|
|
310
|
+
return h(), t = {
|
|
316
311
|
tick: m,
|
|
317
312
|
restart: function() {
|
|
318
|
-
return u.restart(p),
|
|
313
|
+
return u.restart(p), t;
|
|
319
314
|
},
|
|
320
315
|
stop: function() {
|
|
321
|
-
return u.stop(),
|
|
316
|
+
return u.stop(), t;
|
|
322
317
|
},
|
|
323
|
-
nodes: function(
|
|
324
|
-
return arguments.length ? (
|
|
318
|
+
nodes: function(n) {
|
|
319
|
+
return arguments.length ? (e = n, h(), l.forEach(g), t) : e;
|
|
325
320
|
},
|
|
326
321
|
alpha: function(e) {
|
|
327
|
-
return arguments.length ? (i = +e,
|
|
322
|
+
return arguments.length ? (i = +e, t) : i;
|
|
328
323
|
},
|
|
329
324
|
alphaMin: function(e) {
|
|
330
|
-
return arguments.length ? (a = +e,
|
|
325
|
+
return arguments.length ? (a = +e, t) : a;
|
|
331
326
|
},
|
|
332
327
|
alphaDecay: function(e) {
|
|
333
|
-
return arguments.length ? (o = +e,
|
|
328
|
+
return arguments.length ? (o = +e, t) : +o;
|
|
334
329
|
},
|
|
335
330
|
alphaTarget: function(e) {
|
|
336
|
-
return arguments.length ? (s = +e,
|
|
331
|
+
return arguments.length ? (s = +e, t) : s;
|
|
337
332
|
},
|
|
338
333
|
velocityDecay: function(e) {
|
|
339
|
-
return arguments.length ? (c = 1 - e,
|
|
334
|
+
return arguments.length ? (c = 1 - e, t) : 1 - c;
|
|
340
335
|
},
|
|
341
336
|
randomSource: function(e) {
|
|
342
|
-
return arguments.length ? (f = e, l.forEach(g),
|
|
337
|
+
return arguments.length ? (f = e, l.forEach(g), t) : f;
|
|
343
338
|
},
|
|
344
|
-
force: function(e,
|
|
345
|
-
return arguments.length > 1 ? (
|
|
339
|
+
force: function(e, n) {
|
|
340
|
+
return arguments.length > 1 ? (n == null ? l.delete(e) : l.set(e, g(n)), t) : l.get(e);
|
|
346
341
|
},
|
|
347
|
-
find: function(
|
|
348
|
-
var i = 0, a =
|
|
349
|
-
for (r == null ? r = Infinity : r *= r, i = 0; i < a; ++i) l =
|
|
342
|
+
find: function(t, n, r) {
|
|
343
|
+
var i = 0, a = e.length, o, s, c, l, u;
|
|
344
|
+
for (r == null ? r = Infinity : r *= r, i = 0; i < a; ++i) l = e[i], o = t - l.x, s = n - l.y, c = o * o + s * s, c < r && (u = l, r = c);
|
|
350
345
|
return u;
|
|
351
346
|
},
|
|
352
|
-
on: function(e,
|
|
353
|
-
return arguments.length > 1 ? (d.on(e,
|
|
347
|
+
on: function(e, n) {
|
|
348
|
+
return arguments.length > 1 ? (d.on(e, n), t) : d.on(e);
|
|
354
349
|
}
|
|
355
350
|
};
|
|
356
351
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
var e, t, n, r, i = D(-30), a, o = 1, s = Infinity, c = .81;
|
|
352
|
+
function ce() {
|
|
353
|
+
var e, t, n, r, i = O(-30), a, o = 1, s = Infinity, c = .81;
|
|
360
354
|
function l(n) {
|
|
361
|
-
var i, a = e.length, o = C(e,
|
|
355
|
+
var i, a = e.length, o = C(e, re, ie).visitAfter(d);
|
|
362
356
|
for (r = n, i = 0; i < a; ++i) t = e[i], o.visit(f);
|
|
363
357
|
}
|
|
364
358
|
function u() {
|
|
@@ -383,9 +377,9 @@ function se() {
|
|
|
383
377
|
function f(e, i, l, u) {
|
|
384
378
|
if (!e.value) return !0;
|
|
385
379
|
var d = e.x - t.x, f = e.y - t.y, p = u - i, m = d * d + f * f;
|
|
386
|
-
if (p * p / c < m) return m < s && (d === 0 && (d =
|
|
380
|
+
if (p * p / c < m) return m < s && (d === 0 && (d = k(n), m += d * d), f === 0 && (f = k(n), m += f * f), m < o && (m = Math.sqrt(o * m)), t.vx += d * e.value * r / m, t.vy += f * e.value * r / m), !0;
|
|
387
381
|
if (!(e.length || m >= s)) {
|
|
388
|
-
(e.data !== t || e.next) && (d === 0 && (d =
|
|
382
|
+
(e.data !== t || e.next) && (d === 0 && (d = k(n), m += d * d), f === 0 && (f = k(n), m += f * f), m < o && (m = Math.sqrt(o * m)));
|
|
389
383
|
do
|
|
390
384
|
e.data !== t && (p = a[e.data.index] * r / m, t.vx += d * p, t.vy += f * p);
|
|
391
385
|
while (e = e.next);
|
|
@@ -394,7 +388,7 @@ function se() {
|
|
|
394
388
|
return l.initialize = function(t, r) {
|
|
395
389
|
e = t, n = r, u();
|
|
396
390
|
}, l.strength = function(e) {
|
|
397
|
-
return arguments.length ? (i = typeof e == "function" ? e :
|
|
391
|
+
return arguments.length ? (i = typeof e == "function" ? e : O(+e), u(), l) : i;
|
|
398
392
|
}, l.distanceMin = function(e) {
|
|
399
393
|
return arguments.length ? (o = e * e, l) : Math.sqrt(o);
|
|
400
394
|
}, l.distanceMax = function(e) {
|
|
@@ -403,30 +397,9 @@ function se() {
|
|
|
403
397
|
return arguments.length ? (c = e * e, l) : Math.sqrt(c);
|
|
404
398
|
}, l;
|
|
405
399
|
}
|
|
406
|
-
// node_modules/d3-selection/src/sourceEvent.js
|
|
407
|
-
function ce(e) {
|
|
408
|
-
let t;
|
|
409
|
-
for (; t = e.sourceEvent;) e = t;
|
|
410
|
-
return e;
|
|
411
|
-
}
|
|
412
|
-
// node_modules/d3-selection/src/pointer.js
|
|
413
|
-
function P(e, t) {
|
|
414
|
-
if (e = ce(e), t === void 0 && (t = e.currentTarget), t) {
|
|
415
|
-
var n = t.ownerSVGElement || t;
|
|
416
|
-
if (n.createSVGPoint) {
|
|
417
|
-
var r = n.createSVGPoint();
|
|
418
|
-
return r.x = e.clientX, r.y = e.clientY, r = r.matrixTransform(t.getScreenCTM().inverse()), [r.x, r.y];
|
|
419
|
-
}
|
|
420
|
-
if (t.getBoundingClientRect) {
|
|
421
|
-
var i = t.getBoundingClientRect();
|
|
422
|
-
return [e.clientX - i.left - t.clientLeft, e.clientY - i.top - t.clientTop];
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
return [e.pageX, e.pageY];
|
|
426
|
-
}
|
|
427
400
|
// node_modules/d3-interpolate/src/zoom.js
|
|
428
401
|
var le = 1e-12;
|
|
429
|
-
function
|
|
402
|
+
function P(e) {
|
|
430
403
|
return ((e = Math.exp(e)) + 1 / e) / 2;
|
|
431
404
|
}
|
|
432
405
|
function ue(e) {
|
|
@@ -448,11 +421,11 @@ var fe = (function e(t, n, r) {
|
|
|
448
421
|
else {
|
|
449
422
|
var g = Math.sqrt(p), _ = (u * u - s * s + r * p) / (2 * s * n * g), v = (u * u - s * s - r * p) / (2 * u * n * g), y = Math.log(Math.sqrt(_ * _ + 1) - _);
|
|
450
423
|
h = (Math.log(Math.sqrt(v * v + 1) - v) - y) / t, m = function(e) {
|
|
451
|
-
var r = e * h, i =
|
|
424
|
+
var r = e * h, i = P(y), c = s / (n * g) * (i * de(t * r + y) - ue(y));
|
|
452
425
|
return [
|
|
453
426
|
a + c * d,
|
|
454
427
|
o + c * f,
|
|
455
|
-
s * i /
|
|
428
|
+
s * i / P(t * r + y)
|
|
456
429
|
];
|
|
457
430
|
};
|
|
458
431
|
}
|
|
@@ -462,31 +435,28 @@ var fe = (function e(t, n, r) {
|
|
|
462
435
|
var n = Math.max(.001, +t), r = n * n;
|
|
463
436
|
return e(n, r, r * r);
|
|
464
437
|
}, i;
|
|
465
|
-
})(Math.SQRT2, 2, 4), pe = { passive: !1 },
|
|
438
|
+
})(Math.SQRT2, 2, 4), pe = { passive: !1 }, F = {
|
|
466
439
|
capture: !0,
|
|
467
440
|
passive: !1
|
|
468
441
|
};
|
|
469
|
-
function
|
|
442
|
+
function I(e) {
|
|
470
443
|
e.stopImmediatePropagation();
|
|
471
444
|
}
|
|
472
|
-
function
|
|
445
|
+
function L(e) {
|
|
473
446
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
474
447
|
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
"onselectstart" in t ? n.on("selectstart.drag", R, I) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
|
|
448
|
+
function R(t) {
|
|
449
|
+
var n = t.document.documentElement, r = e(t).on("dragstart.drag", L, F);
|
|
450
|
+
"onselectstart" in n ? r.on("selectstart.drag", L, F) : (n.__noselect = n.style.MozUserSelect, n.style.MozUserSelect = "none");
|
|
479
451
|
}
|
|
480
|
-
function
|
|
481
|
-
var
|
|
482
|
-
|
|
452
|
+
function z(t, n) {
|
|
453
|
+
var r = t.document.documentElement, i = e(t).on("dragstart.drag", null);
|
|
454
|
+
n && (i.on("click.drag", L, F), setTimeout(function() {
|
|
483
455
|
i.on("click.drag", null);
|
|
484
|
-
}, 0)), "onselectstart" in
|
|
456
|
+
}, 0)), "onselectstart" in r ? i.on("selectstart.drag", null) : (r.style.MozUserSelect = r.__noselect, delete r.__noselect);
|
|
485
457
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
// node_modules/d3-drag/src/event.js
|
|
489
|
-
function H(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
|
|
458
|
+
var B = (e) => () => e;
|
|
459
|
+
function V(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
|
|
490
460
|
Object.defineProperties(this, {
|
|
491
461
|
type: {
|
|
492
462
|
value: e,
|
|
@@ -541,11 +511,10 @@ function H(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a,
|
|
|
541
511
|
_: { value: u }
|
|
542
512
|
});
|
|
543
513
|
}
|
|
544
|
-
|
|
514
|
+
V.prototype.on = function() {
|
|
545
515
|
var e = this._.on.apply(this._, arguments);
|
|
546
516
|
return e === this._ ? this : e;
|
|
547
517
|
};
|
|
548
|
-
// node_modules/d3-drag/src/drag.js
|
|
549
518
|
function me(e) {
|
|
550
519
|
return !e.ctrlKey && !e.button;
|
|
551
520
|
}
|
|
@@ -562,91 +531,90 @@ function _e() {
|
|
|
562
531
|
return navigator.maxTouchPoints || "ontouchstart" in this;
|
|
563
532
|
}
|
|
564
533
|
function ve() {
|
|
565
|
-
var
|
|
566
|
-
function
|
|
567
|
-
e.on("mousedown.drag",
|
|
568
|
-
}
|
|
569
|
-
function
|
|
570
|
-
if (!
|
|
571
|
-
var a =
|
|
572
|
-
a && (
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
function g(e) {
|
|
576
|
-
if (R(e), !d) {
|
|
577
|
-
var t = e.clientX - l, n = e.clientY - u;
|
|
578
|
-
d = t * t + n * n > p;
|
|
534
|
+
var n = me, i = he, a = ge, o = _e, s = {}, c = r("start", "drag", "end"), l = 0, u, d, f, p, m = 0;
|
|
535
|
+
function h(e) {
|
|
536
|
+
e.on("mousedown.drag", g).filter(o).on("touchstart.drag", y).on("touchmove.drag", b, pe).on("touchend.drag touchcancel.drag", x).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
537
|
+
}
|
|
538
|
+
function g(t, r) {
|
|
539
|
+
if (!p && n.call(this, t, r)) {
|
|
540
|
+
var a = S(this, i.call(this, t, r), t, r, "mouse");
|
|
541
|
+
a && (e(t.view).on("mousemove.drag", _, F).on("mouseup.drag", v, F), R(t.view), I(t), f = !1, u = t.clientX, d = t.clientY, a("start", t));
|
|
579
542
|
}
|
|
580
|
-
o.mouse("drag", e);
|
|
581
543
|
}
|
|
582
544
|
function _(e) {
|
|
583
|
-
|
|
545
|
+
if (L(e), !f) {
|
|
546
|
+
var t = e.clientX - u, n = e.clientY - d;
|
|
547
|
+
f = t * t + n * n > m;
|
|
548
|
+
}
|
|
549
|
+
s.mouse("drag", e);
|
|
584
550
|
}
|
|
585
|
-
function v(t
|
|
586
|
-
|
|
551
|
+
function v(t) {
|
|
552
|
+
e(t.view).on("mousemove.drag mouseup.drag", null), z(t.view, f), L(t), s.mouse("end", t);
|
|
587
553
|
}
|
|
588
|
-
function y(e) {
|
|
589
|
-
for (var
|
|
554
|
+
function y(e, t) {
|
|
555
|
+
if (n.call(this, e, t)) for (var r = e.changedTouches, a = i.call(this, e, t), o = r.length, s = 0, c; s < o; ++s) (c = S(this, a, e, t, r[s].identifier, r[s])) && (I(e), c("start", e, r[s]));
|
|
590
556
|
}
|
|
591
557
|
function b(e) {
|
|
558
|
+
for (var t = e.changedTouches, n = t.length, r = 0, i; r < n; ++r) (i = s[t[r].identifier]) && (L(e), i("drag", e, t[r]));
|
|
559
|
+
}
|
|
560
|
+
function x(e) {
|
|
592
561
|
var t = e.changedTouches, n = t.length, r, i;
|
|
593
|
-
for (
|
|
594
|
-
|
|
595
|
-
}, 500), r = 0; r < n; ++r) (i =
|
|
596
|
-
}
|
|
597
|
-
function
|
|
598
|
-
var
|
|
599
|
-
if ((
|
|
600
|
-
sourceEvent:
|
|
601
|
-
target:
|
|
602
|
-
identifier:
|
|
603
|
-
active:
|
|
604
|
-
x:
|
|
605
|
-
y:
|
|
562
|
+
for (p && clearTimeout(p), p = setTimeout(function() {
|
|
563
|
+
p = null;
|
|
564
|
+
}, 500), r = 0; r < n; ++r) (i = s[t[r].identifier]) && (I(e), i("end", e, t[r]));
|
|
565
|
+
}
|
|
566
|
+
function S(e, n, r, i, o, u) {
|
|
567
|
+
var d = c.copy(), f = t(u || r, n), p, m, g;
|
|
568
|
+
if ((g = a.call(e, new V("beforestart", {
|
|
569
|
+
sourceEvent: r,
|
|
570
|
+
target: h,
|
|
571
|
+
identifier: o,
|
|
572
|
+
active: l,
|
|
573
|
+
x: f[0],
|
|
574
|
+
y: f[1],
|
|
606
575
|
dx: 0,
|
|
607
576
|
dy: 0,
|
|
608
|
-
dispatch:
|
|
609
|
-
}),
|
|
610
|
-
var
|
|
611
|
-
switch (
|
|
577
|
+
dispatch: d
|
|
578
|
+
}), i)) != null) return p = g.x - f[0] || 0, m = g.y - f[1] || 0, function r(a, c, u) {
|
|
579
|
+
var _ = f, v;
|
|
580
|
+
switch (a) {
|
|
612
581
|
case "start":
|
|
613
|
-
o
|
|
582
|
+
s[o] = r, v = l++;
|
|
614
583
|
break;
|
|
615
|
-
case "end": delete o
|
|
616
|
-
case "drag":
|
|
584
|
+
case "end": delete s[o], --l;
|
|
585
|
+
case "drag": f = t(u || c, n), v = l;
|
|
617
586
|
}
|
|
618
|
-
|
|
619
|
-
sourceEvent:
|
|
620
|
-
subject:
|
|
621
|
-
target:
|
|
622
|
-
identifier:
|
|
623
|
-
active:
|
|
624
|
-
x:
|
|
625
|
-
y:
|
|
626
|
-
dx:
|
|
627
|
-
dy:
|
|
628
|
-
dispatch:
|
|
629
|
-
}),
|
|
587
|
+
d.call(a, e, new V(a, {
|
|
588
|
+
sourceEvent: c,
|
|
589
|
+
subject: g,
|
|
590
|
+
target: h,
|
|
591
|
+
identifier: o,
|
|
592
|
+
active: v,
|
|
593
|
+
x: f[0] + p,
|
|
594
|
+
y: f[1] + m,
|
|
595
|
+
dx: f[0] - _[0],
|
|
596
|
+
dy: f[1] - _[1],
|
|
597
|
+
dispatch: d
|
|
598
|
+
}), i);
|
|
630
599
|
};
|
|
631
600
|
}
|
|
632
|
-
return
|
|
633
|
-
return arguments.length ? (
|
|
634
|
-
},
|
|
635
|
-
return arguments.length ? (
|
|
636
|
-
},
|
|
637
|
-
return arguments.length ? (
|
|
638
|
-
},
|
|
639
|
-
return arguments.length ? (
|
|
640
|
-
},
|
|
641
|
-
var e =
|
|
642
|
-
return e ===
|
|
643
|
-
},
|
|
644
|
-
return arguments.length ? (
|
|
645
|
-
},
|
|
646
|
-
}
|
|
647
|
-
// node_modules/d3-zoom/
|
|
648
|
-
var
|
|
649
|
-
// node_modules/d3-zoom/src/event.js
|
|
601
|
+
return h.filter = function(e) {
|
|
602
|
+
return arguments.length ? (n = typeof e == "function" ? e : B(!!e), h) : n;
|
|
603
|
+
}, h.container = function(e) {
|
|
604
|
+
return arguments.length ? (i = typeof e == "function" ? e : B(e), h) : i;
|
|
605
|
+
}, h.subject = function(e) {
|
|
606
|
+
return arguments.length ? (a = typeof e == "function" ? e : B(e), h) : a;
|
|
607
|
+
}, h.touchable = function(e) {
|
|
608
|
+
return arguments.length ? (o = typeof e == "function" ? e : B(!!e), h) : o;
|
|
609
|
+
}, h.on = function() {
|
|
610
|
+
var e = c.on.apply(c, arguments);
|
|
611
|
+
return e === c ? h : e;
|
|
612
|
+
}, h.clickDistance = function(e) {
|
|
613
|
+
return arguments.length ? (m = (e = +e) * e, h) : Math.sqrt(m);
|
|
614
|
+
}, h;
|
|
615
|
+
}
|
|
616
|
+
// node_modules/d3-zoom/dist/d3-zoom.mjs
|
|
617
|
+
var H = (e) => () => e;
|
|
650
618
|
function ye(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
|
|
651
619
|
Object.defineProperties(this, {
|
|
652
620
|
type: {
|
|
@@ -672,17 +640,16 @@ function ye(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
|
|
|
672
640
|
_: { value: i }
|
|
673
641
|
});
|
|
674
642
|
}
|
|
675
|
-
|
|
676
|
-
function W(e, t, n) {
|
|
643
|
+
function U(e, t, n) {
|
|
677
644
|
this.k = e, this.x = t, this.y = n;
|
|
678
645
|
}
|
|
679
|
-
|
|
680
|
-
constructor:
|
|
646
|
+
U.prototype = {
|
|
647
|
+
constructor: U,
|
|
681
648
|
scale: function(e) {
|
|
682
|
-
return e === 1 ? this : new
|
|
649
|
+
return e === 1 ? this : new U(this.k * e, this.x, this.y);
|
|
683
650
|
},
|
|
684
651
|
translate: function(e, t) {
|
|
685
|
-
return e === 0 & t === 0 ? this : new
|
|
652
|
+
return e === 0 & t === 0 ? this : new U(this.k, this.x + this.k * e, this.y + this.k * t);
|
|
686
653
|
},
|
|
687
654
|
apply: function(e) {
|
|
688
655
|
return [e[0] * this.k + this.x, e[1] * this.k + this.y];
|
|
@@ -712,20 +679,18 @@ W.prototype = {
|
|
|
712
679
|
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
713
680
|
}
|
|
714
681
|
};
|
|
715
|
-
var
|
|
716
|
-
be.prototype =
|
|
682
|
+
var W = new U(1, 0, 0);
|
|
683
|
+
be.prototype = U.prototype;
|
|
717
684
|
function be(e) {
|
|
718
|
-
for (; !e.__zoom;) if (!(e = e.parentNode)) return
|
|
685
|
+
for (; !e.__zoom;) if (!(e = e.parentNode)) return W;
|
|
719
686
|
return e.__zoom;
|
|
720
687
|
}
|
|
721
|
-
|
|
722
|
-
function K(e) {
|
|
688
|
+
function G(e) {
|
|
723
689
|
e.stopImmediatePropagation();
|
|
724
690
|
}
|
|
725
|
-
function
|
|
691
|
+
function K(e) {
|
|
726
692
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
727
693
|
}
|
|
728
|
-
// node_modules/d3-zoom/src/zoom.js
|
|
729
694
|
function xe(e) {
|
|
730
695
|
return (!e.ctrlKey || e.type === "wheel") && !e.button;
|
|
731
696
|
}
|
|
@@ -733,8 +698,8 @@ function Se() {
|
|
|
733
698
|
var e = this;
|
|
734
699
|
return e instanceof SVGElement ? (e = e.ownerSVGElement || e, e.hasAttribute("viewBox") ? (e = e.viewBox.baseVal, [[e.x, e.y], [e.x + e.width, e.y + e.height]]) : [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]) : [[0, 0], [e.clientWidth, e.clientHeight]];
|
|
735
700
|
}
|
|
736
|
-
function
|
|
737
|
-
return this.__zoom ||
|
|
701
|
+
function q() {
|
|
702
|
+
return this.__zoom || W;
|
|
738
703
|
}
|
|
739
704
|
function Ce(e) {
|
|
740
705
|
return -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * (e.ctrlKey ? 10 : 1);
|
|
@@ -742,73 +707,73 @@ function Ce(e) {
|
|
|
742
707
|
function we() {
|
|
743
708
|
return navigator.maxTouchPoints || "ontouchstart" in this;
|
|
744
709
|
}
|
|
745
|
-
function
|
|
710
|
+
function Te(e, t, n) {
|
|
746
711
|
var r = e.invertX(t[0][0]) - n[0][0], i = e.invertX(t[1][0]) - n[1][0], a = e.invertY(t[0][1]) - n[0][1], o = e.invertY(t[1][1]) - n[1][1];
|
|
747
712
|
return e.translate(i > r ? (r + i) / 2 : Math.min(0, r) || Math.max(0, i), o > a ? (a + o) / 2 : Math.min(0, a) || Math.max(0, o));
|
|
748
713
|
}
|
|
749
|
-
function
|
|
750
|
-
var
|
|
751
|
-
function
|
|
752
|
-
e.property("__zoom",
|
|
714
|
+
function Ee() {
|
|
715
|
+
var n = xe, a = Se, o = Te, s = Ce, c = we, l = [0, Infinity], u = [[-Infinity, -Infinity], [Infinity, Infinity]], d = 250, f = fe, p = r("start", "zoom", "end"), m, h, g, _ = 500, v = 150, y = 0, b = 10;
|
|
716
|
+
function x(e) {
|
|
717
|
+
e.property("__zoom", q).on("wheel.zoom", O, { passive: !1 }).on("mousedown.zoom", k).on("dblclick.zoom", ee).filter(c).on("touchstart.zoom", A).on("touchmove.zoom", j).on("touchend.zoom touchcancel.zoom", M).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
753
718
|
}
|
|
754
|
-
|
|
719
|
+
x.transform = function(e, t, n, r) {
|
|
755
720
|
var i = e.selection ? e.selection() : e;
|
|
756
|
-
i.property("__zoom",
|
|
757
|
-
|
|
758
|
-
}) :
|
|
759
|
-
},
|
|
760
|
-
|
|
721
|
+
i.property("__zoom", q), e === i ? i.interrupt().each(function() {
|
|
722
|
+
E(this, arguments).event(r).start().zoom(null, typeof t == "function" ? t.apply(this, arguments) : t).end();
|
|
723
|
+
}) : T(e, t, n, r);
|
|
724
|
+
}, x.scaleBy = function(e, t, n, r) {
|
|
725
|
+
x.scaleTo(e, function() {
|
|
761
726
|
return this.__zoom.k * (typeof t == "function" ? t.apply(this, arguments) : t);
|
|
762
727
|
}, n, r);
|
|
763
|
-
},
|
|
764
|
-
|
|
765
|
-
var e =
|
|
766
|
-
return
|
|
728
|
+
}, x.scaleTo = function(e, t, n, r) {
|
|
729
|
+
x.transform(e, function() {
|
|
730
|
+
var e = a.apply(this, arguments), r = this.__zoom, i = n == null ? w(e) : typeof n == "function" ? n.apply(this, arguments) : n, s = r.invert(i), c = typeof t == "function" ? t.apply(this, arguments) : t;
|
|
731
|
+
return o(C(S(r, c), i, s), e, u);
|
|
767
732
|
}, n, r);
|
|
768
|
-
},
|
|
769
|
-
|
|
770
|
-
return
|
|
733
|
+
}, x.translateBy = function(e, t, n, r) {
|
|
734
|
+
x.transform(e, function() {
|
|
735
|
+
return o(this.__zoom.translate(typeof t == "function" ? t.apply(this, arguments) : t, typeof n == "function" ? n.apply(this, arguments) : n), a.apply(this, arguments), u);
|
|
771
736
|
}, null, r);
|
|
772
|
-
},
|
|
773
|
-
|
|
774
|
-
var e =
|
|
775
|
-
return
|
|
776
|
-
}, r,
|
|
737
|
+
}, x.translateTo = function(e, t, n, r, i) {
|
|
738
|
+
x.transform(e, function() {
|
|
739
|
+
var e = a.apply(this, arguments), i = this.__zoom, s = r == null ? w(e) : typeof r == "function" ? r.apply(this, arguments) : r;
|
|
740
|
+
return o(W.translate(s[0], s[1]).scale(i.k).translate(typeof t == "function" ? -t.apply(this, arguments) : -t, typeof n == "function" ? -n.apply(this, arguments) : -n), e, u);
|
|
741
|
+
}, r, i);
|
|
777
742
|
};
|
|
778
|
-
function
|
|
779
|
-
return t = Math.max(
|
|
743
|
+
function S(e, t) {
|
|
744
|
+
return t = Math.max(l[0], Math.min(l[1], t)), t === e.k ? e : new U(t, e.x, e.y);
|
|
780
745
|
}
|
|
781
|
-
function
|
|
746
|
+
function C(e, t, n) {
|
|
782
747
|
var r = t[0] - n[0] * e.k, i = t[1] - n[1] * e.k;
|
|
783
|
-
return r === e.x && i === e.y ? e : new
|
|
748
|
+
return r === e.x && i === e.y ? e : new U(e.k, r, i);
|
|
784
749
|
}
|
|
785
|
-
function
|
|
750
|
+
function w(e) {
|
|
786
751
|
return [(+e[0][0] + +e[1][0]) / 2, (+e[0][1] + +e[1][1]) / 2];
|
|
787
752
|
}
|
|
788
|
-
function
|
|
753
|
+
function T(e, t, n, r) {
|
|
789
754
|
e.on("start.zoom", function() {
|
|
790
|
-
|
|
755
|
+
E(this, arguments).event(r).start();
|
|
791
756
|
}).on("interrupt.zoom end.zoom", function() {
|
|
792
|
-
|
|
757
|
+
E(this, arguments).event(r).end();
|
|
793
758
|
}).tween("zoom", function() {
|
|
794
|
-
var e = this,
|
|
759
|
+
var e = this, i = arguments, o = E(e, i).event(r), s = a.apply(e, i), c = n == null ? w(s) : typeof n == "function" ? n.apply(e, i) : n, l = Math.max(s[1][0] - s[0][0], s[1][1] - s[0][1]), u = e.__zoom, d = typeof t == "function" ? t.apply(e, i) : t, p = f(u.invert(c).concat(l / u.k), d.invert(c).concat(l / d.k));
|
|
795
760
|
return function(e) {
|
|
796
|
-
if (e === 1) e =
|
|
761
|
+
if (e === 1) e = d;
|
|
797
762
|
else {
|
|
798
763
|
var t = p(e), n = l / t[2];
|
|
799
|
-
e = new
|
|
764
|
+
e = new U(n, c[0] - t[0] * n, c[1] - t[1] * n);
|
|
800
765
|
}
|
|
801
766
|
o.zoom(null, e);
|
|
802
767
|
};
|
|
803
768
|
});
|
|
804
769
|
}
|
|
805
|
-
function
|
|
806
|
-
return !n && e.__zooming || new
|
|
770
|
+
function E(e, t, n) {
|
|
771
|
+
return !n && e.__zooming || new D(e, t);
|
|
807
772
|
}
|
|
808
|
-
function
|
|
809
|
-
this.that = e, this.args = t, this.active = 0, this.sourceEvent = null, this.extent =
|
|
773
|
+
function D(e, t) {
|
|
774
|
+
this.that = e, this.args = t, this.active = 0, this.sourceEvent = null, this.extent = a.apply(e, t), this.taps = 0;
|
|
810
775
|
}
|
|
811
|
-
|
|
776
|
+
D.prototype = {
|
|
812
777
|
event: function(e) {
|
|
813
778
|
return e && (this.sourceEvent = e), this;
|
|
814
779
|
},
|
|
@@ -821,175 +786,227 @@ function Te() {
|
|
|
821
786
|
end: function() {
|
|
822
787
|
return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
|
|
823
788
|
},
|
|
824
|
-
emit: function(
|
|
825
|
-
var
|
|
826
|
-
|
|
789
|
+
emit: function(t) {
|
|
790
|
+
var n = e(this.that).datum();
|
|
791
|
+
p.call(t, this.that, new ye(t, {
|
|
827
792
|
sourceEvent: this.sourceEvent,
|
|
828
|
-
target:
|
|
829
|
-
type: e,
|
|
793
|
+
target: x,
|
|
830
794
|
transform: this.that.__zoom,
|
|
831
|
-
dispatch:
|
|
832
|
-
}),
|
|
795
|
+
dispatch: p
|
|
796
|
+
}), n);
|
|
833
797
|
}
|
|
834
798
|
};
|
|
835
|
-
function
|
|
836
|
-
if (!
|
|
837
|
-
var
|
|
838
|
-
if (
|
|
839
|
-
else if (
|
|
840
|
-
else
|
|
841
|
-
|
|
842
|
-
function
|
|
843
|
-
|
|
799
|
+
function O(e, ...r) {
|
|
800
|
+
if (!n.apply(this, arguments)) return;
|
|
801
|
+
var a = E(this, r).event(e), c = this.__zoom, d = Math.max(l[0], Math.min(l[1], c.k * 2 ** s.apply(this, arguments))), f = t(e);
|
|
802
|
+
if (a.wheel) (a.mouse[0][0] !== f[0] || a.mouse[0][1] !== f[1]) && (a.mouse[1] = c.invert(a.mouse[0] = f)), clearTimeout(a.wheel);
|
|
803
|
+
else if (c.k === d) return;
|
|
804
|
+
else a.mouse = [f, c.invert(f)], i(this), a.start();
|
|
805
|
+
K(e), a.wheel = setTimeout(p, v), a.zoom("mouse", o(C(S(c, d), a.mouse[0], a.mouse[1]), a.extent, u));
|
|
806
|
+
function p() {
|
|
807
|
+
a.wheel = null, a.end();
|
|
844
808
|
}
|
|
845
809
|
}
|
|
846
|
-
function
|
|
847
|
-
if (
|
|
848
|
-
var
|
|
849
|
-
|
|
850
|
-
function
|
|
851
|
-
if (
|
|
852
|
-
var
|
|
853
|
-
|
|
810
|
+
function k(r, ...a) {
|
|
811
|
+
if (g || !n.apply(this, arguments)) return;
|
|
812
|
+
var s = r.currentTarget, c = E(this, a, !0).event(r), l = e(r.view).on("mousemove.zoom", m, !0).on("mouseup.zoom", h, !0), d = t(r, s), f = r.clientX, p = r.clientY;
|
|
813
|
+
R(r.view), G(r), c.mouse = [d, this.__zoom.invert(d)], i(this), c.start();
|
|
814
|
+
function m(e) {
|
|
815
|
+
if (K(e), !c.moved) {
|
|
816
|
+
var n = e.clientX - f, r = e.clientY - p;
|
|
817
|
+
c.moved = n * n + r * r > y;
|
|
854
818
|
}
|
|
855
|
-
|
|
819
|
+
c.event(e).zoom("mouse", o(C(c.that.__zoom, c.mouse[0] = t(e, s), c.mouse[1]), c.extent, u));
|
|
856
820
|
}
|
|
857
|
-
function
|
|
858
|
-
|
|
821
|
+
function h(e) {
|
|
822
|
+
l.on("mousemove.zoom mouseup.zoom", null), z(e.view, c.moved), K(e), c.event(e).end();
|
|
859
823
|
}
|
|
860
824
|
}
|
|
861
|
-
function
|
|
862
|
-
if (
|
|
863
|
-
var
|
|
864
|
-
|
|
825
|
+
function ee(r, ...i) {
|
|
826
|
+
if (n.apply(this, arguments)) {
|
|
827
|
+
var s = this.__zoom, c = t(r.changedTouches ? r.changedTouches[0] : r, this), l = s.invert(c), f = s.k * (r.shiftKey ? .5 : 2), p = o(C(S(s, f), c, l), a.apply(this, i), u);
|
|
828
|
+
K(r), d > 0 ? e(this).transition().duration(d).call(T, p, c, r) : e(this).call(x.transform, p, c, r);
|
|
865
829
|
}
|
|
866
830
|
}
|
|
867
|
-
function A(
|
|
868
|
-
if (
|
|
869
|
-
var
|
|
870
|
-
for (
|
|
871
|
-
|
|
872
|
-
this.__zoom.invert(
|
|
873
|
-
|
|
874
|
-
],
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
},
|
|
831
|
+
function A(e, ...r) {
|
|
832
|
+
if (n.apply(this, arguments)) {
|
|
833
|
+
var a = e.touches, o = a.length, s = E(this, r, e.changedTouches.length === o).event(e), c, l, u, d;
|
|
834
|
+
for (G(e), l = 0; l < o; ++l) u = a[l], d = t(u, this), d = [
|
|
835
|
+
d,
|
|
836
|
+
this.__zoom.invert(d),
|
|
837
|
+
u.identifier
|
|
838
|
+
], s.touch0 ? !s.touch1 && s.touch0[2] !== d[2] && (s.touch1 = d, s.taps = 0) : (s.touch0 = d, c = !0, s.taps = 1 + !!m);
|
|
839
|
+
m &&= clearTimeout(m), c && (s.taps < 2 && (h = d[0], m = setTimeout(function() {
|
|
840
|
+
m = null;
|
|
841
|
+
}, _)), i(this), s.start());
|
|
878
842
|
}
|
|
879
843
|
}
|
|
880
|
-
function j(e, ...
|
|
844
|
+
function j(e, ...n) {
|
|
881
845
|
if (this.__zooming) {
|
|
882
|
-
var
|
|
883
|
-
for (
|
|
884
|
-
if (
|
|
885
|
-
var
|
|
886
|
-
|
|
887
|
-
} else if (
|
|
846
|
+
var r = E(this, n).event(e), i = e.changedTouches, a = i.length, s, c, l, d;
|
|
847
|
+
for (K(e), s = 0; s < a; ++s) c = i[s], l = t(c, this), r.touch0 && r.touch0[2] === c.identifier ? r.touch0[0] = l : r.touch1 && r.touch1[2] === c.identifier && (r.touch1[0] = l);
|
|
848
|
+
if (c = r.that.__zoom, r.touch1) {
|
|
849
|
+
var f = r.touch0[0], p = r.touch0[1], m = r.touch1[0], h = r.touch1[1], g = (g = m[0] - f[0]) * g + (g = m[1] - f[1]) * g, _ = (_ = h[0] - p[0]) * _ + (_ = h[1] - p[1]) * _;
|
|
850
|
+
c = S(c, Math.sqrt(g / _)), l = [(f[0] + m[0]) / 2, (f[1] + m[1]) / 2], d = [(p[0] + h[0]) / 2, (p[1] + h[1]) / 2];
|
|
851
|
+
} else if (r.touch0) l = r.touch0[0], d = r.touch0[1];
|
|
888
852
|
else return;
|
|
889
|
-
|
|
853
|
+
r.zoom("touch", o(C(c, l, d), r.extent, u));
|
|
890
854
|
}
|
|
891
855
|
}
|
|
892
|
-
function M(
|
|
856
|
+
function M(n, ...r) {
|
|
893
857
|
if (this.__zooming) {
|
|
894
|
-
var
|
|
895
|
-
for (
|
|
896
|
-
|
|
897
|
-
},
|
|
898
|
-
if (
|
|
899
|
-
else if (
|
|
900
|
-
var
|
|
901
|
-
|
|
858
|
+
var i = E(this, r).event(n), a = n.changedTouches, o = a.length, s, c;
|
|
859
|
+
for (G(n), g && clearTimeout(g), g = setTimeout(function() {
|
|
860
|
+
g = null;
|
|
861
|
+
}, _), s = 0; s < o; ++s) c = a[s], i.touch0 && i.touch0[2] === c.identifier ? delete i.touch0 : i.touch1 && i.touch1[2] === c.identifier && delete i.touch1;
|
|
862
|
+
if (i.touch1 && !i.touch0 && (i.touch0 = i.touch1, delete i.touch1), i.touch0) i.touch0[1] = this.__zoom.invert(i.touch0[0]);
|
|
863
|
+
else if (i.end(), i.taps === 2 && (c = t(c, this), Math.hypot(h[0] - c[0], h[1] - c[1]) < b)) {
|
|
864
|
+
var l = e(this).on("dblclick.zoom");
|
|
865
|
+
l && l.apply(this, arguments);
|
|
902
866
|
}
|
|
903
867
|
}
|
|
904
868
|
}
|
|
905
|
-
return
|
|
906
|
-
return arguments.length ? (
|
|
907
|
-
},
|
|
908
|
-
return arguments.length ? (
|
|
909
|
-
},
|
|
910
|
-
return arguments.length ? (
|
|
911
|
-
},
|
|
912
|
-
return arguments.length ? (
|
|
913
|
-
},
|
|
914
|
-
return arguments.length ? (
|
|
915
|
-
},
|
|
916
|
-
return arguments.length ? (
|
|
917
|
-
},
|
|
918
|
-
return arguments.length ? (
|
|
919
|
-
},
|
|
920
|
-
return arguments.length ? (
|
|
921
|
-
},
|
|
922
|
-
return arguments.length ? (
|
|
923
|
-
},
|
|
924
|
-
var e =
|
|
925
|
-
return e ===
|
|
926
|
-
},
|
|
927
|
-
return arguments.length ? (
|
|
928
|
-
},
|
|
929
|
-
return arguments.length ? (
|
|
930
|
-
},
|
|
869
|
+
return x.wheelDelta = function(e) {
|
|
870
|
+
return arguments.length ? (s = typeof e == "function" ? e : H(+e), x) : s;
|
|
871
|
+
}, x.filter = function(e) {
|
|
872
|
+
return arguments.length ? (n = typeof e == "function" ? e : H(!!e), x) : n;
|
|
873
|
+
}, x.touchable = function(e) {
|
|
874
|
+
return arguments.length ? (c = typeof e == "function" ? e : H(!!e), x) : c;
|
|
875
|
+
}, x.extent = function(e) {
|
|
876
|
+
return arguments.length ? (a = typeof e == "function" ? e : H([[+e[0][0], +e[0][1]], [+e[1][0], +e[1][1]]]), x) : a;
|
|
877
|
+
}, x.scaleExtent = function(e) {
|
|
878
|
+
return arguments.length ? (l[0] = +e[0], l[1] = +e[1], x) : [l[0], l[1]];
|
|
879
|
+
}, x.translateExtent = function(e) {
|
|
880
|
+
return arguments.length ? (u[0][0] = +e[0][0], u[1][0] = +e[1][0], u[0][1] = +e[0][1], u[1][1] = +e[1][1], x) : [[u[0][0], u[0][1]], [u[1][0], u[1][1]]];
|
|
881
|
+
}, x.constrain = function(e) {
|
|
882
|
+
return arguments.length ? (o = e, x) : o;
|
|
883
|
+
}, x.duration = function(e) {
|
|
884
|
+
return arguments.length ? (d = +e, x) : d;
|
|
885
|
+
}, x.interpolate = function(e) {
|
|
886
|
+
return arguments.length ? (f = e, x) : f;
|
|
887
|
+
}, x.on = function() {
|
|
888
|
+
var e = p.on.apply(p, arguments);
|
|
889
|
+
return e === p ? x : e;
|
|
890
|
+
}, x.clickDistance = function(e) {
|
|
891
|
+
return arguments.length ? (y = (e = +e) * e, x) : Math.sqrt(y);
|
|
892
|
+
}, x.tapDistance = function(e) {
|
|
893
|
+
return arguments.length ? (b = +e, x) : b;
|
|
894
|
+
}, x;
|
|
931
895
|
}
|
|
932
896
|
// src/networkDiagram.ts
|
|
933
|
-
var
|
|
897
|
+
var De = -300, Oe = 100, J = 640, Y = 480, ke = 180, Ae = 1, je = 2, Me = 14, X = .25, Ne = 4, Z = {
|
|
934
898
|
linkStroke: "#9ca3af",
|
|
935
|
-
nodeFill: "#2563eb",
|
|
936
|
-
nodeFillHovered: "#3b82f6",
|
|
937
899
|
nodeFillSelected: "#f59e0b",
|
|
938
|
-
nodeStroke: "#1e40af",
|
|
939
|
-
nodeStrokeHovered: "#1d4ed8",
|
|
940
900
|
nodeStrokeSelected: "#b45309",
|
|
941
901
|
nodeText: "#ffffff"
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
902
|
+
}, Pe = [
|
|
903
|
+
{
|
|
904
|
+
fill: "#475569",
|
|
905
|
+
fillHovered: "#64748b",
|
|
906
|
+
radius: 26,
|
|
907
|
+
stroke: "#1e293b",
|
|
908
|
+
strokeHovered: "#334155"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
fill: "#2563eb",
|
|
912
|
+
fillHovered: "#3b82f6",
|
|
913
|
+
radius: 20,
|
|
914
|
+
stroke: "#1e40af",
|
|
915
|
+
strokeHovered: "#1d4ed8"
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
fill: "#0d9488",
|
|
919
|
+
fillHovered: "#14b8a6",
|
|
920
|
+
radius: 14,
|
|
921
|
+
stroke: "#115e59",
|
|
922
|
+
strokeHovered: "#0f766e"
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
fill: "#7c3aed",
|
|
926
|
+
fillHovered: "#8b5cf6",
|
|
927
|
+
radius: 10,
|
|
928
|
+
stroke: "#5b21b6",
|
|
929
|
+
strokeHovered: "#6d28d9"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
fill: "#db2777",
|
|
933
|
+
fillHovered: "#ec4899",
|
|
934
|
+
radius: 8,
|
|
935
|
+
stroke: "#9d174d",
|
|
936
|
+
strokeHovered: "#be185d"
|
|
937
|
+
}
|
|
938
|
+
];
|
|
939
|
+
function Fe(t, n, r = {}) {
|
|
940
|
+
let i = n.clientWidth || J, a = n.clientHeight || Y, o = t.nodes.map((e) => ({ ...e })), s = t.links.map((e) => ({ ...e })), c = Math.min(i, a) * .22;
|
|
941
|
+
for (let [e, t] of o.entries()) {
|
|
942
|
+
let n = e / o.length * Math.PI * 2;
|
|
943
|
+
t.x = i / 2 + Math.cos(n) * c, t.y = a / 2 + Math.sin(n) * c;
|
|
944
|
+
}
|
|
945
|
+
let l = se(o).force("link", j(s).id((e) => e.id).distance(r.linkDistance ?? Oe)).force("charge", ce().strength(r.chargeStrength ?? De)).force("center", D(i / 2, a / 2)), u = e(n).append("svg").attr("width", i).attr("height", a).attr("viewBox", `0 0 ${String(i)} ${String(a)}`).style("touch-action", "none"), d = u.append("g"), f = d.selectAll("line").data(s).join("line").attr("stroke", Z.linkStroke).attr("stroke-width", 2), p = d.selectAll("g").data(o).join("g").style("cursor", "pointer");
|
|
946
|
+
p.append("circle").attr("r", (e) => Q(e).radius).attr("fill", (e) => Q(e).fill).attr("stroke", (e) => Q(e).stroke).attr("stroke-width", 2), p.append("text").text((e) => e.label ?? e.id).attr("text-anchor", "middle").attr("dy", (e) => e.label == null ? 4 : Q(e).radius + Me).attr("font-size", (e) => e.label == null ? null : 12).attr("fill", (e) => e.label == null ? Z.nodeText : "currentColor");
|
|
947
|
+
let m = null, h = null, g = () => {
|
|
948
|
+
p.selectAll("circle").attr("fill", (e) => e.id === m ? Z.nodeFillSelected : e.id === h ? Q(e).fillHovered : Q(e).fill).attr("stroke", (e) => e.id === m ? Z.nodeStrokeSelected : e.id === h ? Q(e).strokeHovered : Q(e).stroke).attr("stroke-width", (e) => e.id === m ? 3 : 2).attr("r", (e) => {
|
|
949
|
+
let t = e.id === m || e.id === h;
|
|
950
|
+
return Q(e).radius + (t ? je : 0);
|
|
951
|
+
});
|
|
953
952
|
};
|
|
954
|
-
|
|
955
|
-
|
|
953
|
+
p.on("mouseenter", (e, t) => {
|
|
954
|
+
h = t.id, g();
|
|
956
955
|
}).on("mouseleave", (e, t) => {
|
|
957
|
-
|
|
958
|
-
}).on("click", (e,
|
|
959
|
-
e.stopPropagation(),
|
|
960
|
-
}),
|
|
961
|
-
|
|
956
|
+
h === t.id && (h = null), g();
|
|
957
|
+
}).on("click", (e, n) => {
|
|
958
|
+
e.stopPropagation(), m = m === n.id ? null : n.id, g(), r.onNodeClick?.($(t.nodes.find((e) => e.id === n.id)));
|
|
959
|
+
}), u.on("click", () => {
|
|
960
|
+
m = null, g();
|
|
962
961
|
});
|
|
963
|
-
let
|
|
964
|
-
|
|
962
|
+
let _ = Ee().scaleExtent([X, Ne]).on("zoom", (e) => {
|
|
963
|
+
d.attr("transform", e.transform.toString());
|
|
965
964
|
});
|
|
966
|
-
|
|
967
|
-
let
|
|
968
|
-
|
|
965
|
+
u.call(_).on("dblclick.zoom", null);
|
|
966
|
+
let v = (e, t) => typeof e == "object" ? e[t] ?? 0 : 0, y = () => {
|
|
967
|
+
f.attr("x1", (e) => v(e.source, "x")).attr("y1", (e) => v(e.source, "y")).attr("x2", (e) => v(e.target, "x")).attr("y2", (e) => v(e.target, "y")), p.attr("transform", (e) => `translate(${String(e.x ?? 0)},${String(e.y ?? 0)})`);
|
|
968
|
+
}, b = () => {
|
|
969
|
+
if (o.length === 0) return;
|
|
970
|
+
let e = o.map((e) => e.x ?? 0), t = o.map((e) => e.y ?? 0), [r, i, a, s] = [
|
|
971
|
+
Math.min(...e),
|
|
972
|
+
Math.max(...e),
|
|
973
|
+
Math.min(...t),
|
|
974
|
+
Math.max(...t)
|
|
975
|
+
], c = n.clientWidth || J, l = n.clientHeight || Y, d = Math.max(X, Math.min(1, c / (i - r + 140), l / (s - a + 140))), f = W.translate(c / 2, l / 2).scale(d).translate(-(r + i) / 2, -(a + s) / 2);
|
|
976
|
+
u.call((e) => {
|
|
977
|
+
_.transform(e, f);
|
|
978
|
+
});
|
|
969
979
|
};
|
|
970
|
-
|
|
980
|
+
l.stop(), p.call(ve().on("start", (e, t) => {
|
|
971
981
|
e.sourceEvent?.stopPropagation(), t.fx = t.x, t.fy = t.y;
|
|
972
982
|
}).on("drag", (e, t) => {
|
|
973
|
-
t.x = e.x, t.y = e.y, t.fx = e.x, t.fy = e.y,
|
|
983
|
+
t.x = e.x, t.y = e.y, t.fx = e.x, t.fy = e.y, y();
|
|
974
984
|
}).on("end", (e, t) => {
|
|
975
985
|
t.fx = null, t.fy = null;
|
|
976
|
-
})),
|
|
977
|
-
let x =
|
|
986
|
+
})), y();
|
|
987
|
+
let x = u.node();
|
|
978
988
|
if (x == null) throw Error("Failed to create network diagram SVG element.");
|
|
979
989
|
return {
|
|
980
990
|
destroy: () => {
|
|
981
|
-
|
|
991
|
+
l.stop(), u.remove();
|
|
982
992
|
},
|
|
983
993
|
resize: () => {
|
|
984
|
-
let e =
|
|
985
|
-
|
|
994
|
+
let e = n.clientWidth || J, t = n.clientHeight || Y;
|
|
995
|
+
u.attr("width", e).attr("height", t).attr("viewBox", `0 0 ${String(e)} ${String(t)}`), l.force("center", D(e / 2, t / 2));
|
|
986
996
|
},
|
|
987
997
|
svg: x,
|
|
988
998
|
triggerAutoLayout: () => {
|
|
989
|
-
|
|
990
|
-
for (let e = 0; e <
|
|
991
|
-
|
|
999
|
+
l.alpha(1);
|
|
1000
|
+
for (let e = 0; e < ke; e += 1) l.tick();
|
|
1001
|
+
l.stop(), y(), r.fitsView === !0 && b();
|
|
992
1002
|
}
|
|
993
1003
|
};
|
|
994
1004
|
}
|
|
995
|
-
|
|
1005
|
+
function Q(e) {
|
|
1006
|
+
return $(Pe[Math.max(0, Math.min(e.level ?? Ae, Pe.length - 1))]);
|
|
1007
|
+
}
|
|
1008
|
+
function $(e) {
|
|
1009
|
+
if (e === void 0) throw Error("Expected a value in the network diagram.");
|
|
1010
|
+
return e;
|
|
1011
|
+
}
|
|
1012
|
+
export { Fe as renderNetworkDiagram };
|