Skip to content

Commit 74abb7f

Browse files
committed
sort basePlotModules so that splom is always drawn below scattergl
1 parent da81a0e commit 74abb7f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/plots/plots.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@ var isNumeric = require('fast-isnumeric');
1414

1515
var Registry = require('../registry');
1616
var PlotSchema = require('../plot_api/plot_schema');
17-
var axisIDs = require('../plots/cartesian/axis_ids');
1817
var Lib = require('../lib');
19-
var _ = Lib._;
2018
var Color = require('../components/color');
2119
var BADNUM = require('../constants/numerical').BADNUM;
2220

23-
var plots = module.exports = {};
21+
var axisIDs = require('../plots/cartesian/axis_ids');
22+
var sortBasePlotModules = require('./sort_modules').sortBasePlotModules;
2423

2524
var animationAttrs = require('./animation_attributes');
2625
var frameAttrs = require('./frame_attributes');
2726

2827
var relinkPrivateKeys = Lib.relinkPrivateKeys;
28+
var _ = Lib._;
29+
30+
var plots = module.exports = {};
2931

3032
// Expose registry methods on Plots for backward-compatibility
3133
Lib.extendFlat(plots, Registry);
@@ -465,6 +467,9 @@ plots.supplyDefaults = function(gd) {
465467
}
466468
}
467469
}
470+
471+
// sort base plot modules for consistent ordering
472+
newFullLayout._basePlotModules.sort(sortBasePlotModules);
468473
};
469474

470475
/**
1.14 KB
Loading

test/image/mocks/splom_with-cartesian.json

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"data": [{
3+
}, {
4+
"type": "scattergl",
5+
"name": "scattergl",
6+
"mode": "markers",
7+
"text": "should be above splom",
8+
"x": [2],
9+
"y": [2]
10+
}, {
311
"type": "splom",
412
"name": "splom",
513
"dimensions": [{

0 commit comments

Comments
 (0)