Slightly ajar

Opera market share map

, ,

While messing around with SVG I created a map of Opera market share in Eastern and Central Europe. This is much heavier than the previous SVG files I've made as I started with an existing SVG map from Wikipedia, that was originally produced using Inkscape. This adds a lot of extra things that machine generated markup usually produces, but making a map by hand would be bordering on insanity. I've cleaned up some of the markup, but I should be able to trim the file size a lot more by removing some of the inline and redundant styles and extra elements and attributes that are not needed.

I added all the extra information, such as the labels, colouring and animations by hand, which isn't too difficult to do once I worked out that the map was using a viewBox that changes the co-ordinate system (everything I was trying to include was too small to be seen because of this). I'm using the alpha channel of the HSLA colour model to show the different levels of marketshare (offset by 0.2 to make the colours easier to spot), which gave a easy 100% scale to work with. This is easy to do, but have performance penalties and opacity is expensive. It also means that it requires Opera 10 or greater to get the full effect. I'll probably end up mapping the colours to RGB values and use that instead, although that would make it more expensive. The colouring scheme chosen also makes it slightly difficult to see the difference between the colours less than 10% and those around 10 to 20%, so i reduced the opacity of the country borders for those less than 10%. I'd eventually like to show the market share data when clicking on the country rather than a predefined animation that loops through each county. In theory you can zoom in on each country (for those I added - Czech Republic, Slovakia, and Poland), due to the use of the view element and fragment identifiers on the a element, but support for this seems to break when animations are included. I'm not sure if this is a bug or something I'm doing wrong. You can still directly go to the county using a direct link outside of the document. There is also an issue with Safari where HSLA colour model doesn't seem to be supported in SVG, or at least not on the fill property, so the map just displays as black.

As far as the data is concerned, I took the market share values from the StatCounter results for April (at the time of writing). All figures are rounded so 2.49% becomes 2% and 2.51% would become 3%. You'll notice some patterns on the map, with 3 main groups. Those countries that are in the CIS are all post 20% market share. The Visgrád_Group and Baltic nations are around 10% to 15%. Latvia is slightly lower with 9%, and Estonia drops off at the edge of the group with 7%. The major exception is Hungary with only 4%, but we have identified a number of compatibility issues in Hungary (see comments in my previous pot) which may be causing this. The third group is the Balkan and other South-Eastern countries, that are around 4, 5 or 6% market share. This again has exceptions with Serbia and Montenegro both being ahead with around 10% market share, and Slovenia and Albania around 2% market share. I wouldn't be surprised if by the end of the year Hungary has caught up to the 10% mark and the third group of countries also start working their way to that level.

[UPDATE 1] HSL and HSLA are apparently not suppose to be supported by SVG, although they are both supported by Opera and Firefox. I've switched the fill value to red and added the appropriate alpha channel value with the appropriate fill-opacity value. Next up is the issue with Firefox. after talking to Jeff Schiller, its been narrowed down to the lines used to draw the grid. Firefox treats these differently, but I have to work out why. That is something for another day though.

Desktop market share: Central/Eastern Europe editionUpdated SVG map

Comments

Unregistered user Saturday, April 18, 2009 1:23:35 PM

Anonymous writes: unviewable in firefox 3.5

Unregistered user Saturday, April 18, 2009 2:15:00 PM

Duncan Lock writes: Yeah, in Firefox 3.0.8, it draws itself perfectly and you can see all the maps and colours, and then when it's done, blanks itself out in red, leaving just one large red rectangle.

David Storeydstorey Saturday, April 18, 2009 5:31:24 PM

Strange. There is no red rectangles in the source code, except for the start of the key, which I haven't finished yet. That shouldn't create that issue though. It did work in my version of FF before I removed some of the inkscape mark up and before I put the grid on the page. I'll see if I can find out what has gone wrong.

Charles SchlossChas4 Saturday, April 18, 2009 9:53:25 PM

I think some of the bugs may be from not as much svg support as Opera

http://www.codedread.com/svg-support.php

orinoco Sunday, April 19, 2009 6:42:04 PM

Inkscape defaults to 5 decimal places, you can round down to 1 dp without any noticeable degradation & cut your files by quite a bit. I made a simple javascript tool to automate this: http://files.myopera.com/orinoco/tools/roundpath.html Just copy the svg code then click "Round". This tool cuts your file from 553kb to 418kb.

HuzursuZ Sunday, April 19, 2009 7:56:48 PM

hi there... I would like to see Turkey in this map too... I install or recommend everyfriend in Turkey, so there must be an increase smile

Matt Coxcoxy Monday, April 20, 2009 10:26:23 AM

I didn't even know you could do this sort of thing with SVG - I just thought it was a vector format graphic and was unaware of animation / interactivity capabilities.

FataL Monday, April 20, 2009 5:06:09 PM

I would like to see some interaction on this map: when I click on a country slideshow should stop and show country's market share.

Unregistered user Monday, April 20, 2009 10:38:00 PM

Anonymous writes: Agree with Fatal here: if you don't know (like me) the initial of every country, you can't really get which country get wich percentage... Maybe there's a way to show the percentage when you click on the country. That would be great!

David Storeydstorey Tuesday, April 21, 2009 11:30:06 AM

FataL/Annon

I fixed this last night. Try http://people.opera.com/dstorey/images/OperaMarketShareEEhover.svgz (some bugs I still have to fix for FF and Saf.)

Mad Scientist (عادل)qlue Thursday, April 30, 2009 3:24:02 PM

Well it sort of works in Operamini, but obviously without animation. The SVGTviewer app on my Nokia E65 just shows a blank, black map. Could you perhaps do a static version that just shows the percentages? I've just discovered SVG and plan on using it for my banners and backgrounds from now on. IE users won't see anything but who cares about that anyway. lol.

David Storeydstorey Thursday, April 30, 2009 7:47:38 PM

Not sure what SVG engine SVGTviewer uses, but the T stands for SVG Tiny, so it likely lacks the standards support to view the map. I use CSS for the colours and styles and that is not supported in SVG Tiny.

Mad Scientist (عادل)qlue Friday, May 1, 2009 5:24:59 PM

It supports inline styles for color. I know this because I'm currently working with it. So perhaps I need the css file to add the colors in. I'll mess around with it a bit and see what I can accomplish. up.

Write a comment

New comments have been disabled for this post.

May 2013
S M T W T F S
April 2013June 2013
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31