Way to create the diagram when linkdataarray is not there

Hi,

I have a json which gives me a node data array in a sequential manner. Something like:

nodedataarray: [{
“category”: 1,
“id”: 1
},
{
“category”: 2,
“id”: 2
},
{
“category”: 2,
“id”: 3
}
]
But there is no link data array as, the json above is in the sequence in which the steps got executed. How can we generate a flow diagram with such data.

What is the preferred way to achieve that.
Is there any default way which goJS provides for such a case.

What links are you expected to infer?
1 - 2 - 3 ?
Or 1 - 2 and 1 - 3 ?
Some other reasonable graphs would also be quite plausible.

If the resulting graph is tree-structured, I suppose you could use a TreeModel. Then just before calling Model.addNodeData you could set the data.parent property to the key of the desired parent node. Perhaps that would just be the key of the previous/last node, if you just want to create a chain of nodes and links.

Your Diagram.layout could be either a GridLayout or a SerpentineLayout.

Hi Walter,
The expected outcome has to be 1->2->3.
And yes, i am already using treeLayout for the diagram.