You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adding a layout shape line with custom dash lenght lists is not working #3375
ValueError:
Invalid value of type 'builtins.str' received for the 'dash' property of layout.shape.line
Received value: '5px,3px,3px,2px'
The 'dash' property is a string and must be specified as:
- One of the following strings:
['solid', 'dot', 'dash', 'longdash', 'dashdot',
'longdashdot']
- A number that will be converted to a string
Moreover, the documentation and the Line docstring state that it should be allowed, but the layout.shape.Line.dash property docstring states otherwise.
Had the same issue. After looking around a bit, I found that the problem is that the DashValidator from validators/layout/shape/line inherits from StringValidator instead of DashValidator (same actually for validators/scattersmith/line and validators/layout/newshape/line). Changing this line:
class DashValidator(_plotly_utils.basevalidators.StringValidator):
to this:
class DashValidator(_plotly_utils.basevalidators.DashValidator):
in the file C:\Users\[USER]\Anaconda3\Lib\site-packages\plotly\validators\layout\shape\line\_dash.py on Windows (probably similar on Linux/Mac) fixes the issue. Not sure how to make a patch of this though.
Activity
kvanderwijst commentedon Feb 28, 2022
Had the same issue. After looking around a bit, I found that the problem is that the DashValidator from
validators/layout/shape/lineinherits from StringValidator instead of DashValidator (same actually forvalidators/scattersmith/lineandvalidators/layout/newshape/line). Changing this line:to this:
in the file
C:\Users\[USER]\Anaconda3\Lib\site-packages\plotly\validators\layout\shape\line\_dash.pyon Windows (probably similar on Linux/Mac) fixes the issue. Not sure how to make a patch of this though.Fix layout shape line dash w/ custom lenghts plotly#3375
Fix go.layout.shape.line.DashValidator plotly#3375