danielcaldas / react-d3-graph

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

adding staticGraph:true to graph.config makes nodes disappear #439

Open adisingh50 opened 3 years ago

adisingh50 commented 3 years ago

Describe the bug I'm trying to render a directed React D3 Graph with 47 nodes. However, I also want to harcode the x and y coordinates for each of the 47 nodes to have the exact visual display that I desire (thiswill automatically create proper links between them). The staticGraph: true property should do just this according to the official documentation. But when I add this property to my graph Config, all my nodes (which were previously rendering in random locations) just disappear. I have already hardcoded x,y coordinates for every node in the graph. When I don't include the staticGraph property, but have the x,y coordinates harcoded for each node, the nodes simply just render in random locations..

Expected behavior I would expect the x, y coordinates to completely dictate where the nodes are rendered. But when I set staticGraph: true, nothing renders at all..

Screenshots My hard coded coordinates: image

Graph without staticGraph: true: image

Graph with staticGraph: true:... just a blank screen

Environment:

antoninklopp commented 3 years ago

Hi @adisingh50 ,

Sorry to hear that it does not work as expected.

Could you please provide a minimal sandbox reproduction starting from this one. It would help to investigate.

Thanks !

danielcaldas commented 3 years ago

Strange 🤔 This one works fine for me. See the GIF where I refresh the page a few times, and nodes 1, 2, and 3 appear in a fixed position every time.

demo