Skip to content

Commit

Permalink
Merge pull request #7090 from plotly/map-predefined-styles
Browse files Browse the repository at this point in the history
Adding tesst for predefined styles of map subplots
  • Loading branch information
archmoj authored Aug 13, 2024
2 parents 3542cc5 + aedcab6 commit 34568d5
Show file tree
Hide file tree
Showing 9 changed files with 392 additions and 0 deletions.
Binary file added 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 added test/image/baselines/map_predefined-styles2.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/pattern_bars.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/pattern_fgcolor_overlay_fillmode.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/treemap_sunburst_marker_colors.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/treemap_textfit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions test/image/compare_pixels_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ for(var i = 0; i < allMockList.length; i++) {
// list flaky mocks other than mapbox:
'map_density0-legend',
'map_osm-style',
'map_predefined-styles1',
'map_predefined-styles2',
'gl3d_bunny-hull'
].indexOf(mockName) !== -1;

Expand Down
195 changes: 195 additions & 0 deletions test/image/mocks/map_predefined-styles1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
{
"data": [
{
"subplot": "map",
"text": ["basic"],
"textposition": "top center",
"marker": {
"size": [0]
},
"type": "scattermap",
"mode": "markers+text",
"lon": [-75],
"lat": [45.05]
},
{
"subplot": "map2",
"text": ["carto-darkmatter"],
"textposition": "top center",
"marker": {
"size": [0]
},
"type": "scattermap",
"mode": "markers+text",
"lon": [-75],
"lat": [45.05]
},
{
"subplot": "map3",
"text": ["carto-darkmatter-nolabels"],
"textposition": "top center",
"marker": {
"size": [0]
},
"type": "scattermap",
"mode": "markers+text",
"lon": [-75],
"lat": [45.05]
},
{
"subplot": "map4",
"text": ["carto-positron"],
"textposition": "top center",
"marker": {
"size": [0]
},
"type": "scattermap",
"mode": "markers+text",
"lon": [-75],
"lat": [45.05]
},
{
"subplot": "map5",
"text": ["carto-positron-nolabels"],
"textposition": "top center",
"marker": {
"size": [0]
},
"type": "scattermap",
"mode": "markers+text",
"lon": [-75],
"lat": [45.05]
},
{
"subplot": "map6",
"text": ["carto-voyager"],
"textposition": "top center",
"marker": {
"size": [0]
},
"type": "scattermap",
"mode": "markers+text",
"lon": [-75],
"lat": [45.05]
},
{
"subplot": "map7",
"text": ["carto-voyager-nolabels"],
"textposition": "top center",
"marker": {
"size": [0]
},
"type": "scattermap",
"mode": "markers+text",
"lon": [-75],
"lat": [45.05]
}
],
"layout": {
"map": {
"zoom": 10,
"style": "basic",
"center": {
"lon": -75,
"lat": 45
},
"domain": {
"x": [0, 1],
"y": [0.84, 0.96]
}
},
"map2": {
"zoom": 10,
"style": "carto-darkmatter",
"center": {
"lon": -75,
"lat": 45
},
"domain": {
"x": [0, 1],
"y": [0.7, 0.82]
}
},
"map3": {
"zoom": 10,
"style": "carto-darkmatter-nolabels",
"center": {
"lon": -75,
"lat": 45
},
"domain": {
"x": [0, 1],
"y": [0.56, 0.68]
}
},
"map4": {
"zoom": 10,
"style": "carto-darkmatter-nolabels",
"center": {
"lon": -75,
"lat": 45
},
"domain": {
"x": [0, 1],
"y": [0.42, 0.54]
}
},
"map5": {
"zoom": 10,
"style": "carto-positron-nolabels",
"center": {
"lon": -75,
"lat": 45
},
"domain": {
"x": [0, 1],
"y": [0.28, 0.4]
}
},
"map6": {
"zoom": 10,
"style": "carto-voyager",
"center": {
"lon": -75,
"lat": 45
},
"domain": {
"x": [0, 1],
"y": [0.14, 0.26]
}
},
"map7": {
"zoom": 10,
"style": "carto-voyager-nolabels",
"center": {
"lon": -75,
"lat": 45
},
"domain": {
"x": [0, 1],
"y": [0, 0.12]
}
},
"height": 3000,
"width": 900,
"margin": {
"t": 50,
"b": 10,
"l": 10,
"r": 10
},
"showlegend": false,
"title": {
"text": "Predefined styles in maps",
"font": {
"size": 28,
"weight": 800,
"style": "italic"
}
},
"font": {
"color": "#777",
"size": 28
}
}
}
Loading

0 comments on commit 34568d5

Please sign in to comment.