HTML5 Map of the the World Migrations using SVG, Raphael.js and offline storage
migrationsmap.net
migrationsmap.net
Eg:
http://www.gapminder.org/world/#$majorMode=chart$is;shi=t;ly...
http://www.gapminder.org/world/#http://www.gapminder.org/wor...
The Hans Rosling TED talk is fantastic too: http://www.ted.com/talks/hans_rosling_shows_the_best_stats_y...
The colour scheme struck me as a little odd, though. It goes from darker (more migration) to lighter (less migration) but then abruptly to dark grey (no migration), making it harder to interpret at first glance. It would be nice if it were somewhat monotonic: bright colour = more migration, darker/duller colour = less migration, dark grey = no migration.
The only tiny imperfection I see it's in the lines connecting two countries, I'd like to see an arrow so I know if I'm looking at arrivals or departures.
Is there a way to filter the GMO database to see only the current migration flow (say, last 5 years)?
That said, there may be a solution I did not think about.
Did you create this map data or get it from somewhere else? Is this some kind of joke?
[1] http://i.imgur.com/m8Wce.png
[2] https://blogs.msdn.com/b/oldnewthing/archive/2006/10/27/8804...
Maybe the arrow and the name of the currently selected item could be enclosed in a bounding box with a darker background, so as to more clearly show that it is currently selected.
Um, no. Many developers forget about Opera Mobile/Desktop because nobody uses it. Many developers forget about Opera Mini because it's worse to develop for than IE6.
Perhaps you should consider that even a few percentage point share of the browser market still translates to millions of users. About 50 million on Opera Desktop to be more precise.
If you don't care about them I guess you certainly don't care about the few people using screen readers; or how about Safari which has only roughly double Opera's measly market share?
It's also confusing in that the number format follows a European convention of using decimal points rather than commas in between every three digits the numbers, though I can accept that localising your site isn't a big concern.
I would include a zoom function, some small countries are hard to find.
At first I wanted to use polymaps, which supports zoom and pan, but I found it difficult to draw on top of it (for the "arrows") and it lacked ie support. So I went for Raphael.js, but found it to cumbersome to implement zoom and pan.
and I understand this is lifetime, but still those two destinations seem unlikely to me.
fascinating map nonetheless.
Minor nitpick: When I click on 'Macedonia' the origin point appears in Sweden. When I click on 'Serbia' it appears in Canada.
That said, I have already been pondering about this for a previous projects: http://populationpyramid.net and there are solutions : either export the svg tags through an ajax query to a server that would then render it as PNG, or create a script that would create the svg files directly from the data. I did not take time to implement this, though (I have to sleep sometimes...)
1) If you're using a browser that supports SVG (basically, not IE), Raphael will generate the images as SVG nodes in your DOM tree. You can just grab that entire section of the DOM and send the SVG markup to the server where you render it using the image library of your choice.
2) If you have to support IE the above method won't work. Only IE9 has any SVG support and I've heard reports that it's spotty. In these cases, Raphael falls back on VML, an older MS extension that provides more or less the same experience. Unfortunately, I don't know of a server side generation library that supports VML. What's worse, in my testing, IE won't even print the VML image so you can't even use a PDF writer in the browser.
So, the simplest workaround is use the VML fallback in IE for display but when the user wants to download a final version, generate the same drawing as HTML + Javascript on the serverside and then use wkhtmltopdf on the html. (For those who don't know, wkhtmltopdf is an awesome tool that uses a headless webkit browser to convert HTML files to shockingly good PDFs).
As long as the javascript is triggered on load, wkhtmltpdf will include it in the resulting pdf. This doesn't always work perfectly but odds are it'll work for you.
As an added bonus, SVG bits also seemed to be rendered as vector in the actual PDF. This also prevents any chance of the server side image rendering slightly differently from the user preview.
3) If the wkhtmltopdf method isn't rendering properly or is too exotic for your server, you can try using the great raphael.serialize plugin ( https://github.com/jspies/raphael.serialize ). This works around the SVG/VML problems by exporting the data as a JSON structure. This can be re-rendered inside raphael easily but exporting to PNG is trickier. You can convert the JSON to SVG and render that as in method one, Ben Barnett has a small code example on how to do that: ( http://www.benbarnett.net/2010/06/04/export-svg-from-raphael... ) but there's no complete library for doing this yet so you'll have to write some extra bits yourself. If you do write a library for this, please open source it so I don't have to do it too. ;)
Also, Raphael 2.0 is being launched at jsconf.eu next month so it may have a more clever approach for this but I haven't looked into it yet.
BTW changing #hashcode based on the country looking at would be great too.
Then check that http://migrationsmap.net/#/SHN/departures is still broken.
It could be there was some so-called return immigration, with Chinese-Brazilians going to China during the times of high unemployment rate on Brazil (as lots of Japanese-Brazilians did). But as a Brazilian I've never heard of that, so 50k sounds implausible.
You can easily verify this here: http://www.migrationdrc.org/research/typesofmigration/global...