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

Graph looks different with same data #532

Open
vardhan-saniko opened this issue Jun 30, 2022 · 3 comments
Open

Graph looks different with same data #532

vardhan-saniko opened this issue Jun 30, 2022 · 3 comments

Comments

@vardhan-saniko
Copy link

Describe the bug
A clear and concise description of what the bug is.

This is the issue I have raised in stack-overflow.
https://stackoverflow.com/questions/72818388/react-d3-graph-renders-differently-for-same-data

I have a component that renders react D3 graph. And I have a switch that displays graph1 when its ON and displays graph2 when its OFF.

Basically there was react conditional rendering based on one variable state.

Issue is: graph1 is appearing differently. When component loads first time, it looks different. When switch is OFF(graph2) and then again ON(graph1), now it looks different. I prefer first graph.

Expected behavior
Graph should look the same when there is exactly the same data

Screenshots
Screen Shot 2022-06-30 at 8 02 28 AM
Screen Shot 2022-06-30 at 8 02 42 AM

Environment:

  • OS: [e.g. iOS] macOS
  • Browser [e.g. chrome, safari] chrome
  • Version [e.g. 22]
  • Node version [e.g. 8.11.0]
  • react-d3-graph version [e.g. 2.0.0-rc2] 2.6.0
  • d3 version [e.g. 5.5.0] 5.16.0
  • react version [e.g. 16.0.0] 18.1.0
@radhakpr
Copy link

Is it resolved?I am also facing same issue

@Sahilcf
Copy link

Sahilcf commented Oct 18, 2023

is it resolved ?

@vardhan-saniko
Copy link
Author

No, it is not. I found it as a limitation of read-d3-graph.
If the state changes and re-renders, the location of nodes are changing.

We should load the graph with a different key whenever re-rendering happens

Ex:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants