Closed
Description
Currently, color scale attributes have a kinda weird behavior:
import plotly.graph_objs as go
go.scatter.Marker(colorscale="Viridis").colorscale
(('V',), ('i',), ('r',), ('i',), ('d',), ('i',), ('s',))
This is unlike the behavior (to the best of my knowledge) for other attributes specified as strings:
go.scatter.Marker(color="red").color
'red'
And this is pretty unintuitive behavior when doing stuff like:
marker1 = go.scatter.Marker(colorscale="Viridis")
go.scatter.Marker(colorscale=marker1.colorscale)
ValueError:
Invalid value of type 'builtins.tuple' received for the 'colorscale' property of scatter.marker
Received value: (('V',), ('i',), ('r',), ('i',), ('d',), ('i',), ('s',))
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