Skip to content

实现“线”这种特殊的自定义节点node #2046

Answered by JamesTing
MrMengJ asked this question in Q&A
Discussion options

You must be logged in to vote
  1. 这本质就是边了,不是node。所以,可以通过graph.addEdge创建一条边,source、target指定为坐标。
  2. 改变长度的问题,可以直接使用边的tools解决,即source-arrowhead、target-arrowhead。
  3. 如果你想实现dnd一条边到画布的效果,可以采用移花接木的方式,即dnd一个path 的node,拖拽到画布后立即删除,同时用第一步的方法创建一条边。

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@MrMengJ
Comment options

Answer selected by NewByVector
Comment options

You must be logged in to vote
2 replies
@JamesTing
Comment options

@TLovers
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants