From ee9565496d853d8cbd5a49ed9bafa9174ab1d59d Mon Sep 17 00:00:00 2001 From: Mario Buikhuizen Date: Tue, 2 Jul 2024 13:55:22 +0200 Subject: [PATCH] fix: height and spacing --- jdaviz/solara.css | 10 ++++++++++ jdaviz/solara.py | 11 ++++------- pyproject.toml | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 jdaviz/solara.css 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..10ba8ac5c9 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,6 +30,8 @@ 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 '')) @@ -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 7d53f6fcf5..303b801bbb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -105,6 +105,7 @@ jdaviz = [ "data/*", "data/*/*", "*.vue", + "*.css", "components/*.vue", "configs/*/*/*/*.vue", "configs/*/*.yaml",