vasturiano/force-graph

Group Node by a field

Opened this issue · 3 comments

Hi, would be possible to group different node by a particular field?
For example i would like to show in my graph something like this:

image

Thanks,
Federico

Hi, thanks for the reply :)

at each click of the node I get new data via an ajax call:

"nodes": [{ "id": "id1", "name": "name1", "group": 1 }]
"nodes": [{ "id": "id2", "name": "name2", "group": 2 }]
"nodes": [{ "id": "id3", "name": "name3", "group": 1 }]

I would like to know if it would be possible to group all the nodes based on a field (for example: "group") through a click of a button.

@federico-acn if you look through the source code of that example you'll see that it does something similar to what you're intending.