       points.length - 1
     ]
     arc points
-
+    
   return
 
 # add tooltips

colors = [
  [
    'rgb(228,26,28)'
    'rgba(228,26,28,0.5)'
  ]
  [
    'rgb(55,126,184)'
    'rgba(55,126,184,0.5)'
  ]
  [
    'rgb(77,175,74)'
    'rgba(77,175,74,0.5)'
  ]
  [
    'rgb(152,78,163)'
    'rgba(152,78,163,0.5)'
  ]
  [
    'rgb(255,127,0)'
    'rgba(255,127,0,0.5)'
  ]
  [
    'rgb(255,255,51)'
    'rgba(255,255,51,0.5)'
  ]
  [
    'rgb(166,86,40)'
    'rgba(166,86,40,0.5)'
  ]
  [
    'rgb(247,129,191)'
    'rgba(247,129,191,0.5)'
  ]
  [
    'rgb(153,153,153)'
    'rgba(153,153,153,0.5)'
  ]
]
jQuery(document).ready ($) ->
  $(".file").click (event) ->
    path = $(this).attr("href")
    event.preventDefault()
    $.ajax
      url: path
      success: (response) ->
        $("#content").empty()
        $('#arc').remove()
        $('span.info').remove()
        
        obj = response
        setHistory path
        buildGraph obj

setHistory = (path) ->
  if path!=window.location
    window.history.pushState({path:path},'',path)

# all for graph bulding
buildGraph = (graph) ->
  # create svg image
  svg = d3.select("#content").append("svg").attr("id", "arc").attr("width", width).attr("height", height)
  # create plot area within svg image
  plot = svg.append("g").attr("id", "plot").attr("transform", "translate(" + pad + ", " + pad*25 + ")")
  
  linearLayout graph.nodes

  for k,v of graph.links
    act_color = colors[list_index]
    list_index += 2
    console.log 
    arcLinks graph.nodes,v,act_color[1],'t',k
    $("#head").append "<a href='#" + k + "' class='info navbar-brand' style='color:" + act_color[0] + "'>#" + k + ": " + v.length + "</a>"
  
  drawNodes graph.nodes
  writeClaims graph.nodes

linearLayout = (nodes) ->
  xscale = d3.scale.linear().domain([
    0
    nodes.length - 1
