                     idx = _.line.search regex
                     _._text_object.children[idx].position.x
                 .reduce (a, b) -> a - b
-            child._text_object.position.x += offset
+            child._text_object.position.x = parent_x + offset
+
+    addObjects: (lines_object) =>
+        (root) =>
+            traverse = (node) =>
+                debugger if ! node.line?
+                node._text_object = @getLineObject(node.line)
+                node._text_object.children.forEach (mesh) ->
+                    mesh.material.uniforms.opacity.value = 0.2
+                lines_object.add node._text_object
+
+                node.children.forEach traverse if node.children
+
+            traverse(root)
+
+    # transitionTargetWord: (word, transition) =>
+    #     (child) =>
+    #
+
+    animateLines: (root) =>
+        traverse = (node) =>
+            @panCameraToBBox node._text_object
+                .then -> fade(0.2, 1, 1000) node._text_object
+                .then ->
+                    if node.children?
+                        promises = node.children.map (child) ->
+                             fade(0.2, 1, 1000) child._text_object
+
+        traverse root
 
     addLines: (lines) =>
         lines_object = new THREE.Object3D()

                        @camera.position.y = y(t)
                .each "end", resolve

    getTransitionPromise = (interpolator) ->
        (text_object) ->
            new Promise (resolve) ->
                d3.select(text_object).transition()
                    .duration FADE_DURATION
                    .ease "poly", 5
                    .tween "fadeOpacity", ->
                        i = interpolator
                        (t) -> this.children.forEach (mesh) ->
                            mesh.material.uniforms.opacity.value = i(t)
                    .each "end", resolve

    fadeOut = (text_object) ->
        i = d3.interpolate(0.5, 0)


        root = linesToTree lines

        @addObjects(lines_object)(root)

        traverse = (parent) =>
            return if ! parent.children?

            positions_array = d3.shuffle parent.children.concat parent
            parent_index = positions_array.indexOf parent
            parent_y = parent._text_object.position.y

            positions_array.forEach (node, index) =>
                offset_from_parent = index - parent_index
                obj = node._text_object
                line_height = obj._layout.height + LINE_SPACING
                obj.position.y = parent_y + offset_from_parent * line_height

            parent.children.forEach alignToNode(parent)

