Skip to content

[Bug]: behaviors: ['drag-canvas', 'zoom-canvas']demo 无法正常运行 #7471

@zyc329

Description

@zyc329

Describe the bug / 问题描述

import { Graph } from '@antv/g6';

const graph = new Graph({
  container: 'container',
  layout: {
    type: 'grid',
  },
  data: {
    nodes: [{ id: 'node1' }, { id: 'node2' }, { id: 'node3' }, { id: 'node4' }, { id: 'node5' }],
    edges: [
      { source: 'node1', target: 'node2' },
      { source: 'node1', target: 'node3' },
      { source: 'node1', target: 'node4' },
      { source: 'node2', target: 'node3' },
      { source: 'node3', target: 'node4' },
      { source: 'node4', target: 'node5' },
    ],
  },
  behaviors: ['drag-canvas','zoom-canvas'],
});

graph.render();

官网例子加一个;zoom-canvas 就可以了

Reproduction link / 复现链接

https://g6.antv.antgroup.com/examples/behavior/canvas/#drag

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

进入页面滚轮缩放生效,拖拽过画布后,滚轮缩放就失效了

Version / 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    question 💬This issue is just a question. It will be converted into discussion automatically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions