Skip to content

Commit d94f5a8

Browse files
committed
Set responsive=True in config by default (without this, plotly won't fill it's container in v6)
1 parent 110f866 commit d94f5a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

shinywidgets/_render_widget_base.py

+4
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ def set_layout_defaults(widget: Widget) -> Tuple[Widget, bool]:
178178
# so change that 60px default to 32px
179179
if layout.margin["t"] == 60: # pyright: ignore
180180
layout.margin["t"] = 32 # pyright: ignore
181+
# In plotly >=v6.0, the plot won't actually fill unless it's responsive
182+
if fill:
183+
print("setting responsive")
184+
widget._config = {"responsive": True, **widget._config} # type: ignore
181185

182186
widget.layout = layout
183187

0 commit comments

Comments
 (0)