@yuneta/gobj-ui 7.23.156 → 7.23.158
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 +38 -71
- package/dist/gobj-ui.cjs.js +299 -959
- package/dist/gobj-ui.es.js +300 -960
- package/package.json +1 -1
- package/src/c_g6_nodes_tree.js +227 -241
- package/src/c_yui_treedb_graph.js +91 -13
- 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
|
@@ -1254,23 +1254,38 @@ construction rather than by a check in twenty places.
|
|
|
1254
1254
|
### Finding a node in the graph
|
|
1255
1255
|
|
|
1256
1256
|
`C_YUI_TREEDB_GRAPH` carries a find box in the middle of its toolbar. It
|
|
1257
|
-
matches the term against the node's **label**, its id and its topic name,
|
|
1258
|
-
every match in the same amber `active` state the topic focus
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1257
|
+
matches the term against the node's **label**, its id and its topic name, and
|
|
1258
|
+
puts every match **on screen** in the same amber `active` state the topic focus
|
|
1259
|
+
uses. It changes nothing else: no group is opened, no layout runs, the camera
|
|
1260
|
+
does not move. Emptying the box takes the amber off and leaves the graph
|
|
1261
|
+
exactly as it was.
|
|
1262
|
+
|
|
1263
|
+
Details that are not decoration:
|
|
1264
|
+
|
|
1265
|
+
- it **only looks** (since `7.23.158`). It used to search the whole treedb and
|
|
1266
|
+
unfold a page of the matches it found, so every keystroke re-laid the graph
|
|
1267
|
+
out, and the groups it opened stayed open when the box was cleared. Opening
|
|
1268
|
+
up to a topic is the legend's focus button, which still searches the whole
|
|
1269
|
+
treedb and unfolds what it needs.
|
|
1270
|
+
- the term **stays live**. It is repainted after every change of what is on
|
|
1271
|
+
screen (a group opened by hand, a fold level, a refresh, a hidden topic), so
|
|
1272
|
+
newly shown matches arrive lit and the count follows the screen.
|
|
1273
|
+
- **Enter** centres the next lit card, **Shift+Enter** the previous one, in
|
|
1274
|
+
reading order (top to bottom, then left to right). That is the one camera
|
|
1275
|
+
move of the find, and the reader asks for it. The count then reads `k/N`.
|
|
1263
1276
|
- it matches the **label**, not only the id. On a topic keyed by `rowid`,
|
|
1264
1277
|
`uuid` or `qualified` the id is a counter or a path and the name a human
|
|
1265
1278
|
knows the record by lives in a secondary key — the same reason `node_label()`
|
|
1266
1279
|
exists.
|
|
1267
|
-
- it **says how many** it found
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1280
|
+
- it **says how many** it found, and how many more it did NOT light:
|
|
1281
|
+
`12 matches (+513 not shown, +40 in hidden topics)`. A graph with no amber
|
|
1282
|
+
looks identical whether nothing matched or the matches are folded away, so
|
|
1283
|
+
the count is shown next to the box (hidden while the box is empty; a typed
|
|
1284
|
+
term that matches nothing shows `0`, which is an answer).
|
|
1271
1285
|
|
|
1272
1286
|
The find and the topic focus **share the highlight**: starting one clears the
|
|
1273
|
-
other. Two amber sets at once would say
|
|
1287
|
+
other (a topic focus also empties the box). Two amber sets at once would say
|
|
1288
|
+
nothing about either.
|
|
1274
1289
|
|
|
1275
1290
|
The highlight is painted **into the card's own html**, not with G6's `active`
|
|
1276
1291
|
element state. That state is an amber `stroke` + `halo`, both properties of a
|
|
@@ -1281,9 +1296,12 @@ changes are repainted, and a theme switch carries the highlight across (it
|
|
|
1281
1296
|
rebuilds every card, and rebuilding them without it would clear what is on
|
|
1282
1297
|
screen).
|
|
1283
1298
|
|
|
1284
|
-
Wiring: the box sends `EV_FIND_NODES {text}` to the view,
|
|
1285
|
-
`
|
|
1286
|
-
|
|
1299
|
+
Wiring: the box sends `EV_FIND_NODES {text}` to the view, and Enter sends
|
|
1300
|
+
`EV_FIND_NEXT {back}`; the view forwards both to `C_G6_NODES_TREE`. The graph
|
|
1301
|
+
answers `EV_FIND_RESULT {term, matches, folded_matches, hidden_matches,
|
|
1302
|
+
current}`, which the view declares like every other event its child publishes.
|
|
1303
|
+
Consumer i18n keys: `matches` (counted), `not shown`, `hidden topics`,
|
|
1304
|
+
`find on screen` (the box's title and name).
|
|
1287
1305
|
|
|
1288
1306
|
### The graph opens FOLDED, like a JSON viewer
|
|
1289
1307
|
|
|
@@ -1387,8 +1405,8 @@ G6 5.1 registers these layouts, and this is how each meets that shape:
|
|
|
1387
1405
|
| `circular`, `concentric`, `grid`, `mds`, `random` | rings, rings by degree, a grid, projection, noise | none knows a parent from a child |
|
|
1388
1406
|
| `combo-combined`, `fishbone` | combos / cause-effect | not this data |
|
|
1389
1407
|
|
|
1390
|
-
So
|
|
1391
|
-
layouts by
|
|
1408
|
+
So two of our own, in `treedb_layout.js` (pure, tested), registered as G6
|
|
1409
|
+
layouts by two thin adapters in `c_g6_nodes_tree.js`:
|
|
1392
1410
|
|
|
1393
1411
|
- **`treedb-tree`** — the classic tidy tree, **top to bottom**. A row per
|
|
1394
1412
|
depth as tall as its tallest card, a node centred over the block of its
|
|
@@ -1402,25 +1420,6 @@ layouts by three thin adapters in `c_g6_nodes_tree.js`:
|
|
|
1402
1420
|
keeps the other reading for a host that wants it). The outline that shipped
|
|
1403
1421
|
beside it (`treedb-outline`, one row per node) was removed in `7.23.75`: a
|
|
1404
1422
|
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
1423
|
- **`radial`** (`treedb-radial`) — the root in the middle, a ring per depth,
|
|
1425
1424
|
every subtree an angular **sector** proportional to its leaves, and the
|
|
1426
1425
|
radius of each ring the largest of three: one `ranksep` out from the ring
|
|
@@ -1430,15 +1429,7 @@ layouts by three thin adapters in `c_g6_nodes_tree.js`:
|
|
|
1430
1429
|
cards touching, where the tidy tree's `ranksep` is a gap between COLUMNS
|
|
1431
1430
|
and a column carries its own width. A fan that cannot overlap by
|
|
1432
1431
|
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.
|
|
1432
|
+
circle around an empty centre.
|
|
1442
1433
|
|
|
1443
1434
|
**Elbow edges** (`7.23.149`) are an option of the edges, not a layout: the
|
|
1444
1435
|
toolbar's `GRAPH_EDGE_ELBOW` toggle sets `edge_shape` to `elbow`, and every
|
|
@@ -1475,36 +1466,12 @@ what gets routed is a detour with a third card in its way, an edge dropping
|
|
|
1475
1466
|
several rows, an edge between two cards of one row. Since `7.23.152` a node is
|
|
1476
1467
|
measured **whole** — card, ports and label — so a line keeps clear of the
|
|
1477
1468
|
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
|
|
1469
|
+
and last segments are not tested against their own box. G6's `shortest-path`
|
|
1470
|
+
router is not used: it is not exported, it
|
|
1504
1471
|
falls back in silence to a route that crosses cards, and it rewrites its
|
|
1505
1472
|
module defaults with every config it is given.
|
|
1506
1473
|
|
|
1507
|
-
|
|
1474
|
+
Both take the **same spanning tree**, chosen deterministically: roots are the
|
|
1508
1475
|
nodes with no incoming edge, in node order; a node belongs to the **first
|
|
1509
1476
|
parent that reaches it** in a breadth-first walk (the place, not the
|
|
1510
1477
|
controller, because the place's column came first) and its other links are
|