Skip to content

Commit

Permalink
modify default - add image test
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Jan 11, 2020
1 parent 639913e commit 75d3e7d
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/plots/geo/layout_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) {
var isConic = geoLayoutOut._isConic = projType.indexOf('conic') !== -1;
var isClipped = geoLayoutOut._isClipped = !!constants.lonaxisSpan[projType];

var visible = coerce('visible');
if(geoLayoutIn.visible === false) {
visible = geoLayoutOut.visible = true;
// should override template.layout.geo.show* - see issue 4482

// make a copy
Expand All @@ -68,9 +66,9 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) {
// set ref to copy
geoLayoutOut._template = newTemplate;
}
var visible = coerce('visible');

var show;

for(var i = 0; i < axesNames.length; i++) {
var axisName = axesNames[i];
var dtickDflt = [30, 10][i];
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions test/image/mocks/geo_visible_false_override_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"data": [
{
"type": "scattergeo",
"marker": {
"opacity": 0.5,
"color": "green",
"size": 100
},
"lon": [
0
],
"lat": [
0
]
},
{
"geo": "geo2",
"type": "scattergeo",
"marker": {
"opacity": 0.5,
"color": "yellow",
"size": 100
},
"lon": [
0
],
"lat": [
0
]
},
{
"geo": "geo3",
"type": "scattergeo",
"marker": {
"opacity": 0.5,
"color": "red",
"size": 100
},
"lon": [
0
],
"lat": [
0
]
}
],
"layout": {
"width": 600,
"height": 800,
"title": {
"text": "geo visible false should override template.layout.geo.show*"
},
"geo": {
"visible": true
},
"geo2": {
"visible": false
},
"geo3": {
"visible": true
},
"template": {
"layout": {
"geo": {
"showcoastlines": true,
"showcountries": true,
"showframe": true,
"showland": true,
"showlakes": true,
"showocean": true,
"showrivers": true,
"showsubunits": true,
"lonaxis": {
"showgrid": true
},
"lataxis": {
"showgrid": true
}
}
}
}
}
}

0 comments on commit 75d3e7d

Please sign in to comment.