Skip to content

Commit 12a49c0

Browse files
authored
Merge pull request #6165 from plotly/fix-ticks-display
let `drawTicks` method empty ticks on exit
2 parents 646dfd6 + 3e6035c commit 12a49c0

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

src/plots/cartesian/axes.js

+28-27
Original file line numberDiff line numberDiff line change
@@ -2174,12 +2174,14 @@ axes.drawOne = function(gd, ax, opts) {
21742174
}
21752175

21762176
var tickSigns = axes.getTickSigns(ax);
2177-
var tickSubplots = [];
21782177

2178+
var tickPath;
21792179
if(ax.ticks) {
2180-
var mainTickPath = axes.makeTickPath(ax, mainLinePosition, tickSigns[2]);
2180+
var mainTickPath;
21812181
var mirrorTickPath;
21822182
var fullTickPath;
2183+
2184+
mainTickPath = axes.makeTickPath(ax, mainLinePosition, tickSigns[2]);
21832185
if(ax._anchorAxis && ax.mirror && ax.mirror !== true) {
21842186
mirrorTickPath = axes.makeTickPath(ax, mainMirrorPosition, tickSigns[3]);
21852187
fullTickPath = mainTickPath + mirrorTickPath;
@@ -2188,7 +2190,6 @@ axes.drawOne = function(gd, ax, opts) {
21882190
fullTickPath = mainTickPath;
21892191
}
21902192

2191-
var tickPath;
21922193
if(ax.showdividers && outsideTicks && ax.tickson === 'boundaries') {
21932194
var dividerLookup = {};
21942195
for(i = 0; i < dividerVals.length; i++) {
@@ -2200,33 +2201,33 @@ axes.drawOne = function(gd, ax, opts) {
22002201
} else {
22012202
tickPath = fullTickPath;
22022203
}
2203-
2204-
axes.drawTicks(gd, ax, {
2205-
vals: tickVals,
2206-
layer: mainAxLayer,
2207-
path: tickPath,
2208-
transFn: transTickFn
2209-
});
2210-
2211-
if(ax.mirror === 'allticks') {
2212-
tickSubplots = Object.keys(ax._linepositions || {});
2213-
}
22142204
}
22152205

2216-
for(i = 0; i < tickSubplots.length; i++) {
2217-
sp = tickSubplots[i];
2218-
plotinfo = fullLayout._plots[sp];
2219-
// [bottom or left, top or right], free and main are handled above
2220-
var linepositions = ax._linepositions[sp] || [];
2221-
var spTickPath = axes.makeTickPath(ax, linepositions[0], tickSigns[0]) +
2222-
axes.makeTickPath(ax, linepositions[1], tickSigns[1]);
2206+
axes.drawTicks(gd, ax, {
2207+
vals: tickVals,
2208+
layer: mainAxLayer,
2209+
path: tickPath,
2210+
transFn: transTickFn
2211+
});
22232212

2224-
axes.drawTicks(gd, ax, {
2225-
vals: tickVals,
2226-
layer: plotinfo[axLetter + 'axislayer'],
2227-
path: spTickPath,
2228-
transFn: transTickFn
2229-
});
2213+
if(ax.mirror === 'allticks') {
2214+
var tickSubplots = Object.keys(ax._linepositions || {});
2215+
2216+
for(i = 0; i < tickSubplots.length; i++) {
2217+
sp = tickSubplots[i];
2218+
plotinfo = fullLayout._plots[sp];
2219+
// [bottom or left, top or right], free and main are handled above
2220+
var linepositions = ax._linepositions[sp] || [];
2221+
var spTickPath = axes.makeTickPath(ax, linepositions[0], tickSigns[0]) +
2222+
axes.makeTickPath(ax, linepositions[1], tickSigns[1]);
2223+
2224+
axes.drawTicks(gd, ax, {
2225+
vals: tickVals,
2226+
layer: plotinfo[axLetter + 'axislayer'],
2227+
path: spTickPath,
2228+
transFn: transTickFn
2229+
});
2230+
}
22302231
}
22312232

22322233
var seq = [];

0 commit comments

Comments
 (0)