Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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 14 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 6 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 BIN +120 KB (110%) 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 BIN -1.82 KB (99%) 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 BIN +4.39 KB (110%) 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 BIN +131 Bytes (100%) 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 BIN +3.33 KB (100%) 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 BIN +10.1 KB (120%) 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 BIN +6.04 KB (110%) 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 BIN +5.34 KB (110%) 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 BIN +4.94 KB (110%) 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 BIN +2.76 KB (100%) 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 BIN +3.9 KB (110%) 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 BIN +5.05 KB (110%) 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 BIN +6.39 KB (110%) 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 BIN +703 Bytes (100%) 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 BIN +1.02 KB (100%) 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 BIN +4.98 KB (110%) 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 BIN +3.92 KB (110%) 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 BIN -4.14 KB (92%) 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 BIN +12.1 KB (110%) 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 BIN +3.35 KB (110%) 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 BIN +5.88 KB (110%) 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 BIN +1.79 KB (100%) 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 BIN -1 Byte (100%) 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 BIN +2.81 KB (110%) 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 BIN +4.97 KB (110%) 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 BIN +541 Bytes (100%) test/image/baselines/geo_fitbounds-geojson.png
Binary file modified BIN +57.4 KB (110%) test/image/baselines/geo_fitbounds-locations.png
Binary file modified BIN +3.59 KB (100%) test/image/baselines/geo_fitbounds-scopes.png
Binary file modified BIN +5.69 KB (110%) test/image/baselines/geo_kavrayskiy7.png
Binary file modified BIN +25.5 KB (110%) test/image/baselines/geo_lakes-and-rivers.png
Binary file modified BIN +6.48 KB (110%) test/image/baselines/geo_legendonly.png
Binary file modified BIN +2.38 KB (110%) test/image/baselines/geo_miterlimit-base-layers.png
Binary file modified BIN +5.37 KB (110%) test/image/baselines/geo_multi-geos.png
Binary file modified BIN +1.66 KB (100%) test/image/baselines/geo_multiple-usa-choropleths.png
Binary file modified BIN +6.48 KB (110%) test/image/baselines/geo_orthographic.png
Binary file modified BIN +8.02 KB (110%) test/image/baselines/geo_point-selection.png
Binary file modified BIN +4.21 KB (110%) test/image/baselines/geo_scattergeo-locations.png
Binary file modified BIN +5.59 KB (110%) test/image/baselines/geo_scattergeo-out-of-usa.png
Binary file modified BIN +4.21 KB (110%) test/image/baselines/geo_second.png
Binary file modified BIN -4 Bytes (100%) test/image/baselines/geo_skymap.png
Binary file modified BIN +4.26 KB (110%) test/image/baselines/geo_stereographic.png
Binary file modified BIN +13.2 KB (110%) test/image/baselines/geo_text_chart_arrays.png
Binary file modified BIN +10.5 KB (110%) test/image/baselines/geo_tick0.png
Binary file modified BIN -995 Bytes (98%) test/image/baselines/geo_usa-states-on-world-scope.png
Binary file modified BIN +521 Bytes (100%) test/image/baselines/geo_usa-states.png
Binary file modified BIN +13.1 KB (110%) test/image/baselines/geo_visible_false_override_template.png
Binary file modified BIN +6.69 KB (100%) test/image/baselines/geo_winkel-tripel.png
Binary file modified BIN +705 Bytes (100%) test/image/baselines/grid_subplot_types.png
Binary file modified BIN +500 Bytes (100%) test/image/baselines/h-colorbar_geo_multiple-usa-choropleths.png
Binary file modified BIN +1.25 KB (100%) test/image/baselines/marker-standoff.png
Binary file modified BIN +1.14 KB (100%) test/image/baselines/marker-standoff_auto-backoff.png
Binary file modified BIN +1.21 KB (100%) test/image/baselines/marker-standoff_auto-backoff2.png
Binary file modified BIN +1.75 KB (100%) test/image/baselines/plot_types.png
Binary file modified BIN +1 KB (100%) test/image/baselines/plot_types_grid_dash.png
Binary file modified BIN +3.49 KB (100%) test/image/baselines/texttemplate_scatter.png
Binary file modified BIN +12 KB (100%) test/image/baselines/various_geo_projections.png
4 changes: 4 additions & 0 deletions 4 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 5 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 4 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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.