Skip to content

Commit

Permalink
persistent tick labels
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Jan 24, 2022
1 parent 29ab444 commit 3b259ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
var minRange = Math.min(rng[0], rng[1]);
var maxRange = Math.max(rng[0], rng[1]);

var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');
var numDtick = isNumeric(ax.dtick);
var isDLog = (ax.type === 'log') && !(numDtick || ax.dtick.charAt(0) === 'L');
var isPeriod = ax.ticklabelmode === 'period';

// find the first tick
Expand All @@ -829,19 +830,24 @@ axes.calcTicks = function calcTicks(ax, opts) {
}
}

var id = -1;

if(isPeriod) {
// add one item to label period before tick0
x = axes.tickIncrement(x, ax.dtick, !axrev, ax.calendar);
id--;
}

var ticklabeljump = ax.ticklabeljump;

var maxTicks = Math.max(1000, ax._length || 0);
var tickVals = [];
var xPrevious = null;

var dTick = numDtick ? ax.dtick : ax._roughDTick;

var id = Math.round((
ax.r2l(x) -
ax.r2l(ax.tick0)
) / dTick) - 1;

for(;
(axrev) ? (x >= endTick) : (x <= endTick);
x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)
Expand Down
Binary file modified test/image/baselines/h-colorbar05.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3b259ed

Please sign in to comment.