@antv/g-plugin-gesture
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

@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);
});

/@antv/g-plugin-gesture/

    Package Sidebar

    Install

    npm i @antv/g-plugin-gesture

    Weekly Downloads

    299

    Version

    2.0.5

    License

    MIT

    Unpacked Size

    107 kB

    Total Files

    13

    Last publish

    Collaborators

    • xuying1027
    • lvisei
    • yisi.wang
    • basketduck
    • biupiubiupiu
    • flash1
    • dreammy23
    • laixingui.lxg
    • zhangjunjie-loki
    • rainy25ghz
    • zeyuwang
    • yanxiong
    • susiwen8
    • freestyle21
    • soundquiet
    • elaine.q.10
    • sturuby
    • sakuya223
    • serializedowen
    • xdzhao
    • yangzhanmei
    • wjgogogo
    • leungwensen
    • dori
    • iaaron
    • yard
    • simaq
    • dxq613
    • intchous
    • susan_ann
    • jinke.li
    • lzxue
    • army8735
    • atool
    • baizn
    • dengfuping
    • neoddish
    • jeffy2012
    • zqlu
    • afc163
    • pomelo-nwu
    • kopiluwaky
    • ccnuzindex
    • panyuqi
    • bubkoo
    • zengyue
    • kasmine
    • boyu.zlj
    • l1ud0ngq1
    • newbyvector
    • winniexing
    • chenluli
    • kn9117
    • xdddst
    • semious2020
    • esora
    • nadia_liu
    • bbsqq
    • mxz96102
    • openwayne
    • pearmini
    • pddpd
    • yiqianyao
    • zhanba
    • cxxxxxn