uber/react-vis-force

graph position wrong after data prop change

James2516 opened this issue · 8 comments

If i update the data props of graph without remounting it, the graph goes out of place.

See the demo below.

Edit 40p1rqryz4

I can fix it by adding

const simulation = forceSimulation();
simulation.strength = {};

to

applyAlphaFactors(simulation, options);
and renaming the simulation param, but that doesn't look like a proper fix.

facing this too

Also facing this.

Did anyone solve this?

Facing this too

Me too!

It seems @James2516 addition was pushed to react-vis-force/src/utils-d3-force.js but still it doesn't work for me. I've read in other related open issues that it might be also related to using .map to generate nodes and links.

@rosa what could be the particular issue with respect to using .map? Where did you read this?