Skip to content

Commit da4e322

Browse files
authored
Merge pull request #6414 from plotly/arrayOk-arrows
Fix auto `backoff` when marker symbols and sizes are arrays
2 parents 9834144 + b61cfef commit da4e322

File tree

4 files changed

+412
-1
lines changed

4 files changed

+412
-1
lines changed

draftlogs/6414_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix auto `backoff` when marker symbols and sizes are arrays [[#6414](https://github.com/plotly/plotly.js/pull/6414)]

src/components/drawing/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,13 @@ function applyBackoff(pt, start) {
12031203
if(trace.type === 'scatter') endI--; // Why we need this hack?
12041204

12051205
var endMarker = end.marker;
1206-
b = endMarker ? drawing.symbolBackOffs[drawing.symbolNumber(endMarker.symbol)] * endMarker.size : 0;
1206+
var endMarkerSymbol = endMarker.symbol;
1207+
if(Lib.isArrayOrTypedArray(endMarkerSymbol)) endMarkerSymbol = endMarkerSymbol[endI];
1208+
1209+
var endMarkerSize = endMarker.size;
1210+
if(Lib.isArrayOrTypedArray(endMarkerSize)) endMarkerSize = endMarkerSize[endI];
1211+
1212+
b = endMarker ? drawing.symbolBackOffs[drawing.symbolNumber(endMarkerSymbol)] * endMarkerSize : 0;
12071213
b += drawing.getMarkerStandoff(d[endI], trace) || 0;
12081214
}
12091215

Loading

0 commit comments

Comments
 (0)