Skip to content
Browse files

country names are now clickable in the legend

  • Loading branch information...
1 parent d37c857 commit 3ed46d752d167cba839becc2cdf361ba7722e873 @madewulf committed Sep 9, 2011
Showing with 12 additions and 4 deletions.
  1. +1 −2 README.md
  2. +6 −2 index.html
  3. +5 −0 main.css
View
3 README.md
@@ -12,8 +12,7 @@ used to generate the JSON data files.
In the processes of creating those matrices, two useful files are generated:
* `code_to_name.json` a JSON object allowing to match iso country codes to country names
* `name_to_code.json` allows the reverse translation from country names to country code
-
- `parser.py' also contains the function `geolocalize_the_world`
+ `parser.py` also contains the function `geolocalize_the_world`
which obtains geographic coordinates for every country of `code_to_name.json` from the Google
geolocation api and stores it in `geoloc.json` (beware, because of some mistakes, this file
has been manually edited after the process, for example because Georgia had been located
View
8 index.html
@@ -1,5 +1,5 @@
<!DOCTYPE HTML>
-<html manifest="/cache.manifest" itemscope itemtype="http://schema.org/Visualization">
+<html manifest="/cache.madnifest" itemscope itemtype="http://schema.org/Visualization">
<head>
<title>Migrations Map: Where are migrants coming from? Where have migrants left? </title>
<meta property="og:title" content="MigrationsMap.net"/>
@@ -281,7 +281,7 @@ <h1 style="color:white;">MigrationsMap.net</h1>
var l;
var path;
line = paper.path(val[0]);
- $("#countries").append("<tr><td><div class=color_span style='height:1em;width:1em;background-color:"+ten_colors[counter] +" '>&nbsp;&nbsp;&nbsp;</div></td><td class='country_name'>"+val[1]+'</td><td style="text-align: right;">'+insertDecimalPoints(val[2])+"</td></tr>")
+ $("#countries").append("<tr><td><div class=color_span style='height:1em;width:1em;background-color:"+ten_colors[counter] +" '>&nbsp;&nbsp;&nbsp;</div></td><td class='country_name' value='"+name_to_code[val[1]] +"'>"+val[1]+'</td><td style="text-align: right;">'+insertDecimalPoints(val[2])+"</td></tr>")
line.attr({stroke:arrow_color,'stroke-width':2,'opacity':0});
line.animate({stroke:arrow_color,'stroke-width':2,'opacity':1},333);
current_arrows.push(line);
@@ -394,6 +394,10 @@ <h1 style="color:white;">MigrationsMap.net</h1>
function() { $(this).removeClass('ui-state-hover'); }
);
$('#legend').draggable();
+ $("#legend").delegate(".country_name","click",function(e){
+ currentCountry = $(this).attr("value");
+ redraw();
+ });
var progressBar = $("#progressbar");
View
5 main.css
@@ -202,6 +202,11 @@ td {
td.country_name{
height: 1.5em;
padding-left:1em;
+
+}
+
+#legend .country_name{
+ cursor: pointer;
}
#progressbar {

0 comments on commit 3ed46d7

Please sign in to comment.
Something went wrong with that request. Please try again.