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):
16941694 except (ValueError , TypeError , OverflowError ):
16951695 self .raise_invalid_val (v )
16961696 v = v_array # Always numeric numpy array
1697+ # Normalize v onto the interval [-180, 180)
1698+ v = (v + 180 ) % 360 - 180
16971699 elif self .array_ok and is_simple_array (v ):
16981700 # Check numeric
16991701 invalid_els = [e for e in v if not isinstance (e , numbers .Number )]
17001702
17011703 if invalid_els :
17021704 self .raise_invalid_elements (invalid_els [:10 ])
17031705
1704- v = to_scalar_or_list (v )
1706+ v = [( x + 180 ) % 360 - 180 for x in to_scalar_or_list (v )]
17051707 elif not isinstance (v , numbers .Number ):
17061708 self .raise_invalid_val (v )
17071709 else :
You can’t perform that action at this time.
0 commit comments