@@ -16,20 +16,16 @@ var modebarConfig = require('./modebar_config');
1616/**
1717 * UI controller for interactive plots
1818 * @Class
19- * @Param {object} config
20- * @Param {object} config.buttons nested arrays of grouped buttons to initialize
21- * @Param {object} config.container container div to append modebar
22- * @Param {object} config.Plotly main plotly namespace module
23- * @Param {object} config.graphInfo primary plot object containing data and layout
19+ * @Param {object} opts
20+ * @Param {object} opts.buttons nested arrays of grouped buttons to initialize
21+ * @Param {object} opts.container container div to append modebar
22+ * @Param {object} opts.graphInfo primary plot object containing data and layout
2423 */
25- function ModeBar ( config ) {
26-
27- if ( ! ( this instanceof ModeBar ) ) return new ModeBar ( ) ;
28-
24+ function ModeBar ( opts ) {
2925 var _this = this ;
3026
3127 this . _snapshotInProgress = false ;
32- this . graphInfo = config . graphInfo ;
28+ this . graphInfo = opts . graphInfo ;
3329 this . element = document . createElement ( 'div' ) ;
3430
3531 if ( this . graphInfo . _context . displayModeBar === 'hover' ) {
@@ -38,7 +34,7 @@ function ModeBar (config) {
3834 this . element . className = 'modebar' ;
3935 }
4036
41- this . buttons = config . buttons ;
37+ this . buttons = opts . buttons ;
4238 this . buttonElements = [ ] ;
4339
4440 this . buttons . forEach ( function ( buttonGroup ) {
@@ -64,7 +60,7 @@ function ModeBar (config) {
6460 this . element . appendChild ( this . getLogo ( ) ) ;
6561 }
6662
67- config . container . appendChild ( this . element ) ;
63+ opts . container . appendChild ( this . element ) ;
6864
6965 this . updateActiveButton ( ) ;
7066}
@@ -493,9 +489,7 @@ proto.toImage = function() {
493489
494490proto . sendDataToCloud = function ( ) {
495491 var gd = this . graphInfo ;
496- Plotly . Plots . sendDataToCloud ( gd )
497- } ;
498-
492+ Plotly . Plots . sendDataToCloud ( gd ) ;
499493} ;
500494
501495module . exports = ModeBar ;
0 commit comments