antvis/G6

G6 version 5.0.17 Snapline cannot be disabled issue #6257

1282000569 posted onGitHub

Describe the bug / 问题描述

snapline插件 初始化属性autoSnap无法关闭对齐线

No response

Steps to Reproduce the Bug or Issue / 重现步骤

1、初始化 @antv/g6 5.0.17版本 2、vite vue3开发 3、插件引入设置: { type: 'snapline', key: 'snapline', autoSnap: false, filter: () => ['combo'] } 4、运行渲染,snapline一直可用,无法关闭

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Edge

Additional context / 补充说明

通过updatePlugin更新插件的方式也无法关闭


两种方法解决:

  1. 通过 setPlugins 移除 snapline 来停用插件,并在需要时添加进去
  2. 欢迎给 G6 贡献代码,只需要给 snapline 添加一个 enable 选项就可以了参考:https://github.com/antvis/G6/blob/v5/packages/g6/src/plugins/contextmenu/index.ts#L70
posted by Aarebecca 8 months ago

Fund this Issue

$0.00
Funded

Pull requests