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
Binary file modified test/image/baselines/map_0.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/map_angles.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/map_bubbles-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/map_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/map_carto-style.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/map_carto-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/map_choropleth-multiple.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/map_choropleth-raw-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/map_choropleth0-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/map_choropleth0.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/map_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/map_density-multiple.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/map_density-multiple_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/map_density0.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/map_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/map_fonts-supported-metropolis-italic.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/map_fonts-supported-metropolis-weight.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/map_fonts-supported-metropolis.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/map_geojson-attributes.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/map_predefined-styles1.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/map_symbol-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/map_texttemplate.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/scattermap_dynamic_defaults.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions test/jasmine/tests/choroplethmap_test.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions test/jasmine/tests/densitymap_test.js

Large diffs are not rendered by default.

71 changes: 36 additions & 35 deletions test/jasmine/tests/map_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,16 +515,16 @@ describe('map plots', function() {
expect(mapInfo.style.name).toEqual(style);
}

assertLayout('Dark Matter');
assertLayout('Dark Matter (Protomaps)');

Plotly.relayout(gd, 'map.style', 'carto-positron')
.then(function() {
assertLayout('Positron');
assertLayout('Positron (Protomaps)');

return Plotly.relayout(gd, 'map.style', 'carto-darkmatter');
})
.then(function() {
assertLayout('Dark Matter');
assertLayout('Dark Matter (Protomaps)');
})
.then(done, done.fail);
}, LONG_TIMEOUT_INTERVAL);
Expand Down Expand Up @@ -1210,13 +1210,14 @@ describe('map plots', function() {
}, LONG_TIMEOUT_INTERVAL);

