Skip to content

Commit

Permalink
Merge pull request #467 from kecnry/tst-density-map-no-msg
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog authored Aug 30, 2024
2 parents 19f7ac4 + 54499a8 commit 5ef073a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions glue_jupyter/bqplot/scatter/layer_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def __init__(self, view, viewer_state, layer_state=None, layer=None):
vmin=self.density_auto_limits.min,
vmax=self.density_auto_limits.max,
histogram2d_func=self.compute_density_map,
visible=False
)

self.view.figure.marks = list(self.view.figure.marks) + [
Expand Down
5 changes: 4 additions & 1 deletion glue_jupyter/bqplot/scatter/scatter_density_mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def __init__(
stretch=None,
dpi=None,
external_padding=None,
visible=True,
):

# FIXME: need to use weakref to avoid circular references
Expand All @@ -91,6 +92,7 @@ def __init__(
self.vmin = vmin
self.vmax = vmax
self.stretch = stretch
self.visible = visible

if dpi is not None:
self.dpi = dpi
Expand All @@ -106,6 +108,7 @@ def __init__(
self.observe(self._update_rendered_image, "vmin")
self.observe(self._update_rendered_image, "vmax")
self.observe(self._update_rendered_image, "stretch")
self.observe(self._update_rendered_image, "visible")

self._scale_image = ColorScale()
self._scales = {
Expand Down Expand Up @@ -194,7 +197,7 @@ def _update_counts(self, *args, **kwargs):

def _update_rendered_image(self, *args, **kwargs):

if self._counts is None:
if self._counts is None or not self.visible:
self.image = EMPTY_IMAGE
return

Expand Down

0 comments on commit 5ef073a

Please sign in to comment.