GG-Editor 如何自定义 edges(连线)属性 ?
如题,在节点(node)加入属性,可以在拖入画面的时候,在 model 中加入属性,例如下面代码,如何自定义 edges(连线)属性?比如加入一个id。
<ItemPanel className={styles.itemPanel}>
<Item
type="node"
size="72*72"
shape="flow-circle"
model={{
color: item.color,
label: item.label,
id: item.id,
xxx: xxx
}}
src={""}
>
<span
style={{
"-moz-user-select": "none",
"webkit-user-select": "none",
"-ms-user-select": "none",
"user-select": "none"
}}
>
{item.label}
</span>
</Item>
</ItemPanel>
GG-Editor 图形结构:
{
"nodes":[
{
"type":"node",
"size":"72*72",
"shape":"flow-circle",
"color":"#00BFFF",
"label":"result16",
"parentId":"85925db4-5bfa-4224-81c6-0df513cae72d",
"desDatabase":"cardb",
"desSchema":"public",
"desTableName":"result16",
"x":321.91668701171875,
"y":192.4666748046875,
"id":"d81e0c6d",
"index":0
},
{
"type":"node",
"size":"72*72",
"shape":"flow-circle",
"color":"#00BFFF",
"label":"car_cross_info1",
"parentId":"85925db4-5bfa-4224-81c6-0df513cae72d",
"desDatabase":"cardb",
"desSchema":"public",
"desTableName":"car_cross_info1",
"x":127.91668701171875,
"y":83.46667480468749,
"id":"44ae872a",
"index":1
}
],
"edges":[
{
"source":"44ae872a",
"sourceAnchor":1,
"target":"d81e0c6d",
"targetAnchor":3,
"id":"1f3d7a69",
"label":"eee",
"shape":"flow-smooth",
"index":2
}
]
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论