Skip to content

Commit 5da3851

Browse files
committed
do not draw ticks above dividers
1 parent 939df6e commit 5da3851

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

src/plots/cartesian/axes.js

+23-3
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,7 @@ axes.drawOne = function(gd, ax, opts) {
16711671
}
16721672

16731673
var gridVals = ax._gridVals = valsClipped;
1674+
var dividerVals = getDividerVals(ax, vals);
16741675

16751676
if(!fullLayout._hasOnlyLargeSploms) {
16761677
// keep track of which subplots (by main conteraxis) we've already
@@ -1711,14 +1712,33 @@ axes.drawOne = function(gd, ax, opts) {
17111712

17121713
if(ax.ticks) {
17131714
var mainTickPath = axes.makeTickPath(ax, mainLinePosition, tickSigns[2]);
1715+
var mirrorTickPath;
1716+
var fullTickPath;
17141717
if(ax._anchorAxis && ax.mirror && ax.mirror !== true) {
1715-
mainTickPath += axes.makeTickPath(ax, mainMirrorPosition, tickSigns[3]);
1718+
mirrorTickPath = axes.makeTickPath(ax, mainMirrorPosition, tickSigns[3]);
1719+
fullTickPath = mainTickPath + mirrorTickPath;
1720+
} else {
1721+
mirrorTickPath = '';
1722+
fullTickPath = mainTickPath;
1723+
}
1724+
1725+
var tickPath;
1726+
if(ax.showdividers && ax.ticks === 'outside' && ax.tickson === 'boundaries') {
1727+
var dividerLookup = {};
1728+
for(i = 0; i < dividerVals.length; i++) {
1729+
dividerLookup[dividerVals[i].x] = 1;
1730+
}
1731+
tickPath = function(d) {
1732+
return dividerLookup[d.x] ? mirrorTickPath : fullTickPath;
1733+
};
1734+
} else {
1735+
tickPath = fullTickPath;
17161736
}
17171737

17181738
axes.drawTicks(gd, ax, {
17191739
vals: tickVals,
17201740
layer: mainAxLayer,
1721-
path: mainTickPath,
1741+
path: tickPath,
17221742
transFn: transFn
17231743
});
17241744

@@ -1785,7 +1805,7 @@ axes.drawOne = function(gd, ax, opts) {
17851805
labelLength += getLabelLevelSpan(ax, axId + 'tick2');
17861806

17871807
return drawDividers(gd, ax, {
1788-
vals: getDividerVals(ax, vals),
1808+
vals: dividerVals,
17891809
layer: mainAxLayer,
17901810
path: axes.makeTickPath(ax, mainLinePosition, tickSigns[2], labelLength),
17911811
transFn: transFn
-48 Bytes
Loading
-28 Bytes
Loading
-23 Bytes
Loading
-50 Bytes
Loading

0 commit comments

Comments
 (0)