-
Notifications
You must be signed in to change notification settings - Fork 15
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.progress_bar and ui.progress_circle #892
Merged
wusteven815
merged 20 commits into
deephaven:main
from
wusteven815:826-progress-bar-circle
Oct 4, 2024
Merged
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
eb80fa8
add progress bar and circle
wusteven815 af92dd3
reorder import
wusteven815 bad4227
build: Post version update for utilities (#886)
jnumainville c38d941
add docs
wusteven815 dcadc95
fix: Correct type for generated JsPlugin (#741)
jnumainville c9bd5c1
ci: Specify deephaven-plugin-utilities version for pre-commit (#898)
mattrunyon e34ad14
add return type
wusteven815 785efb0
update docs from review
wusteven815 15262dd
fix: allows keys to be set in props (#810)
wusteven815 b780b27
fix: empty list view (#828)
wusteven815 23bcd52
build: Upgrade to Vite 5 (#899)
mattrunyon cf3f463
feat: Time Field UI Component (#825)
dgodinez-dh 9b95ac2
test: fix flaky key tests (#901)
wusteven815 fdf710b
add key prop
wusteven815 a9e1d21
update docs
wusteven815 2d5f692
update docs from review
wusteven815 113a6fc
Merge branch 'deephaven:main' into 826-progress-bar-circle
wusteven815 ece6c75
Merge branch 'deephaven:main' into 826-progress-bar-circle
wusteven815 a82c111
update docs from review
wusteven815 22ce47b
update docs from review
wusteven815 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
from __future__ import annotations | ||
from typing import Any, Callable | ||
from .types import ( | ||
AriaExpanded, | ||
AriaHasPopup, | ||
AriaPressed, | ||
StaticColor, | ||
LabelPosition, | ||
AlignSelf, | ||
CSSProperties, | ||
DimensionValue, | ||
JustifySelf, | ||
LayoutFlex, | ||
Position, | ||
ProgressBarSize, | ||
) | ||
|
||
from .basic import component_element | ||
from ..elements import Element | ||
|
||
ProgressBarButton = Element | ||
|
||
|
||
def progress_bar( | ||
size: ProgressBarSize = "L", | ||
static_color: StaticColor | None = None, | ||
label_position: LabelPosition = "top", | ||
show_value_label: bool | None = None, | ||
label: Element | None = None, | ||
# format_options, # omitted because need to connect it to Deephaven formatting options as well | ||
value_label: Element | None = None, | ||
value: float = 0, | ||
min_value: float = 0, | ||
max_value: float = 100, | ||
is_indeterminate: bool | None = None, | ||
flex: LayoutFlex | None = None, | ||
flex_grow: float | None = None, | ||
flex_shrink: float | None = None, | ||
flex_basis: DimensionValue | None = None, | ||
align_self: AlignSelf | None = None, | ||
justify_self: JustifySelf | None = None, | ||
order: int | None = None, | ||
grid_area: str | None = None, | ||
grid_row: str | None = None, | ||
grid_row_start: str | None = None, | ||
grid_row_end: str | None = None, | ||
grid_column: str | None = None, | ||
grid_column_start: str | None = None, | ||
grid_column_end: str | None = None, | ||
margin: DimensionValue | None = None, | ||
margin_top: DimensionValue | None = None, | ||
margin_bottom: DimensionValue | None = None, | ||
margin_start: DimensionValue | None = None, | ||
margin_end: DimensionValue | None = None, | ||
margin_x: DimensionValue | None = None, | ||
margin_y: DimensionValue | None = None, | ||
width: DimensionValue | None = None, | ||
height: DimensionValue | None = None, | ||
min_width: DimensionValue | None = None, | ||
min_height: DimensionValue | None = None, | ||
max_width: DimensionValue | None = None, | ||
max_height: DimensionValue | None = None, | ||
position: Position | None = None, | ||
top: DimensionValue | None = None, | ||
bottom: DimensionValue | None = None, | ||
start: DimensionValue | None = None, | ||
end: DimensionValue | None = None, | ||
left: DimensionValue | None = None, | ||
right: DimensionValue | None = None, | ||
z_index: int | None = None, | ||
is_hidden: bool | None = None, | ||
id: str | None = None, | ||
exclude_from_tab_order: bool | None = None, | ||
aria_expanded: AriaExpanded | None = None, | ||
aria_haspopup: AriaHasPopup | None = None, | ||
aria_controls: str | None = None, | ||
aria_label: str | None = None, | ||
aria_labelledby: str | None = None, | ||
aria_describedby: str | None = None, | ||
aria_pressed: AriaPressed | None = None, | ||
aria_details: str | None = None, | ||
UNSAFE_class_name: str | None = None, | ||
UNSAFE_style: CSSProperties | None = None, | ||
): | ||
""" | ||
ProgressBars show the progression of a system operation: downloading, uploading, processing, etc., in a visual way. They can represent either determinate or indeterminate progress. | ||
|
||
Args: | ||
size: How thick the bar should be. | ||
static_color: The static color style to apply. Useful when the button appears over a color background. | ||
label_position: The label's overall position relative to the element it is labeling. | ||
show_value_label: Whether the value label should be displayed. True by default if the label is provided. | ||
label: The content to display as the label. | ||
value_label: The content to display as the value's label. | ||
value: The current value (controlled). | ||
min_value: The smallest value allowed for the input. | ||
max_value: The largest value allowed for the input. | ||
wusteven815 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
is_indeterminate: Indeterminism is presentational only. The indeterminate visual representation remains regardless of user interaction. | ||
flex: When used in a flex layout, specifies how the element will grow or shrink to fit the space available. | ||
flex_grow: When used in a flex layout, specifies how much the element will grow to fit the space available. | ||
flex_shrink: When used in a flex layout, specifies how much the element will shrink to fit the space available. | ||
flex_basis: When used in a flex layout, specifies the initial size of the element. | ||
align_self: Overrides the align_items property of a flex or grid container. | ||
justify_self: Specifies how the element is justified inside a flex or grid container. | ||
order: The layout order for the element within a flex or grid container. | ||
grid_area: The name of the grid area to place the element in. | ||
grid_row: The name of the grid row to place the element in. | ||
grid_row_start: The name of the grid row to start the element in. | ||
grid_row_end: The name of the grid row to end the element in. | ||
grid_column: The name of the grid column to place the element in. | ||
grid_column_start: The name of the grid column to start the element in. | ||
grid_column_end: The name of the grid column to end the element in. | ||
margin: The margin to apply around the element. | ||
margin_top: The margin to apply above the element. | ||
margin_bottom: The margin to apply below the element. | ||
margin_start: The margin to apply before the element. | ||
margin_end: The margin to apply after the element. | ||
margin_x: The margin to apply to the left and right of the element. | ||
margin_y: The margin to apply to the top and bottom of the element. | ||
width: The width of the element. | ||
height: The height of the element. | ||
min_width: The minimum width of the element. | ||
min_height: The minimum height of the element. | ||
max_width: The maximum width of the element. | ||
max_height: The maximum height of the element. | ||
position: Specifies how the element is positioned. | ||
top: The distance from the top of the containing element. | ||
bottom: The distance from the bottom of the containing element. | ||
start: The distance from the start of the containing element. | ||
end: The distance from the end of the containing element. | ||
left: The distance from the left of the containing element. | ||
right: The distance from the right of the containing element. | ||
z_index: The stack order of the element. | ||
is_hidden: Whether the element is hidden. | ||
id: A unique identifier for the element. | ||
exclude_from_tab_order: Whether the element should be excluded from the tab order. | ||
aria_expanded: Whether the element is expanded. | ||
aria_haspopup: Whether the element has a popup. | ||
aria_controls: The id of the element that the element controls. | ||
aria_label: The label for the element. | ||
aria_labelledby: The id of the element that labels the element. | ||
aria_describedby: The id of the element that describes the element. | ||
aria_pressed: Whether the element is pressed. | ||
aria_details: The details for the element. | ||
UNSAFE_class_name: A CSS class to apply to the element. | ||
UNSAFE_style: A CSS style to apply to the element. | ||
|
||
Returns: | ||
The rendered ProgressBar element. | ||
""" | ||
return component_element( | ||
"ProgressBar", | ||
size=size, | ||
static_color=static_color, | ||
label_position=label_position, | ||
show_value_label=show_value_label, | ||
label=label, | ||
value_label=value_label, | ||
value=value, | ||
min_value=min_value, | ||
max_value=max_value, | ||
is_indeterminate=is_indeterminate, | ||
flex=flex, | ||
flex_grow=flex_grow, | ||
flex_shrink=flex_shrink, | ||
flex_basis=flex_basis, | ||
align_self=align_self, | ||
justify_self=justify_self, | ||
order=order, | ||
grid_area=grid_area, | ||
grid_row=grid_row, | ||
grid_row_start=grid_row_start, | ||
grid_row_end=grid_row_end, | ||
grid_column=grid_column, | ||
grid_column_start=grid_column_start, | ||
grid_column_end=grid_column_end, | ||
margin=margin, | ||
margin_top=margin_top, | ||
margin_bottom=margin_bottom, | ||
margin_start=margin_start, | ||
margin_end=margin_end, | ||
margin_x=margin_x, | ||
margin_y=margin_y, | ||
width=width, | ||
height=height, | ||
min_width=min_width, | ||
min_height=min_height, | ||
max_width=max_width, | ||
max_height=max_height, | ||
position=position, | ||
top=top, | ||
bottom=bottom, | ||
start=start, | ||
end=end, | ||
left=left, | ||
right=right, | ||
z_index=z_index, | ||
is_hidden=is_hidden, | ||
id=id, | ||
exclude_from_tab_order=exclude_from_tab_order, | ||
aria_expanded=aria_expanded, | ||
aria_haspopup=aria_haspopup, | ||
aria_controls=aria_controls, | ||
aria_label=aria_label, | ||
aria_labelledby=aria_labelledby, | ||
aria_describedby=aria_describedby, | ||
aria_pressed=aria_pressed, | ||
aria_details=aria_details, | ||
UNSAFE_class_name=UNSAFE_class_name, | ||
UNSAFE_style=UNSAFE_style, | ||
) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ethanalvizo is adding this to
number_field
right now, can add it toprogress_bar
when he's done that.