@yuneta/gobj-ui 7.31.2 → 7.31.3
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 +3 -1
- package/dist/gobj-ui.cjs.js +8 -5
- package/dist/gobj-ui.es.js +8 -5
- package/package.json +1 -1
- package/src/c_g6_nodes_tree.js +5 -2
- package/src/c_yui_treedb_schema.js +7 -2
- package/src/g6_nodes_tree_focus.wiring.test.js +5 -0
- package/src/treedb_schema_lit_edge.wiring.test.js +3 -0
package/README.md
CHANGED
|
@@ -2624,7 +2624,9 @@ ringed with it and the two rows it joins -- the hook of the parent and the fkey
|
|
|
2624
2624
|
of the child -- washed, so a line says which two fields it ties. A second click
|
|
2625
2625
|
on the same edge, or a click on the canvas, puts it out. The treedb graph
|
|
2626
2626
|
(`C_G6_NODES_TREE`) lights an edge and its two records the same way, except in
|
|
2627
|
-
`edition`, where a click selects the edge.
|
|
2627
|
+
`edition`, where a click selects the edge. In both graphs an edge takes a
|
|
2628
|
+
click some 7px either side of its line (`increasedLineWidthForHitTesting: 14`,
|
|
2629
|
+
`7.31.3`; G6's default adds 2px to a line drawn 2px wide). And the drawing always carries a
|
|
2628
2630
|
**minimap** (bottom left, the library's `yui_graph_minimap.js`), because a
|
|
2629
2631
|
schema of more cards than the screen holds is the usual case.
|
|
2630
2632
|
|
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -67291,11 +67291,12 @@ function build_graph$1(gobj) {
|
|
|
67291
67291
|
edge: {
|
|
67292
67292
|
style: {
|
|
67293
67293
|
startArrow: true,
|
|
67294
|
-
endArrow: false
|
|
67294
|
+
endArrow: false,
|
|
67295
|
+
increasedLineWidthForHitTesting: 14
|
|
67295
67296
|
},
|
|
67296
67297
|
state: { lit: () => ({
|
|
67297
67298
|
stroke: highlight_color(priv.theme),
|
|
67298
|
-
lineWidth:
|
|
67299
|
+
lineWidth: 4,
|
|
67299
67300
|
halo: true,
|
|
67300
67301
|
haloStroke: highlight_halo(priv.theme),
|
|
67301
67302
|
haloLineWidth: 8
|
|
@@ -72770,7 +72771,7 @@ function default_edge_stroke(gobj, d, theme) {
|
|
|
72770
72771
|
function edge_inherited_style_of(gobj, d) {
|
|
72771
72772
|
let priv = gobj.priv;
|
|
72772
72773
|
let style = {
|
|
72773
|
-
lineWidth: d.is_tree ? 2 :
|
|
72774
|
+
lineWidth: d.is_tree ? 2.5 : 2,
|
|
72774
72775
|
stroke: default_edge_stroke(gobj, d, priv.theme),
|
|
72775
72776
|
themed_default: true
|
|
72776
72777
|
};
|
|
@@ -78606,6 +78607,7 @@ var LIT_COLOR_DARK = "#f0a020";
|
|
|
78606
78607
|
var LIT_COLOR_LIGHT = "#b45309";
|
|
78607
78608
|
var LIT_HALO_DARK = "rgba(240,160,32,0.35)";
|
|
78608
78609
|
var LIT_HALO_LIGHT = "rgba(180,83,9,0.35)";
|
|
78610
|
+
var EDGE_HIT_WIDTH = 14;
|
|
78609
78611
|
/***************************************************************
|
|
78610
78612
|
* Data
|
|
78611
78613
|
***************************************************************/
|
|
@@ -79014,7 +79016,8 @@ function schema_to_graph(gobj) {
|
|
|
79014
79016
|
function edge_style(dark) {
|
|
79015
79017
|
return {
|
|
79016
79018
|
stroke: dark ? "#7a8593" : "#9aa4b2",
|
|
79017
|
-
lineWidth:
|
|
79019
|
+
lineWidth: 2,
|
|
79020
|
+
increasedLineWidthForHitTesting: EDGE_HIT_WIDTH,
|
|
79018
79021
|
startArrow: true,
|
|
79019
79022
|
endArrow: false
|
|
79020
79023
|
};
|
|
@@ -79030,7 +79033,7 @@ function edge_options(dark) {
|
|
|
79030
79033
|
style: edge_style(dark),
|
|
79031
79034
|
state: { lit: {
|
|
79032
79035
|
stroke: dark ? LIT_COLOR_DARK : LIT_COLOR_LIGHT,
|
|
79033
|
-
lineWidth:
|
|
79036
|
+
lineWidth: 4,
|
|
79034
79037
|
halo: true,
|
|
79035
79038
|
haloStroke: dark ? LIT_HALO_DARK : LIT_HALO_LIGHT,
|
|
79036
79039
|
haloLineWidth: 8
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -67286,11 +67286,12 @@ function build_graph$1(gobj) {
|
|
|
67286
67286
|
edge: {
|
|
67287
67287
|
style: {
|
|
67288
67288
|
startArrow: true,
|
|
67289
|
-
endArrow: false
|
|
67289
|
+
endArrow: false,
|
|
67290
|
+
increasedLineWidthForHitTesting: 14
|
|
67290
67291
|
},
|
|
67291
67292
|
state: { lit: () => ({
|
|
67292
67293
|
stroke: highlight_color(priv.theme),
|
|
67293
|
-
lineWidth:
|
|
67294
|
+
lineWidth: 4,
|
|
67294
67295
|
halo: true,
|
|
67295
67296
|
haloStroke: highlight_halo(priv.theme),
|
|
67296
67297
|
haloLineWidth: 8
|
|
@@ -72765,7 +72766,7 @@ function default_edge_stroke(gobj, d, theme) {
|
|
|
72765
72766
|
function edge_inherited_style_of(gobj, d) {
|
|
72766
72767
|
let priv = gobj.priv;
|
|
72767
72768
|
let style = {
|
|
72768
|
-
lineWidth: d.is_tree ? 2 :
|
|
72769
|
+
lineWidth: d.is_tree ? 2.5 : 2,
|
|
72769
72770
|
stroke: default_edge_stroke(gobj, d, priv.theme),
|
|
72770
72771
|
themed_default: true
|
|
72771
72772
|
};
|
|
@@ -78601,6 +78602,7 @@ var LIT_COLOR_DARK = "#f0a020";
|
|
|
78601
78602
|
var LIT_COLOR_LIGHT = "#b45309";
|
|
78602
78603
|
var LIT_HALO_DARK = "rgba(240,160,32,0.35)";
|
|
78603
78604
|
var LIT_HALO_LIGHT = "rgba(180,83,9,0.35)";
|
|
78605
|
+
var EDGE_HIT_WIDTH = 14;
|
|
78604
78606
|
/***************************************************************
|
|
78605
78607
|
* Data
|
|
78606
78608
|
***************************************************************/
|
|
@@ -79009,7 +79011,8 @@ function schema_to_graph(gobj) {
|
|
|
79009
79011
|
function edge_style(dark) {
|
|
79010
79012
|
return {
|
|
79011
79013
|
stroke: dark ? "#7a8593" : "#9aa4b2",
|
|
79012
|
-
lineWidth:
|
|
79014
|
+
lineWidth: 2,
|
|
79015
|
+
increasedLineWidthForHitTesting: EDGE_HIT_WIDTH,
|
|
79013
79016
|
startArrow: true,
|
|
79014
79017
|
endArrow: false
|
|
79015
79018
|
};
|
|
@@ -79025,7 +79028,7 @@ function edge_options(dark) {
|
|
|
79025
79028
|
style: edge_style(dark),
|
|
79026
79029
|
state: { lit: {
|
|
79027
79030
|
stroke: dark ? LIT_COLOR_DARK : LIT_COLOR_LIGHT,
|
|
79028
|
-
lineWidth:
|
|
79031
|
+
lineWidth: 4,
|
|
79029
79032
|
halo: true,
|
|
79030
79033
|
haloStroke: dark ? LIT_HALO_DARK : LIT_HALO_LIGHT,
|
|
79031
79034
|
haloLineWidth: 8
|
package/package.json
CHANGED
package/src/c_g6_nodes_tree.js
CHANGED
|
@@ -1238,6 +1238,9 @@ function build_graph(gobj)
|
|
|
1238
1238
|
style: {
|
|
1239
1239
|
startArrow: true, // HACK target/source interchanged
|
|
1240
1240
|
endArrow: false,
|
|
1241
|
+
/* A line of 2px is a 2px target: answer a click
|
|
1242
|
+
* some px around it (G6's default adds 2). */
|
|
1243
|
+
increasedLineWidthForHitTesting: 14,
|
|
1241
1244
|
},
|
|
1242
1245
|
/* An edge lit by a click (light_edge): the amber of a find
|
|
1243
1246
|
* match, its two ends painted with it. A callback, so a
|
|
@@ -1245,7 +1248,7 @@ function build_graph(gobj)
|
|
|
1245
1248
|
state: {
|
|
1246
1249
|
lit: () => ({
|
|
1247
1250
|
stroke: highlight_color(priv.theme),
|
|
1248
|
-
lineWidth:
|
|
1251
|
+
lineWidth: 4,
|
|
1249
1252
|
halo: true,
|
|
1250
1253
|
haloStroke: highlight_halo(priv.theme),
|
|
1251
1254
|
haloLineWidth: 8,
|
|
@@ -9388,7 +9391,7 @@ function edge_inherited_style_of(gobj, d)
|
|
|
9388
9391
|
{
|
|
9389
9392
|
let priv = gobj.priv;
|
|
9390
9393
|
let style = {
|
|
9391
|
-
lineWidth: d.is_tree ? 2 :
|
|
9394
|
+
lineWidth: d.is_tree ? 2.5 : 2,
|
|
9392
9395
|
stroke: default_edge_stroke(gobj, d, priv.theme),
|
|
9393
9396
|
themed_default: true,
|
|
9394
9397
|
};
|
|
@@ -125,6 +125,10 @@ const LIT_COLOR_LIGHT = "#b45309";
|
|
|
125
125
|
const LIT_HALO_DARK = "rgba(240,160,32,0.35)";
|
|
126
126
|
const LIT_HALO_LIGHT = "rgba(180,83,9,0.35)";
|
|
127
127
|
|
|
128
|
+
/* The width an edge answers a click on, in px: a line drawn 2px
|
|
129
|
+
* wide is a 2px target, and G6's default adds only 2 more. */
|
|
130
|
+
const EDGE_HIT_WIDTH = 14;
|
|
131
|
+
|
|
128
132
|
/***************************************************************
|
|
129
133
|
* Data
|
|
130
134
|
***************************************************************/
|
|
@@ -642,7 +646,8 @@ function edge_style(dark)
|
|
|
642
646
|
{
|
|
643
647
|
return {
|
|
644
648
|
stroke: dark ? "#7a8593" : "#9aa4b2",
|
|
645
|
-
lineWidth:
|
|
649
|
+
lineWidth: 2,
|
|
650
|
+
increasedLineWidthForHitTesting: EDGE_HIT_WIDTH,
|
|
646
651
|
startArrow: true,
|
|
647
652
|
endArrow: false,
|
|
648
653
|
};
|
|
@@ -661,7 +666,7 @@ function edge_options(dark)
|
|
|
661
666
|
state: {
|
|
662
667
|
lit: {
|
|
663
668
|
stroke: dark? LIT_COLOR_DARK : LIT_COLOR_LIGHT,
|
|
664
|
-
lineWidth:
|
|
669
|
+
lineWidth: 4,
|
|
665
670
|
halo: true,
|
|
666
671
|
haloStroke: dark? LIT_HALO_DARK : LIT_HALO_LIGHT,
|
|
667
672
|
haloLineWidth: 8,
|
|
@@ -1372,6 +1372,11 @@ describe("a click on an edge lights it and its two ends (not in edition)", () =>
|
|
|
1372
1372
|
return b;
|
|
1373
1373
|
}
|
|
1374
1374
|
|
|
1375
|
+
test("an edge answers a click well around its line", async () => {
|
|
1376
|
+
const {graph} = await reading();
|
|
1377
|
+
expect(graph.options.edge.style.increasedLineWidthForHitTesting).toBeGreaterThanOrEqual(10);
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1375
1380
|
test("the edge takes the lit state, its ends are painted, the host still hears the click", async () => {
|
|
1376
1381
|
const {tree, states} = await reading();
|
|
1377
1382
|
gobj_send_event(tree, "EV_EDGE_CLICK", {id: "e1"}, tree);
|
|
@@ -178,6 +178,9 @@ describe("C_YUI_TREEDB_SCHEMA: minimap and lit edge", () => {
|
|
|
178
178
|
expect(minimap.type).toBe("minimap");
|
|
179
179
|
expect(minimap.containerStyle).toMatchObject({top: "auto", bottom: "12px"});
|
|
180
180
|
expect(graph.edge_options.state.lit).toBeTruthy();
|
|
181
|
+
/* a 2px line is a 2px target: the click is taken well around it */
|
|
182
|
+
expect(graph.edge_options.style.lineWidth).toBeGreaterThanOrEqual(2);
|
|
183
|
+
expect(graph.edge_options.style.increasedLineWidthForHitTesting).toBeGreaterThanOrEqual(10);
|
|
181
184
|
});
|
|
182
185
|
|
|
183
186
|
test("an edge click lights the edge, its two cards and the two rows", async () => {
|