Skip to content

Commit 0f35746

Browse files
committed
fix is-fancy logic:
- if trace has markers and any array style attr -> fancy - if trace has markers and a non-circle symbol -> fancy - if trace has lines and connecgaps false -> fancy
1 parent 83578c8 commit 0f35746

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/traces/scattergl/convert.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ var proto = LineWithMarkers.prototype;
107107

108108
proto.handlePick = function(pickResult) {
109109
var index = pickResult.pointId;
110+
110111
if(pickResult.object !== this.line || this.connectgaps) {
111112
index = this.idToIndex[pickResult.pointId];
112113
}
@@ -136,19 +137,20 @@ proto.isFancy = function(options) {
136137

137138
if(!options.x || !options.y) return true;
138139

139-
var marker = options.marker || {};
140-
if(Array.isArray(marker.symbol) ||
141-
marker.symbol !== 'circle' ||
142-
Array.isArray(marker.size) ||
143-
Array.isArray(marker.line.width) ||
144-
Array.isArray(marker.opacity)
145-
) return true;
146-
147-
var markerColor = marker.color;
148-
if(Array.isArray(markerColor)) return true;
140+
if(this.hasMarkers) {
141+
var marker = options.marker || {};
142+
143+
if(Array.isArray(marker.symbol) ||
144+
marker.symbol !== 'circle' ||
145+
Array.isArray(marker.size) ||
146+
Array.isArray(marker.color) ||
147+
Array.isArray(marker.line.width) ||
148+
Array.isArray(marker.line.color) ||
149+
Array.isArray(marker.opacity)
150+
) return true;
151+
}
149152

150-
var lineColor = Array.isArray(marker.line.color);
151-
if(Array.isArray(lineColor)) return true;
153+
if(this.hasLines && !this.connectgaps) return true;
152154

153155
if(this.hasErrorX) return true;
154156
if(this.hasErrorY) return true;
@@ -471,8 +473,10 @@ proto.updateFancy = function(options) {
471473

472474
proto.updateLines = function(options, positions) {
473475
var i;
476+
474477
if(this.hasLines) {
475478
var linePositions = positions;
479+
476480
if(!options.connectgaps) {
477481
var p = 0;
478482
var x = this.xData;
@@ -484,8 +488,8 @@ proto.updateLines = function(options, positions) {
484488
linePositions[p++] = y[i];
485489
}
486490
}
487-
this.lineOptions.positions = linePositions;
488491

492+
this.lineOptions.positions = linePositions;
489493

490494
var lineColor = convertColor(options.line.color, options.opacity, 1),
491495
lineWidth = Math.round(0.5 * this.lineOptions.width),

0 commit comments

Comments
 (0)