@yuneta/gobj-ui 7.23.82 → 7.23.84
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 +40 -11
- package/dist/gobj-ui.cjs.js +266 -126
- package/dist/gobj-ui.es.js +266 -126
- package/package.json +1 -1
- package/src/c_g6_nodes_tree.js +162 -38
- package/src/c_yui_treedb_graph.js +97 -29
- package/src/treedb_layout.js +55 -16
- package/src/treedb_layout.test.js +15 -0
package/README.md
CHANGED
|
@@ -842,8 +842,13 @@ looked at from afar or read through a keyhole — never scrolled, which is what
|
|
|
842
842
|
a wheel does on a map and on every page. Shift + wheel scrolls sideways, a
|
|
843
843
|
trackpad pinch arrives as Ctrl + wheel and keeps zooming, and the two-finger
|
|
844
844
|
pinch on a touch screen is [our own](#the-graphs-on-a-touch-screen). G6's
|
|
845
|
-
`scroll-canvas` takes the plain wheel (its `enable` stands aside for a
|
|
846
|
-
|
|
845
|
+
`scroll-canvas` takes the plain wheel (its `enable` stands aside for a Ctrl
|
|
846
|
+
wheel) and `zoom-canvas` takes `trigger: ['Control']`. **One key, named the
|
|
847
|
+
same on both sides**: the scroll used to stand aside for Meta as well, so
|
|
848
|
+
Cmd + wheel on a Mac neither scrolled nor zoomed (`7.23.84`). It cannot be
|
|
849
|
+
both keys, either — a G6 `trigger` is a CHORD, not a list of alternatives:
|
|
850
|
+
`Shortcut.match()` compares the keys held to the keys bound as a SET, so
|
|
851
|
+
`['Control', 'Meta']` would mean both at once.
|
|
847
852
|
|
|
848
853
|
`C_G6_NODES_TREE` floats a vertical toolbar over the canvas:
|
|
849
854
|
|
|
@@ -1317,9 +1322,14 @@ layouts by two thin adapters in `c_g6_nodes_tree.js`:
|
|
|
1317
1322
|
list that indents is a JSON viewer, and this library already has one.
|
|
1318
1323
|
- **`radial`** (`treedb-radial`) — the root in the middle, a ring per depth,
|
|
1319
1324
|
every subtree an angular **sector** proportional to its leaves, and the
|
|
1320
|
-
radius of each ring the
|
|
1321
|
-
the length its cards need side by side
|
|
1322
|
-
|
|
1325
|
+
radius of each ring the largest of three: one `ranksep` out from the ring
|
|
1326
|
+
before, the length its cards need side by side, and (since `7.23.84`) far
|
|
1327
|
+
enough for each card to clear the one it HANGS FROM — `ranksep` is a step
|
|
1328
|
+
between CENTRES, so 180 between two cards that reach ~95 each way is two
|
|
1329
|
+
cards touching, where the tidy tree's `ranksep` is a gap between COLUMNS
|
|
1330
|
+
and a column carries its own width. A fan that cannot overlap by
|
|
1331
|
+
construction, across the ring or along the radius; several roots share the
|
|
1332
|
+
circle around an empty centre.
|
|
1323
1333
|
|
|
1324
1334
|
Both take the **same spanning tree**, chosen deterministically: roots are the
|
|
1325
1335
|
nodes with no incoming edge, in node order; a node belongs to the **first
|
|
@@ -1364,10 +1374,13 @@ screen every card is a smudge. Since `7.23.82` a record has **three views**
|
|
|
1364
1374
|
popover's own scope: this node, the topic, every node), remembered as the
|
|
1365
1375
|
topic's default and saved per node in `__graphs__` as `node_shape`.
|
|
1366
1376
|
|
|
1367
|
-
In the view's toolbar (`C_YUI_TREEDB_GRAPH`), next to the fold pair:
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1377
|
+
In the view's toolbar (`C_YUI_TREEDB_GRAPH`), next to the fold pair: three
|
|
1378
|
+
push buttons in one group — a card, a line, a figure — the pressed one being
|
|
1379
|
+
the view that is on (`full` / `compact` / `shape`, persisted as `node_mode`;
|
|
1380
|
+
a change lays the graph out again, because a figure and a card do not take
|
|
1381
|
+
the same room; buttons and not a select since `7.23.83`, because a view is
|
|
1382
|
+
picked at a glance and a closed list says nothing until it is opened) and a
|
|
1383
|
+
labels toggle (`node_labels`, the name under each figure,
|
|
1371
1384
|
enabled in the `shape` view only — nothing moves, the label hangs outside the
|
|
1372
1385
|
figure and the layout measures the figure).
|
|
1373
1386
|
|
|
@@ -1408,11 +1421,19 @@ where a port's `shape` picks the G shape by the names G6 registers itself:
|
|
|
1408
1421
|
`circle`, `square`, `diamond`, `triangle`. `r` stays the one size (the
|
|
1409
1422
|
half-side of the square, the half-diagonal of the diamond), and the hit test,
|
|
1410
1423
|
the resize handles and the edge's landing point read `r` and none of them care
|
|
1411
|
-
about the outline
|
|
1424
|
+
about the outline; the HIT TEST does, since `7.23.84` — a circle around a
|
|
1425
|
+
diamond answers for the air off its corners while missing the middle of its
|
|
1426
|
+
edges — so the distance ranks two overlapping ports and the shape says which
|
|
1427
|
+
are in the running. A selected port shows a gear beside it, as the node does
|
|
1412
1428
|
(under the link icon on an fkey); it opens the **port properties** popover —
|
|
1413
1429
|
shape, radius, and the scope: *this port*, *the same port of every card of
|
|
1414
1430
|
the topic* (the hook or fkey column), or *every port there is* — with a live
|
|
1415
|
-
preview on the port and a cancel that puts it back
|
|
1431
|
+
preview on the port and a cancel that puts it back — and since `7.23.84` any
|
|
1432
|
+
other way out puts it back too: the undo is kept beside the popover and run
|
|
1433
|
+
by whoever hides it (a click on the canvas, the icon pressed again, the
|
|
1434
|
+
element going away), because a preview is not the reader's answer until
|
|
1435
|
+
`apply` is pressed. The same for the node and edge popovers. The choice is
|
|
1436
|
+
remembered
|
|
1416
1437
|
as the topic's default (`port_shapes[key]` / `port_shape`, beside
|
|
1417
1438
|
`port_sizes` / `portR`), so a card that arrives later is born with it, and
|
|
1418
1439
|
saved per node in `__graphs__` as `port_shapes`. On a touch screen the port's
|
|
@@ -1480,6 +1501,14 @@ forwards them as `EV_SET_HIDDEN_TOPICS`, `EV_SET_MAIN_TOPIC`,
|
|
|
1480
1501
|
`main topic`, `highlight topic`, `loose records`, `hidden topics`; `legend`
|
|
1481
1502
|
is no longer used.
|
|
1482
1503
|
|
|
1504
|
+
**The strip is repainted on a language change** (`7.23.84`): its chips are
|
|
1505
|
+
drawn on `EV_LEGEND_STATE`, which arrives after a reconcile and not when the
|
|
1506
|
+
language changes, and a chip's title says an ACTION that depends on the
|
|
1507
|
+
state — so the view subscribes to the shell's `EV_LANGUAGE_CHANGED` and
|
|
1508
|
+
redraws the strip and the find box's counted line. The keys travel in the
|
|
1509
|
+
DOM as well (`data-i18n-title`, `data-i18n-aria-label`), so
|
|
1510
|
+
`refresh_language()` reaches the titles even before the repaint.
|
|
1511
|
+
|
|
1483
1512
|
### C_YUI_TREEDB_SCHEMA — the treedb drawn the way its `.c` draws it
|
|
1484
1513
|
|
|
1485
1514
|
A landing view that draws a treedb the way its schema literal draws it in ASCII
|