@yuneta/gobj-ui 5.16.0 → 5.17.0
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 +60 -10
- package/dist/gobj-ui.cjs.js +349 -56
- package/dist/gobj-ui.es.js +349 -56
- package/package.json +1 -1
- package/src/c_g6_nodes_tree.js +38 -24
- package/src/c_yui_treedb_schema.js +348 -43
- package/src/treedb_node_label.js +73 -0
- package/src/treedb_node_label.test.js +92 -0
package/README.md
CHANGED
|
@@ -430,6 +430,25 @@ Logical DOM classes: `JSON_VIEWER`, `JSON_TOOLBAR`, `JSON_SEARCH`, `JSON_TREE`,
|
|
|
430
430
|
`JSON_ROW`, `JSON_KEY`, `JSON_VALUE`, `JSON_SUMMARY`, `JSON_COLLAPSED`,
|
|
431
431
|
`JSON_TIME`. The gclass imports its own `c_yui_json.css`.
|
|
432
432
|
|
|
433
|
+
### What a node in the graph is CALLED
|
|
434
|
+
|
|
435
|
+
`C_G6_NODES_TREE` (the record graph inside `C_YUI_TREEDB_GRAPH`) labels a card
|
|
436
|
+
by what NAMES the record, which is not always what KEYS it. A topic whose id
|
|
437
|
+
column is flagged `rowid` or `uuid` keys its records by a value nobody reads —
|
|
438
|
+
that is the point of those flags — and the name lives in the secondary key the
|
|
439
|
+
topic declares (`pkey2s`). `treedb_system_schema` is the case that forced it:
|
|
440
|
+
its `topics` and `cols` records are keyed by rowid and named in `value`, so the
|
|
441
|
+
graph drew cards reading `181`, `225`, `193`.
|
|
442
|
+
|
|
443
|
+
The rule is in **`treedb_node_label.js`** (pure, unit-tested): read the pkey
|
|
444
|
+
column's flags from the desc; if the key is synthetic, take the first `pkey2s`
|
|
445
|
+
field the record actually carries; otherwise keep the id. **The pkey is never
|
|
446
|
+
lost** — it is the card's tooltip, on the chip and on the entity card alike.
|
|
447
|
+
|
|
448
|
+
It needs the descriptor to carry `pkey2s`, which `tranger2_topic_desc()` only
|
|
449
|
+
clones from **SDK > 7.13.0**. Against an older node the desc has no `pkey2s`, the
|
|
450
|
+
label falls back to the id, and nothing else changes.
|
|
451
|
+
|
|
433
452
|
### Read-only treedbs: `readonly`
|
|
434
453
|
|
|
435
454
|
`C_YUI_TREEDB_TOPICS` and `C_YUI_TREEDB_GRAPH` take a **`readonly`** attr; the
|
|
@@ -469,14 +488,44 @@ Two implementation notes worth keeping:
|
|
|
469
488
|
still arrive from a keyboard path or a form that outlived the flag, and an
|
|
470
489
|
ignored write is exactly the behaviour this whole change exists to stop.
|
|
471
490
|
|
|
472
|
-
### C_YUI_TREEDB_SCHEMA — the treedb
|
|
473
|
-
|
|
474
|
-
A landing view that draws a treedb
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
491
|
+
### C_YUI_TREEDB_SCHEMA — the treedb drawn the way its `.c` draws it
|
|
492
|
+
|
|
493
|
+
A landing view that draws a treedb the way its schema literal draws it in ASCII
|
|
494
|
+
(`treedb_schema_*.c`, `treedb_system_schema.c`): **one card per topic**,
|
|
495
|
+
listing its fields in schema order, and **one edge per hook**, leaving the row
|
|
496
|
+
that declares the hook and landing on the fkey row of the child it names. Built
|
|
497
|
+
from the schema `descs` **alone**: no data, no backend calls. It is the "every
|
|
498
|
+
treedb is a graph" rule applied to the schema itself, and an alternate landing
|
|
499
|
+
to the topic cards. A node click opens that topic's table through a real hash
|
|
500
|
+
navigation, so the graph is a navigation surface rather than a picture.
|
|
501
|
+
|
|
502
|
+
The marks are the notation of those `.c` literals, so the drawing and the
|
|
503
|
+
source read the same:
|
|
504
|
+
|
|
505
|
+
| Mark | Meaning |
|
|
506
|
+
|------|---------|
|
|
507
|
+
| `{}` | dict hook — N unique children |
|
|
508
|
+
| `[]` | list hook — n not-unique children |
|
|
509
|
+
| `()` | a single child |
|
|
510
|
+
| `(↖)` | 1 fkey — 1 parent |
|
|
511
|
+
| `[↖]` | n fkeys — n parents |
|
|
512
|
+
| `{↖}` | N fkeys — N parents |
|
|
513
|
+
| `*` | required |
|
|
514
|
+
| `#` | the primary key |
|
|
515
|
+
|
|
516
|
+
`dict` and `object` are one shape and `list` and `array` are another, exactly
|
|
517
|
+
as tr_treedb's hook/fkey switches treat them. A self-referent hook (a tree)
|
|
518
|
+
draws as a loop.
|
|
519
|
+
|
|
520
|
+
**Not to be confused with the node graph** (`C_G6_NODES_TREE`, hosted by
|
|
521
|
+
`C_YUI_TREEDB_GRAPH`), which draws the **records**. On a treedb whose records
|
|
522
|
+
are schemas — `treedb_system_schema` — that one draws a box per column,
|
|
523
|
+
hundreds of them, each labelled by a pkey that is a rowid: a correct picture of
|
|
524
|
+
the storage and an unreadable picture of the schema. This view answers the
|
|
525
|
+
schema question; that one answers the data question.
|
|
526
|
+
|
|
527
|
+
The demo `test-app/schema.html` mounts it alone against the real yuneta agent
|
|
528
|
+
schema, so the drawing can be held against the ASCII one in its `.c`.
|
|
480
529
|
|
|
481
530
|
**Contract:**
|
|
482
531
|
|
|
@@ -489,8 +538,9 @@ graph is a navigation surface rather than a picture.
|
|
|
489
538
|
graph in place, preserving the user's zoom/pan), plus the internal
|
|
490
539
|
`EV_NODE_CLICK` a node click sends into the FSM.
|
|
491
540
|
|
|
492
|
-
|
|
493
|
-
|
|
541
|
+
Barrel-exported and public from 4.0.0. Renders with `@antv/g6`; the cards are
|
|
542
|
+
HTML nodes carrying their own inline colours, so a theme switch repaints them in
|
|
543
|
+
place (no CSS of its own).
|
|
494
544
|
|
|
495
545
|
### Frontend view — `setup_frontend_view`
|
|
496
546
|
|