Skip to content

Commit e9893f3

Browse files
authored
Merge pull request #28 from ClimateCompatibleGrowth/issue_25_b
Update colours on world map
2 parents 3021cd0 + d791b5e commit e9893f3

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎app/static/js/world.js‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
const HOVER_COLOR = "#d36f80"
2-
1+
const HOVER_COLOUR = "#FFC300"
2+
const HIGHLIGHT_COLOUR = "#FF5733"
3+
const BACKGROUND_COLOUR = "#DAF7A6"
34

45
function mouseOverHandler(d, i) {
5-
d3.select(this).attr("fill", HOVER_COLOR)
6+
d3.select(this).attr("fill", HOVER_COLOUR)
67
}
78
function mouseOutHandler(d, i) {
8-
d3.select(this).attr("fill", "red")
9+
d3.select(this).attr("fill", HOVER_COLOUR)
910
}
1011
function clickHandler(d, i) {
1112
const url = "/countries/" + i.id
@@ -34,7 +35,7 @@ d3.json("https://raw.githubusercontent.com/holtzy/D3-graph-gallery/master/DATA/w
3435
.selectAll("path")
3536
.data(data.features)
3637
.join("path")
37-
.attr("fill", "#CBD3EA")
38+
.attr("fill", BACKGROUND_COLOUR)
3839
.attr("d", d3.geoPath()
3940
.projection(projection)
4041
)
@@ -55,7 +56,7 @@ d3.json("https://raw.githubusercontent.com/holtzy/D3-graph-gallery/master/DATA/w
5556
.selectAll("path")
5657
.data(filtered_data)
5758
.join("path")
58-
.attr("fill", "#012169")
59+
.attr("fill", HIGHLIGHT_COLOUR)
5960
.attr("d", d3.geoPath()
6061
.projection(projection)
6162
)

0 commit comments

Comments
 (0)