Skip to content

Commit

Permalink
merge latest
Browse files Browse the repository at this point in the history
  • Loading branch information
dgodinez-dh committed Feb 5, 2025
2 parents 7d5a1d8 + c84db85 commit ac3d907
Show file tree
Hide file tree
Showing 25 changed files with 236 additions and 15 deletions.
4 changes: 3 additions & 1 deletion package-lock.json

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

14 changes: 14 additions & 0 deletions plugins/plotly-express/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.

- - -
## plotly-express-v0.13.0 - 2025-02-04
#### Bug Fixes
- DH-18538: Deephaven express not respecting webgl flag within dh.ui (#1103) - (4516b77) - Matthew Runyon
- Pin plotly version (#1104) - (fa37812) - Joe
- Make docs links passthrough (#1085) - (2ef0ddb) - Joe
#### Documentation
- fix renamed unsafe-figure-update (#1091) - (ea5d637) - Don
- Add `unsafe_update_figure` doc (#1058) - (90c8e19) - Joe
- Expand sidebars by default for certain categories, add link to flexbox froggy (#1073) - (e76591d) - Don
#### Features
- `dx.indicator` spec (#1062) - (4478013) - Joe

- - -

## plotly-express-v0.12.1 - 2024-12-12
#### Bug Fixes
- switch to webgl by default for line plot (#992) - (2c7bc01) - Joe
Expand Down
2 changes: 1 addition & 1 deletion plugins/plotly-express/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = deephaven-plugin-plotly-express
description = Deephaven Chart Plugin
long_description = file: README.md
long_description_content_type = text/markdown
version = 0.12.1.dev0
version = 0.13.0.dev0
url = https://github.com/deephaven/deephaven-plugins
project_urls =
Source Code = https://github.com/deephaven/deephaven-plugins
Expand Down
3 changes: 2 additions & 1 deletion plugins/plotly-express/src/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deephaven/js-plugin-plotly-express",
"version": "0.12.1",
"version": "0.13.0",
"description": "Deephaven plotly express plugin",
"keywords": [
"Deephaven",
Expand Down Expand Up @@ -60,6 +60,7 @@
"@deephaven/jsapi-bootstrap": "0.97.0",
"@deephaven/log": "0.97.0",
"@deephaven/plugin": "0.97.0",
"@deephaven/redux": "0.97.0",
"@deephaven/utils": "0.97.0",
"deep-equal": "^2.2.1",
"nanoid": "^5.0.7",
Expand Down
4 changes: 4 additions & 0 deletions plugins/plotly-express/src/js/src/PlotlyExpressChart.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React, { useEffect, useRef, useState } from 'react';
import { useSelector } from 'react-redux';
import Plotly from 'plotly.js-dist-min';
import { Chart } from '@deephaven/chart';
import type { dh } from '@deephaven/jsapi-types';
import { type WidgetComponentProps } from '@deephaven/plugin';
import { useApi } from '@deephaven/jsapi-bootstrap';
import { getSettings, type RootState } from '@deephaven/redux';
import PlotlyExpressChartModel from './PlotlyExpressChartModel.js';
import { useHandleSceneTicks } from './useHandleSceneTicks.js';

Expand All @@ -14,6 +16,7 @@ export function PlotlyExpressChart(
const { fetch } = props;
const containerRef = useRef<HTMLDivElement>(null);
const [model, setModel] = useState<PlotlyExpressChartModel>();
const settings = useSelector(getSettings<RootState>);
const [widgetRevision, setWidgetRevision] = useState(0); // Used to force a clean chart state on widget change

useEffect(() => {
Expand Down Expand Up @@ -42,6 +45,7 @@ export function PlotlyExpressChart(
key={widgetRevision}
containerRef={containerRef}
model={model}
settings={settings}
Plotly={Plotly}
/>
) : null;
Expand Down
12 changes: 6 additions & 6 deletions plugins/ui/docs/components/contextual_help.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contextual help can be used to show extra information about the state of a compo

## Example

For the contextual help component, both the `heading` and `content` props are required.
For the contextual help component, both the `heading` and `content` props are required, while the `footer` prop is optional.

```python
from deephaven import ui
Expand All @@ -13,11 +13,11 @@ from deephaven import ui
my_contextual_help_basic = ui.contextual_help(
heading="Need Help",
content="If you are having issues accessing your account, contact our customer support team for help.",
footer=ui.link("Download support logs"),
variant="info",
)
```


## Placement

The contextual help component supports different placement options for when the popover's positioning needs to be customized.
Expand Down Expand Up @@ -52,7 +52,6 @@ def ui_contextual_help_placement_examples():
my_contextual_help_placement_examples = ui_contextual_help_placement_examples()
```


## Events

The `on_open_change` prop is triggered when the popover opens or closes.
Expand Down Expand Up @@ -80,7 +79,6 @@ def ui_contextual_help_events_example():
my_contextual_help_events_example = ui_contextual_help_events_example()
```


## Visual Options

The `variant` prop can be set to either "info" or "help", depending on how the contextual help component is meant to help the user.
Expand Down Expand Up @@ -108,10 +106,12 @@ def ui_contextual_help_variant_examples():
my_contextual_help_variant_examples = ui_contextual_help_variant_examples()
```


## API reference

```{eval-rst}
.. dhautofunction:: deephaven.ui.contextual_help
.. dhautofunction:: deephaven.ui.content
:no-index:
.. dhautofunction:: deephaven.ui.footer
:no-index:
```

9 changes: 6 additions & 3 deletions plugins/ui/docs/components/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def dialog_example1():
ui.dialog(
ui.heading("Publish 3 pages"),
ui.content("Confirm publish?"),
ui.footer("You can undo this action later."),
ui.button_group(
ui.button("Cancel", variant="secondary", on_press=set_open.off),
ui.button(
Expand Down Expand Up @@ -106,11 +107,11 @@ def dialog_example3():
ui.text_field(label="Last Name"),
ui.text_field(label="Street Address"),
ui.text_field(label="City"),
ui.checkbox(
"I want to receive updates for exclusive offers in my area."
),
)
),
ui.footer(
ui.checkbox("I want to receive updates for exclusive offers."),
),
ui.button_group(
ui.button("Cancel", variant="secondary", on_press=set_open.off),
ui.button("Register", variant="accent", on_press=set_open.off),
Expand Down Expand Up @@ -319,4 +320,6 @@ my_large_example = large_example()

```{eval-rst}
.. dhautofunction:: deephaven.ui.dialog
.. dhautofunction:: deephaven.ui.content
.. dhautofunction:: deephaven.ui.footer
```
4 changes: 4 additions & 0 deletions plugins/ui/docs/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@
"label": "form",
"path": "components/form.md"
},
{
"label": "footer",
"path": "components/footer.md"
},
{
"label": "fragment",
"path": "components/fragment.md"
Expand Down
2 changes: 2 additions & 0 deletions plugins/ui/src/deephaven/ui/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from .divider import divider
from .flex import flex
from .form import form
from .footer import footer
from .fragment import fragment
from .heading import heading
from .grid import grid
Expand Down Expand Up @@ -107,6 +108,7 @@
"divider",
"flex",
"form",
"footer",
"fragment",
"grid",
"heading",
Expand Down
3 changes: 3 additions & 0 deletions plugins/ui/src/deephaven/ui/components/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def content(
UNSAFE_class_name: A CSS class to apply to the element.
UNSAFE_style: A CSS style to apply to the element.
key: A unique identifier used by React to render elements in a list.
Returns:
The rendered content element.
"""
return component_element(
"Content",
Expand Down
151 changes: 151 additions & 0 deletions plugins/ui/src/deephaven/ui/components/footer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
from __future__ import annotations

from .basic import component_element
from ..elements import Element, NodeType
from .types import (
AlignSelf,
CSSProperties,
DimensionValue,
JustifySelf,
LayoutFlex,
Position,
)


def footer(
*children: NodeType,
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,
UNSAFE_class_name: str | None = None,
UNSAFE_style: CSSProperties | None = None,
key: str | None = None,
) -> Element:
"""
A footer for a document or section.
Args:
*children: The items to render within the footer.
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.
UNSAFE_class_name: A CSS class to apply to the element.
UNSAFE_style: A CSS style to apply to the element.
key: A unique identifier used by React to render elements in a list.
Returns:
The rendered footer element.
"""
return component_element(
"Footer",
children=children,
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_column=grid_column,
grid_row=grid_row,
grid_column_start=grid_column_start,
grid_column_end=grid_column_end,
grid_row_start=grid_row_start,
grid_row_end=grid_row_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,
min_width=min_width,
max_width=max_width,
height=height,
min_height=min_height,
max_height=max_height,
position=position,
top=top,
bottom=bottom,
left=left,
right=right,
start=start,
end=end,
z_index=z_index,
is_hidden=is_hidden,
id=id,
UNSAFE_class_name=UNSAFE_class_name,
UNSAFE_style=UNSAFE_style,
key=key,
)
13 changes: 11 additions & 2 deletions plugins/ui/src/js/src/elements/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ type MarkdownProps = Omit<ViewProps, 'children'> & {
};

const renderMarkdown: CodeComponent = props => {
const { children, className } = props;
const { children, className, inline } = props;
if (inline === true) {
return (
<code>
{React.Children.map(children, child =>
typeof child === 'string' ? child.trim() : child
)}
</code>
);
}
const language =
className !== undefined && className?.startsWith('language-')
? className.substring(9)
Expand All @@ -32,7 +41,7 @@ const renderMarkdown: CodeComponent = props => {
export function Markdown({ children, ...props }: MarkdownProps): JSX.Element {
return (
// eslint-disable-next-line react/jsx-props-no-spreading
<View {...props}>
<View {...props} UNSAFE_className="ui-markdown markdown-editor-container">
<ReactMarkdown
components={{ code: renderMarkdown }}
remarkPlugins={[remarkMath]}
Expand Down
Loading

0 comments on commit ac3d907

Please sign in to comment.