     @recordWidths(tree)
     @drawTreeWithWidths(tree, 0, @width, @nodeDistance, mode)
 
-  drawTreeWithWidths : (tree, left, right, top, mode) ->
-    unless mode
-      mode = MODE_NORMAL
+  drawTreeWithWidths : (tree, left, right, top, mode = MODE_NORMAL) ->
 
     # get the decision point
     decisionPoint = @getNextDecisionPoint(tree)

    @canvas[0].width = @canvas.width()
    @canvas[0].height = @canvas.height()
    @ctx = @canvas[0].getContext("2d")
    console.log(@ctx)
    @width = width
    @height = height

    @ctx.lineTo(x2, y2)
    @ctx.stroke()

  drawChainIndicator : (x, top, bottom, emphasize = false) ->
    # Draw a dashed line
    dashLength = (bottom - top) / 7
    if emphasize
      @ctx.lineWidth = 4
    @ctx.beginPath()
    @ctx.strokeStyle = @vgColor
    for i in [0, 1, 2]
      @ctx.moveTo(x, top + (2 * i + 1) * dashLength)
      @ctx.lineTo(x, top + (2 * i + 2) * dashLength)
    @ctx.stroke()
    @ctx.lineWidth = 1

  # Decision point is any point with point.children.length != 1
  getNextDecisionPoint : (tree) ->
