Skip to content

Commit

Permalink
Make FrameSelector import lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Jan 2, 2025
1 parent 3a3fcc2 commit 6d65b1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions large_image/tilesource/jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

from large_image.exceptions import TileSourceXYZRangeError
from large_image.tilesource.utilities import JSONDict
from large_image.widgets.components import FrameSelector

ipyleafletPresent = importlib.util.find_spec('ipyleaflet') is not None
ipyvuePresent = importlib.util.find_spec('ipyvue') is not None


class IPyLeafletMixin:
Expand Down Expand Up @@ -317,7 +317,9 @@ def make_map(

children: List[Any] = []
frames = metadata.get('frames')
if frames is not None:
if frames is not None and ipyvuePresent:
from large_image.widgets.components import FrameSelector

self.frame_selector = FrameSelector()
self.frame_selector.imageMetadata = metadata
self.frame_selector.updateFrameCallback = self.update_frame
Expand Down

0 comments on commit 6d65b1f

Please sign in to comment.