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

[Bug]: Blank space selection in brush-select event causes all edges to be selected #6695

Open
2 of 10 tasks
uioonm opened this issue Jan 3, 2025 · 0 comments
Open
2 of 10 tasks
Labels
bug status: waiting for maintainer These issues have not yet been reviewed by a maintainer

Comments

@uioonm
Copy link

uioonm commented Jan 3, 2025

Describe the bug / 问题描述

antv.bug.mp4

Reproduction link / 复现链接

https://codesandbox.io/p/sandbox/quirky-swanson-t7zd39?file=%2Findex.js%3A75%2C8

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

相关代码

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

const graph = new Graph({
  autoResize: true,
  container: "container",
  autoFit: "view",
  data: {
    nodes: [
      {
        id: "station1",
        style: {
          x: 573,
          y: 484,
        },
      },
      {
        id: "station2",
        style: {
          x: -542.063,
          y: -18.6858,
        },
      },
      {
        id: "station3",
        style: {
          x: 595,
          y: 115,
        },
      },
      {
        id: "station4",
        style: {
          x: -559.514,
          y: 907.692,
        },
      },
      {
        id: "station5",
        style: {
          x: -541.296,
          y: 462.602,
        },
      },
      {
        id: "station6",
        style: {
          x: -141.418,
          y: 504.86,
        },
      },
      {
        id: "station7",
        style: {
          x: 84.5717,
          y: 918.536,
        },
      },
    ],
    edges: [
      {
        id: "crossStationLine1",
        source: "station3",
        target: "station1",
      },
      {
        id: "crossStationLine2",
        source: "station4",
        target: "station7",
      },
      {
        id: "crossStationLine3",
        source: "station2",
        target: "station5",
      },
      {
        id: "crossStationLine4",
        source: "station1",
        target: "station7",
      },
    ],
  },
  behaviors: [
    "zoom-canvas",
    "drag-element",
    {
      type: "drag-canvas",
      enable: (event) =>
        event.targetType === "canvas" && event.ctrlKey === false,
    },
    {
      key: "click-select",
      type: "click-select",
      trigger: ["control"],
      multiple: true,
      enable: (event) =>
        event.targetType === "node" || event.targetType === "edge",
    },
    {
      key: "brush-select",
      type: "brush-select",
      trigger: "control",
      enableElements: ["node", "edge"],
    },
  ],
});

graph.render();

G6 Version / G6 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@uioonm uioonm added the status: waiting for maintainer These issues have not yet been reviewed by a maintainer label Jan 3, 2025
@github-actions github-actions bot changed the title [Bug]: brush-select事件框选空白区域会导致所有边被选中 [Bug]: Blank space selection in brush-select event causes all edges to be selected Jan 3, 2025
@Aarebecca Aarebecca added the bug label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status: waiting for maintainer These issues have not yet been reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants