react-vis-force icon indicating copy to clipboard operation
react-vis-force copied to clipboard

graph position wrong after data prop change

Open James2516 opened this issue 8 years ago • 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 https://github.com/uber/react-vis-force/blob/6b661279392718347b3ea716cdf81dedb2ed2b2b/src/utils/d3-force.js#L263 and renaming the simulation param, but that doesn't look like a proper fix.

James2516 avatar Oct 23 '17 16:10 James2516

facing this too

madsonic avatar Nov 13 '17 04:11 madsonic

Also facing this.

roscioliadp avatar Nov 20 '17 19:11 roscioliadp

Did anyone solve this?

etwerk avatar Jan 05 '18 19:01 etwerk

Facing this too

ThieryMichel avatar Jan 11 '18 17:01 ThieryMichel

Me too!

RosaRomeroGomez avatar Feb 05 '18 21:02 RosaRomeroGomez

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.

RosaRomeroGomez avatar Feb 05 '18 21:02 RosaRomeroGomez

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

kristianmandrup avatar Mar 14 '18 14:03 kristianmandrup

@kristianmandrup was issue #60.

RosaRomeroGomez avatar Mar 14 '18 18:03 RosaRomeroGomez