Skip to content

Add simulation.randomSource.#175

Merged
Fil merged 7 commits into
masterfrom
random-source
Aug 15, 2020
Merged

Add simulation.randomSource.#175
Fil merged 7 commits into
masterfrom
random-source

Conversation

@mbostock
Copy link
Copy Markdown
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
Copy Markdown
Member

Fil commented Aug 12, 2020

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

@mbostock
Copy link
Copy Markdown
Member Author

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

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

I’ve added it to this PR.

Copy link
Copy Markdown
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
Copy Markdown

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

@Fil
Copy link
Copy Markdown
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