Skip to content

Commit 7cefdcb

Browse files
committed
Update formatting, comment, small refactor
1 parent acad36d commit 7cefdcb

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎src/plots/cartesian/axes.js‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ function positionPeriodTicks(tickVals, ax, definedDelta) {
911911
a = i;
912912
b = i;
913913
}
914-
914+
915915
A = tickVals[a].value;
916916
B = tickVals[b].value;
917917
}
@@ -1208,11 +1208,10 @@ axes.calcTicks = function calcTicks(ax, opts) {
12081208
// For each major tick, find the minor tick `ticklabelIndex` steps away.
12091209
// This minor tick will be labeled instead of the major tick.
12101210

1211-
// if a minor tick coincides with a major tick, prefer it over the minor tick
1211+
// if a minor tick coincides with a major tick, drop the minor tick and keep the major one
12121212
// because overlapping minor ticks are stripped away if both minor and major ticks are drawn on the same side.
12131213
const filteredMinors = minorTickVals.filter((minor) => findOverlappingTick(minor, tickVals) == null);
12141214
const labelTickValsAscending = tickVals.concat(filteredMinors)
1215-
.slice()
12161215
.sort((a, b) => a.value - b.value);
12171216

12181217
if (isPeriod && tickVals.length) {
@@ -1236,15 +1235,15 @@ axes.calcTicks = function calcTicks(ax, opts) {
12361235
} else { // labelIndex >= 0
12371236
const largerTicks = labelTickValsAscending.filter((minorTick) => minorTick.value >= majorTick.value);
12381237
if (labelIndex < largerTicks.length) {
1239-
const tickToLabel = largerTicks[labelIndex]
1238+
const tickToLabel = largerTicks[labelIndex];
12401239
allTicklabelVals.push(tickToLabel);
12411240
if (isPeriod && largerTicks[labelIndex + 1]) {
12421241
tickToLabel.periodEndTick = largerTicks[labelIndex + 1];
12431242
}
12441243
}
12451244
}
12461245
});
1247-
// Skip the major tick label since the label moved to a minor tick
1246+
// Skip the major tick label since the label moved to a minor tick
12481247
majorTick.skipLabel = true;
12491248
}
12501249
});

0 commit comments

Comments
 (0)