Skip to content

Commit 60793e7

Browse files
committed
Expose trace modularity for users
1 parent 0a78842 commit 60793e7

18 files changed

+194
-31
lines changed

lib/bar.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/bar');

lib/box.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/box');

lib/choropleth.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/choropleth');

lib/contour.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/contour');

lib/core.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/core');

lib/heatmap.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/heatmap');

lib/histogram.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/histogram');

lib/histogram2d.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/histogram2d');

lib/histogram2dcontour.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/histogram2dcontour');

lib/mesh3d.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/mesh3d');

lib/pie.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/pie');

lib/scatter.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/scatter');

lib/scatter3d.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/scatter3d');

lib/scattergeo.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/scattergeo');

lib/scattergl.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/scattergl');

lib/surface.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
module.exports = require('../src/traces/surface');

src/core.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
/*
12+
* Export the plotly.js API methods.
13+
*/
14+
15+
var Plotly = require('./plotly');
16+
17+
// export the version found in the package.json
18+
exports.version = require('../package.json').version;
19+
20+
// plot api
21+
exports.plot = Plotly.plot;
22+
exports.newPlot = Plotly.newPlot;
23+
exports.restyle = Plotly.restyle;
24+
exports.relayout = Plotly.relayout;
25+
exports.redraw = Plotly.redraw;
26+
exports.extendTraces = Plotly.extendTraces;
27+
exports.prependTraces = Plotly.prependTraces;
28+
exports.addTraces = Plotly.addTraces;
29+
exports.deleteTraces = Plotly.deleteTraces;
30+
exports.moveTraces = Plotly.moveTraces;
31+
exports.setPlotConfig = require('./plot_api/set_plot_config');
32+
exports.register = Plotly.register;
33+
34+
// plot icons
35+
exports.Icons = require('../build/ploticon');
36+
37+
// unofficial 'beta' plot methods, use at your own risk
38+
exports.Plots = Plotly.Plots;
39+
exports.Fx = Plotly.Fx;
40+
exports.Snapshot = Plotly.Snapshot;
41+
exports.PlotSchema = Plotly.PlotSchema;
42+
exports.Queue = Plotly.Queue;
43+
44+
// export d3 used in the bundle
45+
exports.d3 = require('d3');

src/index.js

+5-31
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,16 @@
99
'use strict';
1010

1111
/*
12-
* Export the plotly.js API methods.
13-
*
1412
* This file is browserify'ed into a standalone 'Plotly' object.
15-
*
1613
*/
1714

18-
var Plotly = require('./plotly');
15+
var Core = require('./core');
1916

2017
// package version injected by `npm run preprocess`
2118
exports.version = '1.4.1';
2219

23-
// plot api
24-
exports.plot = Plotly.plot;
25-
exports.newPlot = Plotly.newPlot;
26-
exports.restyle = Plotly.restyle;
27-
exports.relayout = Plotly.relayout;
28-
exports.redraw = Plotly.redraw;
29-
exports.extendTraces = Plotly.extendTraces;
30-
exports.prependTraces = Plotly.prependTraces;
31-
exports.addTraces = Plotly.addTraces;
32-
exports.deleteTraces = Plotly.deleteTraces;
33-
exports.moveTraces = Plotly.moveTraces;
34-
exports.setPlotConfig = require('./plot_api/set_plot_config');
35-
36-
// plot icons
37-
exports.Icons = require('../build/ploticon');
38-
39-
// unofficial 'beta' plot methods, use at your own risk
40-
exports.Plots = Plotly.Plots;
41-
exports.Fx = Plotly.Fx;
42-
exports.Snapshot = Plotly.Snapshot;
43-
exports.PlotSchema = Plotly.PlotSchema;
44-
exports.Queue = Plotly.Queue;
45-
46-
// export d3 used in the bundle
47-
exports.d3 = require('d3');
48-
49-
Plotly.register([
20+
// Load all trace modules
21+
Core.register([
5022
require('./traces/bar'),
5123
require('./traces/box'),
5224
require('./traces/heatmap'),
@@ -62,3 +34,5 @@ Plotly.register([
6234
require('./traces/choropleth'),
6335
require('./traces/scattergl')
6436
]);
37+
38+
module.exports = Core;

0 commit comments

Comments
 (0)