Skip to content

Commit 765dc37

Browse files
committed
fix(colormaps): improve usage and initialization
1 parent f10d0c8 commit 765dc37

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/e3sm_quickview/view_manager.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
vtkTrackballPan,
1111
)
1212
from trame.app import TrameComponent, dataclass
13+
from trame.dataclasses.colormaps import ColormapConfig
1314
from trame.decorators import controller
1415
from trame.ui.html import DivLayout
15-
from trame.widgets import client, html, rca
16+
from trame.widgets import client, colormaps, html, rca
1617
from trame.widgets import vuetify3 as v3
1718
from vtkmodules.vtkRenderingCore import (
1819
vtkActor,
@@ -23,9 +24,6 @@
2324
vtkRenderWindowInteractor,
2425
)
2526

26-
from trame.dataclasses.colormaps import ColormapConfig
27-
from trame.widgets.colormaps import HorizontalScalarBar
28-
from trame_colormaps import module as colormaps_module
2927
from e3sm_quickview.components import view as tview
3028
from e3sm_quickview.utils import perf
3129

@@ -234,7 +232,7 @@ def _build_ui(self):
234232
)
235233

236234
with self.colormap.provide_as(self.name):
237-
HorizontalScalarBar(self.name, popup_location="top")
235+
colormaps.HorizontalScalarBar(self.name, popup_location="top")
238236

239237

240238
class ViewManager(TrameComponent):
@@ -288,8 +286,9 @@ def __init__(self, server, source):
288286
self._last_vars = {}
289287
self._active_configs = {}
290288

289+
# Initialize deferred widgets
291290
rca.initialize(self.server)
292-
self.server.enable_module(colormaps_module)
291+
colormaps.initialize(self.server)
293292

294293
def _on_render_start(self, *_):
295294
if perf.is_enabled():

0 commit comments

Comments
 (0)