antvis/G6

[v5.0.1] polyline中如果controlPoints未undfined,绘制不出边 #5849

zzjjbbaa posted onGitHub

Describe the bug / 问题描述

bad image good image

https://stackblitz.com/edit/react-zh29y4?file=index.js

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

No response

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

希望没有controlPoints也能正常绘制


controlPoints 是具有默认值 [] 的,你这里的问题是因为 edge.style.controlPoints 传入了 undefined 覆盖了默认值,正确的写法应该是:

controlPoints: (d) => d.style.controlPoints || []
posted by Aarebecca 10 months ago

Fund this Issue

$0.00
Funded

Pull requests