react-d3-graph
react-d3-graph copied to clipboard
d3 config behaviour differs after graph is rerendered
Describe the bug The behaviour of a graph with the d3 config set appears to change after a rerender.
To Reproduce Steps to reproduce the behavior:
- Clone the repository at https://github.com/StraightOuttaCrompton/react-d3-graph-rearrange-issue
- Follow bug replication instructions in README
Expected behavior On graph re-render, d3 config should have no impact on appearance change of graph.
I have noticed that this issue has been touched upon before in issue https://github.com/danielcaldas/react-d3-graph/issues/162
In the edit @sauln says
It appears that when there is a parent state change and the graph is rerendered, the graph has considerably different configurations, specifically w.r.t. the d3 configs. This results in the graph drastically changing its appearance.
@danielcaldas says
I would ask you to open it in a separate issue
However I could not find the separate issue
Hey there @StraightOuttaCrompton, I would kindly ask you to check whether your issue is somewhat related to https://github.com/danielcaldas/react-d3-graph/issues/274#issuecomment-565372716. If so a Pull Request has recently been merged to address the issue.
I have been having a look at this today. It doesn't seem related to https://github.com/danielcaldas/react-d3-graph/issues/274. I am using https://github.com/danielcaldas/react-d3-graph/tree/4ecf18cd19d84192658a4886a0d0b6a84cc70a3f and I still experience the same problem.
I am unsure of where the problem is coming from, but I suspect it is to do with the initializeGraphState
call in Graph.jsx. Nodes in the state.d3Nodes
object have different x and y values to that in the this.state.d3Nodes
object.
I had a look at the initializeGraphState
function but had no idea how to proceed?
@danielcaldas - What are your thoughts? Do you think I'm digging in the right are?
Yes, @StraightOuttaCrompton I think you're digging into the right way. Sorry, I don't have currently the time to look into it. Could you tell me if this is still an issue for you? Have you found an workaround for this? Any feedback is much appreciated. Thanks
Yeah, this is still an issue for me. I also haven't had time to look into it further, but I hope to as soon as I can.
Thanks for following up @StraightOuttaCrompton, keep us up to date. Cheers!
I'm still running into this issue
Any solutions for this?