Skip to content

Commit 49c978f

Browse files
committed
pass in plotinfo instead of grid in opts
1 parent e63e65a commit 49c978f

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

src/plots/cartesian/axes.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,12 +2180,11 @@ axes.drawOne = function(gd, ax, opts) {
21802180
var opts = {
21812181
vals: vals,
21822182
layer: mainAxLayer,
2183+
plotinfo: plotinfo,
21832184
transFn: transTickLabelFn,
21842185
labelFns: axes.makeLabelFns(ax, mainLinePosition)
21852186
};
21862187

2187-
opts.grid = plotinfo.gridlayer.select('.' + ax._id);
2188-
21892188
return axes.drawLabels(gd, ax, opts);
21902189
});
21912190

@@ -3092,20 +3091,17 @@ axes.drawLabels = function(gd, ax, opts) {
30923091
};
30933092

30943093
ax._hideCounterAxisInsideTickLabels = function() {
3095-
var anchorAx = ax._anchorAxis || {};
3096-
if((anchorAx.ticklabelposition || '').indexOf('inside') !== -1) {
3097-
var grid = opts.grid;
3098-
if(grid) {
3099-
grid.each(function() {
3100-
d3.select(this).selectAll('path').each(function(d) {
3101-
var q = ax.l2p(d.x) + ax._offset;
3102-
3103-
if(q < ax._visibleLabelMax && q > ax._visibleLabelMin) {
3104-
d3.select(this).style({ opacity: 0 });
3105-
}
3106-
});
3094+
if(((ax._anchorAxis || {}).ticklabelposition || '').indexOf('inside') !== -1) {
3095+
var grid = opts.plotinfo.gridlayer.select('.' + ax._id);
3096+
grid.each(function() {
3097+
d3.select(this).selectAll('path').each(function(d) {
3098+
var q = ax.l2p(d.x) + ax._offset;
3099+
3100+
if(q < ax._visibleLabelMax && q > ax._visibleLabelMin) {
3101+
d3.select(this).style({ opacity: 0 });
3102+
}
31073103
});
3108-
}
3104+
});
31093105
}
31103106
};
31113107

0 commit comments

Comments
 (0)