danielcaldas / react-d3-graph

Interactive and configurable graphs with react and d3 effortlessly
https://danielcaldas.github.io/react-d3-graph/sandbox/
MIT License
818 stars 233 forks source link

How to apply different d3 layouts to Graph (Network, Heirarchy and Radial Views) #395

Open michaelbdavid opened 3 years ago

michaelbdavid commented 3 years ago

Is there a way to apply different layouts to a graph. For example, If I wanted to give a user the option to switch between Network, Heirarchy and Radial Views?

It would be cool if there was a way that I could specify this layout and graph would just update.

danielcaldas commented 3 years ago

Right now, the only way to achieve that is by setting your own x, y coordinate values to construct the different kinds of layouts.

michaelbdavid commented 3 years ago

Hey @danielcaldas , Thanks for the reply, do you know of any libraries that I could use that would take nodes, and edges and give by x, y with container size? Realize this is out of scope for react-d3-graph but thought you might have come across something like this.

Thanks again, Michael

danielcaldas commented 3 years ago

@Hey, @michaelbdavid, maybe something like this would do the trick?