Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add custom G6 interaction mode #62

Closed
totogo opened this issue Mar 8, 2020 · 1 comment
Closed

Cannot add custom G6 interaction mode #62

totogo opened this issue Mar 8, 2020 · 1 comment

Comments

@totogo
Copy link
Contributor

totogo commented Mar 8, 2020

Describe the bug
When passing register to Graphin props, custom G6 mode cannot be initiated as expected.

  const register = {
    behavior: (G6: G6Type): BehaviorRegister[] => [
      {
        mode: 'edit', // Custom mode
        options: {},
        name: 'click-add-node',
        register: (G6: G6Type) => {
          G6.registerBehavior('click-add-node', clickAddNodeBehvavior);
        },
      },
    ],
  };

Additional context
The issue could be solved by allowing additional modes in this piece of code:

modes: {
default: [...defaultModes, ...options.modes!.default!, ...behaviorsMode.default],
},

@pomelo-nwu
Copy link
Member

mode最早的设计是做事件隔离,做编辑状态和普通状态的切换,g6目前专注做图分析, 图编辑已经慢慢弱化,mode模式在上层graphin的图组件里,可以考虑做个兼容处理。

pomelo-nwu added a commit that referenced this issue Mar 10, 2020
fix: Support multiple behavior modes closes #62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants