Skip to content

errors when you get close to our floating point cutoff #1320

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
alexcjohnson opened this issue Jan 19, 2017 · 2 comments
Closed

errors when you get close to our floating point cutoff #1320

alexcjohnson opened this issue Jan 19, 2017 · 2 comments
Labels
bug something broken

Comments

@alexcjohnson
Copy link
Collaborator

If you make this plot, the range gets corrupted and nothing shows:

var trace1 = {
  x: [1, 2, 3, 4, 5],
  y: [
    30.326883631078317,
    31.130257299167397,
    1.7976931348623157e+303,
    1.6976931348623157e+304, // 1.79... does not fail, just disappears
    1.7976931348623157e+308 // this one always disappears
  ],
  mode: 'markers',
  type: 'scatter'
};

var data = [trace1];

Plotly.newPlot('myDiv', data);

The cutoff comes from FP_SAFE: Number.MAX_VALUE / 10000 so this issue has several parts:

  • make sure that no input numbers can corrupt the range calculations (or anything else about the plot)
  • perhaps it would be better to clip out-of-range numbers, rather than discarding them? I'm imagining cases where some program generates Number.MAX_VALUE as some sort of error condition or infinity value.
  • see if we can increase FP_SAFE closer to Number.MAX_VALUE without breaking plotting or interactions (pay attention to log axes too in this whole thing)

cc @cldougl

@alexcjohnson alexcjohnson added the bug something broken label Jan 19, 2017
@cldougl
Copy link
Member

cldougl commented Jan 19, 2017

@alexcjohnson
Additional part: since plotly.js version 1.21.0, when mode:'lines' the entire line is not rendered when a value of ~1.79e+308 is present. See codepens:

plotly-1.20.5: http://codepen.io/plotly/pen/qRrWQB
latest version (1.22.0): http://codepen.io/plotly/pen/dNvGzj

@gvwilson
Copy link
Contributor

gvwilson commented Jun 6, 2024

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

@gvwilson gvwilson closed this as completed Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

3 participants