GGEditor
GGEditor copied to clipboard
[Question] How to create custom nodes for the Flow component?
Hello
I am wondering if there's a way to create custom nodes, where, besides all the existent properties for each node, I could include some extra custom ones, for custom purposes. Let's say I want a node to include a Date
and Age
properties, or something.
Is it possible? If so, how can I achieve that? I checked the docs but couldn't find anything specifically related to that.
Thanks in advance.
This is a demo of registering custom nodes :)
https://codesandbox.io/s/4j62moqy0w
@gaoli
Thanks a lot for the help, but I still don't know how to set custom properties For example, a Date
variable and an int
one, let's say for the createdAt
and age
properties, respectively.
would you mind helping me with that?
Thanks again
@jahirfiquitiva Have you had any luck with this? I just want to add a custom userData field which holds another json. @gaoli any suggestions on how to accomplish this?
Hello @gaoli,
This definitely does help. Thank you!
Is there a way to do this by defining a custom node as well? For example, just like what you've done with the icon, is it possible to define custom properties for every node named custom-node
by extending the model? I've been trying to do that but I've been unsuccessful so far, sadly.
@gaoli 请问大佬 对上面 @ karanrajpal14说的 custom-node通过扩展模型为每个命名节点定义自定义属性 有demo吗?我这边也不会呐 求指教
@gaoli this demo is for version 2.0, with latest one it's broken. Could you provide updated demo?