Skip to content

Regression bug fix to draw 3d traces after heatmap #3360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/plots/cartesian/type_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function setAutoType(ax, data) {
}
}
else {
if(axLetter === 'z') opts.noMultiCategory = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works. But opts.noMultiCategory should already be true from

var opts = {noMultiCategory: !traceIs(d0, 'cartesian') || traceIs(d0, 'noMultiCategory')};

I suspect d0 in this scope is fullData[0] when it should be the first trace on the gl3d subplot.

I hope that makes sense 😄

Copy link
Contributor Author

@archmoj archmoj Dec 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. It seems to be the first trace on fullData which is not invisible.
The issue is not only affected 3d traces. The example below also fails on 'latest':

Plotly.newPlot(gd, {
    "data": [
      {
        "type": "heatmap",
        "x": [0, 1, 2],
        "y": [0, 1, 2],
        "z": [
          [0, 1, 0],
          [1, 0, 1],
          [0, 1, 0]
        ]
      },
      {
        "type": "scattergl",
        "x": [0, 1, 2],
        "y": [0, 1, 2]
      }
    ],
    "layout": {
        "title": "scattergl plot on top of 2d heatmap",
        "width": 600,
        "height": 400
    }
});

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etpinard The 2d case was mentioned above failed on v.1.43.0; but works on master. So I would fetch master changes and fix this for the 3D case as you mentioned.

ax.type = autoType(d0[axLetter] || [d0[axLetter + '0']], calendar, opts);
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions test/image/mocks/gl3d_surface_after_heatmap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"data": [
{
"type": "heatmap",
"x": [0, 1, 2],
"y": [0, 1, 2],
"z": [
[0, 1, 0],
[1, 0, 1],
[0, 1, 0]
]
},
{
"type": "surface",
"x": [0, 1, 2],
"y": [0, 1, 2],
"z": [
[0, 1, 0],
[1, 0, 1],
[0, 1, 0]
]
}
],
"layout": {
"title": "Surface 3d plot on top of 2d heatmap!",
"width": 600,
"height": 400
}
}