diff --git a/jdaviz/core/launcher.py b/jdaviz/core/launcher.py index 5d59c380d2..7c7f6eb35e 100644 --- a/jdaviz/core/launcher.py +++ b/jdaviz/core/launcher.py @@ -196,7 +196,7 @@ def vue_launch_config(self, event): config = event.get('config') helper = _launch_config_with_data(config, self.loaded_data, filepath=self.filepath, show=False) - if self.height != '100%': + if self.height not in ['100%', '100vh']: # We're in jupyter mode. Set to default height default_height = helper.app.state.settings['context']['notebook']['max_height'] helper.app.layout.height = default_height diff --git a/jdaviz/solara.css b/jdaviz/solara.css new file mode 100644 index 0000000000..4bb8709513 --- /dev/null +++ b/jdaviz/solara.css @@ -0,0 +1,10 @@ +.solara-content-main { + padding-top: 0 !important; +} +.widget-output { + margin: 0; +} +.v-content.jdaviz__content--not-in-notebook { + height: 100vh; + max-height: 100vh; +} diff --git a/jdaviz/solara.py b/jdaviz/solara.py index 30e7a5ddb4..7234459b2e 100644 --- a/jdaviz/solara.py +++ b/jdaviz/solara.py @@ -1,4 +1,6 @@ import os +from pathlib import Path + import solara import ipygoldenlayout import ipysplitpanes @@ -28,9 +30,11 @@ def Page(): ipyvue.register_component_from_file('g-viewer-tab', "container.vue", jdaviz.__file__) + solara.Style(Path(__file__).parent / "solara.css") + if not len(data_list): from jdaviz.core.launcher import Launcher - launcher = Launcher(height='100%', filepath=(data_list[0] if len(data_list) == 1 else '')) + launcher = Launcher(height='100vh', filepath=(data_list[0] if len(data_list) == 1 else '')) solara.display(launcher.main_with_launcher) return @@ -42,11 +46,4 @@ def Page(): else: viz.load_data(data, **load_data_kwargs) - viz.app.template.template = viz.app.template.template.replace( - 'calc(100% - 48px);', '800px' # '80vh !important;' - ) - - height = '800px' - viz.app.layout.height = height - viz.app.state.settings['context']['notebook']['max_height'] = height solara.display(viz.app) diff --git a/pyproject.toml b/pyproject.toml index 4a0a6e4913..9d7ac695b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -105,6 +105,7 @@ jdaviz = [ "data/*", "data/*/*", "*.vue", + "*.css", "components/*.vue", "configs/*/*/*/*.vue", "configs/*/*.yaml",