Skip to content
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

Fix grid lines being displayed on top of first traces when using zorder #7149

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions src/components/images/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var Drawing = require('../drawing');
var Axes = require('../../plots/cartesian/axes');
var axisIds = require('../../plots/cartesian/axis_ids');
var xmlnsNamespaces = require('../../constants/xmlns_namespaces');
var zindexSeparator = require('../../plots/cartesian/constants').zindexSeparator;

module.exports = function draw(gd) {
var fullLayout = gd._fullLayout;
Expand Down Expand Up @@ -226,6 +227,9 @@ module.exports = function draw(gd) {
var allSubplots = Object.keys(fullLayout._plots);
for(i = 0; i < allSubplots.length; i++) {
subplot = allSubplots[i];
if (subplot.indexOf(zindexSeparator) !== -1) {
continue;
}
var subplotObj = fullLayout._plots[subplot];

// filter out overlaid plots (which have their images on the main plot)
Expand Down
8 changes: 7 additions & 1 deletion src/plot_api/subroutines.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ function lsInner(gd) {
var yDomain = plotinfo.yaxis.domain;
var plotgroup = plotinfo.plotgroup;

if(overlappingDomain(xDomain, yDomain, lowerDomains) && subplot.indexOf(zindexSeparator) === -1) {
if(overlappingDomain(xDomain, yDomain, lowerDomains) &&
subplot.indexOf(zindexSeparator) === -1 &&
subplot !== xDomain + yDomain + zindexSeparator + 1
) {
var pgNode = plotgroup.node();
var plotgroupBg = plotinfo.bg = Lib.ensureSingle(plotgroup, 'rect', 'bg');
pgNode.insertBefore(plotgroupBg.node(), pgNode.childNodes[0]);
Expand Down Expand Up @@ -258,6 +261,9 @@ function lsInner(gd) {
}

for(subplot in fullLayout._plots) {
if (subplot.indexOf(zindexSeparator) !== -1) {
continue;
}
plotinfo = fullLayout._plots[subplot];
xa = plotinfo.xaxis;
ya = plotinfo.yaxis;
Expand Down
8 changes: 4 additions & 4 deletions src/plots/cartesian/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ exports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {
var subplot = subplots[i];
var subplotInfo = fullLayout._plots[subplot];

if(z > 0) {
if(zindices.length > 1) {
var idWithZ = subplotInfo.id;
if(idWithZ.indexOf(zindexSeparator) !== -1) continue;
idWithZ += zindexSeparator + (z + 1);
Expand Down Expand Up @@ -418,7 +418,7 @@ exports.drawFramework = function(gd) {
subplotData[i] = initialSubplotData[i].slice();
}

for(var z = 1; z < zindices.length; z++) {
for(var z = 0; z < zindices.length; z++) {
var newSubplotData = [];
for(i = 0; i < len; i++) {
newSubplotData[i] = initialSubplotData[i].slice();
Expand Down Expand Up @@ -532,9 +532,9 @@ function makeSubplotData(gd) {

var d = [];

for(var z = 1; z <= numZ; z++) {
for(var z = 0; z <= numZ; z++) {
var zStr = '';
if(z > 1) zStr += zindexSeparator + z;
if(z > 0) zStr += zindexSeparator + z;

// use info about axis layer and overlaying pattern
// to clean what need to be cleaned up in exit selection
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.