jacomyal/sigma.js — pull request #106 by rpeleg1970 (2013-06-05 08:50:01+00:00)
Title: Added plug-in for custom node shapes and images

Hi,

I added a plug-in called sigma.nodeShapes - demo / intro code sample here: https://dl.dropboxusercontent.com/u/45136256/sigma.js/nodeshapes.html

![screen shot 2013-06-05 at 11 36 17 am](https://f.cloud.github.com/assets/1434590/610678/59b006fe-cdbc-11e2-9208-872d178a493d.png)

the plug-in itself adds more node drawing functions for:
- square
- triangle
- diamond
- star (configurable number of points and inner radius)

In addition, the plug-in exposes an API to add additional custom shapes - also shown in demo with a 'Pacman' node.

All node drawing functions keep the shape bounded in the node size radius. This is important for keeping the rest working - mouse click and hover, force atlas, arrow edges, etc.

Last - the plug-in adds the ability to draw images on nodes, demonstrated as well. This addresses issue #83

This plugin is based on minimal changes to plotter - needed to expose the functionality that currently draws circle for regular, active, and hover nodes (as well as borders). no changes to node attribute were made - the attributes for shape and image drawing are piggybacked on the node.attr bag.