Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squeezing if "staticGraph": true #24

Closed
scoutrul opened this issue Oct 20, 2017 · 2 comments · Fixed by #26
Closed

Squeezing if "staticGraph": true #24

scoutrul opened this issue Oct 20, 2017 · 2 comments · Fixed by #26
Labels

Comments

@scoutrul
Copy link

@scoutrul scoutrul commented Oct 20, 2017

If I set static Graph, then all lines and nodes have zero at x,y,z propertys that makes picture squeeze.

@danielcaldas

This comment has been minimized.

Copy link
Owner

@danielcaldas danielcaldas commented Oct 20, 2017

Correct, if you look closely to the documentation you will read this entry on staticGraph:

  • staticGraph boolean when setting this value to true the graph will be completely static, thus all forces and drag events upon nodes will be disabled. Plus, if this value is true the nodes will be rendered with the provided x and y coordinates, no coordinates will be calculated by react-d3-graph.

So if you do not provide initial values for nodes and links you will get a squeezed graph. Nevertheless, when I was confirming this behavior I found that props x and y on nodes and x1, x2, x3 and x4 on links are not being properly handled in rd3g, so I will tag this as a bug.

PS. A simple temporal workaround would be to make the graph static only after you see that d3 calculated nodes and links positions.

@danielcaldas

This comment has been minimized.

Copy link
Owner

@danielcaldas danielcaldas commented Oct 21, 2017

@scoutrul react-d3-graph v0.3.0 fixes this problem https://github.com/danielcaldas/react-d3-graph/releases/tag/0.3.0, thanks for reporting 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.