Skip to content

Updating baselines for new geodata #7406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
14 changes: 13 additions & 1 deletion src/lib/geo_location_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function locationToFeature(locationmode, location, features) {

for(i = 0; i < filteredFeatures.length; i++) {
f = filteredFeatures[i];
if(f.id === locationId) return f;
if(f.id === locationId && isMainCountryFeature(f)) return f;
}

loggers.log([
Expand All @@ -74,6 +74,18 @@ function locationToFeature(locationmode, location, features) {
return false;
}

function isMainCountryFeature(feature) {
// Returns false for certain features which are not the main region of their country
if(feature.id === 'USA') {
if(feature.properties && feature.properties.ct && feature.properties.ct[0] == -155.5 &&
feature.properties.ct[1] == 19.6) {
// Hawaii
return false;
}
}
return true;
}

function feature2polygons(feature) {
var geometry = feature.geometry;
var coords = geometry.coordinates;
Expand Down
6 changes: 5 additions & 1 deletion src/lib/topojson_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ topojsonUtils.getTopojsonName = function(geoLayout) {
};

topojsonUtils.getTopojsonPath = function(topojsonURL, topojsonName) {
return topojsonURL + topojsonName + '.json';
if (topojsonURL.endsWith('/')) {
return topojsonURL + topojsonName + '.json';
} else {
return topojsonURL + '/' + topojsonName + '.json';
}
};

topojsonUtils.getTopojsonFeatures = function(trace, topojson) {
Expand Down
Binary file modified test/image/baselines/canada_geo_projections.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/distance_satellite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_across-antimeridian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_africa-insets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_aitoff-sinusoidal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Binary file modified test/image/baselines/geo_big-frame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_bubbles-colorscales.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_bubbles-sizeref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_canadian-cities.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_centering.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_choropleth-legend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_choropleth-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_choropleth-usa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_choropleth-usa_legend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_conic-conformal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_connectgaps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_country-names-text-chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_country-names.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_custom-colorscale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_custom-geojson.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_europe-bubbles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_featureidkey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_fill.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_first.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/geo_fitbounds-geojson.png
Binary file modified test/image/baselines/geo_fitbounds-locations.png
Binary file modified test/image/baselines/geo_fitbounds-scopes.png
Binary file modified test/image/baselines/geo_kavrayskiy7.png
Binary file modified test/image/baselines/geo_lakes-and-rivers.png
Binary file modified test/image/baselines/geo_legendonly.png
Binary file modified test/image/baselines/geo_miterlimit-base-layers.png
Binary file modified test/image/baselines/geo_multi-geos.png
Binary file modified test/image/baselines/geo_multiple-usa-choropleths.png
Binary file modified test/image/baselines/geo_orthographic.png
Binary file modified test/image/baselines/geo_point-selection.png
Binary file modified test/image/baselines/geo_scattergeo-locations.png
Binary file modified test/image/baselines/geo_scattergeo-out-of-usa.png
Binary file modified test/image/baselines/geo_second.png
Binary file modified test/image/baselines/geo_skymap.png
Binary file modified test/image/baselines/geo_stereographic.png
Binary file modified test/image/baselines/geo_text_chart_arrays.png
Binary file modified test/image/baselines/geo_tick0.png
Binary file modified test/image/baselines/geo_usa-states-on-world-scope.png
Binary file modified test/image/baselines/geo_usa-states.png
Binary file modified test/image/baselines/geo_visible_false_override_template.png
Binary file modified test/image/baselines/geo_winkel-tripel.png
Binary file modified test/image/baselines/grid_subplot_types.png
Binary file modified test/image/baselines/h-colorbar_geo_multiple-usa-choropleths.png
Binary file modified test/image/baselines/marker-standoff.png
Binary file modified test/image/baselines/marker-standoff_auto-backoff.png
Binary file modified test/image/baselines/marker-standoff_auto-backoff2.png
Binary file modified test/image/baselines/plot_types.png
Binary file modified test/image/baselines/plot_types_grid_dash.png
Binary file modified test/image/baselines/texttemplate_scatter.png
Binary file modified test/image/baselines/various_geo_projections.png
4 changes: 4 additions & 0 deletions test/image/compare_pixels_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ argv._.forEach(function(pattern) {
var blacklist = [
'map_angles',
'map_stamen-style',
'map_predefined-styles2',
'map_scattercluster',
'map_fonts-supported-open-sans',
'map_fonts-supported-open-sans-weight',
];

if(virtualWebgl) {
Expand Down
5 changes: 5 additions & 0 deletions test/image/make_baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
plotlyjs = plotlyjs_with_virtual_webgl

pio.kaleido.scope.plotlyjs = plotlyjs
pio.kaleido.scope.topojson = "file://" + os.path.join(root, 'dist', 'topojson')
pio.templates.default = 'none'

ALL_MOCKS = [os.path.splitext(a)[0] for a in os.listdir(dirIn) if a.endswith('.json')]
Expand All @@ -66,6 +67,10 @@
# unable to generate baselines for the following mocks
blacklist = [
'map_stamen-style',
'map_predefined-styles2',
'map_scattercluster',
'map_fonts-supported-open-sans',
'map_fonts-supported-open-sans-weight',
]
allNames = [a for a in allNames if a not in blacklist]

Expand Down
4 changes: 2 additions & 2 deletions test/jasmine/tests/geo_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2759,10 +2759,10 @@ describe('Test geo interactions update marker angles:', function() {
})
.then(function() {
newPath = getPath();
expect(newPath).toEqual('M0,0L18.22327727600463,8.240883770679762L19.586810955756498,-4.044358612123453Z');
expect(newPath).toEqual('M0,0L18.223277273610172,8.24088377597469L19.58681095693162,-4.04435860643234Z');

expect(newPath).not.toEqual(initialPath);
expect(newPath).toEqual('M0,0L18.22327727600463,8.240883770679762L19.586810955756498,-4.044358612123453Z');
expect(newPath).toEqual('M0,0L18.223277273610172,8.24088377597469L19.58681095693162,-4.04435860643234Z');
expect(initialPath).toEqual('M0,0L-1.5100144203478312,19.942914943667123L10.500523963798084,17.021721313830223Z');
})
.then(done, done.fail);
Expand Down