Skip to content

Commit

Permalink
improve image test
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Dec 10, 2021
1 parent 07cd536 commit a0901bd
Show file tree
Hide file tree
Showing 10 changed files with 360 additions and 4 deletions.
Binary file added test/image/baselines/h-colorbar01_no-border.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/h-colorbar12_no-border.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/h-colorbar_geo_multiple-usa-choropleths.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions test/image/mocks/h-colorbar01_no-border.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"data": [
{
"x": [-1, 0, 1],
"y": [0, 0, 0],
"mode": "markers",
"marker": {
"size": 100,
"color": [0, 50, 100],
"colorscale": "Reds",
"showscale": true,
"colorbar": {
"orientation": "h",
"ticks": "outside",
"ticklen": 10,
"bordercolor": "gray",
"title": {
"text": "Colorbar<br>title",
"font": {
"size": 16
}
}
}
}
}
],
"layout": {
"width": 600,
"height": 400,
"plot_bgcolor": "lightblue",
"title": {
"text": "Graph title",
"font": {
"size": 24
}
}
}
}
44 changes: 44 additions & 0 deletions test/image/mocks/h-colorbar12_no-border.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"data": [
{
"x": [-1, 0, 1],
"y": [0, 0, 0],
"mode": "markers",
"marker": {
"size": 100,
"color": [0, 50, 100],
"colorscale": "Reds",
"showscale": true,
"colorbar": {
"orientation": "h",
"xanchor": "left",
"yanchor": "top",
"y": 1,
"x": 0,
"len": 0.5,
"thickness": 10,
"ticks": "outside",
"ticklen": 10,
"title": {
"side": "right",
"text": "Colorbar<br>title",
"font": {
"size": 16
}
}
}
}
}
],
"layout": {
"width": 600,
"height": 400,
"plot_bgcolor": "lightblue",
"title": {
"text": "Graph title",
"font": {
"size": 24
}
}
}
}
4 changes: 0 additions & 4 deletions test/image/mocks/h-colorbar_geo_multiple-usa-choropleths.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
],
"colorbar": {
"orientation": "h",
"borderwidth": 1,
"xanchor": "left",
"yanchor": "top",
"tick0": 0,
Expand Down Expand Up @@ -122,7 +121,6 @@
],
"colorbar": {
"orientation": "h",
"borderwidth": 1,
"xanchor": "left",
"yanchor": "top",
"tick0": 10,
Expand Down Expand Up @@ -184,7 +182,6 @@
],
"colorbar": {
"orientation": "h",
"borderwidth": 1,
"xanchor": "left",
"yanchor": "top",
"tick0": 100,
Expand Down Expand Up @@ -222,7 +219,6 @@
],
"colorbar": {
"orientation": "h",
"borderwidth": 1,
"xanchor": "left",
"yanchor": "top",
"tick0": 1000,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
{
"data": [
{
"zmax": 10,
"colorscale": [
[
0,
"#ffffcc"
],
[
1,
"#ffffcc"
]
],
"text": [
"1.0CO",
"2.0OR",
"3.0ID",
"3.0KY",
"3.0MT",
"3.0PA",
"5.0MD",
"6.0TN"
],
"zmin": 0,
"locations": [
"CO",
"OR",
"ID",
"KY",
"MT",
"PA",
"MD",
"TN"
],
"colorbar": {
"orientation": "h",
"borderwidth": 1,
"xanchor": "left",
"yanchor": "top",
"tick0": 0,
"y": 0.25,
"dtick": 10,
"len": 0.15, "thickness": 10,
"x": 1
},
"locationmode": "USA-states",
"z": [
1,
2,
3,
3,
3,
3,
5,
6
],
"type": "choropleth"
},
{
"zmax": 100,
"colorscale": [
[
0,
"#addd8e"
],
[
1,
"#addd8e"
]
],
"text": [
"11.0IL",
"12.0CA",
"15.0DE",
"17.0SD",
"19.0IN",
"20.0MS",
"23.0NH",
"24.0WY",
"26.0AR",
"27.0LA",
"27.0NM",
"36.0AZ",
"36.0NE",
"42.0NC",
"42.0SC",
"52.0OH",
"52.0UT",
"55.0AL",
"56.0GA",
"61.0WA",
"71.0NV",
"84.0MO",
"89.0FL"
],
"zmin": 10,
"locations": [
"IL",
"CA",
"DE",
"SD",
"IN",
"MS",
"NH",
"WY",
"AR",
"LA",
"NM",
"AZ",
"NE",
"NC",
"SC",
"OH",
"UT",
"AL",
"GA",
"WA",
"NV",
"MO",
"FL"
],
"colorbar": {
"orientation": "h",
"borderwidth": 1,
"xanchor": "left",
"yanchor": "top",
"tick0": 10,
"y": 0.5,
"dtick": 90,
"len": 0.15, "thickness": 10,
"x": 1
},
"locationmode": "USA-states",
"z": [
11,
12,
15,
17,
19,
20,
23,
24,
26,
27,
27,
36,
36,
42,
42,
52,
52,
55,
56,
61,
71,
84,
89
],
"type": "choropleth"
},
{
"zmax": 1000,
"colorscale": [
[
0,
"#78c679"
],
[
1,
"#78c679"
]
],
"text": [
"109.0VA",
"112.0OK",
"129.0CT"
],
"zmin": 100,
"locations": [
"VA",
"OK",
"CT"
],
"colorbar": {
"orientation": "h",
"borderwidth": 1,
"xanchor": "left",
"yanchor": "top",
"tick0": 100,
"y": 0.75,
"dtick": 900,
"len": 0.15, "thickness": 10,
"x": 1
},
"locationmode": "USA-states",
"z": [
109,
112,
129
],
"type": "choropleth"
},
{
"zmax": 1500,
"colorscale": [
[
0,
"#31a354"
],
[
1,
"#31a354"
]
],
"text": [
"1281.0TX"
],
"zmin": 1000,
"locations": [
"TX"
],
"colorbar": {
"orientation": "h",
"borderwidth": 1,
"xanchor": "left",
"yanchor": "top",
"tick0": 1000,
"y": 1,
"dtick": 500,
"len": 0.15, "thickness": 10,
"x": 1
},
"locationmode": "USA-states",
"z": [
1281
],
"type": "choropleth"
}
],
"layout": {
"paper_bgcolor": "lightgray",
"width": 600,
"height": 400,
"title": {"text": "Executions by U.S. State Since 1819"},
"geo": {
"scope": "usa",
"projection": {
"type": "albers usa"
}
}
}
}
25 changes: 25 additions & 0 deletions test/image/mocks/h-colorbar_tickformat_with-border.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"data": [
{
"type": "contour",
"z": [
["0", "2e6"],
["2e6", "3e7"]
],
"colorbar": {
"borderwidth": 1,
"orientation": "h",
"tickformat": ",.1f",
"tickprefix": "*** ",
"showtickprefix": "first",
"ticksuffix": "",
"showticksuffix": "last"
}
}
],
"layout": {
"width": 500,
"height": 400,
"title": {"text": "colorbar tickformat"}
}
}

0 comments on commit a0901bd

Please sign in to comment.