-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Infinity
and NaN
should be converted to undefined
in JSON? Or base64 could/should be used to describe these values in the figure?
#4807
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
Comments
undefined
in JSON
undefined
in JSONInfinity
and NaN
should be converted to undefined
in JSON
Infinity
and NaN
should be converted to undefined
in JSONInfinity
and NaN
should be converted to undefined
in JSON and base64 encoding should not be used in those cases
Infinity
and NaN
should be converted to undefined
in JSON and base64 encoding should not be used in those casesInfinity
and NaN
should be converted to undefined
in JSON
Further discussion with @emilykl @archmoj:
Still need to add tests for the above cases ^^ in plotly.js? @alexcjohnson Does this seem right to you? |
Infinity
and NaN
should be converted to undefined
in JSONInfinity
and NaN
should be converted to undefined
in JSON? Or base64 could/should be used to describe these values in the figure?
Oh this is cool, b64 can actually encode more info than regular JSON. I think this is fine behavior, but most of the time the behavior will (ie should, and we should add some tests) be indistinguishable from null. Meaning if infinity or nan values are in coordinates they should not be displayed, nor should they impact autorange. I suppose in principle a bar chart could show a bar to infinity (without impacting range) but I wouldn’t implement that without a clear use case. Otherwise about the only cases I can see this having a concrete effect are colorscale (+/-inf should show the color at the corresponding end of the scale, as any other out-of-range value would) or hover (via customdata or other non-coordinate fields in the hovertemplate) |
I can't see any reason to not take advantage of this except possibly the extra work it would take to handle the cases @alexcjohnson outlines (e.g., making sure inf hits the margin of the color scale), so I'm 👍 to having Infinity and NaN rather than forcing conversion to undefined. |
In #4470, the
test_fast_track_finite_arrays
, but it raised concerns that the replacement of NaN or Infinity with null in arrays is no longer running because the array is base64 encoded already when that code is run. The code that does the replacement currently is hereThe text was updated successfully, but these errors were encountered: