Skip to content

Commit

Permalink
Merge pull request #6414 from plotly/arrayOk-arrows
Browse files Browse the repository at this point in the history
Fix auto `backoff` when marker symbols and sizes are arrays
  • Loading branch information
archmoj authored Dec 21, 2022
2 parents 9834144 + b61cfef commit da4e322
Show file tree
Hide file tree
Showing 4 changed files with 412 additions and 1 deletion.
1 change: 1 addition & 0 deletions draftlogs/6414_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix auto `backoff` when marker symbols and sizes are arrays [[#6414](https://github.com/plotly/plotly.js/pull/6414)]
8 changes: 7 additions & 1 deletion src/components/drawing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,13 @@ function applyBackoff(pt, start) {
if(trace.type === 'scatter') endI--; // Why we need this hack?

var endMarker = end.marker;
b = endMarker ? drawing.symbolBackOffs[drawing.symbolNumber(endMarker.symbol)] * endMarker.size : 0;
var endMarkerSymbol = endMarker.symbol;
if(Lib.isArrayOrTypedArray(endMarkerSymbol)) endMarkerSymbol = endMarkerSymbol[endI];

var endMarkerSize = endMarker.size;
if(Lib.isArrayOrTypedArray(endMarkerSize)) endMarkerSize = endMarkerSize[endI];

b = endMarker ? drawing.symbolBackOffs[drawing.symbolNumber(endMarkerSymbol)] * endMarkerSize : 0;
b += drawing.getMarkerStandoff(d[endI], trace) || 0;
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit da4e322

Please sign in to comment.