-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[5.0.0-beta.32]如何渲染自定义节点 #5634
Comments
For custom node rendering in G6 version 5.0.0-beta.32, where the Please note, the tutorial is in Chinese, so you might need to use a translation tool if you're not comfortable with the language. Regarding the broken sandbox link you provided, it's not accessible, so I'm unable to review your implementation directly. If you could update the link or provide a new one, I'd be more than happy to offer more specific guidance based on your code. If after consulting the tutorial you still face difficulties or have further questions, feel free to share more details about the challenges you're encountering. Sources
|
覆写 {
render(attributes, container){
super.render(attributes, container);
this.drawMyShapes(attributes, container);
}
// 自定义的绘制函数,命名自定
drawMyShapes(attributes, container) {
this.upsert(...);
}
} |
非常感谢! |
问题描述
[5.0.0-beta.32]代码和g5官网示例不符,drawOtherShapes方法消失了,base-node.ts的render方法里面只有draw keyshape、badgeshapes、portshapes、haloshapes,请问如果添加自定义形状呢?复写render方法也比较麻烦,icon、label这些形状都没有export。
重现链接
https://codesandbox.io/p/sandbox/competent-mopsa-mn2l3g
重现步骤
https://g6-next.antv.antgroup.com/examples/item/customNode/#card 切到最新版g5跑不通
预期行为
希望提供drawOtherShapes方法
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: