Skip to content

Commit 45d6ce1

Browse files
committed
Fix recursive ax.minor structure
Also reduce impact on charts that don't use ticklabelindex. This is not really necessary, but a precaution.
1 parent 680dded commit 45d6ce1

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/plots/cartesian/axes.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,15 +690,21 @@ axes.prepMinorTicks = function(mockAx, ax, opts) {
690690
// put back the original range, to use to find the full set of minor ticks
691691
mockAx.range = ax.range;
692692
}
693+
693694
if(ax.minor?._tick0Init === undefined) {
694695
// ensure identical tick0
695696
mockAx.tick0 = ax.tick0;
696697
}
697-
autoTickRound(mockAx);
698-
if(ax.ticklabelmode === 'period') {
699-
mockAx._definedDelta = definedDeltaForTickformat(axes.getTickFormat(mockAx));
698+
if (ax._useTicklabelIndex) {
699+
// these could also always be done but the additional information on the minor
700+
// axis is just necessary for ticklabelindex.
701+
autoTickRound(mockAx);
702+
if(ax.ticklabelmode === 'period') {
703+
mockAx._definedDelta = definedDeltaForTickformat(axes.getTickFormat(mockAx));
704+
}
705+
delete mockAx.minor; // prevent self-reference
706+
Lib.extendFlat(ax.minor, mockAx);
700707
}
701-
Lib.extendFlat(ax.minor, mockAx);
702708
};
703709

704710
function isMultiple(bigger, smaller) {

0 commit comments

Comments
 (0)