Skip to content

Commit 8126914

Browse files
committed
add cartesian plot index + register it in plotly.js
1 parent c8bc6e4 commit 8126914

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

src/plotly.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ exports.MathJaxConfig = require('./fonts/mathjax_config');
3333
exports.defaultConfig = require('./plot_api/plot_config');
3434

3535
// plots
36-
exports.Plots = require('./plots/plots');
36+
var Plots = exports.Plots = require('./plots/plots');
37+
38+
var Cartesian = require('./plots/cartesian');
39+
Plots.registerSubplot(Cartesian);
3740
exports.Axes = require('./plots/cartesian/axes');
3841
exports.Fx = require('./plots/cartesian/graph_interact');
3942
exports.Scene = require('./plots/gl3d/scene');

src/plots/cartesian/axes.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ var isNumeric = require('fast-isnumeric');
1515

1616
var axes = module.exports = {};
1717

18-
axes.attributes = require('./attributes');
19-
20-
Plotly.Plots.registerSubplot('cartesian', ['xaxis', 'yaxis'], ['x', 'y'], axes.attributes);
21-
2218
axes.layoutAttributes = require('./layout_attributes');
2319

2420
var xAxisMatch = /^xaxis[0-9]*$/,

src/plots/cartesian/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
10+
'use strict';
11+
12+
var Plotly = require('../../plotly');
13+
14+
15+
exports.type = 'cartesian';
16+
17+
exports.attr = ['xaxis', 'yaxis'];
18+
19+
exports.idRoot = ['x', 'y'];
20+
21+
exports.attributes = require('./attributes');

0 commit comments

Comments
 (0)