antvis/G6

官网的自定义边,如果节点是垂直方向,自定义连接线路径有错误 #5622

Shen120 posted onGitHub

问题描述

image 图中只是处理了横向连接线的路径,但是垂直走向就是错误的;正常情况应该是这样的: image ;请问如何计算?

重现链接

https://g6.antv.antgroup.com/zh/examples/item/customEdge/#customPolyline

重现步骤

打开页面拖动节点,进行垂直摆放

预期行为

正确的路径走向

平台

  • 操作系统: Windows 10
  • 网页浏览器: Chrome
  • G6 版本: 4.8.21

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


<img width="695" alt="image" src="https://github.com/antvis/G6/assets/25787943/8c1f2e83-5afc-4e90-b9b7-b25c96aa5e44">

看着没什么问题呢

  getPath(points) {
      const { x: x1, y: y1 } = points[0];
      const { x: x2, y: y2 } = points[1];
      const [width, height] = [x2 - x1, y2 - y1];
      return [
        ['M', x1, y1],
        ['L', x1, y1 + height / 2],
        ['L', x2, y1 + height / 2],
        ['L', x2, y2],
      ];
    }
posted by Aarebecca about 1 year ago

G6 中 Path 遵守 SVG Path 规范,不过使用的是数组形式表达。 自动寻径能力仅 5.x 版本可用 Demo

posted by Aarebecca about 1 year ago

Fund this Issue

$0.00
Funded

Pull requests