Skip to content

Commit

Permalink
Set responsive=True in config by default (without this, plotly won't …
Browse files Browse the repository at this point in the history
…fill it's container in v6)
  • Loading branch information
cpsievert committed Jan 29, 2025
1 parent 110f866 commit 66bfe47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shinywidgets/_render_widget_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ def set_layout_defaults(widget: Widget) -> Tuple[Widget, bool]:
# so change that 60px default to 32px
if layout.margin["t"] == 60: # pyright: ignore
layout.margin["t"] = 32 # pyright: ignore
# In plotly >=v6.0, the plot won't actually fill unless it's responsive
if fill:
widget._config = {"responsive": True, **widget._config} # type: ignore

widget.layout = layout

Expand Down

0 comments on commit 66bfe47

Please sign in to comment.