Skip to content

Commit 33dc2de

Browse files
authored
Merge pull request #6787 from plotly/fix6770-scattergl-legend-marker-angles
fix scattergl legend with marker angle array
2 parents 5231272 + fd91d7a commit 33dc2de

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

draftlogs/6787_fix.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix `scattergl` legend when `marker.angle` is an array [[#6787](https://github.com/plotly/plotly.js/pull/6787)]

src/components/drawing/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,10 @@ function getMarkerAngle(d, trace) {
16071607
var angle = d.ma;
16081608

16091609
if(angle === undefined) {
1610-
angle = trace.marker.angle || 0;
1610+
angle = trace.marker.angle;
1611+
if(!angle || Lib.isArrayOrTypedArray(angle)) {
1612+
angle = 0;
1613+
}
16111614
}
16121615

16131616
var x, y;
1.67 KB
Loading

test/image/mocks/gl2d_period_positioning.json

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
{
44
"name": "scattergl",
55
"type": "scattergl",
6+
"marker": {
7+
"size": 20,
8+
"symbol": "arrow-wide",
9+
"angle": [150, -30, 150, -30, 150, -30]
10+
},
611
"x": ["2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01"],
712
"y": ["1970-01-01", "1970-02-01", "1970-03-01", "1970-04-01", "1970-05-01", "1970-06-01"],
813
"xperiod": "M12",

0 commit comments

Comments
 (0)