Trame wrapper to a Docking Layout Manager
Project description
Trame-dockview extend trame widgets with dockview capabilities tuned so it can easily be used within trame. Dockview is a fully featured Docking Layout Manager with customizable themes and controls.
This package is not supposed to be used by itself but rather should come as a dependency of trame. For any specificity, please refer to the trame documentation.
Installing
trame-dockview can be installed with pip:
pip install --upgrade trame-dockview
Usage
The Trame Tutorial is the place to go to learn how to use the library and start building your own application.
The API Reference documentation provides API-level documentation.
The Dockview website is very well made for exploring capabilities that the library is providing.
DockView Widget
First you need to import the dockview module so you can instantiate the layout manager like illustrated below.
from trame.app import TrameApp
from trame.ui.html import DivLayout
from trame.ui.vuetify3 import SinglePageLayout
from trame.widgets import dockview, html
from trame.widgets import vtk as vtk_widgets
from trame.widgets import vuetify3 as v3
THEMES = [
"Abyss",
"AbyssSpaced",
"Dark",
"Dracula",
"Light",
"LightSpaced",
"Replit",
"VisualStudio",
]
class Demo(TrameApp):
def __init__(self, server=None):
super().__init__(server)
self._panel_count = 0
self._build_ui()
# init vtk.js
vtk_widgets.VtkView(trame_server=server)
def _build_ui(self):
with SinglePageLayout(self.server, full_height=True) as self.ui:
with self.ui.toolbar:
v3.VSpacer()
v3.VSelect(
v_model=("theme", "Abyss"),
items=("themes", THEMES),
hide_details=True,
density="compact",
style="max-width:200px;",
)
v3.VBtn(icon="mdi-plus", click=self.add_panel, density="compact")
with self.ui.content:
with v3.VContainer(classes="pa-0 ma-0 fill-height", fluid=True):
dockview.DockView(
ctx_name="dock_view",
theme=("theme",),
)
def add_panel(self):
self._panel_count += 1
panel_id = f"panel_{self._panel_count}"
title = f"Panel {self._panel_count}"
template_name = f"dock_{panel_id}"
resolution_key = f"{template_name}_resolution"
with DivLayout(self.server, template_name) as layout:
layout.root.style = "height:100%;position:relative;"
with vtk_widgets.VtkView() as view:
with html.Div(
style="position:absolute;top:1rem;right:1rem;z-index:1;display:flex;flex-align:center;"
):
html.Input(
type="range",
v_model_number=(resolution_key, 6),
min=3,
max=60,
step=1,
)
html.Button(
"Reset",
style="padding:0 5px;margin:10px;background:white;",
click=view.reset_camera,
)
with vtk_widgets.VtkGeometryRepresentation():
vtk_widgets.VtkAlgorithm(
vtk_class="vtkConeSource",
state=(f"{{ resolution: {resolution_key} }}",),
)
self.ctx.dock_view.add_panel(panel_id, title, template_name)
def main():
app = Demo()
app.server.start()
if __name__ == "__main__":
main()
License
trame-dockview is made available under the MIT License. For more details, see LICENSE This license has been chosen to match the one use by DockView License which is instrumental for making that library possible.
Community
Trame | Discussions | Issues | Contact Us
Enjoying trame?
Share your experience with a testimonial or with a brand approval.
JavaScript dependency
This Python package bundle the following dockview-vue@4.4.0 library. If you would like us to upgrade its dependency or expose more capabilities provided by the underlying library, please reach out.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trame_dockview-1.0.3.tar.gz.
File metadata
- Download URL: trame_dockview-1.0.3.tar.gz
- Upload date:
- Size: 48.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76efa8e683386742dd06f550a1ed8d0d3f140813436550dda7d63effb18df4e1
|
|
| MD5 |
6c4b3eefb3a69f6e4fd2ac7656db11f5
|
|
| BLAKE2b-256 |
0d7aa4a6049ce7a793f07bebb5a0de1bde87f6809986b0cb9c63f47a992c443e
|
Provenance
The following attestation bundles were made for trame_dockview-1.0.3.tar.gz:
Publisher:
test_and_release.yml on Kitware/trame-dockview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trame_dockview-1.0.3.tar.gz -
Subject digest:
76efa8e683386742dd06f550a1ed8d0d3f140813436550dda7d63effb18df4e1 - Sigstore transparency entry: 248287854
- Sigstore integration time:
-
Permalink:
Kitware/trame-dockview@d2ec195fd80de51a72cbab4f707f6c3bbd638d56 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Kitware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test_and_release.yml@d2ec195fd80de51a72cbab4f707f6c3bbd638d56 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trame_dockview-1.0.3-py3-none-any.whl.
File metadata
- Download URL: trame_dockview-1.0.3-py3-none-any.whl
- Upload date:
- Size: 50.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76af14eb64cc6b8034b16f9f0f1296697e5552e402ae1b9d1cfacbd27f4585de
|
|
| MD5 |
d4a0ef1f5be5dc44ae059b9fc013f8a3
|
|
| BLAKE2b-256 |
9ec8ca448555d06f35d2f36989266cd4948e0401d7cc33af8af78a047a925a4a
|
Provenance
The following attestation bundles were made for trame_dockview-1.0.3-py3-none-any.whl:
Publisher:
test_and_release.yml on Kitware/trame-dockview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trame_dockview-1.0.3-py3-none-any.whl -
Subject digest:
76af14eb64cc6b8034b16f9f0f1296697e5552e402ae1b9d1cfacbd27f4585de - Sigstore transparency entry: 248287856
- Sigstore integration time:
-
Permalink:
Kitware/trame-dockview@d2ec195fd80de51a72cbab4f707f6c3bbd638d56 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Kitware
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test_and_release.yml@d2ec195fd80de51a72cbab4f707f6c3bbd638d56 -
Trigger Event:
push
-
Statement type: