Monthly Archives: August 2013

A Risk Map in SVG

I’ve managed to track down a decent map of a Risk board, created using SVG. You can find the original SVG, generated using Inkscape by Gr0gmint here. For my own nefarious purposes, I have stripped out everything except the country

Tagged with: , , ,
Posted in Risk, SVG

SVG Dice using D3

This is a javascript D3 function I wrote to create SVG dice images. function append_die(element,number,cx,cy,width,colour,dotcolour) { element.append(“rect”).attr(“x”, cx-width/2).attr(“y”, cy-width/2).attr(“width”, width).attr(“height”, width).attr(“rx”, width/6).attr(“ry”, width/6).attr(“fill”, colour); if (number == 1) { element.append(“circle”).attr(“cx”, cx).attr(“cy”, cy).attr(“r”, width/8).attr(“fill”, dotcolour); } if (number == 2) {

Tagged with: ,
Posted in D3, SVG

A Risk Legacy Mapping Tool

Warning! Work in progress. ** EDIT 11 Sep 2013 ** There is now a new version of the Risk Legacy Mapping Tool which you can find here. There’s a post about it where you can tell me what needs changing.

Tagged with: , , , , ,
Posted in jQuery SVG, Risk, SVG

SVG Polygon Generator

OK, so the hexagon generator in the previous post seems a little inadequate in hindsight. So here is the code for a more general, regular, convex polygon. function polygon(x,y,rad,sides) { var path = “M “; for (a=0;a<sides;a++) { if (a>0)

Tagged with: , ,
Posted in jQuery SVG, SVG

An SVG Hexagon

Do you need a quick way to generate hexagons in SVG? Include this script in your javascript, and use it to generate the path string for a hexagon. You can then use the string with your chosen SVG plugin. I’ve

Tagged with: ,
Posted in jQuery SVG, SVG

Comparing SVG Plugins

My last post on SVG was basically an extremely light introduction to the subject. It was basically a way of working out what the best way of embedding SVG in a WordPress post was. Iframes as it turns out. Anyway,

Posted in D3, jQuery SVG, Raphael, SVG

Risk Legacy Tools

Many of you have probably played the classic strategy game of Risk. Less have you are likely to have played one of the many variations that Hasbro have released over the years: Risk Legacy. The cool thing about Risk Legacy

Tagged with: , , , , , ,
Posted in Risk