   ctx.lineWidth   = s.width  if s.width
   ctx.font        = s.font   if s.font
 
+renderShape = (ctx, shape, radius) ->
+  switch shape
+    when 'circle'
+      ctx.arc(0,0,radius,0,Math.PI*2)
+    when 'square'
+      ctx.moveTo(-radius,-radius)
+      ctx.lineTo(-radius,+radius)
+      ctx.lineTo(+radius,+radius)
+      ctx.lineTo(+radius,-radius)
+      ctx.closePath()
+    when 'diamond'
+      ctx.moveTo(-radius*Math.SQRT2,0)
+      ctx.lineTo(0,+radius*Math.SQRT2)
+      ctx.lineTo(+radius*Math.SQRT2,0)
+      ctx.lineTo(0,-radius*Math.SQRT2)
+      ctx.closePath()
+
+  return
+
+default_node_radius = 15
+
 class Node
   render: (ctx) ->
     ctx.save()
     ctx.translate(@x, @y)
     setStyle(ctx, node_style)
     ctx.beginPath()
-    ctx.arc(0,0,@radius,0,Math.PI*2)
+    renderShape(ctx, @shape, @radius)
     ctx.fill()
     ctx.stroke()
     ctx.restore()

      n.render(ctx)
      ctx.restore()

      # TODO: render collection handle

  mousedown: (pos) ->
    for n in @nodes

    ctx.restore()

class Inner extends Node
  constructor: (@value, @child0, @child1, @shape) ->

  render: (ctx) ->
    ctx.save()
