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));
ashishk
  • 299
  • 1
  • 3
  • 17

1 Answers1

14

Just use

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

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

dave
  • 4,353
  • 2
  • 29
  • 25
  • Is there any way I can know about the source and target id of first object from this? – ashishk Aug 13 '14 at 10:38
  • every link has source and target properties containing the ID of its associated objects: `link.get('source').id` – dave Aug 13 '14 at 11:17