       cx += dx
       cy += dy
 
+  saving = null
+  save = ->
+    if not saving
+      setTimeout ->
+        localStorage.setItem 'nodes', JSON.stringify nodes
+        saving = false
+      , 1000
+
+  $('#title').on 'input propertychange', ->
+    if selected
+      selected.title = $(this).val()
+      save()
+
+  $('#notes').on 'input propertychange', ->
+    if selected
+      selected.notes = $(this).val()
+      save()
+
   if nodes.length is 0
     head = new Node()
     head.x = w / 2

      .attr('cx', 0)
      .attr('cy', 0)
      .attr('r', 30)

    svg.selectAll('.node text')
      .text((d) -> d.text)
      .attr('x', 0)
      .attr('y', 0)
      .attr('fill', 'red')


  nodes = JSON.parse localStorage.getItem 'nodes' or '[]'
  links = JSON.parse localStorage.getItem 'links' or '[]'
  # nodes = []
  # links = []

  sx = null
  sy = null
  selected = null
  cx = 0
  cy = 0

