-T.def 'rankings', ->
+T.def 'rankings', (ytd) ->
   [
     [ 'h2'
       'ATP rankings chart for top 50 players'
-      #[ 'span.generated-note'
-      #  '(generated at'
-      #  [ 'span.generated-at' ]
-      #  ')'
-      #]
+      [ 'span.generated-note'
+        ' (generated at '
+        [ 'span.generated-at' ]
+        ' )'
+      ]
     ]
     [ 'form#rankings-form'
       action: "#/rankings"

x               = d3.scale.linear().domain([0, xMax]).range([0, maxBarWidth])
xBarLabel       = (d) -> x d.points

toggle = (ytd) ->
  resource = if ytd then "rankings_ytd" else "rankings"
  loadData resource, (rankings) -> showChart rankings

initChart = ->
  # svg container element
  chart = d3.select("#rankings-chart")

        type: "checkbox"
        name: "ytd"
        value: "true"
        click: -> 
          route = "#/rankings"
          if $(this).is(':checked') then route += '?ytd'
          window.location.hash = route
        renderComplete: (el) ->
          if ytd
            $(el).attr('checked', 'checked')
      ]
      [ 'label'
        for: "ytd"
