8000 Expose trace modularity for users · plotly/plotly.js@1aaf5d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1aaf5d9

Browse files
committed
Expose trace modularity for users
1 parent 9cebd58 commit 1aaf5d9

18 files changed

+195
-33
lines changed

lib/bar.js

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
Ori EED3 ginal 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

Lines changed: 45 additions & 0 deletions
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

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,15 @@
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

20-
// export the version found in the package.json
21-
exports.version = require('../package.json').version;
17+
console.log(Object.keys(Core));
2218

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([
19+
// Load all trace modules
20+
Core.register([
5021
require('./traces/bar'),
5122
require('./traces/box'),
5223
require('./traces/heatmap'),
@@ -62,3 +33,5 @@ Plotly.register([
6233
require('./traces/choropleth'),
6334
require('./traces/scattergl')
6435
]);
36+
37+
module.exports = Core;

0 commit comments

Comments
 (0)
0