diff --git a/src/plots/geo/geo.js b/src/plots/geo/geo.js index 8161a965e23..71fe1994989 100644 --- a/src/plots/geo/geo.js +++ b/src/plots/geo/geo.js @@ -308,10 +308,7 @@ proto.adjustLayout = function(geoLayout, graphSize) { width: geoLayout._width, height: geoLayout._height }) - .style({ - 'fill': geoLayout.bgcolor, - 'stroke-width': 0 - }); + .call(Color.fill, geoLayout.bgcolor); }; proto.drawTopo = function(selection, layerName, geoLayout) { diff --git a/src/snapshot/tosvg.js b/src/snapshot/tosvg.js index 825db73035d..0312fdd8976 100644 --- a/src/snapshot/tosvg.js +++ b/src/snapshot/tosvg.js @@ -105,6 +105,11 @@ module.exports = function toSVG(gd, format) { } } + // remove draglayer for Adobe Illustrator compatibility + if(fullLayout._draggers) { + fullLayout._draggers.node().remove(); + } + // in case the svg element had an explicit background color, remove this // we want the rect to get the color so it's the right size; svg bg will // fill whatever container it's displayed in regardless of plot size. diff --git a/test/image/baselines/geo_bg-color.png b/test/image/baselines/geo_bg-color.png index 177b51ccddd..44df296e155 100644 Binary files a/test/image/baselines/geo_bg-color.png and b/test/image/baselines/geo_bg-color.png differ diff --git a/test/jasmine/tests/color_test.js b/test/jasmine/tests/color_test.js index 3b67c8ea3b7..aef74e24a78 100644 --- a/test/jasmine/tests/color_test.js +++ b/test/jasmine/tests/color_test.js @@ -145,4 +145,34 @@ describe('Test color:', function() { expect(container2).toEqual(expectedContainer2); }); }); + + describe('fill', function() { + + it('should call style with both fill and fill-opacity', function() { + var mockElement = { + style: function(object) { + expect(object.fill).toBe('rgb(255, 255, 0)'); + expect(object['fill-opacity']).toBe(0.5); + } + }; + + Color.fill(mockElement, 'rgba(255,255,0,0.5'); + }); + + }); + + describe('stroke', function() { + + it('should call style with both fill and fill-opacity', function() { + var mockElement = { + style: function(object) { + expect(object.stroke).toBe('rgb(255, 255, 0)'); + expect(object['stroke-opacity']).toBe(0.5); + } + }; + + Color.stroke(mockElement, 'rgba(255,255,0,0.5'); + }); + + }); });