Skip to content

let drawTicks method empty ticks on exit #6165

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 1 commit into from
Apr 6, 2022
Merged
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
55 changes: 28 additions & 27 deletions src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2174,12 +2174,14 @@ axes.drawOne = function(gd, ax, opts) {
}

var tickSigns = axes.getTickSigns(ax);
var tickSubplots = [];

var tickPath;
if(ax.ticks) {
var mainTickPath = axes.makeTickPath(ax, mainLinePosition, tickSigns[2]);
var mainTickPath;
var mirrorTickPath;
var fullTickPath;

mainTickPath = axes.makeTickPath(ax, mainLinePosition, tickSigns[2]);
if(ax._anchorAxis && ax.mirror && ax.mirror !== true) {
mirrorTickPath = axes.makeTickPath(ax, mainMirrorPosition, tickSigns[3]);
fullTickPath = mainTickPath + mirrorTickPath;
Expand All @@ -2188,7 +2190,6 @@ axes.drawOne = function(gd, ax, opts) {
fullTickPath = mainTickPath;
}

var tickPath;
if(ax.showdividers && outsideTicks && ax.tickson === 'boundaries') {
var dividerLookup = {};
for(i = 0; i < dividerVals.length; i++) {
Expand All @@ -2200,33 +2201,33 @@ axes.drawOne = function(gd, ax, opts) {
} else {
tickPath = fullTickPath;
}

axes.drawTicks(gd, ax, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note this call should be outside if(ax.ticks) { ... } block

vals: tickVals,
layer: mainAxLayer,
path: tickPath,
transFn: transTickFn
});

if(ax.mirror === 'allticks') {
tickSubplots = Object.keys(ax._linepositions || {});
}
}

for(i = 0; i < tickSubplots.length; i++) {
sp = tickSubplots[i];
plotinfo = fullLayout._plots[sp];
// [bottom or left, top or right], free and main are handled above
var linepositions = ax._linepositions[sp] || [];
var spTickPath = axes.makeTickPath(ax, linepositions[0], tickSigns[0]) +
axes.makeTickPath(ax, linepositions[1], tickSigns[1]);
axes.drawTicks(gd, ax, {
vals: tickVals,
layer: mainAxLayer,
path: tickPath,
transFn: transTickFn
});

axes.drawTicks(gd, ax, {
vals: tickVals,
layer: plotinfo[axLetter + 'axislayer'],
path: spTickPath,
transFn: transTickFn
});
if(ax.mirror === 'allticks') {
var tickSubplots = Object.keys(ax._linepositions || {});

for(i = 0; i < tickSubplots.length; i++) {
sp = tickSubplots[i];
plotinfo = fullLayout._plots[sp];
// [bottom or left, top or right], free and main are handled above
var linepositions = ax._linepositions[sp] || [];
var spTickPath = axes.makeTickPath(ax, linepositions[0], tickSigns[0]) +
axes.makeTickPath(ax, linepositions[1], tickSigns[1]);

axes.drawTicks(gd, ax, {
vals: tickVals,
layer: plotinfo[axLetter + 'axislayer'],
path: spTickPath,
transFn: transTickFn
});
}
}

var seq = [];
Expand Down