From 6a4000ddf725cac9ce2bb306dd86d573319486b8 Mon Sep 17 00:00:00 2001 From: srgbennett Date: Mon, 3 Aug 2015 16:30:34 +0100 Subject: [PATCH 1/5] Update map.js This should highlight the country with the cursor closes ukodi-training/ODP-Group6#2 --- map/js/map.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/map/js/map.js b/map/js/map.js index 6e65d36..ebba21c 100644 --- a/map/js/map.js +++ b/map/js/map.js @@ -98,10 +98,14 @@ var country = svg.selectAll(".country").data(countries); // Respond to mouse actions country .on("mousemove", function(d,i) { + d3.select(this).style("stroke","black") + .style("stroke-width","1.2px") }) .on("click", function(d,i) { }) .on("mouseout", function(d,i) { + d3.select(this).style("stroke","#666") + .style("stroke-width","0.4px") }); } From 1dd8a99e26c29922ae95169380fbdaf7d9e9a441 Mon Sep 17 00:00:00 2001 From: srgbennett Date: Mon, 3 Aug 2015 16:36:10 +0100 Subject: [PATCH 2/5] Update index.html Links the info section into the html. Partially fixes ukodi-training/ODP-Group6#3 --- map/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map/index.html b/map/index.html index 3428e9e..06ec608 100644 --- a/map/index.html +++ b/map/index.html @@ -29,7 +29,7 @@

Shaded Map of World

- +
From 88e910799a9f6e331251e5e445d69a8de7047594 Mon Sep 17 00:00:00 2001 From: srgbennett Date: Mon, 3 Aug 2015 16:51:06 +0100 Subject: [PATCH 3/5] Update map.js Second part of info function closes ukodi-training/ODP-Group6#3 --- map/js/map.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/map/js/map.js b/map/js/map.js index ebba21c..9500f22 100644 --- a/map/js/map.js +++ b/map/js/map.js @@ -100,7 +100,9 @@ var country = svg.selectAll(".country").data(countries); .on("mousemove", function(d,i) { d3.select(this).style("stroke","black") .style("stroke-width","1.2px") - }) + $('#info').html("

"+d.name+"

Population:"+d.value.toString().replace(/\B(?=\d{3})+(?!\d))/g,",")+""); + } + ) .on("click", function(d,i) { }) .on("mouseout", function(d,i) { From c0cf3c1fdc21114ae5f2601713787cae6cef09bd Mon Sep 17 00:00:00 2001 From: srgbennett Date: Mon, 3 Aug 2015 16:58:19 +0100 Subject: [PATCH 4/5] Update map.js Fixes an open bracket in our previous commit closes ukodi-training/ODP-Group6#3 --- map/js/map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map/js/map.js b/map/js/map.js index 9500f22..55638c9 100644 --- a/map/js/map.js +++ b/map/js/map.js @@ -100,7 +100,7 @@ var country = svg.selectAll(".country").data(countries); .on("mousemove", function(d,i) { d3.select(this).style("stroke","black") .style("stroke-width","1.2px") - $('#info').html("

"+d.name+"

Population:"+d.value.toString().replace(/\B(?=\d{3})+(?!\d))/g,",")+""); + $('#info').html("

"+d.name+"

Population:"+d.value.toString().replace(/\B(?=\d{3})+(?!\d)/g,",")+""); } ) .on("click", function(d,i) { From 5e94884ce935cbc1e770fe721a87dbb538cc9d71 Mon Sep 17 00:00:00 2001 From: srgbennett Date: Mon, 3 Aug 2015 17:01:12 +0100 Subject: [PATCH 5/5] Update index.html fixes the fact that the map overlaps the info section --- map/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/map/index.html b/map/index.html index 06ec608..7c41e47 100644 --- a/map/index.html +++ b/map/index.html @@ -28,8 +28,10 @@

Shaded Map of World

Your challenge. Create a shaded map of the world from some data about each country, get it to display and also dynamically update other content on this page.

-
+ +
+