@yuneta/gobj-ui 7.23.156 → 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 +6 -57
- package/dist/gobj-ui.cjs.js +55 -877
- package/dist/gobj-ui.es.js +56 -878
- 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 +39 -620
- package/src/treedb_layout.test.js +3 -269
package/README.md
CHANGED
|
@@ -1387,8 +1387,8 @@ G6 5.1 registers these layouts, and this is how each meets that shape:
|
|
|
1387
1387
|
| `circular`, `concentric`, `grid`, `mds`, `random` | rings, rings by degree, a grid, projection, noise | none knows a parent from a child |
|
|
1388
1388
|
| `combo-combined`, `fishbone` | combos / cause-effect | not this data |
|
|
1389
1389
|
|
|
1390
|
-
So
|
|
1391
|
-
layouts by
|
|
1390
|
+
So two of our own, in `treedb_layout.js` (pure, tested), registered as G6
|
|
1391
|
+
layouts by two thin adapters in `c_g6_nodes_tree.js`:
|
|
1392
1392
|
|
|
1393
1393
|
- **`treedb-tree`** — the classic tidy tree, **top to bottom**. A row per
|
|
1394
1394
|
depth as tall as its tallest card, a node centred over the block of its
|
|
@@ -1402,25 +1402,6 @@ layouts by three thin adapters in `c_g6_nodes_tree.js`:
|
|
|
1402
1402
|
keeps the other reading for a host that wants it). The outline that shipped
|
|
1403
1403
|
beside it (`treedb-outline`, one row per node) was removed in `7.23.75`: a
|
|
1404
1404
|
list that indents is a JSON viewer, and this library already has one.
|
|
1405
|
-
- **`compact-tree`** (`treedb-compact`, `7.23.148`) — the same tree packed by
|
|
1406
|
-
**contour** instead of by block. The tidy tree gives each subtree its whole
|
|
1407
|
-
block, so a hall opened with twenty-four devices pushes the siblings of its
|
|
1408
|
-
ancestors apart at depths where nothing of theirs touches; here every
|
|
1409
|
-
sibling slides against the outline of the ones before it, and a closed
|
|
1410
|
-
branch sits beside an open one at the depth they share. Same rows and order
|
|
1411
|
-
as `treedb-tree`, so switching moves cards sideways and never reorders them.
|
|
1412
|
-
One region open with a 24-device hall is 70% of the tidy width on a treedb
|
|
1413
|
-
shaped like a real one; a uniform tree is the same width. The contour
|
|
1414
|
-
arithmetic is Moen's (1990) as mxGraph wrote it in `mxCompactTreeLayout`
|
|
1415
|
-
(JGraph Ltd, Apache-2.0), read in maxGraph — a port, not a dependency,
|
|
1416
|
-
because maxGraph's layouts drive its own graph model. Since `7.23.154` a run
|
|
1417
|
-
of three or more **leaf** children is **stacked**: two columns under the
|
|
1418
|
-
parent with a corridor between them, row after row — the contour alone
|
|
1419
|
-
gained nothing on a whole level opened with the stepper, where every parent
|
|
1420
|
-
still needed the row of its children beside it. Against `tree`: regions
|
|
1421
|
-
only 10% of the width, one region open with a 24-device hall 21%, a whole
|
|
1422
|
-
level open 41%. The tree grows taller instead; with elbow edges or curves
|
|
1423
|
-
alike, since `7.23.155` a curve keeps off the cards too.
|
|
1424
1405
|
- **`radial`** (`treedb-radial`) — the root in the middle, a ring per depth,
|
|
1425
1406
|
every subtree an angular **sector** proportional to its leaves, and the
|
|
1426
1407
|
radius of each ring the largest of three: one `ranksep` out from the ring
|
|
@@ -1430,15 +1411,7 @@ layouts by three thin adapters in `c_g6_nodes_tree.js`:
|
|
|
1430
1411
|
cards touching, where the tidy tree's `ranksep` is a gap between COLUMNS
|
|
1431
1412
|
and a column carries its own width. A fan that cannot overlap by
|
|
1432
1413
|
construction, across the ring or along the radius; several roots share the
|
|
1433
|
-
circle around an empty centre.
|
|
1434
|
-
**leaf** children is **stacked**, as in the compact tree: it asks its ring
|
|
1435
|
-
for one row of about the square root of its cards instead of one slot per
|
|
1436
|
-
leaf, and lays them in rows going outward, each as full as its room allows
|
|
1437
|
-
— rings round the parent when it is alone, a fan inside its sector when
|
|
1438
|
-
not. Measured over the arc it covers (a card is wider slanted), and a
|
|
1439
|
-
neighbour of the outer rings by the angle it covers, so nothing overlaps.
|
|
1440
|
-
On a real-shaped treedb it is 53–63% of the radial it was; `stack: false`
|
|
1441
|
-
keeps the old one.
|
|
1414
|
+
circle around an empty centre.
|
|
1442
1415
|
|
|
1443
1416
|
**Elbow edges** (`7.23.149`) are an option of the edges, not a layout: the
|
|
1444
1417
|
toolbar's `GRAPH_EDGE_ELBOW` toggle sets `edge_shape` to `elbow`, and every
|
|
@@ -1475,36 +1448,12 @@ what gets routed is a detour with a third card in its way, an edge dropping
|
|
|
1475
1448
|
several rows, an edge between two cards of one row. Since `7.23.152` a node is
|
|
1476
1449
|
measured **whole** — card, ports and label — so a line keeps clear of the
|
|
1477
1450
|
ports as well; the edge's own ports stick out of its own cards, so its first
|
|
1478
|
-
and last segments are not tested against their own box.
|
|
1479
|
-
|
|
1480
|
-
The edges sharing an **end** do not lie on top of each other either
|
|
1481
|
-
(`7.23.153`): the forward edges leaving one card — all of them, not only one
|
|
1482
|
-
port's, or two hooks side by side would stack their runs — and those reaching
|
|
1483
|
-
one card (all its fkeys enter by one point) are **staggered**, each turning at
|
|
1484
|
-
its own height in the channel, 10px apart at most and closer when the channel
|
|
1485
|
-
is short. Leaving, the farthest turns highest; arriving, the farthest turns
|
|
1486
|
-
lowest: the orders in which the lines of one end nest without crossing. A
|
|
1487
|
-
routed line leaves its port and reaches the other one **sideways**, because
|
|
1488
|
-
the column straight under or over a port is where the staggered edges of that
|
|
1489
|
-
port run. Only the stub at the port is shared. Into a lower row of a stack of
|
|
1490
|
-
the compact tree an edge runs a **comb** (`7.23.154`): along the channel to a
|
|
1491
|
-
lane of its own in the stack's corridor, down it, and into the gap above its
|
|
1492
|
-
card; lanes go outermost first by row, so none crosses another, and a comb is
|
|
1493
|
-
drawn as laid out, never routed.
|
|
1494
|
-
|
|
1495
|
-
**Curved edges keep off the cards as well** (`7.23.155`). On a layout with
|
|
1496
|
-
rows a curve is `treedb-curve-v` / `-h`, a subclass of G6's cubic: the cubic
|
|
1497
|
-
as before, unless that very curve — the path G6 would draw, sampled, not the
|
|
1498
|
-
rectangle round it — would cross a card other than its own two, or the edge
|
|
1499
|
-
does not run forward and so would cross its own. Then it takes the way its
|
|
1500
|
-
elbow would (comb, detour, route, the same lanes and staggered turns) with
|
|
1501
|
-
corners rounded to 24px. On a layout with no rows the edges stay G6's plain
|
|
1502
|
-
cubic. G6's `shortest-path` router is not used: it is
|
|
1503
|
-
not exported, it
|
|
1451
|
+
and last segments are not tested against their own box. G6's `shortest-path`
|
|
1452
|
+
router is not used: it is not exported, it
|
|
1504
1453
|
falls back in silence to a route that crosses cards, and it rewrites its
|
|
1505
1454
|
module defaults with every config it is given.
|
|
1506
1455
|
|
|
1507
|
-
|
|
1456
|
+
Both take the **same spanning tree**, chosen deterministically: roots are the
|
|
1508
1457
|
nodes with no incoming edge, in node order; a node belongs to the **first
|
|
1509
1458
|
parent that reaches it** in a breadth-first walk (the place, not the
|
|
1510
1459
|
controller, because the place's column came first) and its other links are
|