-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ColorScaleValidator should probably return a string when it's specified as a string. #1087
Comments
Thanks for the report @ivirshup . Yeah, this is definitely an oversight. You're proposed fix should take care of it. Feel free to submit a PR, otherwise we'll get to in the next few weeks. Thanks! |
Added a test checking that a colorscale specified as a string is returned as a string. Previously it had been returned as a tuple of 1-tuples. e.g. "Viridis" -> (('V',), ('i',), ('r',), ('i',), ('d',), ('i',), ('s',)). Catches plotly#1087.
Added tests checking that a colorscale specified as a string is returned correctly. Previously it had been returned as a tuple of 1-tuples. e.g. "Viridis" -> (('V',), ('i',), ('r',), ('i',), ('d',), ('i',), ('s',)). Catches plotly#1087.
* Added tests for colorscales specified as a string Added tests checking that a colorscale specified as a string is returned correctly. Previously it had been returned as a tuple of 1-tuples. e.g. "Viridis" -> (('V',), ('i',), ('r',), ('i',), ('d',), ('i',), ('s',)). Catches #1087. * Fix presentation of string colorscales Fixes #1087. * Added support for Cividis to ColorScaleValidator
Hi @ivirshup , I just pushed out release candidates for plotly.py 3.1.1 and plotlywidget 0.2.1. Installation instructions for the release candidates are at https://github.com/plotly/plotly.py/blob/bc1d4d188ab999cd9c21e3a7908729f156bc200f/README.md. If you have a chance to confirm that this issue is resolved in the release candidate that would be awesome! |
Currently, color scale attributes have a kinda weird behavior:
This is unlike the behavior (to the best of my knowledge) for other attributes specified as strings:
And this is pretty unintuitive behavior when doing stuff like:
Though
.update(marker1)
does work for some reason.My guess is all that needs to happen is to add an
elif isinstance(v, str): return v
to this function, since you won't be breaking that immutability requirement.plotly.py/_plotly_utils/basevalidators.py
Lines 1276 to 1281 in d670bb0
The text was updated successfully, but these errors were encountered: