While dropping off to sleep last night, I was thinking about how much work it might be to add a world map to the WordPress Statistics for Emacs thing. Not because it’s useful, but because Jetpack has one, and I have to have feature parity!!!
So that’s what the Jetpack one looks like… Yeah, yeah, Mercator, but it does look kinda nice?
But then it occurred to me: Surely somebody has made an SVG world map with nice markup? And yes!
So I just have to read it in with libxml-parse-xml-region, adjust the colours to reflect view numbers with some dom-by-id and then let Emacs render it:
Easy peasy.
The one complication is that not all countries are contiguous, and you can’t have the same ID on several elements, so how do they solve that?
*sigh*
So non-contiguous countries don’t have IDs at all, but have a class grouping them… using the country name! So you have to have not only country codes, but a mapping to country names, and hope you’re using the same mapping that they’re using (i.e., “United States” and not “United States of America”, etc (and can class names even have spaces?)).
I should demand a refund! For that free map! The nerve of some people!
Anyway.