Commit 88fbe86
authored
fix: allow plotly plots to shrink inside ui.flex/grid layouts (#1946)
- set responsive config to true which allows plots to properly grow and
shrink
- removed unnecessary useResizeHandler (which only watches window), as
we have our own observer
- fixed failing test by changing locator to plotly parent container.
Responsive setting has an absolutely positioned child that makes the
other locator have zero height,
Tested with the following script, and resizing golden-layout panels both
vertically and horizontally and resizing browser window horizontally and
vertically.
```py
from deephaven import ui, empty_table
from deephaven.plot import express as dx
t = empty_table(100).update(["x = i", "y = i"])
p = dx.line(t, x="x", y="y")
@ui.component
def common_example():
return ui.panel(
ui.flex(
ui.text_field(label="Text Field"),
ui.text_field(label="Text Field"),
ui.text_field(label="Text Field"),
),
t,
p
)
ui_common_example = common_example()
@ui.component
def common_example_row():
return ui.panel(
ui.flex(
ui.text_field(label="Text Field"),
ui.text_field(label="Text Field"),
ui.text_field(label="Text Field"),
direction="column"
),
t,
p,
direction="row"
)
ui_common_example_row = common_example_row()
```1 parent b63ab18 commit 88fbe86
2 files changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
| |||
704 | 708 | | |
705 | 709 | | |
706 | 710 | | |
707 | | - | |
708 | 711 | | |
709 | 712 | | |
710 | 713 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
0 commit comments