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

feat: UI dashboard #176

Merged
merged 13 commits into from
Jan 26, 2024
278 changes: 278 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plugins/ui/src/deephaven/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
class UIRegistration(Registration):
@classmethod
def register_into(cls, callback: Callback) -> None:
callback.register(DashboardType)
callback.register(ElementType)
10 changes: 10 additions & 0 deletions plugins/ui/src/deephaven/ui/components/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from .icon import icon
from .make_component import make_component as component
from .make_dashboard import make_dashboard as dashboard
from .fragment import fragment
from .panel import panel
from .spectrum import *
from .table import table
from .row import row
from .column import column
from .stack import stack

# from .dashboard import dashboard
mattrunyon marked this conversation as resolved.
Show resolved Hide resolved
from . import html


Expand All @@ -12,9 +18,11 @@
"button",
"button_group",
"checkbox",
"column",
"component",
"content",
"contextual_help",
"dashboard",
"flex",
"form",
"fragment",
Expand All @@ -28,8 +36,10 @@
"item",
"panel",
"range_slider",
"row",
"slider",
"spectrum_element",
"stack",
"switch",
"table",
"tab_list",
Expand Down
18 changes: 18 additions & 0 deletions plugins/ui/src/deephaven/ui/components/column.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from __future__ import annotations

from typing import Any
from ..elements import BaseElement


def column(*children: Any, width: float | None = None, **kwargs: Any):
"""
A column is a container that can be used to group elements.
Each element will be placed below its prior sibling.

Args:
children: Elements to render in the column.
width: The percent width of the column relative to other children of its parent. If not provided, the column will be sized automatically.
"""
return BaseElement(
"deephaven.ui.components.Column", *children, width=width, **kwargs
)
14 changes: 14 additions & 0 deletions plugins/ui/src/deephaven/ui/components/dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from __future__ import annotations

from typing import Any
from ..elements import BaseElement


def dashboard(*children: Any, **kwargs: Any):
"""
A dashboard is the container for an entire layout.

Args:
children: Elements to render in the dashboard. Must have only 1 root element.
mattrunyon marked this conversation as resolved.
Show resolved Hide resolved
"""
return BaseElement("deephaven.ui.components.Dashboard", *children, **kwargs)
mattrunyon marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading