         if @expanded then @_expand() else @_collapse()
 
     _expand: () ->
-      widths = ($(leg).width() for leg in @$el.find '.leg')
-      totalWidth = _.reduce widths, (t,w) -> t + w
-      heightRatio = EXPANDED_HEIGHT / totalWidth
-      heights = (Math.floor(_.max [width * heightRatio, MINIMUM_LEG_HEIGHT]) for width in widths)
-      totalHeight = _.reduce heights, (t,h) -> t + h
-
-      @$el.css 'height', totalHeight
-      @_moveLegsToTheSide heights
-      @_showLegInfos heights
+      numberOfLegs = @route.get('legs').length
+      totalHeight = EXPANDED_HEIGHT * numberOfLegs
+      @$el.css 'height', totalHeight + 6
+      @_moveLegsToTheSide()
+      @_showLegInfos()
 
     _collapse: () ->
       @$el.css height: ''

  MINIMUM_LEG_HEIGHT = 12

  # ToDo: Legs really deserve their own view class at this point.

  class RouteGraphView extends Backbone.View


    _moveLegsToTheSide: (legHeights) ->
      cumulativeHeight = 0
      for leg, index in @$el.find('.leg[data-leg]')
        $(leg).data
          collapsedLeft: $(leg).css 'left'
          collapsedWidth: $(leg).css 'width'
        $(leg).css
          top: cumulativeHeight
          height: EXPANDED_HEIGHT - 1 # Leave one pixel for the "gutter"
          left: 0
          width: "#{EXPANDED_HEIGHT}px"
        $('.leg-bar', leg).css 'height', EXPANDED_HEIGHT - 5 # gutter + 2 x padding (ToDO: this isn't the place for this sort of thing)
        cumulativeHeight += EXPANDED_HEIGHT

    _moveLegsToTheTop: () ->
      for leg in @$el.find('.leg[data-leg]')
