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

Add simulation.randomSource. #175

Merged
merged 7 commits into from
Aug 15, 2020
Merged

Add simulation.randomSource. #175

merged 7 commits into from
Aug 15, 2020

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Aug 12, 2020

Fixes #121.

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

@mbostock mbostock requested a review from Fil August 12, 2020 21:36
@Fil
Copy link
Member

Fil commented Aug 12, 2020

Would we add the lcg in d3-random then? d3/d3-random#33

@mbostock
Copy link
Member Author

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

@Fil
Copy link
Member

Fil commented Aug 12, 2020

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
Copy link
Member Author

I’ve added it to this PR.

Copy link
Member

@Fil Fil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Created a test in https://observablehq.com/d/0db0d022c48d72da that I will pull in when the tests (#177) are merged

@Fil Fil merged commit 127cbb7 into master Aug 15, 2020
@Fil Fil deleted the random-source branch August 15, 2020 11:30
@mcrawshaw
Copy link

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

@Fil
Copy link
Member

Fil commented Aug 19, 2020

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).

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

Successfully merging this pull request may close these issues.

Suggestion: add option for collide force to be deterministic
3 participants