We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6cb0c1 commit 6d9f4adCopy full SHA for 6d9f4ad
packages/python/plotly/_plotly_utils/basevalidators.py
@@ -1694,14 +1694,16 @@ def validate_coerce(self, v):
1694
except (ValueError, TypeError, OverflowError):
1695
self.raise_invalid_val(v)
1696
v = v_array # Always numeric numpy array
1697
+ # Normalize v onto the interval [-180, 180)
1698
+ v = (v + 180) % 360 - 180
1699
elif self.array_ok and is_simple_array(v):
1700
# Check numeric
1701
invalid_els = [e for e in v if not isinstance(e, numbers.Number)]
1702
1703
if invalid_els:
1704
self.raise_invalid_elements(invalid_els[:10])
1705
- v = to_scalar_or_list(v)
1706
+ v = [(x + 180) % 360 - 180 for x in to_scalar_or_list(v)]
1707
elif not isinstance(v, numbers.Number):
1708
1709
else:
0 commit comments