@yuneta/gobj-ui 7.23.7 → 7.23.9
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 +53 -0
- package/dist/gobj-ui.cjs.js +588 -112
- package/dist/gobj-ui.es.js +589 -113
- package/package.json +1 -1
- package/src/c_g6_nodes_tree.js +415 -55
- package/src/c_yui_gobj_tree_js.js +2 -0
- package/src/c_yui_json.js +9 -3
- package/src/c_yui_json_graph.js +43 -23
- package/src/c_yui_treedb_graph.js +28 -18
- package/src/g6_drag_canvas_touch.js +21 -0
- package/src/g6_touch_gestures.js +413 -0
- package/src/lib_graph.css +19 -0
- package/src/lib_icons.js +14 -0
package/README.md
CHANGED
|
@@ -830,6 +830,59 @@ so it survived that — two light islands over a dark canvas.
|
|
|
830
830
|
(all tooltips, so a host that has not defined them shows the key on hover and
|
|
831
831
|
nothing else breaks).
|
|
832
832
|
|
|
833
|
+
### The graphs on a touch screen
|
|
834
|
+
|
|
835
|
+
The three G6 graphs (`C_G6_NODES_TREE` under the treedb view,
|
|
836
|
+
`C_YUI_JSON_GRAPH`, `C_YUI_GOBJ_TREE_JS`) have always DRAWN correctly on a
|
|
837
|
+
phone. What they could not be was **operated** on one, for reasons that were
|
|
838
|
+
structural rather than cosmetic — and none of them is visible in the CSS:
|
|
839
|
+
|
|
840
|
+
- **There is no wheel on a phone**, and `zoom-canvas` binds the wheel and
|
|
841
|
+
nothing else, so the only zoom was the toolbar's `+`/`−`. G6 ships a pinch
|
|
842
|
+
recogniser, but `trigger: ['pinch']` REPLACES the wheel (its `bindEvents` is
|
|
843
|
+
an `if/else`), and its `PinchHandler` keeps its instance and callbacks in
|
|
844
|
+
**statics** — with two graphs on a page the second registers against the
|
|
845
|
+
first one's emitter, so pinching one zooms both and pinching the other does
|
|
846
|
+
nothing. `g6_touch_gestures.js` recognises the gesture per graph and
|
|
847
|
+
registers a `zoom-canvas` that keeps the wheel, the same pattern
|
|
848
|
+
`g6_drag_canvas_touch.js` already uses for `drag-canvas`. **Every graph gets
|
|
849
|
+
it with no change to its `behaviors` list.**
|
|
850
|
+
- **G6 does not read the DOM's `contextmenu` event.** Its `BehaviorController`
|
|
851
|
+
synthesises the event from `pointerdown` with `button === 2`, so the context
|
|
852
|
+
menu was a right click and only a right click, whatever the browser does
|
|
853
|
+
with a long press. The same module gives it a **long press** (500ms, 10px of
|
|
854
|
+
slop) that re-emits G6's own forwarded event under the name the plugin
|
|
855
|
+
listens for — so `getItems(e)` sees exactly what a right click gives it,
|
|
856
|
+
including the port under the finger.
|
|
857
|
+
|
|
858
|
+
Everything a finger has to LAND on is sized off `(pointer: coarse)`, which
|
|
859
|
+
means **a mouse sees no change at all**: node resize handles become a 14px
|
|
860
|
+
mark in a 44px box and drop to the four corners (eight fingertip-sized boxes
|
|
861
|
+
around a 90px node overlap into one blob, and a corner resizes both axes);
|
|
862
|
+
`node properties` and `delete node` go from two 28px circles 4px apart —
|
|
863
|
+
one fingertip covered both, with the destructive one underneath — to 44px
|
|
864
|
+
and 12px apart; a port's hit area stops being a flat `+4` in **world** units
|
|
865
|
+
(a different target at every zoom, and 5 screen px at the 50% a phone lands
|
|
866
|
+
on after fit) and becomes a screen measurement converted to world; popover
|
|
867
|
+
controls and context-menu rows get a 44px floor at 16px, under which iOS
|
|
868
|
+
Safari zooms the page on focus and never zooms back.
|
|
869
|
+
|
|
870
|
+
And the two **floating toolbars fold**. They are drawn inside the canvas, one
|
|
871
|
+
on each edge: on a 356px-wide phone canvas they took a third of the drawing
|
|
872
|
+
area and stood on top of the nodes. Under **480px of container** — measured on
|
|
873
|
+
the container, not the window, because the same graph is a full page in one
|
|
874
|
+
app and a card in a column in another — they collapse behind a single `⋮`,
|
|
875
|
+
and the edit strip is removed rather than emptied (an empty toolbar is still
|
|
876
|
+
a card with a border sitting on the graph). Above that width nothing changes.
|
|
877
|
+
|
|
878
|
+
**New keys for consumers: `show toolbar`, `hide toolbar`.**
|
|
879
|
+
|
|
880
|
+
What is still desktop-only, deliberately: **multi-selection**. `brush-select`
|
|
881
|
+
is bound to `shift`, and `drag-canvas` stands aside for the same key — there
|
|
882
|
+
is no shift on a phone, and giving the rubber band a touch gesture means
|
|
883
|
+
taking one away from panning. Selecting nodes one at a time works on a phone;
|
|
884
|
+
selecting a region does not.
|
|
885
|
+
|
|
833
886
|
### Tabs opened at runtime, and the two decisions their url costs
|
|
834
887
|
|
|
835
888
|
`yui_tab_routes.js`. A workspace whose tabs are opened by the operator —
|