cpettitt/dagre-d3 — pull request #69 by PaulKlint (2014-07-27 15:00:16+00:00)
Title: Implemented "arbitrary" node shapes

Added optional "use" element in node meta-data for user-defined node shapes

The basic idea is that instead of the standard rectangle that is now drawn for each node, a separate shape can be defined per node.

This is achieved by adding an extra ```use``` field that holds the name of an SVG ```def``` element. Whenever a node is rendered and the use element is present, the defined element will be drawn. See ```demos/user-defined-nodes.html``` for an example.

The defined node shape element should satisfy the following requirements:

- It occurs in a ```defs``` section that is part of the svg in which the graph is being rendered.
- It is wrapped in a group element with the same ```id``` as occurs in the ```use``` element in the node's meta-data.
- The first element in the group is one of the following shapes for which special boundary intersection algorithms have been implemented:
- circle
- ellipse
- polygon

- When these requirements are not satisfied, the node shape is treated as a rectangle.

A typical (good) example of a defined node shape is:
```

N4

```
__Caveats__:

- The above rules forbid node shapes surrounded by extra transformations (e.g. scale, rotate).
- The connection points for concave polygons are not yet pixel perfect. I am still looking into this.