Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
include responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Dec 15, 2020
1 parent 0482abd commit ec7b6bc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/fragments/Graph.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,13 @@ class PlotlyGraph extends Component {
}

const configClone = this.getConfig(config, responsive);
const layoutClone = this.getLayout(figure.layout, responsive);

gd.classList.add('dash-graph--pending');

return Plotly.react(gd, {
data: figure.data,
layout: figure.layout,
layout: layoutClone,
frames: figure.frames,
config: configClone,
}).then(() => {
Expand Down Expand Up @@ -225,8 +226,11 @@ class PlotlyGraph extends Component {
if (!layout) {
return layout;
}

return mergeDeepRight(layout, this.getLayoutOverride(responsive));
let override = this.getLayoutOverride(responsive);
for (let key in override) {
layout[key] = override[key];
}
return layout; // not really a clone
}

getConfigOverride(responsive) {
Expand Down

0 comments on commit ec7b6bc

Please sign in to comment.