Get outgoing links of an element
Asked Answered
V

1

5

I want to get all the outgoing links associated with an element .What is the way to achieve this in jointJs .Actually I have tried something like this but It is giving result for both outgoing and incoming .

paper.findViewByModel(start).options.inbound=true;
alert(graph.getConnectedLinks(start));
Verger answered 12/8, 2014 at 6:48 Comment(0)
F
14

Just use

var outboundLinks = graph.getConnectedLinks(myElement, { outbound: true })

See the JointJS API reference here http://jointjs.com/api#joint.dia.Graph:getConnectedLinks.

Feudalism answered 13/8, 2014 at 6:41 Comment(2)
Is there any way I can know about the source and target id of first object from this?Verger
every link has source and target properties containing the ID of its associated objects: link.get('source').idFeudalism

© 2022 - 2024 — McMap. All rights reserved.