@yuneta/gobj-ui 7.23.84 → 7.23.86
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 +24 -0
- package/dist/gobj-ui.cjs.js +128 -72
- package/dist/gobj-ui.es.js +128 -72
- package/package.json +1 -1
- package/src/c_g6_nodes_tree.js +117 -62
- package/src/c_yui_gobj_tree_js.js +2 -1
- package/src/c_yui_json_graph.js +2 -1
- package/src/c_yui_treedb_graph.js +32 -20
- package/src/yui_graph_camera.js +30 -2
package/README.md
CHANGED
|
@@ -850,6 +850,16 @@ both keys, either — a G6 `trigger` is a CHORD, not a list of alternatives:
|
|
|
850
850
|
`Shortcut.match()` compares the keys held to the keys bound as a SET, so
|
|
851
851
|
`['Control', 'Meta']` would mean both at once.
|
|
852
852
|
|
|
853
|
+
**One glyph size for the whole row** (`7.23.86`): `YUI_GRAPH_ICON_SIZE` in
|
|
854
|
+
`yui_graph_camera.js`, with a `yui_graph_icon()` that builds the `<i>`. It is
|
|
855
|
+
in **`rem` and not `em`** for a reason worth keeping: in `em` the same
|
|
856
|
+
`1.5em` drew 24px inside a plain button, 18px inside an `is-small` chip of
|
|
857
|
+
the legend, and a labelled button left its icon at the inherited 16px — three
|
|
858
|
+
sizes in two strips that are read as one thing. The legend under the toolbar
|
|
859
|
+
follows it: topic name at `1rem`, count at `.875rem` (the one deliberate step
|
|
860
|
+
down), glyphs at the shared size, and `align-items: stretch` so a chip's star
|
|
861
|
+
and crosshair are as tall as its body.
|
|
862
|
+
|
|
853
863
|
`C_G6_NODES_TREE` floats a vertical toolbar over the canvas:
|
|
854
864
|
|
|
855
865
|
| control | what it does |
|
|
@@ -1374,6 +1384,20 @@ screen every card is a smudge. Since `7.23.82` a record has **three views**
|
|
|
1374
1384
|
popover's own scope: this node, the topic, every node), remembered as the
|
|
1375
1385
|
topic's default and saved per node in `__graphs__` as `node_shape`.
|
|
1376
1386
|
|
|
1387
|
+
**The colours are remembered the same way** (since `7.23.85`): `apply` writes
|
|
1388
|
+
`fill`, `stroke` and `lineWidth` into the node's entry in `__graphs__` — and
|
|
1389
|
+
into the topic's defaults for the wider scopes — and the three views read
|
|
1390
|
+
them back through one `node_paint_of()`, while every repaint takes the colour
|
|
1391
|
+
from the style the node is wearing rather than from `desc.color`. Before
|
|
1392
|
+
that, the colour lived on the live style alone, which on an html card is
|
|
1393
|
+
UNDER the html: the first repaint (a selection, the focus, a theme switch, a
|
|
1394
|
+
pill appearing) rebuilt that html from the topic's colour and the choice was
|
|
1395
|
+
gone, and nothing of it ever reached the store. Choosing the topic's own
|
|
1396
|
+
colour back, with the stroke and line width that go with it, **forgets** the
|
|
1397
|
+
entry instead of writing it: the palette is assigned by position, so a
|
|
1398
|
+
colour written down would freeze today's palette on that card — the trap the
|
|
1399
|
+
sizes fell into in `7.23.80`.
|
|
1400
|
+
|
|
1377
1401
|
In the view's toolbar (`C_YUI_TREEDB_GRAPH`), next to the fold pair: three
|
|
1378
1402
|
push buttons in one group — a card, a line, a figure — the pressed one being
|
|
1379
1403
|
the view that is on (`full` / `compact` / `shape`, persisted as `node_mode`;
|
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -10560,6 +10560,30 @@ function getPointPosition(count, index, margin = .2) {
|
|
|
10560
10560
|
* All Rights Reserved.
|
|
10561
10561
|
***********************************************************************/
|
|
10562
10562
|
/************************************************************
|
|
10563
|
+
* ONE size for every glyph of a graph's toolbar ROW, in
|
|
10564
|
+
* `rem` and not `em`.
|
|
10565
|
+
*
|
|
10566
|
+
* In `em` the same declaration draws three different icons:
|
|
10567
|
+
* `1.5em` is 24px inside a plain button, 18px inside an
|
|
10568
|
+
* `is-small` one, and a labelled button left its icon at the
|
|
10569
|
+
* inherited 16px -- so one row held 16px, 18px and 24px
|
|
10570
|
+
* glyphs and looked like three toolbars pushed together.
|
|
10571
|
+
* `rem` is measured against the page, so a chip that is
|
|
10572
|
+
* deliberately shorter than a button still carries the same
|
|
10573
|
+
* glyph.
|
|
10574
|
+
*
|
|
10575
|
+
* 20px against the row's 16px text: an icon-only button is
|
|
10576
|
+
* legible at half its 40px height, and beside a label the
|
|
10577
|
+
* glyph reads as a marker rather than as a second word.
|
|
10578
|
+
************************************************************/
|
|
10579
|
+
var YUI_GRAPH_ICON_SIZE = "1.25rem";
|
|
10580
|
+
function yui_graph_icon(icon_class, extra_style) {
|
|
10581
|
+
return ["i", {
|
|
10582
|
+
class: icon_class,
|
|
10583
|
+
style: `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;` + (extra_style || "")
|
|
10584
|
+
}];
|
|
10585
|
+
}
|
|
10586
|
+
/************************************************************
|
|
10563
10587
|
* One icon button that fires `event_name`.
|
|
10564
10588
|
************************************************************/
|
|
10565
10589
|
function camera_button(gobj, icon, event_name, label_key, wide, extra_style) {
|
|
@@ -10577,10 +10601,7 @@ function camera_button(gobj, icon, event_name, label_key, wide, extra_style) {
|
|
|
10577
10601
|
"aria-label": (0, i18next.t)(label_key),
|
|
10578
10602
|
"data-i18n-aria-label": label_key
|
|
10579
10603
|
},
|
|
10580
|
-
|
|
10581
|
-
style: "font-size:1.5em; color:inherit;" + (extra_style || ""),
|
|
10582
|
-
class: icon
|
|
10583
|
-
}],
|
|
10604
|
+
yui_graph_icon(icon, extra_style),
|
|
10584
10605
|
{ click: (evt) => {
|
|
10585
10606
|
evt.stopPropagation();
|
|
10586
10607
|
(0, _yuneta_gobj_js.gobj_send_event)(gobj, event_name, { evt }, gobj);
|
|
@@ -11673,7 +11694,7 @@ function make_toolbar$5(gobj) {
|
|
|
11673
11694
|
[$find_input, [
|
|
11674
11695
|
"span",
|
|
11675
11696
|
{ class: "icon is-left" },
|
|
11676
|
-
[
|
|
11697
|
+
[yui_graph_icon("yi-magnifying-glass")]
|
|
11677
11698
|
]]
|
|
11678
11699
|
]);
|
|
11679
11700
|
attach_clear($find_control, $find_input);
|
|
@@ -18115,7 +18136,7 @@ function make_find_items(gobj) {
|
|
|
18115
18136
|
[$find_input, [
|
|
18116
18137
|
"span",
|
|
18117
18138
|
{ class: "icon is-left" },
|
|
18118
|
-
[
|
|
18139
|
+
[yui_graph_icon("yi-magnifying-glass")]
|
|
18119
18140
|
]]
|
|
18120
18141
|
]);
|
|
18121
18142
|
attach_clear($find_control, $find_input);
|
|
@@ -55656,6 +55677,52 @@ function topic_defaults_of(gobj, topic_name) {
|
|
|
55656
55677
|
return (0, _yuneta_gobj_js.is_object)(topic_props) && (0, _yuneta_gobj_js.is_object)(topic_props.defaults) ? topic_props.defaults : null;
|
|
55657
55678
|
}
|
|
55658
55679
|
/************************************************************
|
|
55680
|
+
* What a node is PAINTED with: its own colours, then the
|
|
55681
|
+
* topic's default, then the topic's colour.
|
|
55682
|
+
*
|
|
55683
|
+
* A card is html, and its html was built with `desc.color`
|
|
55684
|
+
* every time it was repainted -- so a colour chosen in the node
|
|
55685
|
+
* properties popover lasted until the next selection, focus,
|
|
55686
|
+
* theme or pill change, and was never written to `__graphs__`
|
|
55687
|
+
* at all. Only the `shape` view kept it, because a figure is a
|
|
55688
|
+
* native G6 node and `style.fill` is what paints it. The FIGURE
|
|
55689
|
+
* was already remembered (`node_shape`); this is the wiring the
|
|
55690
|
+
* colour was missing.
|
|
55691
|
+
************************************************************/
|
|
55692
|
+
function node_paint_of(gobj, desc, geometry) {
|
|
55693
|
+
let defaults = topic_defaults_of(gobj, desc.topic_name);
|
|
55694
|
+
let g = (0, _yuneta_gobj_js.is_object)(geometry) ? geometry : {};
|
|
55695
|
+
let fill = g.fill || defaults && defaults.fill || desc.color;
|
|
55696
|
+
return {
|
|
55697
|
+
fill,
|
|
55698
|
+
stroke: g.stroke || defaults && defaults.stroke || getStrokeColor(fill),
|
|
55699
|
+
lineWidth: g.lineWidth || defaults && defaults.lineWidth || 1
|
|
55700
|
+
};
|
|
55701
|
+
}
|
|
55702
|
+
/************************************************************
|
|
55703
|
+
* Write a chosen paint into an entry of `__graphs__` -- a
|
|
55704
|
+
* node's or a topic's defaults.
|
|
55705
|
+
*
|
|
55706
|
+
* A colour nobody chose is not saved: the topic's own colour,
|
|
55707
|
+
* with the stroke and the line width that go with it, is what a
|
|
55708
|
+
* card wears anyway, and writing it down would freeze today's
|
|
55709
|
+
* palette on that card -- the trap the SIZES fell into in
|
|
55710
|
+
* 7.23.80, and the palette is assigned by POSITION (`ac_descs`),
|
|
55711
|
+
* so it moves when a topic is added. Choosing it back MEANS
|
|
55712
|
+
* forgetting the entry.
|
|
55713
|
+
************************************************************/
|
|
55714
|
+
function paint_into(entry, desc, fill, stroke, line_width) {
|
|
55715
|
+
if (fill === desc.color && stroke === getStrokeColor(desc.color) && line_width === 1) {
|
|
55716
|
+
delete entry.fill;
|
|
55717
|
+
delete entry.stroke;
|
|
55718
|
+
delete entry.lineWidth;
|
|
55719
|
+
return;
|
|
55720
|
+
}
|
|
55721
|
+
entry.fill = fill;
|
|
55722
|
+
entry.stroke = stroke;
|
|
55723
|
+
entry.lineWidth = line_width;
|
|
55724
|
+
}
|
|
55725
|
+
/************************************************************
|
|
55659
55726
|
* The CARD: an html node, the tier's size, the ports, the
|
|
55660
55727
|
* saved geometry on top. The flags (focus, selection, anchor)
|
|
55661
55728
|
* are not painted here: repaint_cards() reads them where they
|
|
@@ -55666,10 +55733,11 @@ function card_shape_of(gobj, desc, record, geometry, pills_html) {
|
|
|
55666
55733
|
let node_treedb_type = desc.node_treedb_type;
|
|
55667
55734
|
let label = node_label(desc, record);
|
|
55668
55735
|
let ports = build_ports(gobj, desc);
|
|
55736
|
+
let paint = node_paint_of(gobj, desc, geometry);
|
|
55669
55737
|
let style = {
|
|
55670
|
-
fill:
|
|
55671
|
-
stroke:
|
|
55672
|
-
lineWidth:
|
|
55738
|
+
fill: paint.fill,
|
|
55739
|
+
stroke: paint.stroke,
|
|
55740
|
+
lineWidth: paint.lineWidth,
|
|
55673
55741
|
lineDash: [],
|
|
55674
55742
|
halo: false,
|
|
55675
55743
|
labelText: ""
|
|
@@ -55678,9 +55746,9 @@ function card_shape_of(gobj, desc, record, geometry, pills_html) {
|
|
|
55678
55746
|
style.size = size;
|
|
55679
55747
|
style.dx = -size[0] / 2;
|
|
55680
55748
|
style.dy = -size[1] / 2;
|
|
55681
|
-
if (node_treedb_type === "child") style.innerHTML = build_chip_innerHTML(
|
|
55682
|
-
else if (node_treedb_type === "extended") style.innerHTML = build_node_innerHTML(
|
|
55683
|
-
else style.innerHTML = build_node_innerHTML(
|
|
55749
|
+
if (node_treedb_type === "child") style.innerHTML = build_chip_innerHTML(paint.fill, priv.theme, record.icon, label, record.id);
|
|
55750
|
+
else if (node_treedb_type === "extended") style.innerHTML = build_node_innerHTML(paint.fill, priv.theme, record.icon, label, desc.topic_name, true, record.id, false, false, false, pills_html);
|
|
55751
|
+
else style.innerHTML = build_node_innerHTML(paint.fill, priv.theme, record.icon, label, desc.topic_name, false, record.id, false, false, false, pills_html);
|
|
55684
55752
|
let topic_props = priv._graph_properties[desc.topic_name];
|
|
55685
55753
|
let topic_defaults = (0, _yuneta_gobj_js.is_object)(topic_props) && (0, _yuneta_gobj_js.is_object)(topic_props.defaults) ? topic_props.defaults : null;
|
|
55686
55754
|
if (topic_defaults) {
|
|
@@ -55752,17 +55820,18 @@ function pill_shape_of(gobj, desc, record, geometry) {
|
|
|
55752
55820
|
let priv = gobj.priv;
|
|
55753
55821
|
let size = PILL_SIZE[desc.node_treedb_type] || PILL_SIZE.hierarchical;
|
|
55754
55822
|
let ports = build_ports(gobj, desc);
|
|
55823
|
+
let paint = node_paint_of(gobj, desc, geometry);
|
|
55755
55824
|
let style = {
|
|
55756
|
-
fill:
|
|
55757
|
-
stroke:
|
|
55758
|
-
lineWidth:
|
|
55825
|
+
fill: paint.fill,
|
|
55826
|
+
stroke: paint.stroke,
|
|
55827
|
+
lineWidth: paint.lineWidth,
|
|
55759
55828
|
lineDash: [],
|
|
55760
55829
|
halo: false,
|
|
55761
55830
|
labelText: "",
|
|
55762
55831
|
size: [...size],
|
|
55763
55832
|
dx: -size[0] / 2,
|
|
55764
55833
|
dy: -size[1] / 2,
|
|
55765
|
-
innerHTML: build_chip_innerHTML(
|
|
55834
|
+
innerHTML: build_chip_innerHTML(paint.fill, priv.theme, record.icon, node_label(desc, record), record.id)
|
|
55766
55835
|
};
|
|
55767
55836
|
dress_ports(gobj, style, ports, geometry, topic_defaults_of(gobj, desc.topic_name), PORT_R_PILL, true);
|
|
55768
55837
|
return {
|
|
@@ -55773,7 +55842,7 @@ function pill_shape_of(gobj, desc, record, geometry) {
|
|
|
55773
55842
|
function pill_innerHTML_of(gobj, nd, theme, highlight, selected, anchored) {
|
|
55774
55843
|
let desc = nd.data.desc;
|
|
55775
55844
|
let record = nd.data.record || {};
|
|
55776
|
-
return build_chip_innerHTML(
|
|
55845
|
+
return build_chip_innerHTML(node_fill_of(nd), theme, record.icon, node_label(desc, record), record.id, highlight, selected, anchored);
|
|
55777
55846
|
}
|
|
55778
55847
|
function node_figure_of(gobj, desc, geometry) {
|
|
55779
55848
|
let shape = geometry ? geometry.node_shape : null;
|
|
@@ -55800,8 +55869,9 @@ function figure_shape_of(gobj, desc, record, geometry, flags) {
|
|
|
55800
55869
|
let side = SHAPE_SIZE[tier] || SHAPE_SIZE.hierarchical;
|
|
55801
55870
|
let labels = (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "node_labels");
|
|
55802
55871
|
let figure = node_figure_of(gobj, desc, geometry || {});
|
|
55803
|
-
let
|
|
55804
|
-
let
|
|
55872
|
+
let paint = node_paint_of(gobj, desc, geometry);
|
|
55873
|
+
let stroke = paint.stroke;
|
|
55874
|
+
let line_width = Math.max(paint.lineWidth, 1.5);
|
|
55805
55875
|
if (f.selected) {
|
|
55806
55876
|
stroke = SELECT_RING;
|
|
55807
55877
|
line_width = 3;
|
|
@@ -55819,7 +55889,7 @@ function figure_shape_of(gobj, desc, record, geometry, flags) {
|
|
|
55819
55889
|
let style = {
|
|
55820
55890
|
size: [side, side],
|
|
55821
55891
|
radius: figure === "square" ? Math.round(side / 5) : 0,
|
|
55822
|
-
fill:
|
|
55892
|
+
fill: paint.fill,
|
|
55823
55893
|
stroke,
|
|
55824
55894
|
lineWidth: line_width,
|
|
55825
55895
|
lineDash: dash,
|
|
@@ -58644,39 +58714,23 @@ function show_node_popover(gobj) {
|
|
|
58644
58714
|
let rect = get_node_viewport_rect(gobj, node_id);
|
|
58645
58715
|
if (!rect) return;
|
|
58646
58716
|
const popover = create_popover_base(rect.right + floating_popover_dx(), rect.top + floating_icon_dy(), "g6-node-popover", "#d9d9d9", 180);
|
|
58647
|
-
let
|
|
58648
|
-
let undo_node = () => {
|
|
58649
|
-
let restoreStyle = {
|
|
58650
|
-
fill: origFill,
|
|
58651
|
-
stroke: origStroke,
|
|
58652
|
-
lineWidth: origLW
|
|
58653
|
-
};
|
|
58654
|
-
if (node_graph_type === "hierarchical") {
|
|
58655
|
-
let record = nodeData.data.record || {};
|
|
58656
|
-
restoreStyle.innerHTML = build_node_innerHTML(origFill, priv.theme, record.icon, node_label(nodeData.data.desc, record), nodeData.data.desc.topic_name, false, record.id, false, false, false, pills_html_of(gobj, nodeData));
|
|
58657
|
-
}
|
|
58717
|
+
let paint_node = (fill, stroke, lw) => {
|
|
58658
58718
|
graph.updateNodeData([{
|
|
58659
58719
|
id: node_id,
|
|
58660
|
-
style:
|
|
58720
|
+
style: {
|
|
58721
|
+
fill,
|
|
58722
|
+
stroke,
|
|
58723
|
+
lineWidth: lw
|
|
58724
|
+
}
|
|
58661
58725
|
}]);
|
|
58726
|
+
repaint_cards(gobj, /* @__PURE__ */ new Set([node_id]));
|
|
58662
58727
|
graph.draw();
|
|
58663
58728
|
};
|
|
58729
|
+
let undo_node = () => {
|
|
58730
|
+
paint_node(origFill, origStroke, origLW);
|
|
58731
|
+
};
|
|
58664
58732
|
function preview_node() {
|
|
58665
|
-
|
|
58666
|
-
let updateStyle = {
|
|
58667
|
-
fill,
|
|
58668
|
-
stroke: strokeInput.value,
|
|
58669
|
-
lineWidth: parseInt(lwInput.value) || 1
|
|
58670
|
-
};
|
|
58671
|
-
if (node_graph_type === "hierarchical") {
|
|
58672
|
-
let record = nodeData.data.record || {};
|
|
58673
|
-
updateStyle.innerHTML = build_node_innerHTML(fill, priv.theme, record.icon, node_label(nodeData.data.desc, record), nodeData.data.desc.topic_name, false, record.id, false, false, false, pills_html_of(gobj, nodeData));
|
|
58674
|
-
}
|
|
58675
|
-
graph.updateNodeData([{
|
|
58676
|
-
id: node_id,
|
|
58677
|
-
style: updateStyle
|
|
58678
|
-
}]);
|
|
58679
|
-
graph.draw();
|
|
58733
|
+
paint_node(fillInput.value, strokeInput.value, parseInt(lwInput.value) || 1);
|
|
58680
58734
|
}
|
|
58681
58735
|
create_form_label(popover, "fill color");
|
|
58682
58736
|
let fillInput = create_form_color_input(popover, currentFill, preview_node);
|
|
@@ -58915,15 +58969,19 @@ function refresh_minimap(gobj) {
|
|
|
58915
58969
|
* same three-way choice — it lived inline in the theme refresh and is
|
|
58916
58970
|
* shared now. Returns null for a node that carries no desc.
|
|
58917
58971
|
************************************************************/
|
|
58972
|
+
function node_fill_of(nd) {
|
|
58973
|
+
return nd && nd.style && nd.style.fill || nd.data.desc.color;
|
|
58974
|
+
}
|
|
58918
58975
|
function node_innerHTML_of(nd, theme, highlight, selected, anchored, pills_html) {
|
|
58919
58976
|
if (!nd || !nd.data || !nd.data.desc) return null;
|
|
58920
58977
|
let desc = nd.data.desc;
|
|
58921
58978
|
let record = nd.data.record || {};
|
|
58922
58979
|
let label = node_label(desc, record);
|
|
58980
|
+
let fill = node_fill_of(nd);
|
|
58923
58981
|
switch (desc.node_treedb_type) {
|
|
58924
|
-
case "child": return build_chip_innerHTML(
|
|
58925
|
-
case "extended": return build_node_innerHTML(
|
|
58926
|
-
case "hierarchical": return build_node_innerHTML(
|
|
58982
|
+
case "child": return build_chip_innerHTML(fill, theme, record.icon, label, record.id, highlight, selected, anchored);
|
|
58983
|
+
case "extended": return build_node_innerHTML(fill, theme, record.icon, label, desc.topic_name, true, record.id, highlight, selected, anchored, pills_html);
|
|
58984
|
+
case "hierarchical": return build_node_innerHTML(fill, theme, record.icon, label, desc.topic_name, false, record.id, highlight, selected, anchored, pills_html);
|
|
58927
58985
|
}
|
|
58928
58986
|
return null;
|
|
58929
58987
|
}
|
|
@@ -59478,15 +59536,19 @@ function apply_node_properties(gobj, node_id, fill, stroke, lineWidth, scope, sh
|
|
|
59478
59536
|
if (!nodeData || !nodeData.data) return;
|
|
59479
59537
|
let source_topic = nodeData.data.desc ? nodeData.data.desc.topic_name : null;
|
|
59480
59538
|
let updates = [];
|
|
59539
|
+
let repaint = /* @__PURE__ */ new Set();
|
|
59481
59540
|
const nodes = graph.getData().nodes;
|
|
59482
59541
|
let figure = shape && (0, _yuneta_gobj_js.str_in_list)(NODE_SHAPES, shape) ? shape : "";
|
|
59483
59542
|
let reshaped = [];
|
|
59484
|
-
if (
|
|
59543
|
+
if (scope !== "this") {
|
|
59485
59544
|
let topics = scope === "same_topic" ? [source_topic] : Object.keys(priv.descs || {});
|
|
59486
59545
|
for (let topic_name of topics) {
|
|
59546
|
+
let desc = priv.descs[topic_name];
|
|
59547
|
+
if (!desc) continue;
|
|
59487
59548
|
if (!(0, _yuneta_gobj_js.is_object)(priv._graph_properties[topic_name])) priv._graph_properties[topic_name] = {};
|
|
59488
59549
|
let defaults = priv._graph_properties[topic_name].defaults || {};
|
|
59489
|
-
defaults.node_shape = figure;
|
|
59550
|
+
if (figure) defaults.node_shape = figure;
|
|
59551
|
+
paint_into(defaults, desc, fill, stroke, lineWidth);
|
|
59490
59552
|
priv._graph_properties[topic_name].defaults = defaults;
|
|
59491
59553
|
}
|
|
59492
59554
|
}
|
|
@@ -59495,27 +59557,27 @@ function apply_node_properties(gobj, node_id, fill, stroke, lineWidth, scope, sh
|
|
|
59495
59557
|
if (!nd || !nd.data || !nd.data.desc) continue;
|
|
59496
59558
|
if (scope === "this" && nodes[i].id !== node_id) continue;
|
|
59497
59559
|
if (scope === "same_topic" && nd.data.desc.topic_name !== source_topic) continue;
|
|
59560
|
+
let entry = node_props_entry(gobj, nd);
|
|
59498
59561
|
if (figure) {
|
|
59499
|
-
|
|
59562
|
+
entry.node_shape = figure;
|
|
59500
59563
|
if (node_mode_of(gobj, nodes[i].id) === "shape") reshaped.push(nodes[i].id);
|
|
59501
59564
|
}
|
|
59565
|
+
paint_into(entry, nd.data.desc, fill, stroke, lineWidth);
|
|
59502
59566
|
let updateStyle = {
|
|
59503
59567
|
fill,
|
|
59504
59568
|
stroke,
|
|
59505
59569
|
lineWidth
|
|
59506
59570
|
};
|
|
59507
|
-
if (nd.data.desc.node_treedb_type === "hierarchical") {
|
|
59508
|
-
let record = nd.data.record || {};
|
|
59509
|
-
updateStyle.innerHTML = build_node_innerHTML(fill, priv.theme, record.icon, node_label(nd.data.desc, record), nd.data.desc.topic_name, false, record.id, false, false, false, pills_html_of(gobj, nd));
|
|
59510
|
-
}
|
|
59511
59571
|
updates.push({
|
|
59512
59572
|
id: nodes[i].id,
|
|
59513
59573
|
style: updateStyle
|
|
59514
59574
|
});
|
|
59575
|
+
repaint.add(nodes[i].id);
|
|
59515
59576
|
}
|
|
59516
59577
|
if (updates.length > 0) {
|
|
59517
59578
|
graph.updateNodeData(updates);
|
|
59518
59579
|
if (reshaped.length) reshape_nodes(gobj, reshaped);
|
|
59580
|
+
repaint_cards(gobj, repaint);
|
|
59519
59581
|
graph.draw().then(() => {
|
|
59520
59582
|
mark_graph_dirty(gobj);
|
|
59521
59583
|
});
|
|
@@ -62041,10 +62103,7 @@ function node_shape_items(gobj, wide) {
|
|
|
62041
62103
|
"data-i18n-aria-label": key,
|
|
62042
62104
|
"aria-pressed": "false"
|
|
62043
62105
|
},
|
|
62044
|
-
[
|
|
62045
|
-
style: "font-size:1.5em; color:inherit;",
|
|
62046
|
-
class: NODE_MODE_ICONS[mode]
|
|
62047
|
-
}],
|
|
62106
|
+
yui_graph_icon(NODE_MODE_ICONS[mode]),
|
|
62048
62107
|
{ click: (evt) => {
|
|
62049
62108
|
evt.stopPropagation();
|
|
62050
62109
|
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SET_NODE_MODE", { node_mode: mode }, gobj);
|
|
@@ -62066,10 +62125,7 @@ function node_shape_items(gobj, wide) {
|
|
|
62066
62125
|
"data-i18n-aria-label": "node labels",
|
|
62067
62126
|
"aria-pressed": "false"
|
|
62068
62127
|
},
|
|
62069
|
-
|
|
62070
|
-
style: "font-size:1.5em; color:inherit;",
|
|
62071
|
-
class: "yi-font"
|
|
62072
|
-
}],
|
|
62128
|
+
yui_graph_icon("yi-font"),
|
|
62073
62129
|
{ click: (evt) => {
|
|
62074
62130
|
evt.stopPropagation();
|
|
62075
62131
|
(0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_TOGGLE_NODE_LABELS", {}, gobj);
|
|
@@ -62163,7 +62219,7 @@ function make_toolbar(gobj) {
|
|
|
62163
62219
|
[
|
|
62164
62220
|
"button",
|
|
62165
62221
|
{ class: "GRAPH_REFRESH button" },
|
|
62166
|
-
[
|
|
62222
|
+
[yui_graph_icon("yi-arrows-rotate"), [
|
|
62167
62223
|
"span",
|
|
62168
62224
|
{
|
|
62169
62225
|
class: "is-hidden-mobile",
|
|
@@ -62188,7 +62244,7 @@ function make_toolbar(gobj) {
|
|
|
62188
62244
|
"data-i18n-title": "raw json",
|
|
62189
62245
|
"data-i18n-aria-label": "raw json"
|
|
62190
62246
|
},
|
|
62191
|
-
[
|
|
62247
|
+
[yui_graph_icon("yi-eye"), [
|
|
62192
62248
|
"span",
|
|
62193
62249
|
{
|
|
62194
62250
|
class: "is-hidden-mobile",
|
|
@@ -62233,7 +62289,7 @@ function make_toolbar(gobj) {
|
|
|
62233
62289
|
[$find_input, [
|
|
62234
62290
|
"span",
|
|
62235
62291
|
{ class: "icon is-left" },
|
|
62236
|
-
[
|
|
62292
|
+
[yui_graph_icon("yi-magnifying-glass")]
|
|
62237
62293
|
]]
|
|
62238
62294
|
]);
|
|
62239
62295
|
attach_clear($find_control, $find_input);
|
|
@@ -63202,9 +63258,9 @@ function ac_set_operation_mode(gobj, event, kw, src) {
|
|
|
63202
63258
|
* card's graph icon travels — as EV_TOPIC_SELECTED, which the host turns
|
|
63203
63259
|
* into the URL, so what you are looking at stays linkable.
|
|
63204
63260
|
************************************************************/
|
|
63205
|
-
var LEGEND_GLYPH_STYLE =
|
|
63206
|
-
var LEGEND_NAME_STYLE = "font-size:
|
|
63207
|
-
var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size
|
|
63261
|
+
var LEGEND_GLYPH_STYLE = `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;`;
|
|
63262
|
+
var LEGEND_NAME_STYLE = "font-size:1rem; line-height:1.2;";
|
|
63263
|
+
var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:.875rem;";
|
|
63208
63264
|
function refresh_legend(gobj) {
|
|
63209
63265
|
let priv = gobj.priv;
|
|
63210
63266
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
@@ -63377,7 +63433,7 @@ function refresh_legend(gobj) {
|
|
|
63377
63433
|
"div",
|
|
63378
63434
|
{
|
|
63379
63435
|
class: "GRAPH_LEGEND_CHIP buttons has-addons",
|
|
63380
|
-
style: "margin:0; flex:0 0 auto; flex-wrap:nowrap;"
|
|
63436
|
+
style: "margin:0; flex:0 0 auto; flex-wrap:nowrap; align-items:stretch;"
|
|
63381
63437
|
},
|
|
63382
63438
|
[$body].concat(extras.map((spec) => (0, _yuneta_gobj_js.createElement2)(spec)))
|
|
63383
63439
|
]);
|