-
Notifications
You must be signed in to change notification settings - Fork 715
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
new(mock-data, demo): add stable randomness #1033
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
williaster
commented
Jan 25, 2021
"@types/d3-random": "^1.1.2", | ||
"d3-random": "^1.0.3" | ||
"@types/d3-random": "^2.2.0", | ||
"d3-random": "^2.2.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support for seeds
was just added 🎉
kristw
approved these changes
Jan 26, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
williaster
added a commit
that referenced
this pull request
Jan 26, 2021
* new(github/workflows): add happo job, split out test and lint jobs * deps(demo): add happo deps * new(demo/Gallery): export tiles * fix(demo): ensure unique sandbox names, ensure correct example package.json import * new(demo/happo): add happo config * new(demo/happo): add snapshots for all gallery examples * github(workflow): add runs-on to all jobs * fix(happo): use .happo.js asyncTimeout for max timeout in snapshots * fix(happo): use better variable name, T => Example * fix(demo/annotation): remove unneeded deps * fix(workflows/happo): fix working-directory syntax * fix(workflows/ci): merge back into one job with multiple steps * fix(workflows/ci/happo): try overriding HAPPO_COMMAND * fix(happo): move asyncTimeout to separate file * fix(happo): fix timeout filepath * new(mock-data, demo): add stable randomness (#1033) * deps(mock-data): d3-random@^2.2.2 for seeded random * new(mock-data): add getSeededRandom, support seeds in all generators * test(mock-data): add tests for seeded random across generators * new(mock-data): export getRandomNormal * internal(demo): use stable randomness for all demos * internal(happo/gallery): factor out reusable renderWithTimeout
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR builds on #1030 and is all about making randomness in demos / happo snapshots stable so that happo diffs don't break on every PR. After it's approved I'll merge it into the
chris--happo-ii
branch, and thenchris--happo-ii
intomaster
.🚀 Enhancements
This PR
getSeededRandom
to@visx/mock-data
to support deterministic random number generation@visx/mock-data
generator functionsgenRandomNormalPoints
: now acceptsseed
paramgenDateValue
: now acceptsseed
+startTimeMs
paramsgenStats
: now accepts override ofrandom
+randomOffset
functions which can usegetSeededRandom
genBin/genBins
: already take customcount
+bin
functions which can usegetSeededRandom
genPhyllotaxis
is already deterministicd3-random
'sgetRandomNormal
generator from@visx/mock-data
🏠 Internal
@visx/demo
examples that rely on the ^above generators orMath.random
to use seeded randomness. These were all tested by refreshing the page and ensuring data did not change.@hshoff @kristw
cc @lencioni