Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: height and spacing #9

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jdaviz/core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
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']:

Check warning on line 199 in jdaviz/core/launcher.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/core/launcher.py#L199

Added line #L199 was not covered by tests
# 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
Expand Down
10 changes: 10 additions & 0 deletions jdaviz/solara.css
Original file line number Diff line number Diff line change
@@ -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;
}
13 changes: 5 additions & 8 deletions jdaviz/solara.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
from pathlib import Path

import solara
import ipygoldenlayout
import ipysplitpanes
Expand Down Expand Up @@ -28,9 +30,11 @@

ipyvue.register_component_from_file('g-viewer-tab', "container.vue", jdaviz.__file__)

solara.Style(Path(__file__).parent / "solara.css")

Check warning on line 33 in jdaviz/solara.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/solara.py#L33

Added line #L33 was not covered by tests

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 ''))

Check warning on line 37 in jdaviz/solara.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/solara.py#L37

Added line #L37 was not covered by tests
solara.display(launcher.main_with_launcher)
return

Expand All @@ -42,11 +46,4 @@
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)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jdaviz = [
"data/*",
"data/*/*",
"*.vue",
"*.css",
"components/*.vue",
"configs/*/*/*/*.vue",
"configs/*/*.yaml",
Expand Down