Skip to content

Commit 2d1c317

Browse files
committed
destructure style
1 parent b6e4c64 commit 2d1c317

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/marks/tick.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ export class TickX extends AbstractTick {
6161
return i => X[i];
6262
}
6363
_y1(scales, {y: Y}, {marginTop}) {
64-
return Y ? i => Y[i] + this.insetTop : marginTop + this.insetTop;
64+
const {insetTop} = this;
65+
return Y ? i => Y[i] + insetTop : marginTop + insetTop;
6566
}
6667
_y2({y}, {y: Y}, {height, marginBottom}) {
67-
return Y ? i => Y[i] + y.bandwidth() - this.insetBottom : height - marginBottom - this.insetBottom;
68+
const {insetBottom} = this;
69+
return Y ? i => Y[i] + y.bandwidth() - insetBottom : height - marginBottom - insetBottom;
6870
}
6971
}
7072

@@ -92,10 +94,12 @@ export class TickY extends AbstractTick {
9294
selection.call(applyTransform, null, y, 0, 0.5);
9395
}
9496
_x1(scales, {x: X}, {marginLeft}) {
95-
return X ? i => X[i] + this.insetLeft : marginLeft + this.insetLeft;
97+
const {insetLeft} = this;
98+
return X ? i => X[i] + insetLeft : marginLeft + insetLeft;
9699
}
97100
_x2({x}, {x: X}, {width, marginRight}) {
98-
return X ? i => X[i] + x.bandwidth() - this.insetRight : width - marginRight - this.insetRight;
101+
const {insetRight} = this;
102+
return X ? i => X[i] + x.bandwidth() - insetRight : width - marginRight - insetRight;
99103
}
100104
_y1(scales, {y: Y}) {
101105
return i => Y[i];

0 commit comments

Comments
 (0)