Comments (3)
For custom node rendering in G6 version 5.0.0-beta.32, where the drawOtherShapes
method is missing, the G6 team has updated their documentation to include a tutorial on custom nodes. You can find this tutorial here: Custom Nodes Tutorial. This guide provides a comprehensive overview of customization, including specific sections on nodes and edges, which should help address your issue.
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
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from g6.
覆写 render
是可以的
{
render(attributes, container){
super.render(attributes, container);
this.drawMyShapes(attributes, container);
}
// 自定义的绘制函数,命名自定
drawMyShapes(attributes, container) {
this.upsert(...);
}
}
from g6.
非常感谢!
from g6.
Related Issues (20)
- 隐藏显示Node和预期不一致 HOT 2
- combo聚合后样式的问题
- 紧凑树,节点展开收缩时移动鼠标,动画卡顿 HOT 9
- [V5] When brush-select clearing the state, the original state of the element is not retained HOT 2
- 【V5】 G6V5.x 版本里,state 更新后,自定义节点无法接收到回调,没有 demo 和说明。非常难实现预期效果。 HOT 7
- 【v5】求Graph数据转换(transforms option)的案例
- graph.save的数据怎么加载啊,我在使用了分组和自动布局后,g6无法使用坐标中心点缩放等其他信息
- It is recommended that the history plugin add records of specified operation types, and if not specified, all records will be defaulted
- graph.getPluginInstance('fullscreen') return undefined ,the graph is a instance of Graph HOT 5
- optimize-viewport-transform 配置后箭头问题
- V5性能问题 HOT 1
- upsert添加Image失败,请教如何添加
- 边设置箭头样式问题
- 触摸板手势交互问题(mac电脑) HOT 1
- 【V5.0.13~5.0.16】树布局,新增或删除某个节点时,整棵树都会重新展开。希望恢复到 5.13 版本前的显示方式
- edge 为 cubic-horizontal时,节点的anchorPoints不生效,导致节点拖拽时箭头显示有问题
- 【v5】自定义节点,如何在drawKeyShape时,获取原始节点数据 HOT 1
- 刚开始接触G6,发现一个小问题 HOT 2
- 【v5】自定义节点,会在未完全完成自定义节点的构造时调用drawKeyShape,导致异常
- [V5] Edge arrow offset behaves inconsistently
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from g6.