File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/python/plotly/_plotly_utils Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1694,14 +1694,16 @@ def validate_coerce(self, v):
1694
1694
except (ValueError , TypeError , OverflowError ):
1695
1695
self .raise_invalid_val (v )
1696
1696
v = v_array # Always numeric numpy array
1697
+ # Normalize v onto the interval [-180, 180)
1698
+ v = (v + 180 ) % 360 - 180
1697
1699
elif self .array_ok and is_simple_array (v ):
1698
1700
# Check numeric
1699
1701
invalid_els = [e for e in v if not isinstance (e , numbers .Number )]
1700
1702
1701
1703
if invalid_els :
1702
1704
self .raise_invalid_elements (invalid_els [:10 ])
1703
1705
1704
- v = to_scalar_or_list (v )
1706
+ v = [( x + 180 ) % 360 - 180 for x in to_scalar_or_list (v )]
1705
1707
elif not isinstance (v , numbers .Number ):
1706
1708
self .raise_invalid_val (v )
1707
1709
else :
You can’t perform that action at this time.
0 commit comments