Skip to content

Commit 8c88f24

Browse files
committed
use visibility instead of opacity to hide elements
1 parent 23a035f commit 8c88f24

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/plots/cartesian/axes.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2865,7 +2865,7 @@ axes.drawGrid = function(gd, ax, opts) {
28652865
.attr('d', opts.path)
28662866
.call(Color.stroke, ax.gridcolor || '#ddd')
28672867
.style('stroke-width', ax._gw + 'px')
2868-
.style({ opacity: 1 }); // ensure visible
2868+
.style({ visibility: 'visible' });
28692869

28702870
if(((ax._anchorAxis || {}).ticklabelposition || '').indexOf('inside') !== -1) {
28712871
if(ax._hideCounterAxisInsideTickLabels) {
@@ -3035,7 +3035,7 @@ axes.drawLabels = function(gd, ax, opts) {
30353035
});
30363036

30373037
if(isInside) {
3038-
thisText.style({ opacity: 1 }); // ensure visible
3038+
thisText.style({ visibility: 'visible' });
30393039

30403040
if(ax._hideOutOfRangeInsideTickLabels) {
30413041
ax._hideOutOfRangeInsideTickLabels();
@@ -3080,7 +3080,7 @@ axes.drawLabels = function(gd, ax, opts) {
30803080
else if(bb.top + (ax.tickangle ? 0 : d.fontSize / 4) < min) hide = true;
30813081
}
30823082
if(hide) {
3083-
thisLabel.select('text').style({ opacity: 0 });
3083+
thisLabel.select('text').style({ visibility: 'hidden' });
30843084
} else {
30853085
visibleLabelMin = Math.min(visibleLabelMin, isX ? bb.top : bb.left);
30863086
visibleLabelMax = Math.max(visibleLabelMax, isX ? bb.bottom : bb.right);
@@ -3103,7 +3103,7 @@ axes.drawLabels = function(gd, ax, opts) {
31033103
var q = ax.l2p(d.x) + ax._offset;
31043104

31053105
if(q < ax._visibleLabelMax && q > ax._visibleLabelMin) {
3106-
d3.select(this).style({ opacity: 0 });
3106+
d3.select(this).style({ visibility: 'hidden' });
31073107
}
31083108
});
31093109
});

0 commit comments

Comments
 (0)