Skip to content

Commit 10d591b

Browse files
committed
add Modebar.destroy method
1 parent 9a3e45b commit 10d591b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/modebar/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ proto.hasButtons = function (buttons) {
223223
/**
224224
* @return {HTMLDivElement} The logo image wrapped in a group
225225
*/
226-
proto.getLogo = function(){
226+
proto.getLogo = function() {
227227
var group = this.createGroup(),
228228
a = document.createElement('a');
229229

@@ -523,6 +523,11 @@ proto.removeAllButtons = function() {
523523

524524
this.hasLogo = false;
525525
};
526+
527+
proto.destroy = function() {
528+
Plotly.Lib.removeElement(this.container.querySelector('.modebar'));
529+
};
530+
526531
function createModebar(gd, buttons) {
527532
var fullLayout = gd._fullLayout;
528533

0 commit comments

Comments
 (0)