feat: add mobile event support

This commit is contained in:
openwayne 2021-05-07 21:55:08 +08:00 committed by Yanyan Wang
parent aa3d777b7e
commit 36c27ef4f4

View File

@ -635,6 +635,11 @@ export enum G6Event {
NODE_DRAGSTART = 'node:dragstart', NODE_DRAGSTART = 'node:dragstart',
NODE_DRAG = 'node:drag', NODE_DRAG = 'node:drag',
NODE_DRAGEND = 'node:dragend', NODE_DRAGEND = 'node:dragend',
NODE_TAP = 'node:tap',
NODE_PANSTART = 'node:panstart',
NODE_PANMOVE = 'node:panmove',
NODE_PANEND = 'node:panend',
// combo, extends from nodes // combo, extends from nodes
COMBO_CONTEXTMENU = 'combo:contextmenu', COMBO_CONTEXTMENU = 'combo:contextmenu',
COMBO_CLICK = 'combo:click', COMBO_CLICK = 'combo:click',
@ -653,6 +658,10 @@ export enum G6Event {
COMBO_DRAGSTART = 'combo:dragstart', COMBO_DRAGSTART = 'combo:dragstart',
COMBO_DRAG = 'combo:drag', COMBO_DRAG = 'combo:drag',
COMBO_DRAGEND = 'combo:dragend', COMBO_DRAGEND = 'combo:dragend',
COMBO_TAP = 'combo:tap',
COMBO_PANSTART = 'combo:panstart',
COMBO_PANMOVE = 'combo:panmove',
COMBO_PANEND = 'combo:panend',
// edge events // edge events
EDGE_CONTEXTMENU = 'edge:contextmenu', EDGE_CONTEXTMENU = 'edge:contextmenu',
@ -687,6 +696,10 @@ export enum G6Event {
CANVAS_DRAGSTART = 'canvas:dragstart', CANVAS_DRAGSTART = 'canvas:dragstart',
CANVAS_DRAG = 'canvas:drag', CANVAS_DRAG = 'canvas:drag',
CANVAS_DRAGEND = 'canvas:dragend', CANVAS_DRAGEND = 'canvas:dragend',
CANVAS_TAP = 'canvas:tap',
CANVAS_PANSTART = 'canvas:panstart',
CANVAS_PANMOVE = 'canvas:panmove',
CANVAS_PANEND = 'canvas:panend',
// timing events // timing events
BEFORERENDER = 'beforerender', BEFORERENDER = 'beforerender',
@ -730,6 +743,14 @@ export enum G6Event {
VIEWPORTCHANGE = 'viewportchange', VIEWPORTCHANGE = 'viewportchange',
DRAGNODEEND = 'dragnodeend', DRAGNODEEND = 'dragnodeend',
STACKCHANGE = 'stackchange', STACKCHANGE = 'stackchange',
// Mobile event support
TAP = 'tap',
PINCHSTART = 'pinchstart',
PINCHMOVE = 'pinchmove',
PANSTART = 'panstart',
PANMOVE = 'panmove',
PANEND = 'panend',
} }
export type DefaultBehaviorType = IG6GraphEvent | string | number | object; export type DefaultBehaviorType = IG6GraphEvent | string | number | object;