-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
newPlot
does not clear histogram axis type!!!
#1231
Comments
What is the desired behavior here in your mind? |
In my mind, Plotly should not crash when switching the type of data used in a histogram. 'Strings' are useful in histograms to bin things into categories, while 'Numbers' are useful to group things into ranges. Using one type should not cause Plotly to assume that's the type for all future histograms. I'd actually prefer being allowed to specify the type instead of allowing Plotly to make the decision for me, as right now I have to append a https://en.wikipedia.org/wiki/Zero-width_space in order to force String types that sometimes involve Numbers to be seen as such. |
Anything else I can provide to help out on this? |
Oh. You're using Thanks for the report. |
Changing the issue title to attract more attention. |
newPlot
does not clear histogram axis type!!!
The issue can be replicated all the back be to |
We haven't fixed the bug yet, but here's a workaround: http://codepen.io/etpinard/pen/dOwJoZ Our poor user input object management is responsible for this bug. |
- plotly/plotly.js#1229 - plotly/plotly.js#1231 - Also ensures that strings are treated as strings (by adding a zero width space).
- plotly/plotly.js#1229 - plotly/plotly.js#1231 - Also ensures that strings are treated as strings (by adding a zero width space).
DDF-2644 DDF-2644 - plotly/plotly.js#1229 DDF-2644 - plotly/plotly.js#1231 DDF-2644 - Also ensures that strings are treated as strings (by adding a zero width space).
- plotly/plotly.js#1229 - plotly/plotly.js#1231 - Also ensures that strings are treated as strings (by adding a zero width space).
- plotly/plotly.js#1229 - plotly/plotly.js#1231 - Also ensures that strings are treated as strings (by adding a zero width space).
- plotly/plotly.js#1229 - plotly/plotly.js#1231 - Also ensures that strings are treated as strings (by adding a zero width space).
- plotly/plotly.js#1229 - plotly/plotly.js#1231 - Also ensures that strings are treated as strings (by adding a zero width space).
- plotly/plotly.js#1229 - plotly/plotly.js#1231 - Also ensures that strings are treated as strings (by adding a zero width space).
Just to be clear what @etpinard means by "poor user input object management" - the issue is that we mutate the We can only fix this in v2, at which point we can clone |
Merging into #2234 |
- plotly/plotly.js#1229 - plotly/plotly.js#1231 - Also ensures that strings are treated as strings (by adding a zero width space).
Here are the relevant codepens to reproduce:
http://codepen.io/andrewkfiedler/pen/XNqMeW?editors=0010
http://codepen.io/andrewkfiedler/pen/ObZpzv?editors=0010
In the first codepen, you can see that plotting a histogram of type 'Number' causes future histograms to be assumed to be of type 'Number' as well. As such it throws an error (the second plot is attempted 5 seconds after the first, so wait 5 seconds).
In the second codepen, you can see that plotting a histogram of type 'String' causes future histograms to be assumed to be of type 'String' as well. As such, the numbers are binned as though they are strings.
Both are examples are using Plotly.newPlot.
The text was updated successfully, but these errors were encountered: