Skip to content

Add config options in plot schema #3376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/loggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/* eslint-disable no-console */

var config = require('../plot_api/plot_config');
var dfltConfig = require('../plot_api/plot_config').dfltConfig;

var loggers = module.exports = {};

Expand All @@ -21,7 +21,7 @@ var loggers = module.exports = {};
*/

loggers.log = function() {
if(config.logging > 1) {
if(dfltConfig.logging > 1) {
var messages = ['LOG:'];

for(var i = 0; i < arguments.length; i++) {
Expand All @@ -33,7 +33,7 @@ loggers.log = function() {
};

loggers.warn = function() {
if(config.logging > 0) {
if(dfltConfig.logging > 0) {
var messages = ['WARN:'];

for(var i = 0; i < arguments.length; i++) {
Expand All @@ -45,7 +45,7 @@ loggers.warn = function() {
};

loggers.error = function() {
if(config.logging > 0) {
if(dfltConfig.logging > 0) {
var messages = ['ERROR:'];

for(var i = 0; i < arguments.length; i++) {
Expand Down
6 changes: 2 additions & 4 deletions src/lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
* LICENSE file in the root directory of this source tree.
*/


'use strict';

var Lib = require('../lib');
var config = require('../plot_api/plot_config');

var dfltConfig = require('../plot_api/plot_config').dfltConfig;

/**
* Copy arg array *without* removing `undefined` values from objects.
Expand Down Expand Up @@ -91,7 +89,7 @@ queue.add = function(gd, undoFunc, undoArgs, redoFunc, redoArgs) {
queueObj.redo.args.push(redoArgs);
}

if(gd.undoQueue.queue.length > config.queueLength) {
if(gd.undoQueue.queue.length > dfltConfig.queueLength) {
gd.undoQueue.queue.shift();
gd.undoQueue.index--;
}
Expand Down
6 changes: 3 additions & 3 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var initInteractions = require('../plots/cartesian/graph_interact').initInteract
var xmlnsNamespaces = require('../constants/xmlns_namespaces');
var svgTextUtils = require('../lib/svg_text_utils');

var defaultConfig = require('./plot_config');
var dfltConfig = require('./plot_config').dfltConfig;
var manageArrays = require('./manage_arrays');
var helpers = require('./helpers');
var subroutines = require('./subroutines');
Expand Down Expand Up @@ -405,7 +405,7 @@ function emitAfterPlot(gd) {
}

exports.setPlotConfig = function setPlotConfig(obj) {
return Lib.extendFlat(defaultConfig, obj);
return Lib.extendFlat(dfltConfig, obj);
};

function setBackground(gd, bgColor) {
Expand All @@ -423,7 +423,7 @@ function opaqueSetBackground(gd, bgColor) {

function setPlotContext(gd, config) {
if(!gd._context) {
gd._context = Lib.extendDeep({}, defaultConfig);
gd._context = Lib.extendDeep({}, dfltConfig);

// stash <base> href, used to make robust clipPath URLs
var base = d3.select('base');
Expand Down
Loading