antvis/G6

自定义折线设置radius不生效 #4463

Sharang-heng posted onGitHub

问题描述

想设置折线的曲率不生效,90度的折线不太好看
G6.registerEdge('line-arrow', { draw(cfg, group) { const startPoint = cfg.startPoint; const endPoint = cfg.endPoint; const shape = group.addShape('path', { attrs: { stroke: '#C0C4CC', radius: 10, lineWidth: 1, path: [ ['M', startPoint.x, startPoint.y], ['L', startPoint.x, endPoint.y - 40], ['L', endPoint.x, endPoint.y - 40], ['L', endPoint.x, endPoint.y], ], endArrow: true, }, name: 'path-shape', }); if (cfg.label) { group.addShape('text', { attrs: { text: cfg.label, fill: '#595959', textAlign: 'center', textBaseline: 'middle', x: endPoint.x, y: endPoint.y - 40, }, name: 'right-text-shape', }); } return shape; }, });

重现链接

重现步骤

预期行为

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

image

补充说明(可选)

No response


Fund this Issue

$0.00
Funded

Pull requests