Build Graph from Data
This demo shows how to build a graph using the data stored in JSON-format.
This demo utilizes the IGraph API to create graph elements, which can
be useful for handling special cases.
However, for general use cases, we recommend using the GraphBuilder for
creating graphs from data. It simplifies the process and is the recommended approach for
most scenarios.
- Note that some nodes have individual colors or sizes.
- Look at the hierarchy of group nodes.
- See the edges connecting to normal nodes and group nodes.
The input data structure itself is arbitrary. It just needs to contain all the necessary
information to build the graph. This demo uses the following structure:
{
"nodesSource" = [
{"id": "0", "label": "Source"},
{"id": "1", "group": "group0"},
...
],
"edgesSource": [
{"from": "0", "to": "group0"},
...
],
"groupsSource": [
{
"id": "group0",
"label": "Group 1"
},
...
]
}