@antv/g-plugin-gesture
v2.0.19
Published
A G plugin for Gesture implemented with PointerEvents
Downloads
1,858
Maintainers
Readme
@antv/g-plugin-gesture
Getting Started
Create and register plugin in renderer.
import { Renderer } from '@antv/g-canvas';
import { Plugin } from '@antv/g-plugin-gesture';
const plugin = new Plugin();
const renderer = new Renderer();
renderer.registerPlugin(plugin);
Enable gesture with gestureEnabled
in style.
const circle = new Circle({
style: {
cx: 200,
cy: 200,
r: 100,
fill: 'blue',
gestureEnabled: true,
},
});
Then we can listen gesture event such as press
on plugin:
canvas.addEventListener('press', (e) => {
console.log(e.target);
});