antvis/G6

使用react自定义节点后,元素为啥发现了变化,造成我的线对不齐了。 #4906

zhangxinyong12 posted onGitHub

问题描述

如标题所示。

重现链接

https://codesandbox.io/s/brave-bush-7fq4hh?file=/src/App.tsx

重现步骤

如上所述

预期行为

希望位置不变化

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ] "@antv/g6": "^4.8.21", "@antv/g6-react-node": "^1.4.5",

屏幕截图或视频(可选)

image image

补充说明(可选)

No response


自定义节点图形的 x y 应该是相对于自身坐标系的位置,而不是 cfg 中节点的位置。比如 keyShape 的 rect 应该是 x: -size[0] / 2, y: -size[1] / 2 这样自身坐标系的坐标原点对齐到矩形的中心

posted by Yanyan-Wang over 1 year ago

@Yanyan-Wang 我也遇到了这个问题,我没太明白这个react节点该怎么指定keyShape。

posted by Dawnwangzi over 1 year ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests