Skip to content

Commit

Permalink
refactor: Enable module in widgets, not dataset_viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Jun 18, 2024
1 parent 8389496 commit 1c4d30c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 0 additions & 2 deletions pan3d/dataset_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from pan3d import catalogs as pan3d_catalogs
from pan3d.dataset_builder import DatasetBuilder
from pan3d.ui import AxisDrawer, MainDrawer, Toolbar, RenderOptions, BoundsConfigure
from pan3d.ui.pan3d_components import module
from pan3d.utils import (
initial_state,
has_gpu_rendering,
Expand Down Expand Up @@ -57,7 +56,6 @@ def __init__(
builder._viewer = self
self.builder = builder
self.server = get_server(server, client_type="vue3")
self.server.enable_module(module)
self.current_event_loop = asyncio.get_event_loop()
self.pool = concurrent.futures.ThreadPoolExecutor(max_workers=1)
self._ui = None
Expand Down
14 changes: 13 additions & 1 deletion pan3d/ui/pan3d_components/widgets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
from trame_client.widgets.core import HtmlElement
from trame_client.widgets.core import AbstractElement
from . import module

__all__ = [
"PreviewBounds",
]


class HtmlElement(AbstractElement):
def __init__(self, _elem_name, children=None, **kwargs):
super().__init__(_elem_name, children, **kwargs)
if self.server:
self.server.enable_module(module)


class PreviewBounds(HtmlElement):
Expand Down

0 comments on commit 1c4d30c

Please sign in to comment.