diff --git a/draftlogs/6787_fix.md b/draftlogs/6787_fix.md new file mode 100644 index 00000000000..301c15a447d --- /dev/null +++ b/draftlogs/6787_fix.md @@ -0,0 +1 @@ + - Fix `scattergl` legend when `marker.angle` is an array [[#6787](https://github.com/plotly/plotly.js/pull/6787)] diff --git a/src/components/drawing/index.js b/src/components/drawing/index.js index fb1724489c6..d02095aaa86 100644 --- a/src/components/drawing/index.js +++ b/src/components/drawing/index.js @@ -1607,7 +1607,10 @@ function getMarkerAngle(d, trace) { var angle = d.ma; if(angle === undefined) { - angle = trace.marker.angle || 0; + angle = trace.marker.angle; + if(!angle || Lib.isArrayOrTypedArray(angle)) { + angle = 0; + } } var x, y; diff --git a/test/image/baselines/gl2d_period_positioning.png b/test/image/baselines/gl2d_period_positioning.png index eb3fbd667a4..ad4ca0a1ae7 100644 Binary files a/test/image/baselines/gl2d_period_positioning.png and b/test/image/baselines/gl2d_period_positioning.png differ diff --git a/test/image/mocks/gl2d_period_positioning.json b/test/image/mocks/gl2d_period_positioning.json index 358e8872653..3a9adefb628 100644 --- a/test/image/mocks/gl2d_period_positioning.json +++ b/test/image/mocks/gl2d_period_positioning.json @@ -3,6 +3,11 @@ { "name": "scattergl", "type": "scattergl", + "marker": { + "size": 20, + "symbol": "arrow-wide", + "angle": [150, -30, 150, -30, 150, -30] + }, "x": ["2001-01-01", "2002-01-01", "2003-01-01", "2004-01-01", "2005-01-01", "2006-01-01"], "y": ["1970-01-01", "1970-02-01", "1970-03-01", "1970-04-01", "1970-05-01", "1970-06-01"], "xperiod": "M12",