   node.children.forEach (child) ->
     depth = maxDepth(child)
     max = depth if depth > max
-    maxY = child.y if child.y > maxY
 
   return max + 1
+
+
+getLastTwoTokens = (str) ->
+  tokens = str.split(".")
+  tokens.slice(tokens.length - 2).join(".")
 
 d3.flameGraph = ->
 
   class FlameGraph
-    constructor: (@containerId) ->
-      @_generateAccessors(['width', 'height'])
+    constructor: () ->
+      @_generateAccessors([
+        'width',
+        'height',
+        'cellHeight',
+        'containerId',
+        'colorScheme'])
       @_allData = []
 
     data: (data) ->
       return @_data if not data
       @_allData.push(data)
 
+      @_data = d3.layout.partition()
+        .sort((a,b) -> a.name.localeCompare(b.name))
+        .nodes(data)
+      @
+
+    breadcrumbs: () ->
       breadcrumbData = @_allData.map((prevData, idx) -> { name: prevData.name, value: idx })
-      console.log(breadcrumbData)
       breadcrumbs = d3.select('.breadcrumb')
         .selectAll('li')
         .data(breadcrumbData)

      @container
        .selectAll('.label')
        .on 'click', clickHandler

      console.timeEnd('interactivity')
      @



  node

maxDepth = (node) ->
  return 0 if not node
  return 1 if not node.children
