         source: entry[0]
         target: entry[1]
         distance: entry[2]
+        key: [entry[0],entry[1]]
       [minDist, maxDist] = d3.extent(links, (l) -> l.distance)
       linkPercentage = .05
       links = _.filter(links, (l) -> l.distance < (minDist + maxDist)*linkPercentage)

        voronoiPatches.classed('active', (d) -> d.active)
        _.delay (-> node.classed('active', (d) -> d.active)) # delay to ensure css animations still work

      link = svg.selectAll('.link').data(links).enter().append('line').attr('class', 'link')
      updateLinks = (link) ->
        link.attr('x1', (d) ->
          xScaleD d.source
        ).attr('y1', (d) ->
          yScaleD d.source
        ).attr('x2', (d) ->
          xScaleD d.target
        ).attr('y2', (d) ->
          yScaleD d.target
        ).attr('stroke', (d) ->
          "rgba(255,255,255,#{dScale(d.distance)}"
        ).attr('stroke-width', (d) ->
          dScale(d.distance)*1.5
        )

      node = svg.selectAll('.node').data(nodes, (a) -> a.url).enter().append('g').attr('class', (d) -> 'node ' + d.predictedLabel).call(force.drag)
      node.append('circle').attr('class', 'selectionIndicator').attr('cx', 0).attr('cy', 0).attr('r', circleSize * 4)

  $http.get('distances.json').then (response) -> response.data

app.directive 'networkChart', (Network) ->
  scope:
    showLinks: '='
  link: (scope, elem, attrs) ->
    # preparing
    width = 800
