Skip to content

Commit 645c7f6

Browse files
committed
removed circular reference
1 parent 273e22c commit 645c7f6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/modebar/buttons.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var eraseActiveShape = require('../shapes/draw').eraseActiveShape;
88
var Lib = require('../../lib');
99
var _ = Lib._;
1010
var lodash = require('lodash'); // Import lodash, not using default _
11-
var Plotly = require('../../plot_api/plot_api');
1211

1312
var modeBarButtons = module.exports = {};
1413

@@ -824,7 +823,8 @@ function addTooltip(gd, data, userTemplate, customStyle) {
824823

825824
if(existingIndex === -1) {
826825
fullLayout.annotations.push(newAnnotation);
827-
Plotly.relayout(gd, { annotations: fullLayout.annotations });
826+
var aObj = { annotations: fullLayout.annotations };
827+
Registry.call('_guiRelayout', gd, aObj);
828828
}
829829
}
830830
}
@@ -836,7 +836,8 @@ function removeEmptyAnnotations(gd, eventData) {
836836
if(eventData[key] === '') {
837837
var updatedAnnotations = gd.layout.annotations || [];
838838
updatedAnnotations.splice(index, 1);
839-
Plotly.relayout(gd, { annotations: updatedAnnotations });
839+
var aObj = { annotations: updatedAnnotations };
840+
Registry.call('_guiRelayout', gd, aObj);
840841
break;
841842
}
842843
}

0 commit comments

Comments
 (0)