   $.get("#{graphs_uri}?depth=#{depth}", (data) ->
       displayGraph(data)
     , "json")
+
+randomNumber = (min, max) ->
+  return Math.random() * (max - min) + min
 
 addClass = (selector, klass) ->
   el = $(selector)

      text((d) ->
        nodeDisplayName(d))


    tick = ->
      node.attr("transform", (d) ->

        dx = d.target.x - d.source.x
        dy = d.target.y - d.source.y
        dr = Math.sqrt(dx*dx + dy*dy)*2
        calc_offsets(d)
        if d.source.info.id != d.target.info.id
          "M#{d.source.x},#{d.source.y}" +
          "A#{dr},#{dr} 0 0,1 #{d.target.x},#{d.target.y}"
        else
          "M#{d.source.x},#{d.source.y-0.6}" +
          "A-#{d.arc_offset_a},-#{d.arc_offset_b} 0 " +
          "#{d.pos_offset_a},#{d.pos_offset_b} #{d.target.x-4},#{d.target.y}"
      )
    force.on('tick', tick)

