@yuneta/gobj-ui 7.29.2 → 7.29.4

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
@@ -2100,7 +2100,7 @@ a level or two, with a count on every cut.
2100
2100
  (`right-top`), **`confirm_delete_node`** and **`confirm_unlink_edge`**. The
2101
2101
  defaults repeat the engine's, so a host that says nothing gets what it got
2102
2102
  before.
2103
- - **A pill per hook on the card** — `▸ devices 142` folded, `▾ devices 24/142`
2103
+ - **A pill per hook on the card** — `▸ devices 200` folded, `▾ devices 24/200`
2104
2104
  open on a page — in the colour of the child topic, the same colour its hook
2105
2105
  port wears. Tapping it opens or folds that hook, and the card stays where it
2106
2106
  was on screen while the layout moves everything else (`yui_graph_place_at`).
@@ -2144,8 +2144,8 @@ a level or two, with a count on every cut.
2144
2144
  `EV_SET_FOCUS_TOPIC`) — *show me these* means all of them — while the graph's
2145
2145
  per-topic **route** (`.../graph/devices` is a focus on `devices`) gets one
2146
2146
  page, because it lands on every load, and revealing a whole topic there
2147
- opened 563 groups of a 6400-record treedb before anybody had touched
2148
- anything.
2147
+ opened hundreds of groups of a treedb of several thousand records before
2148
+ anybody had touched anything.
2149
2149
  - **Edition and the saved geometry are untouched by folding.** Only the cards
2150
2150
  on screen are read when the graph is saved; a folded card keeps the entry it
2151
2151
  had in `__graphs__`. A card on its default size grows by the pill row when it
@@ -2158,7 +2158,7 @@ One consumer key came with it: `show more`, the chip's tooltip.
2158
2158
  ### Layouts: what G6 offers, and the two made for a treedb
2159
2159
 
2160
2160
  What a treedb graph IS, once folded: a **forest read top to bottom**. A main
2161
- topic is a tree (places: country, region, site, hall), the other topics hang
2161
+ topic is a tree (places: country, region, site, building), the other topics hang
2162
2162
  from its nodes through hooks, a record may hang from two parents (a device
2163
2163
  from its place AND its controller), and every visible node was reached from a
2164
2164
  root. Tens to a few hundred cards on screen, never the store.
@@ -2169,7 +2169,7 @@ G6 5.1 registers these layouts, and this is how each meets that shape:
2169
2169
  |---|---|---|
2170
2170
  | `dagre` / `antv-dagre` | layered DAG: longest-path ranks, crossing minimisation, one direction | the right reading (LR); but the crossing heuristic **reorders the siblings on every run** — open one hook and the column next to it shuffles — and it is the one thing that takes time on a big expansion |
2171
2171
  | `compact-box`, `indented`, `dendrogram`, `mindmap` | @antv/hierarchy tree layouts | the shape wanted, but G6 runs them on a tree it **builds from the edges** (`createTreeStructure`): a node with two parents lands under whichever parent the builder met first, unstably |
2172
- | `radial` | MDS on graph distances from a focus node, a ring per depth, overlaps pushed apart afterwards | the right idea — a hall with a hundred devices is a **fan**, not a column — but the ring radius is one it is TOLD: twenty cards of 172px on a ring of radius 200 have 52px each and pile up. Tried, and replaced by our own (below) |
2172
+ | `radial` | MDS on graph distances from a focus node, a ring per depth, overlaps pushed apart afterwards | the right idea — a building with a hundred devices is a **fan**, not a column — but the ring radius is one it is TOLD: twenty cards of 172px on a ring of radius 200 have 52px each and pile up. Tried, and replaced by our own (below) |
2173
2173
  | `force`, `d3-force`, `force-atlas2`, `fruchterman` | physics | scatter a tree: the pile with springs. `d3-force` and `force-atlas2` stay in the picker for the rare flat treedb |
2174
2174
  | `circular`, `concentric`, `grid`, `mds`, `random` | rings, rings by degree, a grid, projection, noise | none knows a parent from a child |
2175
2175
  | `combo-combined`, `fishbone` | combos / cause-effect | not this data |
@@ -2181,7 +2181,7 @@ layouts by two thin adapters in `c_g6_nodes_tree.js`:
2181
2181
  depth as tall as its tallest card, a node centred over the block of its
2182
2182
  children, siblings side by side with `nodesep`. **The default** for a
2183
2183
  treedb nobody has arranged (was `dagre`). It reads down because down is
