Add separate element in JointJS DirectedGraph

295 views Asked by At

Is it possible to add elements outside of the DirectedGraph's function? I have tried using graph.addCell() as in the documentation, but the chart only shows elements from the DirectedGraph plugin.

I'm trying to accomplish a DirectedGraph where perhaps one or two elements have 'extra parents' linked outside of the normal hierarchy.

I'm using the source code as shown here

Flow Example

Any advice/guidance would be great. Thanks!

1

There are 1 answers

0
Glen Despaux Jr On BEST ANSWER

Accomplished by simply including the outlying elements. To achieve the layout in the image posted, use:

<div id="adjacency-list">{
    "A":["B"],
    "B":["C","D"],
    "C":[],
    "D":[],
    "EXTRA":["D"]
}</div>

This is not included in the documentation. As far as I can tell, works pretty well for any number of parent/children combinations.