@@ -33,7 +33,7 @@ var initInteractions = require('../plots/cartesian/graph_interact').initInteract
33
33
var xmlnsNamespaces = require ( '../constants/xmlns_namespaces' ) ;
34
34
var svgTextUtils = require ( '../lib/svg_text_utils' ) ;
35
35
36
- var defaultConfig = require ( './plot_config' ) ;
36
+ var dfltConfig = require ( './plot_config' ) . dfltConfig ;
37
37
var manageArrays = require ( './manage_arrays' ) ;
38
38
var helpers = require ( './helpers' ) ;
39
39
var subroutines = require ( './subroutines' ) ;
@@ -405,7 +405,7 @@ function emitAfterPlot(gd) {
405
405
}
406
406
407
407
exports . setPlotConfig = function setPlotConfig ( obj ) {
408
- return Lib . extendFlat ( defaultConfig , obj ) ;
408
+ return Lib . extendFlat ( dfltConfig , obj ) ;
409
409
} ;
410
410
411
411
function setBackground ( gd , bgColor ) {
@@ -423,7 +423,7 @@ function opaqueSetBackground(gd, bgColor) {
423
423
424
424
function setPlotContext ( gd , config ) {
425
425
if ( ! gd . _context ) {
426
- gd . _context = Lib . extendDeep ( { } , defaultConfig ) ;
426
+ gd . _context = Lib . extendDeep ( { } , dfltConfig ) ;
427
427
428
428
// stash <base> href, used to make robust clipPath URLs
429
429
var base = d3 . select ( 'base' ) ;
@@ -507,6 +507,25 @@ function setPlotContext(gd, config) {
507
507
// Check if gd has a specified widht/height to begin with
508
508
context . _hasZeroHeight = context . _hasZeroHeight || gd . clientHeight === 0 ;
509
509
context . _hasZeroWidth = context . _hasZeroWidth || gd . clientWidth === 0 ;
510
+
511
+ // fill context._scrollZoom helper to help manage scrollZoom flaglist
512
+ var szIn = context . scrollZoom ;
513
+ var szOut = context . _scrollZoom = { } ;
514
+ if ( szIn === true ) {
515
+ szOut . cartesian = 1 ;
516
+ szOut . gl3d = 1 ;
517
+ szOut . geo = 1 ;
518
+ szOut . mapbox = 1 ;
519
+ } else if ( typeof szIn === 'string' ) {
520
+ var parts = szIn . split ( '+' ) ;
521
+ for ( i = 0 ; i < parts . length ; i ++ ) {
522
+ szOut [ parts [ i ] ] = 1 ;
523
+ }
524
+ } else if ( szIn !== false ) {
525
+ szOut . gl3d = 1 ;
526
+ szOut . geo = 1 ;
527
+ szOut . mapbox = 1 ;
528
+ }
510
529
}
511
530
512
531
function plotLegacyPolar ( gd , data , layout ) {
0 commit comments