diff --git a/.bumpversion.cfg b/.bumpversion.cfg index de659a9..a4a1f9d 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.5 +current_version = 0.1.6 commit = True tag = True diff --git a/pyproject.toml b/pyproject.toml index 621a87d..314021d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "quickview" -version = "0.1.5" +version = "0.1.6" description = "An application to explore/analyze data for atmosphere component for E3SM" authors = [ {name = "Kitware Inc."}, diff --git a/quickview/__init__.py b/quickview/__init__.py index 957169c..60295e5 100644 --- a/quickview/__init__.py +++ b/quickview/__init__.py @@ -1,5 +1,5 @@ """QuickView: Visual Analysis for E3SM Atmosphere Data.""" -__version__ = "0.1.5" +__version__ = "0.1.6" __author__ = "Kitware Inc." __license__ = "Apache-2.0" diff --git a/quickview/interface.py b/quickview/interface.py index 60903ea..fa8f5d3 100644 --- a/quickview/interface.py +++ b/quickview/interface.py @@ -267,7 +267,7 @@ def update_state_from_config(self, initstate): self.interface_vars_state = np.array(selection_interface) self.viewmanager.registry = build_color_information(initstate) - self.load_variables() + self.load_variables(use_cached_layout=True) @trigger("layout_changed") def on_layout_changed_trigger(self, layout, **kwargs): @@ -363,7 +363,7 @@ def load_data(self): state.midpoints = [] state.interfaces = [] - def load_variables(self): + def load_variables(self, use_cached_layout=False): surf = [] mid = [] intf = [] @@ -400,7 +400,9 @@ def load_variables(self): state.override_range = [False] * len(vars) state.colorbar_images = [""] * len(vars) # Initialize empty images - self.viewmanager.rebuild_visualization_layout(self._cached_layout) + # Only use cached layout when explicitly requested (i.e., when loading state) + layout_to_use = self._cached_layout if use_cached_layout else None + self.viewmanager.rebuild_visualization_layout(layout_to_use) # Update cached layout after rebuild if state.layout and state.variables: self._cached_layout = {} @@ -686,10 +688,10 @@ def ui(self) -> SinglePageWithDrawerLayout: style="height: calc(100% - 0.66rem); position: relative;", classes="pa-0", ) as cardcontent: - # VTK View takes up most of the space + # VTK View fills entire space cardcontent.add_child( """ - + """, ) @@ -713,33 +715,31 @@ def ui(self) -> SinglePageWithDrawerLayout: ) # Mask to prevent VTK view from getting scroll/mouse events html.Div( - style="position:absolute; top: 0; left: 0; width: 100%; height: calc(100% - 30px); z-index: 1;" + style="position:absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;" ) - # View Properties + # Colorbar container (horizontal layout at bottom) with html.Div( - style="position:absolute; bottom: 40px; left: 1rem; height: 2rem; z-index: 2;" + style="position: absolute; bottom: 8px; left: 8px; right: 8px; display: flex; align-items: center; justify-content: center; padding: 4px 8px 4px 8px; background-color: rgba(255, 255, 255, 0.1); height: 28px; z-index: 3; overflow: visible; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);", + classes="drag-ignore", ): + # View Properties button (small icon) ViewProperties( update_colormap=self.update_colormap, update_log_scale=self.update_log_scale, update_invert=self.update_invert_colors, update_range=self.set_manual_color_range, reset=self.revert_to_auto_color_range, + style="margin-right: 8px; display: flex; align-items: center;", ) - - # Colorbar container (horizontal layout at bottom) - with html.Div( - style="position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; padding: 4px 12px; background-color: rgba(255, 255, 255, 0.9); height: 30px; z-index: 3; overflow: visible;", - classes="drag-ignore", - ): # Color min value html.Span( "{{ varmin[idx] !== null && !isNaN(varmin[idx]) ? (uselogscale[idx] && varmin[idx] > 0 ? 'log₁₀(' + Math.log10(varmin[idx]).toFixed(3) + ')' : varmin[idx].toFixed(3)) : 'Auto' }}", - style="font-size: 12px; color: #333; white-space: nowrap;", + style="color: white;", + classes="font-weight-medium", ) # Colorbar with html.Div( - style="flex: 1; position: relative; margin: 0 12px; height: 0.75rem;", + style="flex: 1; display: flex; align-items: center; margin: 0 8px; height: 0.6rem;", classes="drag-ignore", ): # Colorbar image @@ -754,7 +754,8 @@ def ui(self) -> SinglePageWithDrawerLayout: # Color max value html.Span( "{{ varmax[idx] !== null && !isNaN(varmax[idx]) ? (uselogscale[idx] && varmax[idx] > 0 ? 'log₁₀(' + Math.log10(varmax[idx]).toFixed(3) + ')' : varmax[idx].toFixed(3)) : 'Auto' }}", - style="font-size: 12px; color: #333; white-space: nowrap;", + style="color: white;", + classes="font-weight-medium", ) return self._ui diff --git a/quickview/ui/view_settings.py b/quickview/ui/view_settings.py index 12ab93b..1db20f9 100644 --- a/quickview/ui/view_settings.py +++ b/quickview/ui/view_settings.py @@ -24,13 +24,15 @@ def __init__( with v2.Template(v_slot_activator="{ on, attrs }"): with v2.VBtn( icon=True, + dense=True, + small=True, outlined=True, - classes="pa-1", - style="background: white;", + classes="pa-0", + style="background: white; width: 24px; height: 24px;", v_bind="attrs", v_on="on", ): - v2.VIcon("mdi-cog") + v2.VIcon("mdi-cog", small=True) style = dict(dense=True, hide_details=True) with v2.VCard( classes="overflow-hidden pa-2", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 11fbb18..6e59e88 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "app" -version = "0.1.5" +version = "0.1.6" description = "QuickView: Visual Analyis for E3SM Atmosphere Data" authors = ["Kitware"] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index d02f94a..434d51e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "QuickView", - "version": "0.1.5" + "version": "0.1.6" }, "tauri": { "allowlist": {