Skip to content

don't crash on Plot.dot({ length: 1 }).plot() #709

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

Merged
merged 3 commits into from
Jan 26, 2022

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Jan 26, 2022

TypeError: Cannot read properties of undefined (reading '0')

Plot.dot({ length: 1 }).plot()

The original use case was in a circlePacking layout where we would have Plot.dot({length:10}, circlePack({r: Math.random})).

However that use case is now solved by having the circlePack layout explicitly pass x: null, y: null. So maybe not worth the potential performance hit of checking each datum against null?

@Fil Fil requested a review from mbostock January 26, 2022 20:21
@mbostock mbostock merged commit 16dbbc9 into main Jan 26, 2022
@mbostock mbostock deleted the fil/crash-undefined-data branch January 26, 2022 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants