Skip to content

Commit

Permalink
plot3d with octarine backend: check if existing viewer has been closed
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Sep 4, 2024
1 parent 01e333d commit 834eeaa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions navis/plotting/ddd.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,13 @@ def plot3d_octarine(x, **kwargs):
# Parse objects to plot
(neurons, volumes, points, visuals) = utils.parse_objects(x)

# Check if any existing viewer has already been closed
if isinstance(getattr(config, "primary_viewer", None), oc.Viewer):
try:
_ = getattr(config, "primary_viewer").canvas
except RuntimeError:
config.primary_viewer = None

if settings.viewer in (None, "new"):
# If it does not exists yet, initialise a canvas object and make global
if (
Expand Down

0 comments on commit 834eeaa

Please sign in to comment.