 
     timeline_chart.render Repo.commits
     Repo.add_files commit.files
-    Repo.calculate_files_of commit
     Repo.timestamp_to_d3 commit
-
-  add_commits: (commits) ->
-    Repo.parsed_commits = 0
-    for commit in Repo.commits
-      if commit.files? and commit.files.length > 0
-        console.log("already had files!!!")
-        Repo.parse_commit(commit)
-      else
-        $.getJSON window.location.origin + '/commits/' + commit.id + ".json", Repo.parse_commit
-
-    Repo.render_timeline() if Object.keys(Repo.commits).length > 0
-    console.log("finished parsing")
-
 
   timestamp_to_d3: (commit) ->
     commit.timestamp = d3.time.format("%Y-%m-%dT%XZ").parse(commit.timestamp) if typeof commit.timestamp is "string"


  summed_additions_deletions: (d) => @get_aggregated_additions(d) + @get_aggregated_deletions(d)
  set_aggregate_values: (commit, filter_text) =>
    commit.aggregated_additions = d3.sum(commit.files, (file) => if @get_filename(file).contains(filter_text) then @get_additions(file) else 0) #jeff change with globbing
    commit.aggregated_deletions = d3.sum(commit.files, (file) => if @get_filename(file).contains(filter_text) then @get_deletions(file) else 0)

  constructor: (@$el) ->

        class: "timeline_chart_svg"
        width: @width
        height: @height

    @render = (commits, filter_text="") =>
      if not @filter_text? or (not @filter_text is filter_text) or not @filtered_commits
        for commit, i in commits
          @set_aggregate_values(commit, filter_text)
          commit.pos = i if commit?
        @filtered_commits = commits
        t = d3.max(@filtered_commits, @summed_additions_deletions)
        @x.domain [0 , @filtered_commits.length]
        @y.domain [0, t]
        @rx.range [0 , @filtered_commits.length]
        @ry.range [0 , t]
      a = @svg.selectAll(".area").data(@layer @filtered_commits)
      a.enter()
        .append("path")
        .attr
          d: @area
          class: (d, i) -> if i is 0 then "additions area" else "deletions area"
      a.transition()
        .delay((d,i) -> i * 1000)
        .attr
          d: @area
          class: (d, i) -> if i is 0 then "additions area" else "deletions area"
      a.exit().remove()

window.timeline_chart = new Timeline($("#timeline"))

do ->
  ls         = $('.left.slider')
  rs         = $('.right.slider')
  $highlight = $("#highlight")
