Skip to content

Commit

Permalink
resize plot when window resizes (#2704)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Skov Madsen <masma@orsted.dk>
  • Loading branch information
MarcSkovMadsen and Marc Skov Madsen authored Sep 2, 2021
1 parent 3b6f0c9 commit 1fab9bb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions panel/models/plotly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 1fab9bb

Please sign in to comment.