-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Shapes are misplaced when using numbers as categoryarray values #5767
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
This seems to be due to the behaviour of the package plotly.js/src/plots/cartesian/set_convert.js Line 182 in 2f17e11
Indeed, in a nodejs console:
> var isNumeric = require('fast-isnumeric');
> isNumeric(40)
true
> isNumeric("40")
true This makes it so that |
also related: #5741 |
See also |
(which is now the default for graphs made with plotly.py) |
Ok I see. Setting |
Yep, that sounds right - if an axis is in strict mode, that should apply to shapes, annotations, and images as well as traces. So that part of this issue can be considered a bug. |
If X axis
type
iscategory
, andcategoryarray
contains (string type) numbers, then shapes are horizontally misplaced, asx0
andx1
values in theshape
are not considered as items, but as indices of thecategoryarray
.Eg.
This one works perfectly:
But if I replace the color names to numbers:
It will work only if I replace the category values to their indices in the
shapes
:Note: if this is not intended to be a bug, but an undocumented feature, please document it, so I can rely on it later. 😃
The text was updated successfully, but these errors were encountered: