Skip to content

Commit

Permalink
Fix: Custom code keeps appending trace per refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
deecay committed Jul 31, 2017
1 parent aacc4b7 commit 1a8078a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/app/visualizations/chart/plotly.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,9 @@ const CustomPlotlyChart = (clientConfig) => {
return;
}
const refresh = () => {
// Clear existing data
element[0].children[0].calcdata = [];
element[0].children[0].data = [];
// Clear existing data with blank data for succeeding codeCall adds data to existing plot.
Plotly.newPlot(element[0].children[0]);

// eslint-disable-next-line no-eval
const codeCall = eval(`codeCall = function(x, ys, element, Plotly){ ${scope.options.customCode} }`);
codeCall(scope.x, scope.ys, element[0].children[0], Plotly);
Expand Down

0 comments on commit 1a8078a

Please sign in to comment.