 
     # Arrows
     for klass in ["non_theorem", "proven", "unproven"]
-      svg.append("svg:defs").selectAll("marker")
+      svg_group.append("svg:defs").selectAll("marker")
         .data([klass])
         .enter().append("svg:marker")
           .attr("id", String)

        else
          "url(#non_theorem)")

    node = svg.selectAll(".node")
      .data(force.nodes())
      .enter().append("g")
      .attr("class", "node")

      import_edges

  drawGraph = (nodes, edges) ->
    zoom = ->
      svg_group.attr("transform",
        "translate(#{d3.event.translate}), scale(#{d3.event.scale})")
    zoom_listener = d3.behavior.zoom().
      scaleExtent([0.1, 3]).on("zoom", zoom)

    $("div#d3_graph").html("")
    svg = d3.select("div#d3_graph").
      append('svg').
      attr('width', width).
      attr('height', height).
      call(zoom_listener)
    svg_group = svg.append('g').
      attr('class', 'graph')

    force = d3.layout.force()
    force.nodes(nodes)
