 
     i = 0
     for label, value of dict
-      leaf = new Leaf(value, label)
+      leaf = new Leaf(value, label, @shape)
       @nodes.push(leaf)
       leaf.x = pos.x + (i / length - .5 ) * 3 * leaf.radius * length
       leaf.y = pos.y
 
       i += 1
 
-  render: (ctx) ->
+  render: (ctx, idx) ->
     if @merging?
       ctx.save()
       setStyle(ctx, light_link_style)

    fn(this)

class NodeCollection
  constructor: () ->
    @nodes = []

  addLeaves: (dict, pos) ->

    context.font = '32px monospace'
    context.fillText(pendingString, 0, canvas.height - 32)

  for collection, idx in collections
    collection.render(context, idx)

  window.requestAnimationFrame(render)

