Skip to content

Commit

Permalink
Updated colorscale for map
Browse files Browse the repository at this point in the history
  • Loading branch information
daenuprobst committed Mar 23, 2020
1 parent 87d1c67 commit b2b212b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def update_graph_map(selected_date_index, mode):
"type": "choropleth",
"locations": data.canton_labels,
"z": [map_data[canton][date] for canton in map_data if canton != "CH"],
"colorscale": [(0, "#7F2238"), (1, "#FF3867")],
"colorscale": style.turbo,
"geojson": "/assets/switzerland.geojson",
"marker": {"line": {"width": 0.0, "color": "#08302A"}},
"colorbar": {
Expand All @@ -301,7 +301,10 @@ def update_graph_map(selected_date_index, mode):
"layout": {
"geo": {
"visible": False,
"fitbounds": "locations",
"center": {"lat": 46.80111, "lon": 8.22667},
"lataxis": {"range": [45.7845, 47.8406]},
"lonaxis": {"range": [5.5223, 10.5421]},
# "fitbounds": "geojson",
"projection": {"type": "transverse mercator"},
# "landcolor": "#1f2630",
# "showland": True,
Expand Down
10 changes: 10 additions & 0 deletions dashcoch/style_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,13 @@ def __init__(self):
"foreground": "#2cfec1",
"accent": "#7fafdf",
}

self.turbo = self.get_turbo()

def get_turbo(self):
scale = [
"#2D384D",
"#DB4453",
]

return [(x / (len(scale) - 1), s) for x, s, in enumerate(scale)]

0 comments on commit b2b212b

Please sign in to comment.