Skip to content

Commit 2382c04

Browse files
committed
rm a few exported objects in src/plotly.js:
by: - requiring svgTextUtils in plot_api.js - moving a injected modules in to src/core.js - requiring some module directly in src/core.js instead of through src/plotly.js
1 parent 161af7e commit 2382c04

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

src/core.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ var Plotly = require('./plotly');
1717
// package version injected by `npm run preprocess`
1818
exports.version = '1.16.2';
1919

20+
// inject promise polyfill
21+
require('es6-promise').polyfill();
22+
23+
// inject plot css
24+
require('../build/plotcss');
25+
26+
// inject default MathJax config
27+
require('./fonts/mathjax_config');
28+
2029
// plot api
2130
exports.plot = Plotly.plot;
2231
exports.newPlot = Plotly.newPlot;
@@ -44,9 +53,9 @@ exports.Icons = require('../build/ploticon');
4453
// unofficial 'beta' plot methods, use at your own risk
4554
exports.Plots = Plotly.Plots;
4655
exports.Fx = Plotly.Fx;
47-
exports.Snapshot = Plotly.Snapshot;
48-
exports.PlotSchema = Plotly.PlotSchema;
49-
exports.Queue = Plotly.Queue;
56+
exports.Snapshot = require('./snapshot');
57+
exports.PlotSchema = require('./plot_api/plot_schema');
58+
exports.Queue = require('./lib/queue');
5059

5160
// export d3 used in the bundle
5261
exports.d3 = require('d3');

src/plot_api/plot_api.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var Shapes = require('../components/shapes');
3636
var Titles = require('../components/titles');
3737
var ModeBar = require('../components/modebar');
3838
var xmlnsNamespaces = require('../constants/xmlns_namespaces');
39+
var svgTextUtils = require('../lib/svg_text_utils');
3940

4041

4142
/**
@@ -453,7 +454,7 @@ function plotPolar(gd, data, layout) {
453454
var placeholderText = 'Click to enter title';
454455

455456
var titleLayout = function() {
456-
this.call(Plotly.util.convertToTspans);
457+
this.call(svgTextUtils.convertToTspans);
457458
//TODO: html/mathjax
458459
//TODO: center title
459460
};
@@ -479,7 +480,7 @@ function plotPolar(gd, data, layout) {
479480
}
480481

481482
var setContenteditable = function() {
482-
this.call(Plotly.util.makeEditable)
483+
this.call(svgTextUtils.makeEditable)
483484
.on('edit', function(text) {
484485
gd.framework({layout: {title: text}});
485486
this.attr({'data-unformatted': text})

src/plotly.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,7 @@
1818
*
1919
*/
2020

21-
// promise polyfill
22-
require('es6-promise').polyfill();
23-
24-
// lib functions
25-
exports.Lib = require('./lib');
26-
exports.util = require('./lib/svg_text_utils');
27-
exports.Queue = require('./lib/queue');
28-
29-
// plot css
30-
require('../build/plotcss');
31-
3221
// configuration
33-
exports.MathJaxConfig = require('./fonts/mathjax_config');
3422
exports.defaultConfig = require('./plot_api/plot_config');
3523

3624
// plots
@@ -53,7 +41,3 @@ exports.ModeBar = require('./components/modebar');
5341

5442
// plot api
5543
require('./plot_api/plot_api');
56-
exports.PlotSchema = require('./plot_api/plot_schema');
57-
58-
// imaging routines
59-
exports.Snapshot = require('./snapshot');

0 commit comments

Comments
 (0)