Skip to content

the default axis can crash on NaN ticks #1334

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

Closed
Fil opened this issue Mar 14, 2023 · 0 comments · Fixed by #1335
Closed

the default axis can crash on NaN ticks #1334

Fil opened this issue Mar 14, 2023 · 0 comments · Fixed by #1335
Labels
bug Something isn’t working

Comments

@Fil
Copy link
Contributor

Fil commented Mar 14, 2023

OK it's pretty rare, but it's possible to crash by providing both the unknown option (so the tick goes somewhere on screen), and a NaN tick value:

Plot.plot({x: { type: "linear", ticks: [NaN, 1, 2], tickFormat: (d) => d, unknown: 1 }})

related: #493

@Fil Fil added the bug Something isn’t working label Mar 14, 2023
Fil added a commit that referenced this issue Mar 14, 2023
…string except when the value is NaN)

Closes #1334

related to #493
mbostock added a commit that referenced this issue Mar 15, 2023
* Guard against formatDefault returning undefined (it always returns a string except when the value is NaN)

Closes #1334

related to #493

* coalesce null to empty string

* DRY

---------

Co-authored-by: Mike Bostock <[email protected]>
chaichontat pushed a commit to chaichontat/plot that referenced this issue Jan 14, 2024
* Guard against formatDefault returning undefined (it always returns a string except when the value is NaN)

Closes observablehq#1334

related to observablehq#493

* coalesce null to empty string

* DRY

---------

Co-authored-by: Mike Bostock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant