Create Editor for Link to Link


#1

Hi,

Please advice, Can you give me an example about creating editor for link to link diagram in gojs? In that editor we can edit drag and drop and connect a line between a node diagram to another.

Thank you.


#2

Have you seen this sample: https://gojs.net/latest/samples/linksToLinks.html ?

The first crucial step is to make sure that you have set https://gojs.net/latest/api/symbols/GraphLinksModel.html#linkLabelKeysProperty.

Note how the sample defines a “LinkLabel” node template that has a port element that is fromLinkable and toLinkable. Note how the model includes a "category":"LinkLabel" node data for each link data.

Note the use of https://gojs.net/latest/api/symbols/LinkingTool.html#archetypeLabelNodeData so that each newly drawn link automatically has its own new label node.

The sample has two different link templates, but you don’t need to do that unless you really want to. If you don’t want to use a different link template for links that connect with links, you can delete the maybeChangeLinkCategory and its uses.