Skip to content

Commit dfd52ab

Browse files
committed
Replace some var with better scoped let and const in ticklabelindex code
1 parent 93baa6e commit dfd52ab

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/plots/cartesian/axes.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
11761176
}
11771177
// add 10e6 to eliminate problematic digits
11781178
const epsilon = 10e6;
1179-
for (var i = 0; i < majorTicks.length; i++) {
1179+
for (let i = 0; i < majorTicks.length; i++) {
11801180
if (epsilon + majorTicks[i].value === epsilon + minorTick.value) {
11811181
return majorTicks[i];
11821182
}
@@ -1190,7 +1190,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
11901190
if(!minorTickVals || minorTickVals.length < 3) {
11911191
ax._useTicklabelIndex = false;
11921192
} else {
1193-
var diff = (minorTickVals[2].value - minorTickVals[1].value) * (isReversed ? -1 : 1);
1193+
const diff = (minorTickVals[2].value - minorTickVals[1].value) * (isReversed ? -1 : 1);
11941194
if(!periodCompatibleWithTickformat(diff, ax.tickformat)) {
11951195
ax._useTicklabelIndex = false;
11961196
// remove previously added tick before tick0 for handling ticklabelindex positioning

0 commit comments

Comments
 (0)