Skip to content

Commit 2f198eb

Browse files
committed
Fix lint errors
1 parent 360d895 commit 2f198eb

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/plots/cartesian/axes.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,10 @@ axes.tickText = function(ax, x, hover, noSuffixPrefix) {
16211621
var tickVal2l = axType === 'category' ? ax.d2l_noadd : ax.d2l;
16221622
var i;
16231623

1624+
var inbounds = function(v) {
1625+
var p = ax.l2p(v);
1626+
return p >= 0 && p <= ax._length ? v : null;
1627+
};
16241628
if(arrayMode && Lib.isArrayOrTypedArray(ax.ticktext)) {
16251629
var rng = Lib.simpleMap(ax.range, ax.r2l);
16261630
var minDiff = (Math.abs(rng[1] - rng[0]) - (ax._lBreaks || 0)) / 10000;
@@ -1630,10 +1634,7 @@ axes.tickText = function(ax, x, hover, noSuffixPrefix) {
16301634
}
16311635
if(i < ax.ticktext.length) {
16321636
out.text = String(ax.ticktext[i]);
1633-
var inbounds = function(v) {
1634-
var p = ax.l2p(v);
1635-
return p >= 0 && p <= ax._length ? v : null;
1636-
};
1637+
16371638
out.xbnd = [
16381639
inbounds(out.x - 0.5),
16391640
inbounds(out.x + ax.dtick - 0.5)
@@ -1679,11 +1680,6 @@ axes.tickText = function(ax, x, hover, noSuffixPrefix) {
16791680
// Setup ticks and grid lines boundaries
16801681
// at 1/2 a 'category' to the left/bottom
16811682
if(ax.tickson === 'boundaries' || ax.showdividers) {
1682-
var inbounds = function(v) {
1683-
var p = ax.l2p(v);
1684-
return p >= 0 && p <= ax._length ? v : null;
1685-
};
1686-
16871683
out.xbnd = [
16881684
inbounds(out.x - 0.5),
16891685
inbounds(out.x + ax.dtick - 0.5)

0 commit comments

Comments
 (0)