Skip to content

Commit 874ac4c

Browse files
authored
Merge pull request #3360 from plotly/dont-call-autotype-for-3d
Regression bug fix to draw 3d traces after heatmap
2 parents 0078626 + 3eb9a9b commit 874ac4c

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

src/plots/gl3d/layout/defaults.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ var Registry = require('../../../registry');
1616
var handleSubplotDefaults = require('../../subplot_defaults');
1717
var supplyGl3dAxisLayoutDefaults = require('./axis_defaults');
1818
var layoutAttributes = require('./layout_attributes');
19+
var getSubplotData = require('../../get_data').getSubplotData;
1920

21+
var GL3D = 'gl3d';
2022

2123
module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
2224
var hasNon3D = layoutOut._basePlotModules.length > 1;
@@ -31,7 +33,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
3133
}
3234

3335
handleSubplotDefaults(layoutIn, layoutOut, fullData, {
34-
type: 'gl3d',
36+
type: GL3D,
3537
attributes: layoutAttributes,
3638
handleDefaults: handleGl3dDefaults,
3739
fullLayout: layoutOut,
@@ -97,10 +99,12 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) {
9799
sceneLayoutIn.aspectmode = sceneLayoutOut.aspectmode;
98100
}
99101

102+
var fullGl3dData = getSubplotData(opts.fullData, GL3D, opts.id);
103+
100104
supplyGl3dAxisLayoutDefaults(sceneLayoutIn, sceneLayoutOut, {
101105
font: opts.font,
102106
scene: opts.id,
103-
data: opts.fullData,
107+
data: fullGl3dData,
104108
bgColor: bgColorCombined,
105109
calendar: opts.calendar,
106110
fullLayout: opts.fullLayout
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"data": [
3+
{
4+
"type": "heatmap",
5+
"x": [0, 1, 2],
6+
"y": [0, 1, 2],
7+
"z": [
8+
[0, 1, 0],
9+
[1, 0, 1],
10+
[0, 1, 0]
11+
]
12+
},
13+
{
14+
"type": "surface",
15+
"x": [0, 1, 2],
16+
"y": [0, 1, 2],
17+
"z": [
18+
[0, 1, 0],
19+
[1, 0, 1],
20+
[0, 1, 0]
21+
]
22+
}
23+
],
24+
"layout": {
25+
"title": "Surface 3d plot on top of 2d heatmap!",
26+
"width": 600,
27+
"height": 400
28+
}
29+
}

0 commit comments

Comments
 (0)