Skip to content

Commit a320f29

Browse files
committed
make main modebar module export a creator function
1 parent 189e313 commit a320f29

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/components/modebar/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,3 +495,22 @@ proto.sendDataToCloud = function() {
495495
};
496496

497497
module.exports = ModeBar;
498+
function createModebar(gd, buttons) {
499+
var fullLayout = gd._fullLayout;
500+
501+
var modebar = new ModeBar({
502+
graphInfo: gd,
503+
container: fullLayout._paperdiv.node(),
504+
buttons: buttons
505+
});
506+
507+
if(fullLayout._privateplot) {
508+
d3.select(modebar.element).append('span')
509+
.classed('badge-private float--left', true)
510+
.text('PRIVATE');
511+
}
512+
513+
return modebar;
514+
}
515+
516+
module.exports = createModebar;

0 commit comments

Comments
 (0)