-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- This way components are rendered directly - Still need to automatically wrap tables, figures, and top level to a panel to keep that behaviour Clean up a bit - it's working for a simple counter example - Still need to wrap in a panel automatically, wrap in UITable/UIFigure automatically, etc Add tabs - They work in the most basic example, but they ain't working with tables: ``` from deephaven import ui @ui.component def tab_test(): return ui.panel( ui.tabs( ui.tab_list( ui.item('Hello'), ui.item('World') ), ui.tab_panels( ui.item('Foo'), ui.item('Bar') ) ) ) tt = tab_test() ``` Clean up how objects are implicitly rendered - Add a ui.object_view to explicitly wrap an exported object in an ObjectView - ExportedObjects that are passed as children of an element are implicitly converted to an ObjectView when decoding the JSON in the WidgetHandler - Enforce no mixed panel/non-panels for the document root, as well as implicitly wrapping the root array in a panel if necessary Clean up all tests affected - They all pass again Clean up tables a bit - They now appear correctly in the Tabs component Fix issue where opening a widget twice wouldn't re-open it correctly - Wasn't memoizing the onOpen/onClose callbacks correctly in DocumentHandler Add a spec for ui.fragment and implementation - Also provided an example for it Clean up example a bit Some fixes after Don reviewing - Automatically map "string" that is set as a children in a spectrum element to a `Text` element. Makes padding more correct for buttons/tabs and things - Provide an example for Tabs - Handle object lifecycle in WidgetHandler - This will conflict with my other PR, and the two need to merge - Also need to handle how widget plugins handle the exported object. Not all objects can be copied (only Table can be), and we may also need to fetch an object twice if it's re-used.
- Loading branch information
Showing
33 changed files
with
583 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
from ..elements import BaseElement | ||
|
||
|
||
def fragment(*children: Any): | ||
""" | ||
A React.Fragment: https://react.dev/reference/react/Fragment. | ||
Used to group elements together without a wrapper node. | ||
Args: | ||
children: The children in the fragment. | ||
""" | ||
return BaseElement("deephaven.ui.components.Fragment", children=children) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
from ..elements import BaseElement | ||
|
||
|
||
def object_view(obj: Any): | ||
""" | ||
A wrapper for an exported object that can be rendered as a view. | ||
E.g. A Table will be rendered as a Grid view. | ||
Args: | ||
obj: The object to display | ||
""" | ||
return BaseElement("deephaven.ui.components.Object", object=obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.