Skip to content

Commit

Permalink
fix overlaying axis layers
Browse files Browse the repository at this point in the history
- bug noticed when both overlaying x and y axes have
  `showline: true`.
- ... but `Plotly.restyle(gd, 'visible', true, [1])` does
      not work for the added mock
- both bugs have been broken since PR
    #946
  released in 1.18.0
  • Loading branch information
etpinard committed Jul 5, 2017
1 parent fbc0296 commit 3bf58db
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plots/cartesian/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ function makeSubplotLayer(plotinfo) {
plotinfo.zerolinelayer = joinLayer(mainplotinfo.overzero, 'g', id);

plotinfo.plot = joinLayer(mainplotinfo.overplot, 'g', id);
plotinfo.xlines = joinLayer(mainplotinfo.overlines, 'path', id);
plotinfo.ylines = joinLayer(mainplotinfo.overlines, 'path', id);
plotinfo.xaxislayer = joinLayer(mainplotinfo.overaxes, 'g', id);
plotinfo.yaxislayer = joinLayer(mainplotinfo.overaxes, 'g', id);
plotinfo.xlines = joinLayer(mainplotinfo.overlines, 'path', id + '-x');
plotinfo.ylines = joinLayer(mainplotinfo.overlines, 'path', id + '-y');
plotinfo.xaxislayer = joinLayer(mainplotinfo.overaxes, 'g', id + '-x');
plotinfo.yaxislayer = joinLayer(mainplotinfo.overaxes, 'g', id + '-y');
}

// common attributes for all subplots, overlays or not
Expand Down
Binary file added test/image/baselines/overlaying-axis-lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions test/image/mocks/overlaying-axis-lines.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"data": [{
"y": [1, 2, 3]
}, {
"x": [4, 5, 6],
"y": [3, 1, 2],
"xaxis": "x2",
"yaxis": "y2"
}],
"layout": {
"xaxis": {"showline": true},
"yaxis": {"showline": true},
"xaxis2": {"showline": true, "overlaying": "x", "side": "top"},
"yaxis2": {"showline": true, "overlaying": "y", "side": "right"}
}
}

0 comments on commit 3bf58db

Please sign in to comment.