From f324c294834a3a84834c2f9dab610e172744d3b3 Mon Sep 17 00:00:00 2001 From: Marc Skov Madsen Date: Thu, 2 Sep 2021 07:13:06 +0200 Subject: [PATCH] resize plot when window resizes --- panel/models/plotly.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/panel/models/plotly.ts b/panel/models/plotly.ts index 4b9033daf4..eac70b0810 100644 --- a/panel/models/plotly.ts +++ b/panel/models/plotly.ts @@ -271,6 +271,13 @@ export class PlotlyPlotView extends PanelHTMLBoxView { ); } + after_layout(): void{ + super.after_layout() + if ((window as any).Plotly) { + (window as any).Plotly.Plots.resize(this._layout_wrapper); + } + } + _get_trace(index: number, update: boolean): any { const trace = clone(this.model.data[index]); const cds = this.model.data_sources[index];