File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 11from uuid import uuid4
22
3+ from numpy import isfinite
34from plotly .graph_objs import Scatter
45
56from glue .core import BaseData
@@ -17,6 +18,8 @@ def dot_radius(viewer, layer_state):
1718 max_diam_world_v = 1
1819 diam_pixel_v = max_diam_world_v * height / abs (viewer_state .y_max - viewer_state .y_min )
1920 diam = min (diam_pixel_v , diam )
21+ if not isfinite (diam ):
22+ diam = 1
2023 return diam / 2
2124
2225
Original file line number Diff line number Diff line change 66from glue_qt .viewers .histogram import HistogramViewer
77
88from glue_plotly .common import sanitize
9- from glue_plotly .common .dotplot import traces_for_layer
9+ from glue_plotly .common .dotplot import dot_radius , traces_for_layer
1010
1111from glue_plotly .viewers .histogram .viewer import PlotlyHistogramView
1212from glue_plotly .viewers .histogram .dotplot_layer_artist import PlotlyDotplotLayerArtist
@@ -76,3 +76,15 @@ def test_basic_dots(self):
7676
7777 assert dots .y == expected_y
7878 assert dots .marker .size == 16 # Default figure is 640x480
79+
80+ def test_dot_radius_defined (self ):
81+ """
82+ This test makes sure that we correctly get the default value for the dot radius
83+ when both axes have no range.
84+ """
85+ self .viewer .state .x_min = 1
86+ self .viewer .state .x_max = 1
87+ self .viewer .state .y_min = 1
88+ self .viewer .state .y_max = 1
89+
90+ assert dot_radius (self .viewer , self .layer .state ) == 0.5
You can’t perform that action at this time.
0 commit comments