d3 / d3-force

Force-directed graph layout using velocity Verlet integration.
https://d3js.org/d3-force
ISC License
1.81k stars 376 forks source link

Add simulation.randomSource. #175

Closed mbostock closed 4 years ago

mbostock commented 4 years ago

Fixes #121.

TODO Default to a linear congruential generator rather than Math.random? Done!

Fil commented 4 years ago

Would we add the lcg in d3-random then? https://github.com/d3/d3-random/issues/33

mbostock commented 4 years ago

We could, or we could do it here as the default value for simulation.randomSource.

Fil commented 4 years ago

I think it makes more sense in d3-random, but the code is so small it might be better to copy it here and avoid the additional dependency.

mbostock commented 4 years ago

I’ve added it to this PR.

mcrawshaw commented 4 years ago

Sorry to bug you, any chance we could get a minor release with this?

Fil commented 4 years ago

I initially planned to do a major release when #176 would be merged but it's a good idea to do a minor before in any case—so here is v2.1.0.

Note to self: In any event we'll release another version soon with larger dependencies (1—2).