     .value()
   if edge_labels.length
     edges[node_id] = _(edge_labels).map (label) ->
-      { label: label, dest: dotty.get(data, label).$oid }
+      label: label
+      dest: dotty.get(data, label).$oid
+      color: edge_color data.__collection, label
 
 process.stdin.pipe(JSONStream.parse()).on 'data', (data) ->
   # sometimes we get piped arrays, sometimes we get one json obj per line

# edges are colored w/ the same color as their dest node
edges = {} # e.g. { "<source_node_id>": [{label: "...", dest: "..."} ... ], ... }

# store mapping from node -> color for edge drawing at the very end
colors = {}

handle_data = (data) ->
  # all nodes keyed on objectid

    collections[data.__collection] ?= {fillcolor: rnd_color(), nodes: []}
    collections[data.__collection].nodes.push node_id
    node_color = collections[data.__collection].fillcolor

  # create/label/fill the node
  stream.write "  \"#{node_id}\" [label=\"#{node_label}\", fillcolor=\"#{node_color}\", penwidth=0, fontname=\"helvetica\", fontcolor=white];\n"
