@yuneta/gobj-ui 7.19.0 → 7.19.1
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/dist/gobj-ui.cjs.js +13 -0
- package/dist/gobj-ui.es.js +13 -0
- package/package.json +1 -1
- package/src/c_g6_nodes_tree.js +37 -0
- package/src/lib_graph.css +11 -0
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -57017,6 +57017,19 @@ function refresh_minimap(gobj) {
|
|
|
57017
57017
|
graph_add_plugin(gobj, "minimap", {
|
|
57018
57018
|
size: [200, 140],
|
|
57019
57019
|
position: "bottom-left",
|
|
57020
|
+
containerStyle: {
|
|
57021
|
+
top: "auto",
|
|
57022
|
+
bottom: "12px",
|
|
57023
|
+
left: "12px",
|
|
57024
|
+
background: "var(--bulma-scheme-main, #fff)",
|
|
57025
|
+
border: "1px solid var(--bulma-border-weak, #ddd)",
|
|
57026
|
+
borderRadius: "6px",
|
|
57027
|
+
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
|
|
57028
|
+
},
|
|
57029
|
+
maskStyle: {
|
|
57030
|
+
border: "2px solid var(--bulma-link, #3b82f6)",
|
|
57031
|
+
background: "rgba(59, 130, 246, 0.12)"
|
|
57032
|
+
},
|
|
57020
57033
|
shape: (id, element_type, element) => {
|
|
57021
57034
|
if (element_type !== "node") return element;
|
|
57022
57035
|
try {
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -57004,6 +57004,19 @@ function refresh_minimap(gobj) {
|
|
|
57004
57004
|
graph_add_plugin(gobj, "minimap", {
|
|
57005
57005
|
size: [200, 140],
|
|
57006
57006
|
position: "bottom-left",
|
|
57007
|
+
containerStyle: {
|
|
57008
|
+
top: "auto",
|
|
57009
|
+
bottom: "12px",
|
|
57010
|
+
left: "12px",
|
|
57011
|
+
background: "var(--bulma-scheme-main, #fff)",
|
|
57012
|
+
border: "1px solid var(--bulma-border-weak, #ddd)",
|
|
57013
|
+
borderRadius: "6px",
|
|
57014
|
+
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
|
|
57015
|
+
},
|
|
57016
|
+
maskStyle: {
|
|
57017
|
+
border: "2px solid var(--bulma-link, #3b82f6)",
|
|
57018
|
+
background: "rgba(59, 130, 246, 0.12)"
|
|
57019
|
+
},
|
|
57007
57020
|
shape: (id, element_type, element) => {
|
|
57008
57021
|
if (element_type !== "node") return element;
|
|
57009
57022
|
try {
|
package/package.json
CHANGED
package/src/c_g6_nodes_tree.js
CHANGED
|
@@ -5166,6 +5166,43 @@ function refresh_minimap(gobj)
|
|
|
5166
5166
|
{
|
|
5167
5167
|
size: [200, 140],
|
|
5168
5168
|
position: "bottom-left",
|
|
5169
|
+
/*
|
|
5170
|
+
* The anchor has to be CSS, not the pixels G6 computes.
|
|
5171
|
+
*
|
|
5172
|
+
* `createPluginCanvas` turns `position` into `left`/`top`
|
|
5173
|
+
* in PIXELS, once, from the canvas size at creation
|
|
5174
|
+
* (`xRatio * (W - width)`). The container then grows --
|
|
5175
|
+
* full screen, a window resize, a panel closing -- and the
|
|
5176
|
+
* minimap stays at the `top` it was given: measured going
|
|
5177
|
+
* full screen, `top` was still `511px` over a container
|
|
5178
|
+
* that had become 768 tall, which put it floating halfway
|
|
5179
|
+
* up the left edge, on top of the graph it is there to
|
|
5180
|
+
* explain.
|
|
5181
|
+
*
|
|
5182
|
+
* `containerStyle` is merged AFTER those pixels, so
|
|
5183
|
+
* `top: auto` + `bottom` is a real anchor the browser
|
|
5184
|
+
* keeps for every size the container ever takes.
|
|
5185
|
+
*
|
|
5186
|
+
* And it follows the theme: G6's default is a `#fff` box
|
|
5187
|
+
* with a `#ddd` border in BOTH themes, which over a
|
|
5188
|
+
* near-black canvas is the brightest thing on screen.
|
|
5189
|
+
*/
|
|
5190
|
+
containerStyle: {
|
|
5191
|
+
top: "auto",
|
|
5192
|
+
bottom: "12px",
|
|
5193
|
+
left: "12px",
|
|
5194
|
+
background: "var(--bulma-scheme-main, #fff)",
|
|
5195
|
+
border: "1px solid var(--bulma-border-weak, #ddd)",
|
|
5196
|
+
borderRadius: "6px",
|
|
5197
|
+
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
|
|
5198
|
+
},
|
|
5199
|
+
/* The viewport rectangle: G6 washes it in black, which is
|
|
5200
|
+
* invisible over a dark minimap. A link-coloured outline
|
|
5201
|
+
* reads on both. */
|
|
5202
|
+
maskStyle: {
|
|
5203
|
+
border: "2px solid var(--bulma-link, #3b82f6)",
|
|
5204
|
+
background: "rgba(59, 130, 246, 0.12)",
|
|
5205
|
+
},
|
|
5169
5206
|
shape: (id, element_type, element) => {
|
|
5170
5207
|
if(element_type !== "node") {
|
|
5171
5208
|
return element; /* edges clone themselves fine */
|
package/src/lib_graph.css
CHANGED
|
@@ -95,6 +95,17 @@
|
|
|
95
95
|
min-width: 20px;
|
|
96
96
|
}
|
|
97
97
|
.g6-toolbar.g6-toolbar-large .g6-toolbar-text {
|
|
98
|
+
/*
|
|
99
|
+
* The click has to land on the ITEM, not on this.
|
|
100
|
+
*
|
|
101
|
+
* G6's toolbar fires `onClick` only when the pressed element's own
|
|
102
|
+
* class list contains `g6-toolbar-item` -- which is why its CSS
|
|
103
|
+
* gives the icon `<svg>` `pointer-events: none`. A text glyph
|
|
104
|
+
* needs the same rule for the same reason: without it the press
|
|
105
|
+
* lands on this span, the class does not match, and the button is
|
|
106
|
+
* simply dead. `1:1` shipped that way.
|
|
107
|
+
*/
|
|
108
|
+
pointer-events: none;
|
|
98
109
|
display: block;
|
|
99
110
|
line-height: 20px;
|
|
100
111
|
font-size: 0.8125rem;
|