@yuneta/gobj-ui 6.3.1 → 6.3.2

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
@@ -529,9 +529,13 @@ Two implementation notes worth keeping:
529
529
 
530
530
  A landing view that draws a treedb the way its schema literal draws it in ASCII
531
531
  (`treedb_schema_*.c`, `treedb_system_schema.c`): **one card per topic**,
532
- listing its fields in schema order, and **one edge per hook**, leaving the row
533
- that declares the hook and landing on the fkey row of the child it names. Built
534
- from the schema `descs` **alone**: no data, no backend calls. It is the "every
532
+ listing its fields in schema order, and **one edge per hook**, between the row
533
+ that declares the hook and the fkey row of the child it names. The **arrowhead
534
+ is on the hook**, the way the `.c` draws it and the way the `↖` of the fkey
535
+ mark reads: the reference is held by the child and points at its parent. The
536
+ edge itself is declared parent → child, which is what ranks the parent to the
537
+ left, first, as the literal lists it. Built from the schema `descs` **alone**:
538
+ no data, no backend calls. It is the "every
535
539
  treedb is a graph" rule applied to the schema itself, and an alternate landing
536
540
  to the topic cards. A node click opens that topic's table through a real hash
537
541
  navigation, so the graph is a navigation surface rather than a picture.
@@ -19796,9 +19796,11 @@ function register_c_yui_treedb_graph() {
19796
19796
  * Schema-graph landing: the treedb drawn the way its `.c` literal
19797
19797
  * draws it in ASCII (treedb_schema_*.c, treedb_system_schema.c) —
19798
19798
  * one CARD per topic listing its fields in schema order, one edge
19799
- * per hook, from the row that declares the hook to the fkey row of
19800
- * the child it names. Built from the schema `descs` alone: no data,
19801
- * no backend calls.
19799
+ * per hook, between the row that declares the hook and the fkey row
19800
+ * of the child it names arrowhead on the HOOK, as the `.c` draws
19801
+ * it and as the `↖` of the fkey mark says: the reference is the
19802
+ * child's and it points at its parent. Built from the schema
19803
+ * `descs` alone: no data, no backend calls.
19802
19804
  *
19803
19805
  * WHY THE CARD AND NOT A DOT. A topic is its fields; a schema is
19804
19806
  * read to find out what a topic holds and what links to what. A
@@ -20058,14 +20060,17 @@ ${rows_html} </div>
20058
20060
  * Derive {nodes, edges} from the schema.
20059
20061
  *
20060
20062
  * Node = a topic, drawn as the card the `.c` literal draws in
20061
- * ASCII: its name and its fields. Edge = a hook, from the row
20062
- * that declares it to the fkey row of the child it names
20063
- * `'hook': {'users': 'departments'}` says both ends, so the
20064
- * arrow can land where the `.c` drawing lands it. An fkey
20065
- * whose parent declares no hook still gets its edge, or a
20063
+ * ASCII: its name and its fields. Edge = a hook, between the
20064
+ * row that declares it and the fkey row of the child it names
20065
+ * `'hook': {'users': 'departments'}` says both ends, so the
20066
+ * edge can land on the rows the `.c` drawing lands it on. An
20067
+ * fkey whose parent declares no hook still gets its edge, or a
20066
20068
  * half-declared schema would draw as disconnected.
20067
20069
  *
20068
- * Left-to-right dagre follows the parent -> child data flow.
20070
+ * An edge is declared parent -> child so left-to-right dagre
20071
+ * ranks the parent first, the order the `.c` literal lists
20072
+ * them in. The ARROWHEAD is the other way (see edge_style):
20073
+ * the fkey points at the hook, never the hook at the fkey.
20069
20074
  ************************************************************/
20070
20075
  function schema_to_graph(gobj) {
20071
20076
  let descs = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "descs");
@@ -20165,12 +20170,20 @@ function schema_to_graph(gobj) {
20165
20170
  * the graph is built and re-applied on a theme switch
20166
20171
  * (ac_theme), which restyles the LIVE graph — rebuilding it
20167
20172
  * would drop the user's zoom/pan and any dragged node.
20173
+ *
20174
+ * The arrowhead is at the START of the edge, on the parent's
20175
+ * hook — the direction the `.c` literals draw and the `↖` of
20176
+ * the fkey mark names: the reference is held by the CHILD and
20177
+ * points at its parent. The edge is still declared parent ->
20178
+ * child, which is what ranks the parent to the left; only the
20179
+ * marker says who points at whom.
20168
20180
  ************************************************************/
20169
20181
  function edge_style(dark) {
20170
20182
  return {
20171
20183
  stroke: dark ? "#7a8593" : "#9aa4b2",
20172
20184
  lineWidth: 1.2,
20173
- endArrow: true
20185
+ startArrow: true,
20186
+ endArrow: false
20174
20187
  };
20175
20188
  }
20176
20189
  /************************************************************
@@ -19783,9 +19783,11 @@ function register_c_yui_treedb_graph() {
19783
19783
  * Schema-graph landing: the treedb drawn the way its `.c` literal
19784
19784
  * draws it in ASCII (treedb_schema_*.c, treedb_system_schema.c) —
19785
19785
  * one CARD per topic listing its fields in schema order, one edge
19786
- * per hook, from the row that declares the hook to the fkey row of
19787
- * the child it names. Built from the schema `descs` alone: no data,
19788
- * no backend calls.
19786
+ * per hook, between the row that declares the hook and the fkey row
19787
+ * of the child it names arrowhead on the HOOK, as the `.c` draws
19788
+ * it and as the `↖` of the fkey mark says: the reference is the
19789
+ * child's and it points at its parent. Built from the schema
19790
+ * `descs` alone: no data, no backend calls.
19789
19791
  *
19790
19792
  * WHY THE CARD AND NOT A DOT. A topic is its fields; a schema is
19791
19793
  * read to find out what a topic holds and what links to what. A
@@ -20045,14 +20047,17 @@ ${rows_html} </div>
20045
20047
  * Derive {nodes, edges} from the schema.
20046
20048
  *
20047
20049
  * Node = a topic, drawn as the card the `.c` literal draws in
20048
- * ASCII: its name and its fields. Edge = a hook, from the row
20049
- * that declares it to the fkey row of the child it names
20050
- * `'hook': {'users': 'departments'}` says both ends, so the
20051
- * arrow can land where the `.c` drawing lands it. An fkey
20052
- * whose parent declares no hook still gets its edge, or a
20050
+ * ASCII: its name and its fields. Edge = a hook, between the
20051
+ * row that declares it and the fkey row of the child it names
20052
+ * `'hook': {'users': 'departments'}` says both ends, so the
20053
+ * edge can land on the rows the `.c` drawing lands it on. An
20054
+ * fkey whose parent declares no hook still gets its edge, or a
20053
20055
  * half-declared schema would draw as disconnected.
20054
20056
  *
20055
- * Left-to-right dagre follows the parent -> child data flow.
20057
+ * An edge is declared parent -> child so left-to-right dagre
20058
+ * ranks the parent first, the order the `.c` literal lists
20059
+ * them in. The ARROWHEAD is the other way (see edge_style):
20060
+ * the fkey points at the hook, never the hook at the fkey.
20056
20061
  ************************************************************/
20057
20062
  function schema_to_graph(gobj) {
20058
20063
  let descs = gobj_read_attr(gobj, "descs");
@@ -20152,12 +20157,20 @@ function schema_to_graph(gobj) {
20152
20157
  * the graph is built and re-applied on a theme switch
20153
20158
  * (ac_theme), which restyles the LIVE graph — rebuilding it
20154
20159
  * would drop the user's zoom/pan and any dragged node.
20160
+ *
20161
+ * The arrowhead is at the START of the edge, on the parent's
20162
+ * hook — the direction the `.c` literals draw and the `↖` of
20163
+ * the fkey mark names: the reference is held by the CHILD and
20164
+ * points at its parent. The edge is still declared parent ->
20165
+ * child, which is what ranks the parent to the left; only the
20166
+ * marker says who points at whom.
20155
20167
  ************************************************************/
20156
20168
  function edge_style(dark) {
20157
20169
  return {
20158
20170
  stroke: dark ? "#7a8593" : "#9aa4b2",
20159
20171
  lineWidth: 1.2,
20160
- endArrow: true
20172
+ startArrow: true,
20173
+ endArrow: false
20161
20174
  };
20162
20175
  }
20163
20176
  /************************************************************
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "6.3.1",
3
+ "version": "6.3.2",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -4,9 +4,11 @@
4
4
  * Schema-graph landing: the treedb drawn the way its `.c` literal
5
5
  * draws it in ASCII (treedb_schema_*.c, treedb_system_schema.c) —
6
6
  * one CARD per topic listing its fields in schema order, one edge
7
- * per hook, from the row that declares the hook to the fkey row of
8
- * the child it names. Built from the schema `descs` alone: no data,
9
- * no backend calls.
7
+ * per hook, between the row that declares the hook and the fkey row
8
+ * of the child it names arrowhead on the HOOK, as the `.c` draws
9
+ * it and as the `↖` of the fkey mark says: the reference is the
10
+ * child's and it points at its parent. Built from the schema
11
+ * `descs` alone: no data, no backend calls.
10
12
  *
11
13
  * WHY THE CARD AND NOT A DOT. A topic is its fields; a schema is
12
14
  * read to find out what a topic holds and what links to what. A
@@ -380,14 +382,17 @@ ${rows_html} </div>
380
382
  * Derive {nodes, edges} from the schema.
381
383
  *
382
384
  * Node = a topic, drawn as the card the `.c` literal draws in
383
- * ASCII: its name and its fields. Edge = a hook, from the row
384
- * that declares it to the fkey row of the child it names
385
- * `'hook': {'users': 'departments'}` says both ends, so the
386
- * arrow can land where the `.c` drawing lands it. An fkey
387
- * whose parent declares no hook still gets its edge, or a
385
+ * ASCII: its name and its fields. Edge = a hook, between the
386
+ * row that declares it and the fkey row of the child it names
387
+ * `'hook': {'users': 'departments'}` says both ends, so the
388
+ * edge can land on the rows the `.c` drawing lands it on. An
389
+ * fkey whose parent declares no hook still gets its edge, or a
388
390
  * half-declared schema would draw as disconnected.
389
391
  *
390
- * Left-to-right dagre follows the parent -> child data flow.
392
+ * An edge is declared parent -> child so left-to-right dagre
393
+ * ranks the parent first, the order the `.c` literal lists
394
+ * them in. The ARROWHEAD is the other way (see edge_style):
395
+ * the fkey points at the hook, never the hook at the fkey.
391
396
  ************************************************************/
392
397
  function schema_to_graph(gobj)
393
398
  {
@@ -509,13 +514,21 @@ function schema_to_graph(gobj)
509
514
  * the graph is built and re-applied on a theme switch
510
515
  * (ac_theme), which restyles the LIVE graph — rebuilding it
511
516
  * would drop the user's zoom/pan and any dragged node.
517
+ *
518
+ * The arrowhead is at the START of the edge, on the parent's
519
+ * hook — the direction the `.c` literals draw and the `↖` of
520
+ * the fkey mark names: the reference is held by the CHILD and
521
+ * points at its parent. The edge is still declared parent ->
522
+ * child, which is what ranks the parent to the left; only the
523
+ * marker says who points at whom.
512
524
  ************************************************************/
513
525
  function edge_style(dark)
514
526
  {
515
527
  return {
516
528
  stroke: dark ? "#7a8593" : "#9aa4b2",
517
529
  lineWidth: 1.2,
518
- endArrow: true,
530
+ startArrow: true,
531
+ endArrow: false,
519
532
  };
520
533
  }
521
534