Blog Archives

Risk Legacy Mapper History

I’ve created a page where I’ll keep track of the history of changes to the Risk Legacy Mapping Tool. It’s also a good place to give me feedback and stuff. Thanks.

Tagged with: , , , , ,
Posted in D3, Mapping Tool, Risk, SVG

Risk Legacy Mapper – new and in D3!

So, it’s been a while since I posted anything, because I’ve been working on a new version of the Risk Legacy Mapper. You can find the new mapping tool here. The most obvious change is that it uses the proper

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

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

SVG – Basic Choices

So, where to start with SVG? It’s a fantastic tool, which I think is quite underused at the moment. It allows simple implementation of vector graphics in web pages. In fact, it’s possible to build a webpage entirely from SVG.

Posted in SVG