     # by recordWidths(), the second by drawTreeWithWidths().
 
     @recordWidths(tree)
-    @drawTreeWithWidths(tree, 0, @width, @nodeDistance)
-
-  drawTreeWithWidths : (tree, left, right, top) -> 
+    @drawTreeWithWidths(tree, 0, @width, @nodeDistance, mode)
+
+  drawTreeWithWidths : (tree, left, right, top, mode) ->
+    unless mode
+      mode = MODE_NORMAL
+
     # get the decision point
     decisionPoint = @getNextDecisionPoint(tree)
     # calculate m (middle that divides the left and right tree, if any)

NODE_RADIUS = 2
MAX_NODE_DISTANCE = 100
CLICK_TRESHOLD = 4

class AbsractTreeViewer
  constructor : (width, height) ->

    # List of {x : ..., y : ..., id: ...} objects
    @nodeList = []

    mode = MODE_NOCHAIN

    @nodeDistance = Math.min(@height / (@getMaxTreeDepth(tree, mode) + 1), MAX_NODE_DISTANCE)

    # The algorithm works as follows:
    # A tree is given a left and right border that it can use. If
