@yuneta/gobj-ui 7.23.155 → 7.23.157
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 +5 -48
- package/dist/gobj-ui.cjs.js +21 -694
- package/dist/gobj-ui.es.js +22 -695
- package/package.json +1 -1
- package/src/c_g6_nodes_tree.js +10 -148
- package/src/c_yui_treedb_graph.js +0 -2
- package/src/treedb_elbow.js +13 -344
- package/src/treedb_elbow.test.js +1 -236
- package/src/treedb_layout.js +0 -390
- package/src/treedb_layout.test.js +1 -174
package/dist/gobj-ui.es.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createJSONEditor } from "vanilla-jsoneditor";
|
|
|
6
6
|
import { TabulatorFull } from "tabulator-tables";
|
|
7
7
|
import * as maplibregl from "maplibre-gl";
|
|
8
8
|
import uPlot from "uplot";
|
|
9
|
-
import { BaseLayout, BrushSelect, CanvasEvent, Circle, CommonEvent,
|
|
9
|
+
import { BaseLayout, BrushSelect, CanvasEvent, Circle, CommonEvent, DragCanvas, EdgeEvent, ExtensionCategory, Graph, HTML, HistoryEvent, NodeEvent, Polyline, Toolbar, ZoomCanvas, register } from "@antv/g6";
|
|
10
10
|
//#region \0rolldown/runtime.js
|
|
11
11
|
var __create = Object.create;
|
|
12
12
|
var __defProp = Object.defineProperty;
|
|
@@ -29309,301 +29309,6 @@ function tidy_tree_lr(nodes, edges, o) {
|
|
|
29309
29309
|
}
|
|
29310
29310
|
return pos;
|
|
29311
29311
|
}
|
|
29312
|
-
/************************************************************
|
|
29313
|
-
* The compact tree.
|
|
29314
|
-
*
|
|
29315
|
-
* The tidy tree above gives every subtree its whole BLOCK: open a
|
|
29316
|
-
* hall with twenty-four devices and its block widens, and with it
|
|
29317
|
-
* every block above it, so the siblings of its ancestors move apart
|
|
29318
|
-
* at depths where nothing of theirs touches. This one keeps the
|
|
29319
|
-
* CONTOUR of each subtree instead -- its outline on each side, depth
|
|
29320
|
-
* by depth -- and slides every sibling against the outline of the
|
|
29321
|
-
* ones before it. A folded region then sits as close to an open one
|
|
29322
|
-
* as their cards allow at each depth, which is what a folded treedb
|
|
29323
|
-
* is: one branch open among closed ones.
|
|
29324
|
-
*
|
|
29325
|
-
* Same spanning tree, same order, same rows as the tidy tree: only
|
|
29326
|
-
* the packing across the depths differs, so switching between the
|
|
29327
|
-
* two moves cards sideways and never reorders them.
|
|
29328
|
-
*
|
|
29329
|
-
* And a run of three or more LEAF children -- a hall's devices, a
|
|
29330
|
-
* region's places when none is open -- is STACKED: two columns
|
|
29331
|
-
* under the parent with a corridor between them, row after row.
|
|
29332
|
-
* That is what makes it compact when a whole level is open, where
|
|
29333
|
-
* the contour alone gains nothing: every parent needed the whole
|
|
29334
|
-
* row of its children beside it. The tree grows taller instead of
|
|
29335
|
-
* wider. Its elbow edges run down the corridor (elbow_combs).
|
|
29336
|
-
*
|
|
29337
|
-
* The contour arithmetic is Moen's ("Drawing dynamic trees", IEEE
|
|
29338
|
-
* Software, 1990) in the form mxGraph gave it in mxCompactTreeLayout
|
|
29339
|
-
* -- Copyright (c) 2006-2015 JGraph Ltd, Apache License 2.0 -- read in
|
|
29340
|
-
* maxGraph's CompactTreeLayout.ts: leaf, join, merge, offset and
|
|
29341
|
-
* bridge below follow that form. What is ours: it runs on the
|
|
29342
|
-
* spanning tree of a FOREST, every depth is a row as wide as its
|
|
29343
|
-
* widest card (mxGraph's `alignRanks`), several roots sit side by
|
|
29344
|
-
* side, and there is no recursion.
|
|
29345
|
-
************************************************************/
|
|
29346
|
-
function layout_compact(nodes, edges, opts) {
|
|
29347
|
-
let o = Object.assign({}, DEFAULTS, opts || {});
|
|
29348
|
-
if (o.direction === "LR") return compact_tree_lr(nodes, edges, o);
|
|
29349
|
-
let lr = compact_tree_lr(nodes.map((n) => Object.assign({}, n, {
|
|
29350
|
-
w: n.h,
|
|
29351
|
-
h: n.w
|
|
29352
|
-
})), edges, o);
|
|
29353
|
-
let pos = /* @__PURE__ */ new Map();
|
|
29354
|
-
for (let [id, p] of lr) pos.set(id, {
|
|
29355
|
-
x: p.y,
|
|
29356
|
-
y: p.x
|
|
29357
|
-
});
|
|
29358
|
-
return pos;
|
|
29359
|
-
}
|
|
29360
|
-
function contour_line(dx, dy, next) {
|
|
29361
|
-
return {
|
|
29362
|
-
dx,
|
|
29363
|
-
dy,
|
|
29364
|
-
next: next || null
|
|
29365
|
-
};
|
|
29366
|
-
}
|
|
29367
|
-
function contour_offset(p1, p2, a1, a2, b1, b2) {
|
|
29368
|
-
if (b1 <= p1 || p1 + a1 <= 0) return 0;
|
|
29369
|
-
let d;
|
|
29370
|
-
if (b1 * a2 - a1 * b2 > 0) {
|
|
29371
|
-
if (p1 < 0) d = p1 * a2 / a1 - p2;
|
|
29372
|
-
else if (p1 > 0) d = p1 * b2 / b1 - p2;
|
|
29373
|
-
else d = -p2;
|
|
29374
|
-
} else if (b1 < p1 + a1) d = b2 - (p2 + (b1 - p1) * a2 / a1);
|
|
29375
|
-
else if (b1 > p1 + a1) d = (a1 + p1) * b2 / b1 - (p2 + a2);
|
|
29376
|
-
else d = b2 - (p2 + a2);
|
|
29377
|
-
return d > 0 ? d : 0;
|
|
29378
|
-
}
|
|
29379
|
-
function contour_bridge(line1, x1, y1, line2, x2, y2) {
|
|
29380
|
-
let dx = x2 + line2.dx - x1;
|
|
29381
|
-
let dy = line2.dx === 0 ? line2.dy : dx * line2.dy / line2.dx;
|
|
29382
|
-
let r = contour_line(dx, dy, line2.next);
|
|
29383
|
-
line1.next = contour_line(0, y2 + line2.dy - dy - y1, r);
|
|
29384
|
-
return r;
|
|
29385
|
-
}
|
|
29386
|
-
function contour_merge(p1, p2) {
|
|
29387
|
-
let x = 0;
|
|
29388
|
-
let y = 0;
|
|
29389
|
-
let total = 0;
|
|
29390
|
-
let upper = p1.lower_head;
|
|
29391
|
-
let lower = p2.upper_head;
|
|
29392
|
-
while (lower && upper) {
|
|
29393
|
-
let d = contour_offset(x, y, lower.dx, lower.dy, upper.dx, upper.dy);
|
|
29394
|
-
y += d;
|
|
29395
|
-
total += d;
|
|
29396
|
-
if (x + lower.dx <= upper.dx) {
|
|
29397
|
-
x += lower.dx;
|
|
29398
|
-
y += lower.dy;
|
|
29399
|
-
lower = lower.next;
|
|
29400
|
-
} else {
|
|
29401
|
-
x -= upper.dx;
|
|
29402
|
-
y -= upper.dy;
|
|
29403
|
-
upper = upper.next;
|
|
29404
|
-
}
|
|
29405
|
-
}
|
|
29406
|
-
if (lower) {
|
|
29407
|
-
let b = contour_bridge(p1.upper_tail, 0, 0, lower, x, y);
|
|
29408
|
-
p1.upper_tail = b.next ? p2.upper_tail : b;
|
|
29409
|
-
p1.lower_tail = p2.lower_tail;
|
|
29410
|
-
} else {
|
|
29411
|
-
let b = contour_bridge(p2.lower_tail, x, y, upper, 0, 0);
|
|
29412
|
-
if (!b.next) p1.lower_tail = b;
|
|
29413
|
-
}
|
|
29414
|
-
p1.lower_head = p2.lower_head;
|
|
29415
|
-
return total;
|
|
29416
|
-
}
|
|
29417
|
-
function stack_trunk_width(k) {
|
|
29418
|
-
let lanes = Math.max(0, k - 2);
|
|
29419
|
-
return Math.max(36, 20 + Math.max(0, lanes - 1) * 6);
|
|
29420
|
-
}
|
|
29421
|
-
function stack_geometry(t, st, col_x, col_w) {
|
|
29422
|
-
let d = st.depth;
|
|
29423
|
-
let k = st.ids.length;
|
|
29424
|
-
let rows = Math.ceil(k / 2);
|
|
29425
|
-
let side = [0, 0];
|
|
29426
|
-
let row_len = [];
|
|
29427
|
-
for (let i = 0; i < k; i++) {
|
|
29428
|
-
let n = t.by_id.get(st.ids[i]);
|
|
29429
|
-
let r = Math.floor(i / 2);
|
|
29430
|
-
side[i % 2] = Math.max(side[i % 2], n.h);
|
|
29431
|
-
row_len[r] = Math.max(row_len[r] || 0, n.w);
|
|
29432
|
-
}
|
|
29433
|
-
row_len[0] = col_w[d];
|
|
29434
|
-
let trunk = stack_trunk_width(k);
|
|
29435
|
-
let starts = [col_x[d]];
|
|
29436
|
-
for (let r = 1; r < rows; r++) starts[r] = starts[r - 1] + row_len[r - 1] + 40;
|
|
29437
|
-
return {
|
|
29438
|
-
side,
|
|
29439
|
-
trunk,
|
|
29440
|
-
starts,
|
|
29441
|
-
row_len,
|
|
29442
|
-
len: starts[rows - 1] + row_len[rows - 1] - col_x[d],
|
|
29443
|
-
ext: side[0] + trunk + side[1]
|
|
29444
|
-
};
|
|
29445
|
-
}
|
|
29446
|
-
function place_stack(t, st, g, top, pos) {
|
|
29447
|
-
for (let i = 0; i < st.ids.length; i++) {
|
|
29448
|
-
let n = t.by_id.get(st.ids[i]);
|
|
29449
|
-
let r = Math.floor(i / 2);
|
|
29450
|
-
let across = i % 2 === 0 ? top + g.side[0] - n.h / 2 : top + g.side[0] + g.trunk + n.h / 2;
|
|
29451
|
-
pos.set(st.ids[i], {
|
|
29452
|
-
x: g.starts[r] + g.row_len[r] / 2,
|
|
29453
|
-
y: across
|
|
29454
|
-
});
|
|
29455
|
-
}
|
|
29456
|
-
}
|
|
29457
|
-
function compact_tree_lr(nodes, edges, o) {
|
|
29458
|
-
let t = spanning_tree(nodes, edges);
|
|
29459
|
-
let pos = /* @__PURE__ */ new Map();
|
|
29460
|
-
let kids_of = /* @__PURE__ */ new Map();
|
|
29461
|
-
let stacks = /* @__PURE__ */ new Map();
|
|
29462
|
-
for (let [id, kids] of t.children) {
|
|
29463
|
-
let out = [];
|
|
29464
|
-
let run = [];
|
|
29465
|
-
let flush = () => {
|
|
29466
|
-
if (run.length >= 3) {
|
|
29467
|
-
let key = { stack: stacks.size };
|
|
29468
|
-
stacks.set(key, {
|
|
29469
|
-
ids: run,
|
|
29470
|
-
depth: t.depth.get(run[0])
|
|
29471
|
-
});
|
|
29472
|
-
out.push(key);
|
|
29473
|
-
} else out.push(...run);
|
|
29474
|
-
run = [];
|
|
29475
|
-
};
|
|
29476
|
-
for (let kid of kids) if ((t.children.get(kid) || []).length === 0) run.push(kid);
|
|
29477
|
-
else {
|
|
29478
|
-
flush();
|
|
29479
|
-
out.push(kid);
|
|
29480
|
-
}
|
|
29481
|
-
flush();
|
|
29482
|
-
kids_of.set(id, out);
|
|
29483
|
-
}
|
|
29484
|
-
let order = [];
|
|
29485
|
-
let todo = t.roots.slice().reverse();
|
|
29486
|
-
while (todo.length) {
|
|
29487
|
-
let id = todo.pop();
|
|
29488
|
-
order.push(id);
|
|
29489
|
-
let kids = kids_of.get(id) || [];
|
|
29490
|
-
for (let i = kids.length - 1; i >= 0; i--) todo.push(kids[i]);
|
|
29491
|
-
}
|
|
29492
|
-
let col_w = [];
|
|
29493
|
-
for (let [id, d] of t.depth) col_w[d] = Math.max(col_w[d] || 0, t.by_id.get(id).w);
|
|
29494
|
-
let col_x = [];
|
|
29495
|
-
let x = 0;
|
|
29496
|
-
for (let d = 0; d < col_w.length; d++) {
|
|
29497
|
-
col_x[d] = x;
|
|
29498
|
-
x += (col_w[d] || 0) + o.ranksep;
|
|
29499
|
-
}
|
|
29500
|
-
let pad = o.nodesep / 2;
|
|
29501
|
-
let dist = o.nodesep;
|
|
29502
|
-
let level_distance = o.ranksep - pad;
|
|
29503
|
-
let tn = /* @__PURE__ */ new Map();
|
|
29504
|
-
for (let id of order) {
|
|
29505
|
-
let st = stacks.get(id);
|
|
29506
|
-
if (st) {
|
|
29507
|
-
let g = stack_geometry(t, st, col_x, col_w);
|
|
29508
|
-
tn.set(id, {
|
|
29509
|
-
len: g.len,
|
|
29510
|
-
ext: g.ext,
|
|
29511
|
-
geom: g,
|
|
29512
|
-
off_x: 0,
|
|
29513
|
-
off_y: 0,
|
|
29514
|
-
y: 0,
|
|
29515
|
-
contour: null
|
|
29516
|
-
});
|
|
29517
|
-
} else tn.set(id, {
|
|
29518
|
-
len: col_w[t.depth.get(id)],
|
|
29519
|
-
ext: t.by_id.get(id).h,
|
|
29520
|
-
off_x: 0,
|
|
29521
|
-
off_y: 0,
|
|
29522
|
-
y: 0,
|
|
29523
|
-
contour: null
|
|
29524
|
-
});
|
|
29525
|
-
}
|
|
29526
|
-
for (let i = order.length - 1; i >= 0; i--) {
|
|
29527
|
-
let id = order[i];
|
|
29528
|
-
let n = tn.get(id);
|
|
29529
|
-
let kids = kids_of.get(id) || [];
|
|
29530
|
-
if (!kids.length) {
|
|
29531
|
-
let upper = contour_line(n.len + dist, 0);
|
|
29532
|
-
let lower_tail = contour_line(0, -n.ext - dist);
|
|
29533
|
-
n.contour = {
|
|
29534
|
-
upper_head: upper,
|
|
29535
|
-
upper_tail: upper,
|
|
29536
|
-
lower_tail,
|
|
29537
|
-
lower_head: contour_line(n.len + dist, 0, lower_tail)
|
|
29538
|
-
};
|
|
29539
|
-
continue;
|
|
29540
|
-
}
|
|
29541
|
-
let first = tn.get(kids[0]);
|
|
29542
|
-
n.contour = first.contour;
|
|
29543
|
-
let h = first.ext + dist;
|
|
29544
|
-
let span = h;
|
|
29545
|
-
for (let k = 1; k < kids.length; k++) {
|
|
29546
|
-
let kid = tn.get(kids[k]);
|
|
29547
|
-
let d = contour_merge(n.contour, kid.contour);
|
|
29548
|
-
kid.off_y = d + h;
|
|
29549
|
-
kid.off_x = 0;
|
|
29550
|
-
h = kid.ext + dist;
|
|
29551
|
-
span += d + h;
|
|
29552
|
-
}
|
|
29553
|
-
let gap = pad + level_distance;
|
|
29554
|
-
let y2 = (span - n.ext) / 2 - pad;
|
|
29555
|
-
let y1 = y2 + n.ext + 2 * pad - span;
|
|
29556
|
-
first.off_x = gap + n.len;
|
|
29557
|
-
first.off_y = y1;
|
|
29558
|
-
n.contour.upper_head = contour_line(n.len, 0, contour_line(gap, y1, n.contour.upper_head));
|
|
29559
|
-
n.contour.lower_head = contour_line(n.len, 0, contour_line(gap, y2, n.contour.lower_head));
|
|
29560
|
-
}
|
|
29561
|
-
let root_of = /* @__PURE__ */ new Map();
|
|
29562
|
-
for (let id of order) {
|
|
29563
|
-
let n = tn.get(id);
|
|
29564
|
-
if (!root_of.has(id)) root_of.set(id, id);
|
|
29565
|
-
let kids = kids_of.get(id) || [];
|
|
29566
|
-
if (!kids.length) continue;
|
|
29567
|
-
let running = n.y + tn.get(kids[0]).off_y;
|
|
29568
|
-
tn.get(kids[0]).y = running;
|
|
29569
|
-
root_of.set(kids[0], root_of.get(id));
|
|
29570
|
-
for (let k = 1; k < kids.length; k++) {
|
|
29571
|
-
let kid = tn.get(kids[k]);
|
|
29572
|
-
kid.y = running + kid.off_y;
|
|
29573
|
-
running = kid.y;
|
|
29574
|
-
root_of.set(kids[k], root_of.get(id));
|
|
29575
|
-
}
|
|
29576
|
-
}
|
|
29577
|
-
let lo = /* @__PURE__ */ new Map();
|
|
29578
|
-
let hi = /* @__PURE__ */ new Map();
|
|
29579
|
-
for (let id of order) {
|
|
29580
|
-
let r = root_of.get(id);
|
|
29581
|
-
let n = tn.get(id);
|
|
29582
|
-
lo.set(r, Math.min(lo.has(r) ? lo.get(r) : Infinity, n.y));
|
|
29583
|
-
hi.set(r, Math.max(hi.has(r) ? hi.get(r) : -Infinity, n.y + n.ext));
|
|
29584
|
-
}
|
|
29585
|
-
let shift = /* @__PURE__ */ new Map();
|
|
29586
|
-
let top = 0;
|
|
29587
|
-
for (let r of t.roots) {
|
|
29588
|
-
shift.set(r, top - lo.get(r));
|
|
29589
|
-
top += hi.get(r) - lo.get(r) + o.nodesep * 2;
|
|
29590
|
-
}
|
|
29591
|
-
for (let id of order) {
|
|
29592
|
-
let n = tn.get(id);
|
|
29593
|
-
let y = n.y + shift.get(root_of.get(id));
|
|
29594
|
-
let st = stacks.get(id);
|
|
29595
|
-
if (st) {
|
|
29596
|
-
place_stack(t, st, n.geom, y, pos);
|
|
29597
|
-
continue;
|
|
29598
|
-
}
|
|
29599
|
-
let d = t.depth.get(id);
|
|
29600
|
-
pos.set(id, {
|
|
29601
|
-
x: col_x[d] + col_w[d] / 2,
|
|
29602
|
-
y: y + n.ext / 2
|
|
29603
|
-
});
|
|
29604
|
-
}
|
|
29605
|
-
return pos;
|
|
29606
|
-
}
|
|
29607
29312
|
function extent_at(n, a) {
|
|
29608
29313
|
if (!n) return 0;
|
|
29609
29314
|
return Math.abs(n.w * Math.cos(a)) + Math.abs(n.h * Math.sin(a));
|
|
@@ -29733,23 +29438,6 @@ function elbow_lane(ids, id) {
|
|
|
29733
29438
|
if (k <= 0) return 0;
|
|
29734
29439
|
return (k % 2 ? 1 : -1) * Math.ceil(k / 2);
|
|
29735
29440
|
}
|
|
29736
|
-
/************************************************************
|
|
29737
|
-
* The rank of `id` among `items` ([{id, span}]): the forward
|
|
29738
|
-
* edges that share one end with it, each with how far it runs
|
|
29739
|
-
* ACROSS. Farthest first; a tie goes to the edge made first.
|
|
29740
|
-
* Returns {rank, count}.
|
|
29741
|
-
************************************************************/
|
|
29742
|
-
function elbow_rank(items, id) {
|
|
29743
|
-
let sorted = items.slice().sort((a, b) => {
|
|
29744
|
-
if (b.span !== a.span) return b.span - a.span;
|
|
29745
|
-
return String(a.id).localeCompare(String(b.id), void 0, { numeric: true });
|
|
29746
|
-
});
|
|
29747
|
-
let rank = sorted.findIndex((it) => it.id === id);
|
|
29748
|
-
return {
|
|
29749
|
-
rank: rank < 0 ? 0 : rank,
|
|
29750
|
-
count: sorted.length
|
|
29751
|
-
};
|
|
29752
|
-
}
|
|
29753
29441
|
function swap(p) {
|
|
29754
29442
|
return [p[1], p[0]];
|
|
29755
29443
|
}
|
|
@@ -29761,136 +29449,6 @@ function swap_box(b) {
|
|
|
29761
29449
|
y2: b.x2
|
|
29762
29450
|
};
|
|
29763
29451
|
}
|
|
29764
|
-
function staggered_turn(lo, hi, st) {
|
|
29765
|
-
let mid = (lo + hi) / 2;
|
|
29766
|
-
let group = null;
|
|
29767
|
-
let k = 0;
|
|
29768
|
-
if (st.dep && st.dep.count > 1) {
|
|
29769
|
-
group = st.dep;
|
|
29770
|
-
k = st.dep.rank;
|
|
29771
|
-
} else if (st.arr && st.arr.count > 1) {
|
|
29772
|
-
group = st.arr;
|
|
29773
|
-
k = st.arr.count - 1 - st.arr.rank;
|
|
29774
|
-
}
|
|
29775
|
-
if (group) {
|
|
29776
|
-
let room = Math.max(0, hi - lo - 12);
|
|
29777
|
-
let step = Math.min(10, room / (group.count - 1));
|
|
29778
|
-
mid = mid - (group.count - 1) * step / 2 + k * step;
|
|
29779
|
-
}
|
|
29780
|
-
return mid;
|
|
29781
|
-
}
|
|
29782
|
-
/************************************************************
|
|
29783
|
-
* The combs of the stacks under one card.
|
|
29784
|
-
*
|
|
29785
|
-
* treedb_layout.js lays a run of leaf children out as two columns
|
|
29786
|
-
* with a corridor between them. A card in the first row is reached
|
|
29787
|
-
* from the channel like any other; one in a lower row cannot be --
|
|
29788
|
-
* the card above it stands in the way -- so its edge runs down
|
|
29789
|
-
* the corridor in a LANE of its own and turns into the gap above
|
|
29790
|
-
* its card, which it shares only with the other card of its row,
|
|
29791
|
-
* reached from the other side.
|
|
29792
|
-
*
|
|
29793
|
-
* targets [{id, box}]: the forward edges leaving one card,
|
|
29794
|
-
* each with the box of the card it reaches
|
|
29795
|
-
* vertical as in elbow_points; false swaps the boxes
|
|
29796
|
-
*
|
|
29797
|
-
* Returns Map id -> {lane, z, top}: the lane, the height of the
|
|
29798
|
-
* gap it turns into, and the top of the stack's first row (where
|
|
29799
|
-
* the channel over the stack ends). Only for a card that stands
|
|
29800
|
-
* under another of the group, within a stack gap and lined up
|
|
29801
|
-
* with it on the corridor side -- what a stack looks like.
|
|
29802
|
-
*
|
|
29803
|
-
* Lanes go outermost first, row by row: a line into a higher row
|
|
29804
|
-
* keeps outside the lines going deeper, and none crosses another.
|
|
29805
|
-
************************************************************/
|
|
29806
|
-
function elbow_combs(targets, vertical) {
|
|
29807
|
-
let list = vertical ? targets : targets.map((it) => ({
|
|
29808
|
-
id: it.id,
|
|
29809
|
-
box: swap_box(it.box)
|
|
29810
|
-
}));
|
|
29811
|
-
let cy = (b) => (b.y1 + b.y2) / 2;
|
|
29812
|
-
let near = (a, b) => Math.abs(a - b) < 1.5;
|
|
29813
|
-
let under = [];
|
|
29814
|
-
for (let it of list) {
|
|
29815
|
-
let b = it.box;
|
|
29816
|
-
let above = null;
|
|
29817
|
-
for (let o of list) {
|
|
29818
|
-
let a = o.box;
|
|
29819
|
-
if (o === it || a.y2 > b.y1 || b.y1 - a.y2 > 40) continue;
|
|
29820
|
-
if (!(near(a.x2, b.x2) || near(a.x1, b.x1))) continue;
|
|
29821
|
-
if (!above || a.y2 > above.y2) above = a;
|
|
29822
|
-
}
|
|
29823
|
-
if (!above) continue;
|
|
29824
|
-
let side;
|
|
29825
|
-
if (near(above.x2, b.x2) && !near(above.x1, b.x1)) side = 0;
|
|
29826
|
-
else if (near(above.x1, b.x1) && !near(above.x2, b.x2)) side = 1;
|
|
29827
|
-
else side = list.some((o) => o !== it && near(cy(o.box), cy(b)) && o.box.x2 <= b.x1) ? 1 : 0;
|
|
29828
|
-
under.push({
|
|
29829
|
-
id: it.id,
|
|
29830
|
-
box: b,
|
|
29831
|
-
above,
|
|
29832
|
-
side
|
|
29833
|
-
});
|
|
29834
|
-
}
|
|
29835
|
-
let corridor = (u) => {
|
|
29836
|
-
if (u.side === 0) {
|
|
29837
|
-
let l = u.box.x2;
|
|
29838
|
-
let col = list.filter((o) => near(o.box.x2, l));
|
|
29839
|
-
let r = Infinity;
|
|
29840
|
-
for (let c of col) for (let o of list) if (o !== c && near(cy(o.box), cy(c.box)) && o.box.x1 >= l - .5) r = Math.min(r, o.box.x1);
|
|
29841
|
-
return {
|
|
29842
|
-
l,
|
|
29843
|
-
r: isFinite(r) ? r : l + 36,
|
|
29844
|
-
col
|
|
29845
|
-
};
|
|
29846
|
-
}
|
|
29847
|
-
let r = u.box.x1;
|
|
29848
|
-
let col = list.filter((o) => near(o.box.x1, r));
|
|
29849
|
-
let l = -Infinity;
|
|
29850
|
-
for (let c of col) for (let o of list) if (o !== c && near(cy(o.box), cy(c.box)) && o.box.x2 <= r + .5) l = Math.max(l, o.box.x2);
|
|
29851
|
-
return {
|
|
29852
|
-
l: isFinite(l) ? l : r - 36,
|
|
29853
|
-
r,
|
|
29854
|
-
col
|
|
29855
|
-
};
|
|
29856
|
-
};
|
|
29857
|
-
let groups = /* @__PURE__ */ new Map();
|
|
29858
|
-
for (let u of under) {
|
|
29859
|
-
let c = corridor(u);
|
|
29860
|
-
u.top = Math.min(...c.col.map((o) => o.box.y1));
|
|
29861
|
-
let key = `${Math.round(c.l)}|${Math.round(c.r)}`;
|
|
29862
|
-
if (!groups.has(key)) groups.set(key, {
|
|
29863
|
-
l: c.l,
|
|
29864
|
-
r: c.r,
|
|
29865
|
-
left: [],
|
|
29866
|
-
right: []
|
|
29867
|
-
});
|
|
29868
|
-
groups.get(key)[u.side === 0 ? "left" : "right"].push(u);
|
|
29869
|
-
}
|
|
29870
|
-
let out = /* @__PURE__ */ new Map();
|
|
29871
|
-
for (let g of groups.values()) {
|
|
29872
|
-
g.left.sort((a, b) => a.box.y1 - b.box.y1);
|
|
29873
|
-
g.right.sort((a, b) => a.box.y1 - b.box.y1);
|
|
29874
|
-
let n = g.left.length + g.right.length;
|
|
29875
|
-
let room = g.r - g.l - 20;
|
|
29876
|
-
let step = n > 1 ? Math.max(0, Math.min(6, room / (n - 1))) : 0;
|
|
29877
|
-
g.left.forEach((u, i) => {
|
|
29878
|
-
out.set(u.id, {
|
|
29879
|
-
lane: g.l + 10 + i * step,
|
|
29880
|
-
z: (u.above.y2 + u.box.y1) / 2,
|
|
29881
|
-
top: u.top
|
|
29882
|
-
});
|
|
29883
|
-
});
|
|
29884
|
-
g.right.forEach((u, j) => {
|
|
29885
|
-
out.set(u.id, {
|
|
29886
|
-
lane: g.r - 10 - j * step,
|
|
29887
|
-
z: (u.above.y2 + u.box.y1) / 2,
|
|
29888
|
-
top: u.top
|
|
29889
|
-
});
|
|
29890
|
-
});
|
|
29891
|
-
}
|
|
29892
|
-
return out;
|
|
29893
|
-
}
|
|
29894
29452
|
/************************************************************
|
|
29895
29453
|
* The control points of an elbow from the port `s` to the port
|
|
29896
29454
|
* `t` ([x, y] each), knowing the boxes of the two cards
|
|
@@ -29898,33 +29456,13 @@ function elbow_combs(targets, vertical) {
|
|
|
29898
29456
|
*
|
|
29899
29457
|
* vertical the rows are stacked (top to bottom); false
|
|
29900
29458
|
* when they are side by side (left to right)
|
|
29901
|
-
|
|
29902
|
-
|
|
29903
|
-
|
|
29904
|
-
* its comb when the target is in a lower row of a
|
|
29905
|
-
* stack (elbow_combs). Absent, the channel is the
|
|
29906
|
-
* middle.
|
|
29907
|
-
************************************************************/
|
|
29908
|
-
function elbow_points(s, t, box_s, box_t, lane, vertical, stagger) {
|
|
29909
|
-
if (!vertical) return elbow_points(swap(s), swap(t), swap_box(box_s), swap_box(box_t), lane, true, stagger).map(swap);
|
|
29459
|
+
************************************************************/
|
|
29460
|
+
function elbow_points(s, t, box_s, box_t, lane, vertical) {
|
|
29461
|
+
if (!vertical) return elbow_points(swap(s), swap(t), swap_box(box_s), swap_box(box_t), lane, true).map(swap);
|
|
29910
29462
|
let shift = lane * 10;
|
|
29911
29463
|
if (t[1] - s[1] > 20) {
|
|
29912
|
-
let
|
|
29913
|
-
|
|
29914
|
-
if (st.comb) {
|
|
29915
|
-
let c = st.comb;
|
|
29916
|
-
let turn = staggered_turn(lo, c.top, { dep: st.dep }) + shift;
|
|
29917
|
-
turn = Math.min(Math.max(turn, lo + 4), c.top - 4);
|
|
29918
|
-
return [
|
|
29919
|
-
[s[0], turn],
|
|
29920
|
-
[c.lane, turn],
|
|
29921
|
-
[c.lane, c.z],
|
|
29922
|
-
[t[0], c.z]
|
|
29923
|
-
];
|
|
29924
|
-
}
|
|
29925
|
-
let hi = Math.min(t[1], box_t.y1);
|
|
29926
|
-
let mid = staggered_turn(lo, hi, st) + shift;
|
|
29927
|
-
mid = Math.min(Math.max(mid, lo + 4), hi - 4);
|
|
29464
|
+
let mid = (s[1] + t[1]) / 2 + shift;
|
|
29465
|
+
mid = Math.min(Math.max(mid, s[1] + 10), t[1] - 10);
|
|
29928
29466
|
return [[s[0], mid], [t[0], mid]];
|
|
29929
29467
|
}
|
|
29930
29468
|
let out = 16 + Math.abs(shift);
|
|
@@ -30018,12 +29556,8 @@ function heap_pop(h) {
|
|
|
30018
29556
|
/************************************************************
|
|
30019
29557
|
* The shortest orthogonal line from `a` to `z` that enters none
|
|
30020
29558
|
* of `boxes` (already expanded by the clearance), a turn costing
|
|
30021
|
-
* ROUTE_BEND. The line leaves `a`
|
|
30022
|
-
*
|
|
30023
|
-
* over it belong to the forward edges that share that port, which
|
|
30024
|
-
* run along them to their staggered turns -- a route going down
|
|
30025
|
-
* that column lay on top of them. So a routed line shares only
|
|
30026
|
-
* the stub between the port and `a` (or `z`).
|
|
29559
|
+
* ROUTE_BEND. The line leaves `a` going down and ends at `z`
|
|
29560
|
+
* going down, since after `z` it drops into a port.
|
|
30027
29561
|
*
|
|
30028
29562
|
* The grid is SPARSE: only the lines of the boxes' borders and
|
|
30029
29563
|
* of the two ends, which is all an orthogonal shortest path ever
|
|
@@ -30089,8 +29623,7 @@ function orth_search(a, z, boxes) {
|
|
|
30089
29623
|
let k = state >> 2;
|
|
30090
29624
|
let dir = state & 3;
|
|
30091
29625
|
if (k === goal) {
|
|
30092
|
-
|
|
30093
|
-
let total = cost + 40;
|
|
29626
|
+
let total = cost + (dir === 2 ? 0 : 40);
|
|
30094
29627
|
if (total < found_cost) {
|
|
30095
29628
|
found_cost = total;
|
|
30096
29629
|
found = state;
|
|
@@ -30098,7 +29631,6 @@ function orth_search(a, z, boxes) {
|
|
|
30098
29631
|
continue;
|
|
30099
29632
|
}
|
|
30100
29633
|
for (let [nk, nd, len] of moves(k)) {
|
|
30101
|
-
if (k === start && nd >= 2) continue;
|
|
30102
29634
|
let c = cost + len + (nd === dir ? 0 : 40);
|
|
30103
29635
|
let ns = nk * 4 + nd;
|
|
30104
29636
|
if (c < best[ns]) {
|
|
@@ -30139,11 +29671,10 @@ function orth_search(a, z, boxes) {
|
|
|
30139
29671
|
* coincide. Nearby cards first; all of them if that finds no way;
|
|
30140
29672
|
* the simple elbow if nothing does.
|
|
30141
29673
|
************************************************************/
|
|
30142
|
-
function elbow_route(s, t, box_s, box_t, lane, vertical, boxes
|
|
29674
|
+
function elbow_route(s, t, box_s, box_t, lane, vertical, boxes) {
|
|
30143
29675
|
let others = boxes || [];
|
|
30144
|
-
if (!vertical) return elbow_route(swap(s), swap(t), swap_box(box_s), swap_box(box_t), lane, true, others.map(swap_box)
|
|
30145
|
-
|
|
30146
|
-
let simple = elbow_points(s, t, box_s, box_t, lane, true, stagger);
|
|
29676
|
+
if (!vertical) return elbow_route(swap(s), swap(t), swap_box(box_s), swap_box(box_t), lane, true, others.map(swap_box)).map(swap);
|
|
29677
|
+
let simple = elbow_points(s, t, box_s, box_t, lane, true);
|
|
30147
29678
|
if (!elbow_path_hits([
|
|
30148
29679
|
s,
|
|
30149
29680
|
...simple,
|
|
@@ -30163,112 +29694,6 @@ function elbow_route(s, t, box_s, box_t, lane, vertical, boxes, stagger) {
|
|
|
30163
29694
|
if (!route && near.length < others.length) route = orth_search(a, z, others.map((b) => box_expand(b, m)));
|
|
30164
29695
|
return route || simple;
|
|
30165
29696
|
}
|
|
30166
|
-
function path_points(path) {
|
|
30167
|
-
let pts = [];
|
|
30168
|
-
let cur = null;
|
|
30169
|
-
for (let c of path) if (c[0] === "M" || c[0] === "L") {
|
|
30170
|
-
cur = [c[1], c[2]];
|
|
30171
|
-
pts.push(cur);
|
|
30172
|
-
} else if (c[0] === "C" && cur) {
|
|
30173
|
-
let [x0, y0] = cur;
|
|
30174
|
-
for (let k = 1; k <= 16; k++) {
|
|
30175
|
-
let u = k / 16;
|
|
30176
|
-
let v = 1 - u;
|
|
30177
|
-
pts.push([v * v * v * x0 + 3 * v * v * u * c[1] + 3 * v * u * u * c[3] + u * u * u * c[5], v * v * v * y0 + 3 * v * v * u * c[2] + 3 * v * u * u * c[4] + u * u * u * c[6]]);
|
|
30178
|
-
}
|
|
30179
|
-
cur = [c[5], c[6]];
|
|
30180
|
-
} else if (c[0] === "Q" && cur) {
|
|
30181
|
-
let [x0, y0] = cur;
|
|
30182
|
-
for (let k = 1; k <= 16; k++) {
|
|
30183
|
-
let u = k / 16;
|
|
30184
|
-
let v = 1 - u;
|
|
30185
|
-
pts.push([v * v * x0 + 2 * v * u * c[1] + u * u * c[3], v * v * y0 + 2 * v * u * c[2] + u * u * c[4]]);
|
|
30186
|
-
}
|
|
30187
|
-
cur = [c[3], c[4]];
|
|
30188
|
-
}
|
|
30189
|
-
return pts;
|
|
30190
|
-
}
|
|
30191
|
-
/************************************************************
|
|
30192
|
-
* Does the G6 path `path` of a curved edge cross a card other than
|
|
30193
|
-
* its own two? Measured on the curve itself -- the path G6 would
|
|
30194
|
-
* draw, sampled -- and not on the rectangle round it, which took
|
|
30195
|
-
* every card the curve merely passed near: the ports of a row
|
|
30196
|
-
* stick well into the space above it. Its own two cards are left
|
|
30197
|
-
* out: the curve starts and ends on their ports.
|
|
30198
|
-
************************************************************/
|
|
30199
|
-
function curve_hits(path, boxes, box_s, box_t) {
|
|
30200
|
-
let pts = path_points(path);
|
|
30201
|
-
if (pts.length < 2) return false;
|
|
30202
|
-
let bb = {
|
|
30203
|
-
x1: Infinity,
|
|
30204
|
-
y1: Infinity,
|
|
30205
|
-
x2: -Infinity,
|
|
30206
|
-
y2: -Infinity
|
|
30207
|
-
};
|
|
30208
|
-
for (let p of pts) {
|
|
30209
|
-
bb.x1 = Math.min(bb.x1, p[0]);
|
|
30210
|
-
bb.y1 = Math.min(bb.y1, p[1]);
|
|
30211
|
-
bb.x2 = Math.max(bb.x2, p[0]);
|
|
30212
|
-
bb.y2 = Math.max(bb.y2, p[1]);
|
|
30213
|
-
}
|
|
30214
|
-
for (let b of boxes || []) {
|
|
30215
|
-
if (same_box(b, box_s) || same_box(b, box_t) || !box_overlaps(b, box_expand(bb, 1))) continue;
|
|
30216
|
-
let inner = box_expand(b, -1);
|
|
30217
|
-
for (let k = 0; k + 1 < pts.length; k++) if (segment_hits(pts[k], pts[k + 1], inner)) return true;
|
|
30218
|
-
}
|
|
30219
|
-
return false;
|
|
30220
|
-
}
|
|
30221
|
-
/************************************************************
|
|
30222
|
-
* A G6 path (['M'|'L'|'Q', ...]) along `points` with every corner
|
|
30223
|
-
* rounded -- by `radius`, or by half the shorter of its two
|
|
30224
|
-
* segments, so a short run is never overshot. The rounding is the
|
|
30225
|
-
* quadratic G6's own polyline uses.
|
|
30226
|
-
************************************************************/
|
|
30227
|
-
function rounded_path(points, radius) {
|
|
30228
|
-
let path = [[
|
|
30229
|
-
"M",
|
|
30230
|
-
points[0][0],
|
|
30231
|
-
points[0][1]
|
|
30232
|
-
]];
|
|
30233
|
-
for (let i = 1; i + 1 < points.length; i++) {
|
|
30234
|
-
let a = points[i - 1];
|
|
30235
|
-
let m = points[i];
|
|
30236
|
-
let b = points[i + 1];
|
|
30237
|
-
let len_in = Math.hypot(m[0] - a[0], m[1] - a[1]);
|
|
30238
|
-
let len_out = Math.hypot(b[0] - m[0], b[1] - m[1]);
|
|
30239
|
-
let r = Math.min(radius, len_in / 2, len_out / 2);
|
|
30240
|
-
let collinear = Math.abs((m[0] - a[0]) * (b[1] - m[1]) - (m[1] - a[1]) * (b[0] - m[0])) < 1e-9;
|
|
30241
|
-
if (r <= 0 || collinear) {
|
|
30242
|
-
path.push([
|
|
30243
|
-
"L",
|
|
30244
|
-
m[0],
|
|
30245
|
-
m[1]
|
|
30246
|
-
]);
|
|
30247
|
-
continue;
|
|
30248
|
-
}
|
|
30249
|
-
let p1 = [m[0] - (m[0] - a[0]) / len_in * r, m[1] - (m[1] - a[1]) / len_in * r];
|
|
30250
|
-
let p2 = [m[0] + (b[0] - m[0]) / len_out * r, m[1] + (b[1] - m[1]) / len_out * r];
|
|
30251
|
-
path.push([
|
|
30252
|
-
"L",
|
|
30253
|
-
p1[0],
|
|
30254
|
-
p1[1]
|
|
30255
|
-
]);
|
|
30256
|
-
path.push([
|
|
30257
|
-
"Q",
|
|
30258
|
-
m[0],
|
|
30259
|
-
m[1],
|
|
30260
|
-
p2[0],
|
|
30261
|
-
p2[1]
|
|
30262
|
-
]);
|
|
30263
|
-
}
|
|
30264
|
-
let last = points[points.length - 1];
|
|
30265
|
-
path.push([
|
|
30266
|
-
"L",
|
|
30267
|
-
last[0],
|
|
30268
|
-
last[1]
|
|
30269
|
-
]);
|
|
30270
|
-
return path;
|
|
30271
|
-
}
|
|
30272
29697
|
//#endregion
|
|
30273
29698
|
//#region node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
30274
29699
|
function _typeof(o) {
|
|
@@ -55156,7 +54581,7 @@ Easing Functions from anime.js, they are tried and true, so, its better to use t
|
|
|
55156
54581
|
var Quad = function Quad(t) {
|
|
55157
54582
|
return Math.pow(t, 2);
|
|
55158
54583
|
};
|
|
55159
|
-
var Cubic
|
|
54584
|
+
var Cubic = function Cubic(t) {
|
|
55160
54585
|
return Math.pow(t, 3);
|
|
55161
54586
|
};
|
|
55162
54587
|
var Quart = function Quart(t) {
|
|
@@ -55293,10 +54718,10 @@ var EasingFunctions = {
|
|
|
55293
54718
|
"out-quad": EaseOut(Quad),
|
|
55294
54719
|
"in-out-quad": EaseInOut(Quad),
|
|
55295
54720
|
"out-in-quad": EaseOutIn(Quad),
|
|
55296
|
-
"in-cubic": Cubic
|
|
55297
|
-
"out-cubic": EaseOut(Cubic
|
|
55298
|
-
"in-out-cubic": EaseInOut(Cubic
|
|
55299
|
-
"out-in-cubic": EaseOutIn(Cubic
|
|
54721
|
+
"in-cubic": Cubic,
|
|
54722
|
+
"out-cubic": EaseOut(Cubic),
|
|
54723
|
+
"in-out-cubic": EaseInOut(Cubic),
|
|
54724
|
+
"out-in-cubic": EaseOutIn(Cubic),
|
|
55300
54725
|
"in-quart": Quart,
|
|
55301
54726
|
"out-quart": EaseOut(Quart),
|
|
55302
54727
|
"in-out-quart": EaseInOut(Quart),
|
|
@@ -57133,12 +56558,6 @@ var _layouts = {
|
|
|
57133
56558
|
nodesep: 18,
|
|
57134
56559
|
ranksep: 90
|
|
57135
56560
|
},
|
|
57136
|
-
"compact-tree": {
|
|
57137
|
-
type: "treedb-compact",
|
|
57138
|
-
direction: "TB",
|
|
57139
|
-
nodesep: 18,
|
|
57140
|
-
ranksep: 90
|
|
57141
|
-
},
|
|
57142
56561
|
"dagre": {
|
|
57143
56562
|
type: "dagre",
|
|
57144
56563
|
rankdir: "LR",
|
|
@@ -57466,11 +56885,8 @@ function register_layouts(gobj) {
|
|
|
57466
56885
|
_g6_extensions_registered = true;
|
|
57467
56886
|
register(ExtensionCategory.LAYOUT, "manual", ManualLayout);
|
|
57468
56887
|
register(ExtensionCategory.LAYOUT, "treedb-tree", TreedbTreeLayout);
|
|
57469
|
-
register(ExtensionCategory.LAYOUT, "treedb-compact", TreedbCompactLayout);
|
|
57470
56888
|
register(ExtensionCategory.EDGE, "treedb-elbow-v", TreedbElbowV);
|
|
57471
56889
|
register(ExtensionCategory.EDGE, "treedb-elbow-h", TreedbElbowH);
|
|
57472
|
-
register(ExtensionCategory.EDGE, "treedb-curve-v", TreedbCurveV);
|
|
57473
|
-
register(ExtensionCategory.EDGE, "treedb-curve-h", TreedbCurveH);
|
|
57474
56890
|
register(ExtensionCategory.LAYOUT, "treedb-radial", TreedbRadialLayout);
|
|
57475
56891
|
register(ExtensionCategory.NODE, "light", LightNode);
|
|
57476
56892
|
register(ExtensionCategory.NODE, "treedb-card", TreedbCard);
|
|
@@ -58165,9 +57581,7 @@ function layout_direction(gobj) {
|
|
|
58165
57581
|
function edge_type_for(gobj) {
|
|
58166
57582
|
let lr = layout_direction(gobj) === "LR";
|
|
58167
57583
|
let rowless = gobj_read_attr(gobj, "rowless_layouts") || [];
|
|
58168
|
-
|
|
58169
|
-
if (rows && gobj_read_str_attr(gobj, "edge_shape") === "elbow") return lr ? "treedb-elbow-h" : "treedb-elbow-v";
|
|
58170
|
-
if (rows) return lr ? "treedb-curve-h" : "treedb-curve-v";
|
|
57584
|
+
if (gobj_read_str_attr(gobj, "edge_shape") === "elbow" && !str_in_list(rowless, gobj.priv.layout)) return lr ? "treedb-elbow-h" : "treedb-elbow-v";
|
|
58171
57585
|
return lr ? "cubic-horizontal" : "cubic";
|
|
58172
57586
|
}
|
|
58173
57587
|
/************************************************************
|
|
@@ -59654,9 +59068,8 @@ var TreedbTreeLayout = class extends BaseLayout {
|
|
|
59654
59068
|
* dragged card, a fold or a layout needs nothing else. `-v` runs
|
|
59655
59069
|
* between rows (top to bottom), `-h` between columns. An edge that
|
|
59656
59070
|
* does not run forward goes round the two cards, the edges joining
|
|
59657
|
-
* the same two cards take lanes,
|
|
59658
|
-
*
|
|
59659
|
-
* routed round it (treedb_elbow.js).
|
|
59071
|
+
* the same two cards take lanes, and a line that would cross any
|
|
59072
|
+
* other card is routed round it (treedb_elbow.js).
|
|
59660
59073
|
************************************************************/
|
|
59661
59074
|
var ELBOW_RADIUS = 6;
|
|
59662
59075
|
function elbow_box(node) {
|
|
@@ -59708,55 +59121,10 @@ function elbow_lane_of(edge) {
|
|
|
59708
59121
|
return 0;
|
|
59709
59122
|
}
|
|
59710
59123
|
}
|
|
59711
|
-
function elbow_stagger_of(edge, vertical) {
|
|
59712
|
-
let graph = edge.context && edge.context.graph;
|
|
59713
|
-
let element = edge.context && edge.context.element;
|
|
59714
|
-
let s = edge.sourceNode && edge.sourceNode.id;
|
|
59715
|
-
let t = edge.targetNode && edge.targetNode.id;
|
|
59716
|
-
if (!graph || !element || s === void 0 || t === void 0) return null;
|
|
59717
|
-
let across = vertical ? 0 : 1;
|
|
59718
|
-
let along = vertical ? 1 : 0;
|
|
59719
|
-
let pos = (id) => graph.getElementPosition(id);
|
|
59720
|
-
let port_of = (node_id, key) => {
|
|
59721
|
-
let node = element.getElement(node_id);
|
|
59722
|
-
let ports = node && typeof node.getPorts === "function" ? node.getPorts() : {};
|
|
59723
|
-
let port = key ? ports[key] : null;
|
|
59724
|
-
return port ? port.getPosition() : pos(node_id);
|
|
59725
|
-
};
|
|
59726
|
-
try {
|
|
59727
|
-
let ps = pos(s);
|
|
59728
|
-
let pt = pos(t);
|
|
59729
|
-
let leaving = graph.getRelatedEdgesData(s, "out").filter((d) => d.source === s && pos(d.target)[along] > ps[along]);
|
|
59730
|
-
let combs = elbow_combs(leaving.map((d) => ({
|
|
59731
|
-
id: d.id,
|
|
59732
|
-
box: elbow_box(element.getElement(d.target))
|
|
59733
|
-
})), vertical);
|
|
59734
|
-
let dep = leaving.map((d) => {
|
|
59735
|
-
let comb = combs.get(d.id);
|
|
59736
|
-
let far = comb ? comb.lane : pos(d.target)[across];
|
|
59737
|
-
return {
|
|
59738
|
-
id: d.id,
|
|
59739
|
-
span: Math.abs(far - port_of(s, d.style && d.style.sourcePort)[across])
|
|
59740
|
-
};
|
|
59741
|
-
});
|
|
59742
|
-
let arr = graph.getRelatedEdgesData(t, "in").filter((d) => d.target === t && pos(d.source)[along] < pt[along]).map((d) => ({
|
|
59743
|
-
id: d.id,
|
|
59744
|
-
span: Math.abs(port_of(d.source, d.style && d.style.sourcePort)[across] - pt[across])
|
|
59745
|
-
}));
|
|
59746
|
-
return {
|
|
59747
|
-
dep: elbow_rank(dep, edge.id),
|
|
59748
|
-
arr: elbow_rank(arr, edge.id),
|
|
59749
|
-
comb: combs.get(edge.id) || null
|
|
59750
|
-
};
|
|
59751
|
-
} catch (e) {
|
|
59752
|
-
log_error(`elbow edge ${edge.id}: cannot read the edges sharing its ends: ${e}`);
|
|
59753
|
-
return null;
|
|
59754
|
-
}
|
|
59755
|
-
}
|
|
59756
59124
|
var TreedbElbowV = class extends Polyline {
|
|
59757
59125
|
getControlPoints(attributes) {
|
|
59758
59126
|
let [s, t] = this.getEndpoints(attributes, false);
|
|
59759
|
-
return elbow_route(s, t, elbow_box(this.sourceNode), elbow_box(this.targetNode), elbow_lane_of(this), true, elbow_obstacles(this)
|
|
59127
|
+
return elbow_route(s, t, elbow_box(this.sourceNode), elbow_box(this.targetNode), elbow_lane_of(this), true, elbow_obstacles(this));
|
|
59760
59128
|
}
|
|
59761
59129
|
getKeyPath(attributes) {
|
|
59762
59130
|
return super.getKeyPath(Object.assign({}, attributes, { radius: attributes.radius || ELBOW_RADIUS }));
|
|
@@ -59765,52 +59133,12 @@ var TreedbElbowV = class extends Polyline {
|
|
|
59765
59133
|
var TreedbElbowH = class extends Polyline {
|
|
59766
59134
|
getControlPoints(attributes) {
|
|
59767
59135
|
let [s, t] = this.getEndpoints(attributes, false);
|
|
59768
|
-
return elbow_route(s, t, elbow_box(this.sourceNode), elbow_box(this.targetNode), elbow_lane_of(this), false, elbow_obstacles(this)
|
|
59136
|
+
return elbow_route(s, t, elbow_box(this.sourceNode), elbow_box(this.targetNode), elbow_lane_of(this), false, elbow_obstacles(this));
|
|
59769
59137
|
}
|
|
59770
59138
|
getKeyPath(attributes) {
|
|
59771
59139
|
return super.getKeyPath(Object.assign({}, attributes, { radius: attributes.radius || ELBOW_RADIUS }));
|
|
59772
59140
|
}
|
|
59773
59141
|
};
|
|
59774
|
-
/************************************************************
|
|
59775
|
-
* A CURVED edge that keeps off the cards. G6's cubic, as before,
|
|
59776
|
-
* unless that very curve -- sampled, not guessed from the
|
|
59777
|
-
* rectangle round it -- would cross a card other than its own two,
|
|
59778
|
-
* or when it does not run forward and so would cross its own:
|
|
59779
|
-
* the card above a lower row of a stack, a row between a parent
|
|
59780
|
-
* and a far child. Then it goes the way an elbow would (the comb,
|
|
59781
|
-
* the detour, the route: the same lanes and staggered turns) with
|
|
59782
|
-
* round corners, so it still reads as a curve. `-v` for rows
|
|
59783
|
-
* stacked top to bottom, `-h` for columns.
|
|
59784
|
-
************************************************************/
|
|
59785
|
-
function curve_key_path(edge, attributes, vertical, plain) {
|
|
59786
|
-
let [s, t] = edge.getEndpoints(attributes, false);
|
|
59787
|
-
let along = vertical ? 1 : 0;
|
|
59788
|
-
let box_s = elbow_box(edge.sourceNode);
|
|
59789
|
-
let box_t = elbow_box(edge.targetNode);
|
|
59790
|
-
let boxes = elbow_obstacles(edge);
|
|
59791
|
-
if (t[along] - s[along] > 20 && !curve_hits(plain, boxes, box_s, box_t)) return plain;
|
|
59792
|
-
return rounded_path([
|
|
59793
|
-
s,
|
|
59794
|
-
...elbow_route(s, t, box_s, box_t, elbow_lane_of(edge), vertical, boxes, elbow_stagger_of(edge, vertical)),
|
|
59795
|
-
t
|
|
59796
|
-
], 24);
|
|
59797
|
-
}
|
|
59798
|
-
var TreedbCurveV = class extends Cubic {
|
|
59799
|
-
getKeyPath(attributes) {
|
|
59800
|
-
return curve_key_path(this, attributes, true, super.getKeyPath(attributes));
|
|
59801
|
-
}
|
|
59802
|
-
};
|
|
59803
|
-
var TreedbCurveH = class extends CubicHorizontal {
|
|
59804
|
-
getKeyPath(attributes) {
|
|
59805
|
-
return curve_key_path(this, attributes, false, super.getKeyPath(attributes));
|
|
59806
|
-
}
|
|
59807
|
-
};
|
|
59808
|
-
var TreedbCompactLayout = class extends BaseLayout {
|
|
59809
|
-
async execute(data, options) {
|
|
59810
|
-
let input = treedb_layout_input(data);
|
|
59811
|
-
return treedb_layout_output(layout_compact(input.nodes, input.edges, options));
|
|
59812
|
-
}
|
|
59813
|
-
};
|
|
59814
59142
|
var TreedbRadialLayout = class extends BaseLayout {
|
|
59815
59143
|
async execute(data, options) {
|
|
59816
59144
|
let input = treedb_layout_input(data);
|
|
@@ -65304,7 +64632,6 @@ function option_label(name) {
|
|
|
65304
64632
|
case "edition": return t("edition");
|
|
65305
64633
|
case "manual": return t("manual");
|
|
65306
64634
|
case "treedb-tree": return t("treedb-tree");
|
|
65307
|
-
case "compact-tree": return t("compact-tree");
|
|
65308
64635
|
case "radial": return t("radial");
|
|
65309
64636
|
case "dagre": return t("dagre");
|
|
65310
64637
|
case "antv-dagre": return t("antv-dagre");
|