Skip to content

Commit 6d0e221

Browse files
committed
add Plotly.setPlotConfig to API:
- to extend the default config with the API.
1 parent dd8b3d3 commit 6d0e221

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ exports.prependTraces = Plotly.prependTraces;
1818
exports.addTraces = Plotly.addTraces;
1919
exports.deleteTraces = Plotly.deleteTraces;
2020
exports.moveTraces = Plotly.moveTraces;
21+
exports.setPlotConfig = require('./plot_api/set_plot_config');
2122

2223
// unofficial 'beta' plot methods, use at your own risk
2324
exports.Plots = Plotly.Plots;

src/plot_api/set_plot_config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
var Plotly = require('../plotly');
4+
5+
/**
6+
* Extends the plot config
7+
*
8+
* @param {object} configObj partial plot configuration object
9+
* to extend the current plot configuration.
10+
*
11+
*/
12+
module.exports = function setPlotConfig(configObj) {
13+
return Plotly.Lib.extendFlat(Plotly.defaultConfig, configObj);
14+
};

0 commit comments

Comments
 (0)