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

Commit

Permalink
Enhancement: add property Graph.prependData to support Plotly.prepend…
Browse files Browse the repository at this point in the history
…Traces
  • Loading branch information
sleighsoft committed Aug 30, 2020
1 parent 115b566 commit ad41ddd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/Graph.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class PlotlyGraph extends Component {
const res =
data && data.length
? {
data: EMPTY_DATA,
data: EMPTY_DATA,
}
: undefined;

Expand Down
12 changes: 2 additions & 10 deletions src/fragments/Graph.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,7 @@ class PlotlyGraph extends Component {

dataArray.forEach(data => {
let updateData, traceIndices, maxPoints;
if (
Array.isArray(data) &&
typeof data[0] === 'object'
) {
if (Array.isArray(data) && typeof data[0] === 'object') {
[updateData, traceIndices, maxPoints] = data;
} else {
updateData = data;
Expand All @@ -215,12 +212,7 @@ class PlotlyGraph extends Component {
}

const gd = this.gd.current;
return Plotly[plotlyFnKey](
gd,
updateData,
traceIndices,
maxPoints
);
return Plotly[plotlyFnKey](gd, updateData, traceIndices, maxPoints);
});
clearState(dataKey);
}
Expand Down

0 comments on commit ad41ddd

Please sign in to comment.