describe('attributions', function() {
function assertLinks(s, exp) {
// CARTO controls the markup of its own links, so only plotly-owned links have a target
function assertLinks(s, exp, checkTarget) {
var elements = s[0][0].getElementsByTagName('a');
expect(elements.length).toEqual(exp.length);
for(var i = 0; i < elements.length; i++) {
var e = elements[i];
expect(e.href).toEqual(exp[i]);
expect(e.target).toEqual('_blank');
if(checkTarget) expect(e.target).toEqual('_blank');
}
}

Expand All @@ -1225,10 +1226,10 @@ describe('map plots', function() {
.then(function() {
var s = d3SelectAll('.maplibregl-ctrl-attrib');
expect(s.size()).toBe(1);
expect(s.text()).toEqual('© CARTO, © OpenStreetMap contributors');
expect(s.text()).toEqual('© OpenStreetMap contributors © CARTO');
assertLinks(s, [
'https://carto.com/about-carto/',
'http://www.openstreetmap.org/about/'
'https://www.openstreetmap.org/copyright',
'https://carto.com/about-carto/'
]);
})
.then(done, done.fail);
Expand All @@ -1242,7 +1243,7 @@ describe('map plots', function() {
expect(s.text()).toEqual('© OpenStreetMap contributors');
assertLinks(s, [
'https://www.openstreetmap.org/copyright'
]);
], true);
})
.then(done, done.fail);
});
Expand All @@ -1252,10 +1253,10 @@ describe('map plots', function() {
.then(function() {
var s = d3SelectAll('.maplibregl-ctrl-attrib');
expect(s.size()).toBe(1);
expect(s.text()).toEqual('© CARTO, © OpenStreetMap contributors');
expect(s.text()).toEqual('© OpenStreetMap contributors © CARTO');
assertLinks(s, [
'https://www.openstreetmap.org/copyright',
'https://carto.com/about-carto/',
'http://www.openstreetmap.org/about/',
]);
})
.then(done, done.fail);
Expand Down Expand Up @@ -1327,7 +1328,7 @@ describe('map plots', function() {
.then(function() {
var s = d3SelectAll('.maplibregl-ctrl-attrib');
expect(s.size()).toBe(1);
expect(s.text()).toEqual([XSS + attr, '© CARTO, © OpenStreetMap contributors'].join(' | '));
expect(s.text()).toEqual([XSS + attr, '© OpenStreetMap contributors © CARTO'].join(' | '));
expect(s.html().indexOf('<img src=x onerror="alert(XSS);">')).toBe(-1);
expect(s.html().indexOf('&lt;img src=x onerror="alert(XSS);"&gt;')).not.toBe(-1);
})
Expand Down Expand Up @@ -1660,43 +1661,43 @@ describe('test map trace/layout *below* interactions', function() {
})
.then(function() {
_assert('default *below*', {
trace: [94, 95, 96, 97],
trace: [96, 97, 98, 99],
layout: 9
});
})
.then(function() { return Plotly.relayout(gd, 'map.layers[0].below', 'traces'); })
.then(function() {
_assert('with layout layer *below:traces*', {
trace: [94, 95, 96, 97],
layout: 93
trace: [96, 97, 98, 99],
layout: 95
});
})
.then(function() { return Plotly.relayout(gd, 'map.layers[0].below', null); })
.then(function() {
_assert('back to default *below* (1)', {
trace: [93, 94, 95, 96],
layout: 97
trace: [95, 96, 97, 98],
layout: 99
});
})
.then(function() { return Plotly.restyle(gd, 'below', ''); })
.then(function() {
_assert('with trace *below:""*', {
trace: [94, 95, 96, 97],
layout: 93
trace: [96, 97, 98, 99],
layout: 95
});
})
.then(function() { return Plotly.restyle(gd, 'below', null); })
.then(function() {
_assert('back to default *below* (2)', {
trace: [93, 94, 95, 96],
layout: 97
trace: [95, 96, 97, 98],
layout: 99
});
})
.then(function() { return Plotly.restyle(gd, 'below', 'water'); })
.then(function() {
_assert('with trace *below:water*', {
trace: [9, 10, 11, 12],
layout: 97
layout: 99
});
})
.then(function() { return Plotly.relayout(gd, 'map.layers[0].below', 'water'); })
Expand All @@ -1710,21 +1711,21 @@ describe('test map trace/layout *below* interactions', function() {
.then(function() {
_assert('with trace *below:water* and layout layer *below:""*', {
trace: [9, 10, 11, 12],
layout: 97
layout: 99
});
})
.then(function() { return Plotly.restyle(gd, 'below', ''); })
.then(function() {
_assert('with trace AND layout layer *below:water*', {
trace: [93, 94, 95, 96],
layout: 97
trace: [95, 96, 97, 98],
layout: 99
});
})
.then(function() { return Plotly.update(gd, {below: null}, {'map.layers[0].below': null}); })
.then(function() {
_assert('back to default *below* (3)', {
trace: [93, 94, 95, 96],
layout: 97
trace: [95, 96, 97, 98],
layout: 99
});
})
.then(done, done.fail);
Expand Down Expand Up @@ -1771,25 +1772,25 @@ describe('test map trace/layout *below* interactions', function() {
})
.then(function() {
_assert('base', {
scatter: [96, 97, 98, 99],
scatter: [98, 99, 100, 101],
density: [13],
choropleth: [72, 73]
choropleth: [74, 75]
});
})
.then(function() { return Plotly.restyle(gd, 'below', ''); })
.then(function() {
_assert('all traces *below:""', {
scatter: [96, 97, 98, 99],
density: [95],
choropleth: [93, 94]
scatter: [98, 99, 100, 101],
density: [97],
choropleth: [95, 96]
});
})
.then(function() { return Plotly.restyle(gd, 'below', null); })
.then(function() {
_assert('back to base', {
scatter: [96, 97, 98, 99],
scatter: [98, 99, 100, 101],
density: [13],
choropleth: [72, 73]
choropleth: [74, 75]
});
})
.then(done, done.fail);
Expand Down Expand Up @@ -1818,7 +1819,7 @@ describe('test map trace/layout *below* interactions', function() {
}
Lib.warn.calls.reset();

getLayerIds().slice(94, -1).forEach(function(id) {
getLayerIds().slice(96, -1).forEach(function(id) {
expect(id.indexOf('plotly-')).toBe(0, 'layer ' + id + ' fallback to top of map');
});
}
Expand Down
Loading