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
自定义Combo如果不继承rect,其update方法要怎么更新其大小? #5655
Comments
To customize your combo in G6 and address the issue with connection points not correctly pointing to the combo's center or edges, you can adjust the For updating the combo's size using the // Example method to update combo size
updateComboSize(comboId: string, newSize: { width: number; height: number }) {
const combo = this.findById(comboId); // Find the combo by ID
if (combo) {
combo.update({
...combo.getAttributes(), // Get current attributes
width: newSize.width,
height: newSize.height,
});
}
} This approach assumes you have a way to find a combo by its ID and directly update its attributes. The actual implementation may vary based on the full capabilities of G6's If you encounter any further questions or need additional clarification, feel free to ask. Sources
|
问题描述
首先,使用的是默认的rect combo,但是连线无法正确指向combo的中心,也没办法指向上下端边界。考虑自定义combo,但是不知道update方法要怎么更新其大小?
重现链接
https://codesandbox.io/p/sandbox/antv-g6-combo-layout-ljhql9?file=%2Findex.js%3A299%2C30
重现步骤
无
预期行为
连线能正常指向combo的中心;或者自定义combo的update实现设置尺寸。
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: