Conversation
src/plots/cartesian/axis_autotype.js
Outdated
| if(linearOK(array)) return 'linear'; | ||
| else return '-'; | ||
| if(linearOK(array, convertNumeric)) return 'linear'; | ||
| else return convertNumeric ? '-' : 'category'; |
There was a problem hiding this comment.
I think it would be better to leave else return '-', for empty arrays and arrays with only null entries, and instead include convertNumeric in the category(array) call, ie replace:
else if(Lib.cleanNumber(ai) !== BADNUM) curvenums++;with something like:
else if(convertNumeric ? Lib.cleanNumber(ai) !== BADNUM : typeof ai === 'number') curvenums++;Co-authored-by: Alex Johnson <johnson.alex.c@gmail.com>
Co-authored-by: Alex Johnson <johnson.alex.c@gmail.com>
|
OK so @alexcjohnson and I chatted about this and the attribute name should be |
|
@archmoj pointed out just now that while we're at it here we could stop treating the number I like this idea, and I think |
|
is it just the number 2000 or something like "integers below 3000" ? |
|
I'd have to check exactly, but I believe it's at least all 4-digit integers, possibly also 2-digit integers. |
Also 2-digit integers: Demo. |
… & linear functions
|
@nicolaskruchten @alexcjohnson |
Fixes #5250 and,
Resolves #5195 by introducing two new attributes at
layoutandaxislevels.TODO:
@plotly/plotly_js