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
    }
]

}

这个应该可以:
https://gitee.com/namespacefe...

阅读 3.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题