             else
                 topNodes.push(node)
 
-    r = 40
+    for topState in tree
+        walk topState, (state) ->
+            for tr in state.transitions or []
+                links.push(
+                    source: nodeMap[state.name]
+                    target: nodeMap[tr.target]
+                )
 
     cell = svg.selectAll('.cell')
         .data(nodes)


    cell.append('text')
        .text((node) -> node.name)

    force = d3.layout.force()
        .charge(0)

            .attr('width', (node) -> node.width)
            .attr('height', (node) -> node.height)

        link.attr('x1', (d) -> d.source.x)
            .attr('y1', (d) -> d.source.y)
            .attr('x2', (d) -> d.target.x)
            .attr('y2', (d) -> d.target.y)


doCollisions = (children) ->
    if children.length
