From 342c90412106c7a42fa4cfa68416135959c5bd90 Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 30 Apr 2020 14:45:12 -0400 Subject: [PATCH 1/2] reset scattermapbox.marker.rotation dflt to null instead of zero --- src/traces/scattermapbox/attributes.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/traces/scattermapbox/attributes.js b/src/traces/scattermapbox/attributes.js index a350ca54d78..b63ecc2eab8 100644 --- a/src/traces/scattermapbox/attributes.js +++ b/src/traces/scattermapbox/attributes.js @@ -89,11 +89,13 @@ module.exports = overrideAll({ }, angle: { valType: 'number', - dflt: 0, + dflt: null, role: 'style', arrayOk: true, description: [ - 'Sets the marker rotation, in degrees clockwise.' + 'Sets the marker rotation, in degrees clockwise.', + 'When it is not defined or using null (i.e. default),', + 'no rotation would be applied in perspective views.' ].join(' ') }, allowoverlap: { From 8654c38abd22d2ced3b8f35e15f600ca88853570 Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 30 Apr 2020 15:45:59 -0400 Subject: [PATCH 2/2] apply auto default - fix fill for zero angles - update angle description --- src/traces/scattermapbox/attributes.js | 8 ++++---- src/traces/scattermapbox/convert.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/traces/scattermapbox/attributes.js b/src/traces/scattermapbox/attributes.js index b63ecc2eab8..833e6ebbb90 100644 --- a/src/traces/scattermapbox/attributes.js +++ b/src/traces/scattermapbox/attributes.js @@ -89,13 +89,13 @@ module.exports = overrideAll({ }, angle: { valType: 'number', - dflt: null, + dflt: 'auto', role: 'style', arrayOk: true, description: [ - 'Sets the marker rotation, in degrees clockwise.', - 'When it is not defined or using null (i.e. default),', - 'no rotation would be applied in perspective views.' + 'Sets the marker orientation from true North, in degrees clockwise.', + 'When using the *auto* default, no rotation would be applied', + 'in perspective views which is different from using a zero angle.' ].join(' ') }, allowoverlap: { diff --git a/src/traces/scattermapbox/convert.js b/src/traces/scattermapbox/convert.js index abb4d9963aa..0362d96a07c 100644 --- a/src/traces/scattermapbox/convert.js +++ b/src/traces/scattermapbox/convert.js @@ -104,7 +104,7 @@ module.exports = function convert(gd, calcTrace) { 'icon-size': trace.marker.size / 10 }); - if('angle' in trace.marker) { + if('angle' in trace.marker && trace.marker.angle !== 'auto') { Lib.extendFlat(symbol.layout, { // unfortunately cant use {angle} do to this issue: // https://github.com/mapbox/mapbox-gl-js/issues/873 @@ -258,7 +258,7 @@ function makeSymbolGeoJSON(calcTrace, gd) { getFillFunc(symbol) : blankFillFunc; - var fillAngle = (angle) ? + var fillAngle = (angle !== 'auto') ? getFillFunc(angle, true) : blankFillFunc;