@yuneta/gobj-ui 7.23.80 → 7.23.82

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 CHANGED
@@ -1341,38 +1341,50 @@ The walks are **iterative**, not recursive: a self-referent hook (a place
1341
1341
  inside a place inside a place) is as deep as the store says, and the stack is
1342
1342
  not. A 20000-node chain is a test.
1343
1343
 
1344
- ### Closed nodes: the topology of a graph with many nodes
1344
+ ### The three views of a record: card, pill, figure
1345
1345
 
1346
1346
  A card is 172×96 px with its ports, and a graph of a few hundred of them is
1347
1347
  readable card by card and unreadable as a whole: at the zoom that fits it on
1348
- screen every card is a smudge. Since `7.23.75` a record has **two shapes**:
1349
-
1350
- - **open** — the card, with its name, its pills and its **ports**. The only
1351
- shape a link can be edited on, because a link is drawn from a port.
1352
- - **closed** — a rounded square of the topic's colour, no ports, no text:
1353
- the **topology** and nothing else. A native G6 `rect`, so the focus, the
1354
- selection and the anchor are its own stroke and halo instead of a rebuilt
1355
- innerHTML. The three tiers keep their order of size (32 / 28 / 22), and
1356
- the structural tier keeps its dashed border.
1357
-
1358
- Two toggles in the view's toolbar (`C_YUI_TREEDB_GRAPH`), next to the fold
1359
- pair, both **states** and both looking pressed:
1360
-
1361
- | toggle | attr (persisted) | what it does |
1362
- |---|---|---|
1363
- | closed nodes | `node_mode` (`expanded` / `compact`) | every record closed or every record open; a change lays the graph out again, because a square and a card do not take the same room |
1364
- | labels | `node_labels` | the name under each closed square, on or off — nothing moves, the label hangs outside the square and the layout measures the square |
1365
-
1366
- And **one node against the rule**: a double click on a node opens it if the
1367
- graph is closed and closes it if the graph is open; the node's context menu
1368
- (`open node` / `close node`) does the same, which is the door a finger has to
1369
- it. The node holds still on screen while the rest makes room, as a fold does.
1370
- A change of the global mode forgets these exceptions. Consumer i18n keys:
1371
- `closed nodes`, `node labels`, `open node`, `close node`.
1348
+ screen every card is a smudge. Since `7.23.82` a record has **three views**
1349
+ (`node_mode`), the same three the gobj tree view offers as `Vertical` /
1350
+ `Vertical compact`:
1351
+
1352
+ - **`expanded`** — the card, with its name, its pills and its **ports**. The
1353
+ view a hook is opened from, and the only one a size can be edited in.
1354
+ - **`compact`** — a one-line **pill** with the name inside, the tint and the
1355
+ border of the topic, and small ports (radius 6) on its edges, so a link can
1356
+ still be drawn. The same one-line chip a leaf record already is, at the
1357
+ tier's width (200 / 180 / 160 px). No pills.
1358
+ - **`shape`** — a **figure** of the topic's colour, no ports, no text: the
1359
+ topology and nothing else. A native G6 node — square (rounded `rect`),
1360
+ circle, diamond, triangle, hexagon or star — so the focus, the selection
1361
+ and the anchor are its own stroke and halo. The three tiers keep their
1362
+ order of size (32 / 28 / 22), the structural tier its dashed border. The
1363
+ figure is chosen in the **node properties** popover (`shape`, with the
1364
+ popover's own scope: this node, the topic, every node), remembered as the
1365
+ topic's default and saved per node in `__graphs__` as `node_shape`.
1366
+
1367
+ In the view's toolbar (`C_YUI_TREEDB_GRAPH`), next to the fold pair: a
1368
+ `nodes` select (`full` / `compact` / `shape`, persisted as `node_mode`; a
1369
+ change lays the graph out again, because a figure and a card do not take the
1370
+ same room) and a labels toggle (`node_labels`, the name under each figure,
1371
+ enabled in the `shape` view only — nothing moves, the label hangs outside the
1372
+ figure and the layout measures the figure).
1373
+
1374
+ And **one node against the rule**: a double click expands a pill or a figure
1375
+ into its card, and collapses a card into a pill; the node's context menu
1376
+ (`expand node` / `collapse node`) does the same, which is the door a finger
1377
+ has to it. The node holds still on screen while the rest makes room, as a
1378
+ fold does. A change of the view forgets these exceptions. The `+N` chip
1379
+ follows the shape of the card it continues: full beside a card, small beside
1380
+ a pill or a figure. Consumer i18n keys: `nodes`, `full`, `compact`, `shape`,
1381
+ `node labels`, `expand node`, `collapse node`, and the figures `square`,
1382
+ `circle`, `diamond`, `triangle`, `hexagon`, `star`.
1372
1383
 
1373
1384
  The ports of an open card grew with this (radius 14 on a card, 8 on a chip
1374
- since `7.23.79`; 10 / 5 in `7.23.75`, 2 px stroke): they are what a link is drawn from and what a resize takes hold
1375
- of, and at radius 6 with a hairline nobody could tell they were either.
1385
+ since `7.23.79`; 10 / 5 in `7.23.75`, 2 px stroke): they are what a link is
1386
+ drawn from and what a resize takes hold of, and at radius 6 with a hairline
1387
+ nobody could tell they were either.
1376
1388
 
1377
1389
  **A size nobody chose is not saved** (since `7.23.80`). `Save` collects the
1378
1390
  geometry of every card into `__graphs__`, and it used to write the SIZE and
@@ -1388,6 +1400,29 @@ radius and per-port radius — per node and as topic defaults from `resize all`
1388
1400
  on the spot, and arm Save. Positions and edge styles are not touched.
1389
1401
  Consumer i18n keys: `reset sizes`, `reset topic sizes`.
1390
1402
 
1403
+ **A port has a shape, and its own properties popover** (since `7.23.81`).
1404
+ G6 draws every port as a circle — `drawPortShapes` upserts a `Circle` and
1405
+ nothing in the port style says otherwise — so a record's card is now a node
1406
+ of its own, `treedb-card` (G6's html node with `drawPortShapes` overridden),
1407
+ where a port's `shape` picks the G shape by the names G6 registers itself:
1408
+ `circle`, `square`, `diamond`, `triangle`. `r` stays the one size (the
1409
+ half-side of the square, the half-diagonal of the diamond), and the hit test,
1410
+ the resize handles and the edge's landing point read `r` and none of them care
1411
+ about the outline. A selected port shows a gear beside it, as the node does
1412
+ (under the link icon on an fkey); it opens the **port properties** popover —
1413
+ shape, radius, and the scope: *this port*, *the same port of every card of
1414
+ 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. The choice is remembered
1416
+ as the topic's default (`port_shapes[key]` / `port_shape`, beside
1417
+ `port_sizes` / `portR`), so a card that arrives later is born with it, and
1418
+ saved per node in `__graphs__` as `port_shapes`. On a touch screen the port's
1419
+ context menu has the same entry. The `+N` chip stays an `html` node.
1420
+ Consumer i18n keys: `port properties`, `shape`, `circle`, `square`, `diamond`,
1421
+ `triangle`, `radius`, `this port`, `same port in topic`, `all ports` — and
1422
+ the node and edge popovers' own labels, which had no key at all (`apply to`,
1423
+ `fill color`, `stroke color`, `line width`, `color`, `create`), so they
1424
+ rendered in English in every language.
1425
+
1391
1426
  ### The legend is the graph's layer control
1392
1427
 
1393
1428
  The legend strip under the toolbar is **always there** now (the *Legend*