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