strathausen / dracula

JavaScript layout and representation of connected graphs.
https://www.graphdracula.net
MIT License
832 stars 133 forks source link

Added JSON import function #80

Open svcu opened 2 years ago

svcu commented 2 years ago

Import your nodes and edges from an external JSON document.

The JSON object must be like this:

{ "Sophie ": ["Albert", "Mike"], "Mike":["Sophie", "Albert"] } When importing the edges you loop through all the keys of the JSON object (Souce Nodes) and read the value of the JSON object in that key, that value must be an array of Destination nodes. You loop through all the Destination nodes and add an edge from the Source Node to the Destination Node