Skip to content

Commit a1ea365

Browse files
committed
use componentsRegistry in plot schema
1 parent d11c8f9 commit a1ea365

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

src/plot_api/plot_schema.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,10 @@ function getModule(arg) {
258258
_module = arg._module;
259259

260260
if(subplotsRegistry[_module]) return subplotsRegistry[_module];
261-
else if('module' in arg) return Plotly[_module];
261+
else if(componentsRegistry[_module]) return componentsRegistry[_module];
262+
263+
// look it internal Plotly if all previous attempts fail
264+
return Plotly[_module];
262265
}
263266

264267
function removeUnderscoreAttrs(attributes) {

src/plots/cartesian/layout_attributes.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
var fontAttrs = require('../font_attributes');
1212
var colorAttrs = require('../../components/color/attributes');
1313
var extendFlat = require('../../lib/extend').extendFlat;
14-
var rangeSliderAttrs = require('../../components/rangeslider/attributes');
15-
var rangeSelectorAttrs = require('../../components/rangeselector/attributes');
1614

1715
var constants = require('./constants');
1816

@@ -97,9 +95,6 @@ module.exports = {
9795
].join(' ')
9896
},
9997

100-
rangeslider: rangeSliderAttrs,
101-
rangeselector: rangeSelectorAttrs,
102-
10398
fixedrange: {
10499
valType: 'boolean',
105100
dflt: false,
@@ -498,6 +493,10 @@ module.exports = {
498493
].join(' ')
499494
},
500495

496+
_nestedModules: {
497+
'rangeslider': 'rangeslider',
498+
'rangeselector': 'rangeselector',
499+
},
501500

502501
_deprecated: {
503502
autotick: {

src/plots/layout_attributes.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,18 @@ module.exports = {
171171
'*': 'Fx'
172172
},
173173

174-
// TODO merge with moduleLayoutDefaults in plots.js
175174
_nestedModules: {
176175
'xaxis': 'Axes',
177176
'yaxis': 'Axes',
178177
'scene': 'gl3d',
179178
'geo': 'geo',
180-
'legend': 'Legend',
181-
'annotations': 'Annotations',
182-
'shapes': 'Shapes',
183-
'images': 'Images',
184-
'updatemenus': 'UpdateMenus',
185179
'ternary': 'ternary',
186-
'mapbox': 'mapbox'
180+
'mapbox': 'mapbox',
181+
182+
'legend': 'legend',
183+
'annotations': 'annotations',
184+
'shapes': 'shapes',
185+
'images': 'images',
186+
'updatemenus': 'updatemenus'
187187
}
188188
};

0 commit comments

Comments
 (0)