• strict warning: Non-static method view::load() should not be called statically in /home/peco/webapps/dp6_peter/sites/default/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /home/peco/webapps/dp6_peter/sites/default/modules/views/handlers/views_handler_argument.inc on line 744.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /home/peco/webapps/dp6_peter/sites/default/modules/views/plugins/views_plugin_style_default.inc on line 24.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/plugins/views_plugin_row.inc on line 134.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/peco/webapps/dp6_peter/sites/default/modules/views/plugins/views_plugin_row.inc on line 134.

SVG Tutorial

SVGs are Scalable Vector Graphics. They are an increasing popular form of image, particular for use on the web.

SVGs are called Vector graphics because they define graphics as a series of vectors, unlike raster graphics, which define graphics as a series of pixel colours. This means if an image contains a black line, rather than setting every pixel along that line to be black, a description of the line is stored. When you view an SVG, the program you're using to view it, for example your web browser, looks at the description and calculates the colour of each pixel. The advantage of this approach is that it makes graphics Scalable: you can zoom in on the image as much as you like and it will never pixelate because the image will be re-rendered after each zoom.

In this series of tutorial I aim to cover the basics of drawing shapes in SVG. For complex drawings you may want to try Inkscape (which is free) or Adobe Illustrator. As much as possible, I hope to include interactive demos like the one below (created using SVG) to allow you to drag the control points around and see what the what code would create that shape.  I hope this will give you a more intutive sense of what each attribute does. This style of demo was very much inspired by Bret Victor, and if you have a spare hour, I recommend watching this video.

At some point I'd like to make a tutorial covering SVG scripting (I started one here). For some more advanced SVG examples check out: