Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/plots/geo/geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 5 additions & 0 deletions src/snapshot/tosvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Binary file modified test/image/baselines/geo_bg-color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions test/jasmine/tests/color_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

});
});