Skip to content

Commit 856f1c1

Browse files
committed
hide Aa text unless mode is text
1 parent 58353f7 commit 856f1c1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/legend/style.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ module.exports = function style(s, gd, legend) {
145145

146146
// with fill and no markers or text, move the line and fill up a bit
147147
// so it's more centered
148-
var markersOrText = subTypes.hasMarkers(trace) || subTypes.hasText(trace);
148+
var markersOrText = subTypes.hasMarkers(trace) || subTypes.isText(trace);
149149
var anyFill = showFill || showGradientFill;
150150
var anyLine = showLine || showGradientLine;
151151
var pathStart = (markersOrText || !anyFill) ? 'M5,0' :
@@ -187,7 +187,7 @@ module.exports = function style(s, gd, legend) {
187187
var d0 = d[0];
188188
var trace = d0.trace;
189189
var showMarkers = subTypes.hasMarkers(trace);
190-
var showText = subTypes.hasText(trace);
190+
var showText = subTypes.isText(trace);
191191
var showLines = subTypes.hasLines(trace);
192192
var dMod, tMod;
193193

src/traces/scatter/subtypes.js

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ module.exports = {
2121
trace.mode.indexOf('text') !== -1;
2222
},
2323

24+
isText: function(trace) {
25+
return trace.visible && trace.mode === 'text';
26+
},
27+
2428
isBubble: function(trace) {
2529
return Lib.isPlainObject(trace.marker) &&
2630
Lib.isArrayOrTypedArray(trace.marker.size);

0 commit comments

Comments
 (0)