2184
- where a tree has room: a hall with a hundred devices is a wide row, not a
2184
+ where a tree has room: a building with a hundred devices is a wide row, not a
2185
2185
  column beside a card — and read right (as it did until `7.23.74`) it was
2186
2186
  `dagre` with the siblings held still, which nobody could tell apart. The
2187
2187
  algorithm is written once, left to right; the top-down tree is the same
@@ -4451,7 +4451,7 @@ export default { plugins: [ yunetaHtmlPlugin({ defaultTitle: "My App" }) ] };
4451
4451
  "metadata": {"description": "What the app does"},
4452
4452
  "csp_connect_src": [
4453
4453
  "_comment: the backend this SPA talks to",
4454
- "wss://my.host:1620",
4454
+ "wss://my.host:4620",
4455
4455
  "https://auth.my.host"
4456
4456
  ]
4457
4457
  }
@@ -55821,7 +55821,7 @@ function cards_grid_descriptor(items, show_label, badge_of) {
55821
55821
  * mounted as a stage view by C_YUI_SHELL when a
55822
55822
  * primary item declares submenu.index)
55823
55823
  * "breadcrumb" — the PATH as one line ("Cards › Energy › South
55824
- * hall › Meter 3"), each crumb a link to that
55824
+ * building › Meter 3"), each crumb a link to that
55825
55825
  * level. Unlike every other layout its items
55826
55826
  * are not a node's children but the trail down
55827
55827
  * to where the user is: the second way to show
@@ -66118,7 +66118,7 @@ function fold_reveal(model, state, node_key) {
66118
66118
  *
66119
66119
  * What a treedb graph IS, once it is folded (treedb_fold_model.js):
66120
66120
  * a forest read top to bottom. A main topic is a tree (places:
66121
- * country, region, site, hall), the other topics hang from its
66121
+ * country, region, site, building), the other topics hang from its
66122
66122
  * nodes through hooks (devices, users, controllers), a record may
66123
66123
  * hang from two parents (a device from its place AND its
66124
66124
  * controller), and every visible node was reached from a root.
@@ -66157,7 +66157,7 @@ function fold_reveal(model, state, node_key) {
66157
66157
  * between them. O(n), and opening a hook moves NOTHING that is
66158
66158
  * not below or beside it -- the cards keep their order, the eye
66159
66159
  * keeps its place. It reads DOWN because that is the direction a
66160
- * tree with many children has room in: a hall with a hundred
66160
+ * tree with many children has room in: a building with a hundred
66161
66161
  * devices is a wide row, not a tall column beside a card. (The
66162
66162
  * left-to-right reading is `direction: "LR"`, kept for a host
66163
66163
  * that wants it; `dagre` reads that way in the graph.)
@@ -66361,7 +66361,7 @@ function extent_at(n, a) {
66361
66361
  * subtree gets an angular SECTOR proportional to its leaves, a node
66362
66362
  * sits in the middle of its sector, and the radius of each ring is
66363
66363
  * the larger of "one step further out than the ring before" and
66364
- * "long enough for its nodes to sit side by side" -- so a hall
66364
+ * "long enough for its nodes to sit side by side" -- so a building
66365
66365
  * with a hundred devices is a wide, sparse fan, and nothing
66366
66366
  * overlaps by construction. Several roots share the circle around
66367
66367
  * a virtual centre.
@@ -66833,7 +66833,7 @@ function css_color_or_null(value) {
66833
66833
  * the reader's level (`fold_level`, `expand_depth` until they
66834
66834
  * step it), one page (`fold_page_size`) of children per hook. Each
66835
66835
  * card carries a pill per hook that has children -- `▸ devices
66836
- * 142` -- which opens or folds that hook; an open hook with more
66836
+ * 200` -- which opens or folds that hook; an open hook with more
66837
66837
  * children than its page ends in a `+N` chip that opens the next
66838
66838
  * page. The arithmetic lives in treedb_fold_model.js; this file
66839
66839
  * reconciles the G6 data with what that model says is visible
@@ -73482,8 +73482,8 @@ function pill_colors(color, theme) {
73482
73482
  };
73483
73483
  }
73484
73484
  /************************************************************
73485
- * One pill: `▸ devices 142` folded, `▾ devices 24/142` open on a
73486
- * page, `▾ devices 142` open whole. A glyph and numbers on
73485
+ * One pill: `▸ devices 200` folded, `▾ devices 24/200` open on a
73486
+ * page, `▾ devices 200` open whole. A glyph and numbers on
73487
73487
  * purpose: the card is an innerHTML string where a WORD could
73488
73488
  * carry no i18n key, and the hook name is a schema identifier,
73489
73489
  * like the topic subtitle above it.
@@ -55816,7 +55816,7 @@ function cards_grid_descriptor(items, show_label, badge_of) {
55816
55816
  * mounted as a stage view by C_YUI_SHELL when a
55817
55817
  * primary item declares submenu.index)
55818
55818
  * "breadcrumb" — the PATH as one line ("Cards › Energy › South
55819
- * hall › Meter 3"), each crumb a link to that
55819
+ * building › Meter 3"), each crumb a link to that
55820
55820
  * level. Unlike every other layout its items
55821
55821
  * are not a node's children but the trail down
55822
55822
  * to where the user is: the second way to show
@@ -66113,7 +66113,7 @@ function fold_reveal(model, state, node_key) {
66113
66113
  *
66114
66114
  * What a treedb graph IS, once it is folded (treedb_fold_model.js):
66115
66115
  * a forest read top to bottom. A main topic is a tree (places:
66116
- * country, region, site, hall), the other topics hang from its
66116
+ * country, region, site, building), the other topics hang from its
66117
66117
  * nodes through hooks (devices, users, controllers), a record may
66118
66118
  * hang from two parents (a device from its place AND its
66119
66119
  * controller), and every visible node was reached from a root.
@@ -66152,7 +66152,7 @@ function fold_reveal(model, state, node_key) {
66152
66152
  * between them. O(n), and opening a hook moves NOTHING that is
66153
66153
  * not below or beside it -- the cards keep their order, the eye
66154
66154
  * keeps its place. It reads DOWN because that is the direction a
66155
- * tree with many children has room in: a hall with a hundred
66155
+ * tree with many children has room in: a building with a hundred
66156
66156
  * devices is a wide row, not a tall column beside a card. (The
66157
66157
  * left-to-right reading is `direction: "LR"`, kept for a host
66158
66158
  * that wants it; `dagre` reads that way in the graph.)
@@ -66356,7 +66356,7 @@ function extent_at(n, a) {
66356
66356
  * subtree gets an angular SECTOR proportional to its leaves, a node
66357
66357
  * sits in the middle of its sector, and the radius of each ring is
66358
66358
  * the larger of "one step further out than the ring before" and
66359
- * "long enough for its nodes to sit side by side" -- so a hall
66359
+ * "long enough for its nodes to sit side by side" -- so a building
66360
66360
  * with a hundred devices is a wide, sparse fan, and nothing
66361
66361
  * overlaps by construction. Several roots share the circle around
66362
66362
  * a virtual centre.
@@ -66828,7 +66828,7 @@ function css_color_or_null(value) {
66828
66828
  * the reader's level (`fold_level`, `expand_depth` until they
66829
66829
  * step it), one page (`fold_page_size`) of children per hook. Each
66830
66830
  * card carries a pill per hook that has children -- `▸ devices
66831
- * 142` -- which opens or folds that hook; an open hook with more
66831
+ * 200` -- which opens or folds that hook; an open hook with more
66832
66832
  * children than its page ends in a `+N` chip that opens the next
66833
66833
  * page. The arithmetic lives in treedb_fold_model.js; this file
66834
66834
  * reconciles the G6 data with what that model says is visible
@@ -73477,8 +73477,8 @@ function pill_colors(color, theme) {
73477
73477
  };
73478
73478
  }
73479
73479
  /************************************************************
73480
- * One pill: `▸ devices 142` folded, `▾ devices 24/142` open on a
73481
- * page, `▾ devices 142` open whole. A glyph and numbers on
73480
+ * One pill: `▸ devices 200` folded, `▾ devices 24/200` open on a
73481
+ * page, `▾ devices 200` open whole. A glyph and numbers on
73482
73482
  * purpose: the card is an innerHTML string where a WORD could
73483
73483
  * carry no i18n key, and the hook name is a schema identifier,
73484
73484
  * like the topic subtitle above it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.29.2",
3
+ "version": "7.29.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/gobj-ui.cjs.js",
@@ -17,7 +17,7 @@
17
17
  * the reader's level (`fold_level`, `expand_depth` until they
18
18
  * step it), one page (`fold_page_size`) of children per hook. Each
19
19
  * card carries a pill per hook that has children -- `▸ devices
20
- * 142` -- which opens or folds that hook; an open hook with more
20
+ * 200` -- which opens or folds that hook; an open hook with more
21
21
  * children than its page ends in a `+N` chip that opens the next
22
22
  * page. The arithmetic lives in treedb_fold_model.js; this file
23
23
  * reconciles the G6 data with what that model says is visible
@@ -571,7 +571,7 @@ const _layouts = {
571
571
  * -- the roots, the first parent that reaches a node, the hooks
572
572
  * in schema order, the records in their order -- so opening a
573
573
  * hook moves nothing that is not under or beside it. Down and not
574
- * right, because down is where a tree has room: a hall with a
574
+ * right, because down is where a tree has room: a building with a
575
575
  * hundred devices is a wide row, not a column beside a card --
576
576
  * and read right it was `dagre` with the siblings held still,
577
577
  * which nobody could tell apart. The default for a treedb nobody
@@ -4101,9 +4101,9 @@ function graph_focus_topic(gobj, topic, reveal_all)
4101
4101
  * topic, however deep it is folded away. The graph's per-topic
4102
4102
  * ROUTE lands here on every load (`.../graph/devices` is a focus
4103
4103
  * on `devices`) and gets ONE PAGE, the same cap the find has:
4104
- * revealing a whole topic on landing opened 563 groups of a
4105
- * 6400-record treedb -- the pile, back, before anybody touched
4106
- * anything. */
4104
+ * revealing a whole topic on landing opened hundreds of groups
4105
+ * of a treedb of several thousand records -- the pile, back,
4106
+ * before anybody touched anything. */
4107
4107
  let keys = [];
4108
4108
  if(!empty_string(topic)) {
4109
4109
  for(let node of model.nodes.values()) {
@@ -10179,8 +10179,8 @@ function pill_colors(color, theme)
10179
10179
  }
10180
10180
 
10181
10181
  /************************************************************
10182
- * One pill: `▸ devices 142` folded, `▾ devices 24/142` open on a
10183
- * page, `▾ devices 142` open whole. A glyph and numbers on
10182
+ * One pill: `▸ devices 200` folded, `▾ devices 24/200` open on a
10183
+ * page, `▾ devices 200` open whole. A glyph and numbers on
10184
10184
  * purpose: the card is an innerHTML string where a WORD could
10185
10185
  * carry no i18n key, and the hook name is a schema identifier,
10186
10186
  * like the topic subtitle above it.
package/src/c_yui_map.js CHANGED
@@ -492,8 +492,6 @@ function devices2geojson(gobj, devices)
492
492
  }
493
493
  let coords = get_coordinates(gobj, device);
494
494
 
495
- // device.image = "http://localhost:8029/static/app/images/devices/enchufe.png";
496
-
497
495
  let feature = {
498
496
  "type": "Feature",
499
497
  "id": device.id,
package/src/c_yui_nav.js CHANGED
@@ -16,7 +16,7 @@
16
16
  * mounted as a stage view by C_YUI_SHELL when a
17
17
  * primary item declares submenu.index)
18
18
  * "breadcrumb" — the PATH as one line ("Cards › Energy › South
19
- * hall › Meter 3"), each crumb a link to that
19
+ * building › Meter 3"), each crumb a link to that
20
20
  * level. Unlike every other layout its items
21
21
  * are not a node's children but the trail down
22
22
  * to where the user is: the second way to show
package/src/c_yui_node.js CHANGED
@@ -997,7 +997,7 @@ function render_path(gobj, $where)
997
997
  }
998
998
 
999
999
  /* From the TREE ROOT down to the tip, not from here: a trail that
1000
- * starts halfway ("South hall › Meter 3") answers the question it
1000
+ * starts halfway ("South building › Meter 3") answers the question it
1001
1001
  * was drawn to answer only by half. The declaring node decides
1002
1002
  * HOW its corner shows the way in; it does not decide where the
1003
1003
  * way in starts. */
@@ -222,9 +222,9 @@ test("normalize_spec accepts its own output (every level re-normalizes)", () =>
222
222
  ***************************************************************/
223
223
  test("aliases carry the former ids of a node", () => {
224
224
  let errors = [];
225
- let spec = normalize_spec({id: "north", aliases: ["hall1", "h1"]}, errors, "/");
225
+ let spec = normalize_spec({id: "north", aliases: ["building1", "b1"]}, errors, "/");
226
226
  expect(errors).toEqual([]);
227
- expect(spec.aliases).toEqual(["hall1", "h1"]);
227
+ expect(spec.aliases).toEqual(["building1", "b1"]);
228
228
  expect(normalize_spec({id: "x"}, errors, "/").aliases).toEqual([]);
229
229
  });
230
230
 
@@ -234,7 +234,7 @@ test("an alias is one url segment, like an id", () => {
234
234
  expect(errors[0]).toMatch(/is not a valid id/);
235
235
 
236
236
  errors = [];
237
- expect(normalize_spec({id: "x", aliases: "hall1"}, errors, "/")).toBe(null);
237
+ expect(normalize_spec({id: "x", aliases: "building1"}, errors, "/")).toBe(null);
238
238
  expect(errors[0]).toMatch(/'aliases' must be an array/);
239
239
  });
240
240
 
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * What a treedb graph IS, once it is folded (treedb_fold_model.js):
7
7
  * a forest read top to bottom. A main topic is a tree (places:
8
- * country, region, site, hall), the other topics hang from its
8
+ * country, region, site, building), the other topics hang from its
9
9
  * nodes through hooks (devices, users, controllers), a record may
10
10
  * hang from two parents (a device from its place AND its
11
11
  * controller), and every visible node was reached from a root.
@@ -44,7 +44,7 @@
44
44
  * between them. O(n), and opening a hook moves NOTHING that is
45
45
  * not below or beside it -- the cards keep their order, the eye
46
46
  * keeps its place. It reads DOWN because that is the direction a
47
- * tree with many children has room in: a hall with a hundred
47
+ * tree with many children has room in: a building with a hundred
48
48
  * devices is a wide row, not a tall column beside a card. (The
49
49
  * left-to-right reading is `direction: "LR"`, kept for a host
50
50
  * that wants it; `dagre` reads that way in the graph.)
@@ -296,7 +296,7 @@ function extent_at(n, a)
296
296
  * subtree gets an angular SECTOR proportional to its leaves, a node
297
297
  * sits in the middle of its sector, and the radius of each ring is
298
298
  * the larger of "one step further out than the ring before" and
299
- * "long enough for its nodes to sit side by side" -- so a hall
299
+ * "long enough for its nodes to sit side by side" -- so a building
300
300
  * with a hundred devices is a wide, sparse fan, and nothing
301
301
  * overlaps by construction. Several roots share the circle around
302
302
  * a virtual centre.
@@ -45,9 +45,9 @@ describe("vite-plugin-yuneta-html", () => {
45
45
  test("a declared csp_connect_src goes into connect-src, comments left out", () => {
46
46
  const html = transform({
47
47
  title: "App",
48
- csp_connect_src: ["wss://host:1620", "_comment: why", "https://tiles.example"]
48
+ csp_connect_src: ["wss://host:4620", "_comment: why", "https://tiles.example"]
49
49
  });
50
- expect(connect_src(html)).toEqual(["'self'", "wss://host:1620", "https://tiles.example"]);
50
+ expect(connect_src(html)).toEqual(["'self'", "wss://host:4620", "https://tiles.example"]);
51
51
  expect(html).toContain("<title>App</title>");
52
52
  });
53
53
 
@@ -73,10 +73,10 @@ describe("vite-plugin-yuneta-html", () => {
73
73
  title: "App",
74
74
  csp_connect_src: [
75
75
  "wss://a:1; base-uri *", "wss://b, wss://c", "wss://d wss://e",
76
- "wss://ok:1620"
76
+ "wss://ok:4620"
77
77
  ]
78
78
  });
79
- expect(connect_src(html)).toEqual(["'self'", "wss://ok:1620"]);
79
+ expect(connect_src(html)).toEqual(["'self'", "wss://ok:4620"]);
80
80
  expect(html).not.toContain("base-uri");
81
81
  expect(err).toHaveBeenCalledTimes(3);
82
82
  err.mockRestore();
@@ -36,8 +36,8 @@ describe("yui_tab_split_subpath", () => {
36
36
  test("a composite id survives the url it travelled in", () => {
37
37
  /* 0x1F joins the two halves of these ids and reaches the url
38
38
  * percent-encoded. */
39
- expect(yui_tab_split_subpath("node-a%1F1630/treedb_authzs/__graphs__"))
40
- .toEqual({id: "node-a" + US + "1630",
39
+ expect(yui_tab_split_subpath("node-a%1F4630/treedb_authzs/__graphs__"))
40
+ .toEqual({id: "node-a" + US + "4630",
41
41
  tail: "treedb_authzs/__graphs__"});
42
42
  });
43
43