For the distribution of seats among political parties in local
governments and parliaments, the Swedish Wikipedia has used
repeated 5px images of different colours (red, red,... blue),
which is both inefficient and hard to edit.
To improve this, I created a template that uses tables with
bgcolor and width. I'm happy with calling this template, the
article text is now very friendly to edit,
http://sv.wikipedia.org/w/index.php?title=Kumla_kommun&diff=8619386
For this typical article, the length was reduced from 21 kbytes to
5 kbytes.
The template parameters are Swedish political party abbreviations
(s, m, c, fp, ...) that are used for looking up the right colour,
interlaced with the number of seats for that party.
But is the template implementation optimal, or would you use some
other technique? For very long bars or very narrow browser
windows, the math gets distorted. Should I use divs instead of
tables? I guess SVG would be the best, but can SVG images be
generated inline from a template?
http://sv.wikipedia.org/wiki/Mall:Mandatstapel
The name is derived from mandat (= seat) and stapel (= bar).
--
Lars Aronsson (lars(a)aronsson.se)
Aronsson Datateknik -
http://aronsson.se