@@ -33,7 +33,7 @@ var initInteractions = require('../plots/cartesian/graph_interact').initInteract
3333var xmlnsNamespaces = require ( '../constants/xmlns_namespaces' ) ;
3434var svgTextUtils = require ( '../lib/svg_text_utils' ) ;
3535
36- var defaultConfig = require ( './plot_config' ) ;
36+ var dfltConfig = require ( './plot_config' ) . dfltConfig ;
3737var manageArrays = require ( './manage_arrays' ) ;
3838var helpers = require ( './helpers' ) ;
3939var subroutines = require ( './subroutines' ) ;
@@ -405,7 +405,7 @@ function emitAfterPlot(gd) {
405405}
406406
407407exports . setPlotConfig = function setPlotConfig ( obj ) {
408- return Lib . extendFlat ( defaultConfig , obj ) ;
408+ return Lib . extendFlat ( dfltConfig , obj ) ;
409409} ;
410410
411411function setBackground ( gd , bgColor ) {
@@ -423,7 +423,7 @@ function opaqueSetBackground(gd, bgColor) {
423423
424424function setPlotContext ( gd , config ) {
425425 if ( ! gd . _context ) {
426- gd . _context = Lib . extendDeep ( { } , defaultConfig ) ;
426+ gd . _context = Lib . extendDeep ( { } , dfltConfig ) ;
427427
428428 // stash <base> href, used to make robust clipPath URLs
429429 var base = d3 . select ( 'base' ) ;
@@ -507,6 +507,25 @@ function setPlotContext(gd, config) {
507507 // Check if gd has a specified widht/height to begin with
508508 context . _hasZeroHeight = context . _hasZeroHeight || gd . clientHeight === 0 ;
509509 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+ }
510529}
511530
512531function plotLegacyPolar ( gd , data , layout ) {
0 commit comments