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

Commit 7b48b18

Browse files
Clone figure.layout in Graph (regression fix)
1 parent c82bea0 commit 7b48b18

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

dash_core_components/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Graph.react.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {Component} from 'react';
22
import PropTypes from 'prop-types';
3-
import {contains, filter, has, isNil, type} from 'ramda';
3+
import {contains, filter, clone, has, isNil, type} from 'ramda';
44
/* global Plotly:true */
55

66
const filterEventData = (gd, eventData, event) => {
@@ -77,15 +77,13 @@ export default class PlotlyGraph extends Component {
7777
if (animate && this._hasPlotted && figure.data.length === gd.data.length) {
7878
return Plotly.animate(id, figure, animation_options);
7979
}
80-
return Plotly.react(id, figure.data, figure.layout, config).then(
81-
() => {
82-
if (!this._hasPlotted) {
83-
this.bindEvents();
84-
Plotly.Plots.resize(document.getElementById(id));
85-
this._hasPlotted = true;
86-
}
80+
return Plotly.react(id, figure.data, clone(figure.layout), config).then(() => {
81+
if (!this._hasPlotted) {
82+
this.bindEvents();
83+
Plotly.Plots.resize(document.getElementById(id));
84+
this._hasPlotted = true;
8785
}
88-
);
86+
});
8987
}
9088

9189
bindEvents() {

0 commit comments

Comments
 (0)