         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: ''

          height: ''
        $('.leg-bar', leg).css height: ''

    _showLegInfos: (legHeights) ->
      cumulativeHeight = 0
      for legInfo, index in @$el.find('.leg-info[data-leg]')
        height = legHeights[index]
        $(legInfo).show().css top: Math.floor(cumulativeHeight), height: "#{height-1}px"
        $('*', legInfo).css 'lineHeight', "#{height-1}px"
        cumulativeHeight += height

    _hideLegInfos: () ->
      @$el.find('.leg-info').hide()

  MINIMUM_LEG_HEIGHT = 12

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

  class RouteGraphView extends Backbone.View

