 
 # collect __collection metadata attached to each object in order to draw subgraphs
 collections = {} # e.g. # { "collection_name": { fillcolor: "...", nodes: [...] } ... }"
-
-rnd_color = () ->
-  #("#{srand.random().toFixed(2)}" for i in [0..2]).join(' ')
-  COLORS[Math.floor(srand.random() * COLORS.length)]
-DEFAULT_FILL=rnd_color()
+default_collection = fillcolor: rnd_color(), nodes: [] # backup for collection-less nodes
 
 # store all edge info for writing/coloring correctly at the very end
 # edges are colored w/ the same color as their dest node

    edges[node_id] = _(edge_labels).map (label) ->
      { label: label, dest: dotty.get(data, label).$oid }

process.stdin.pipe(JSONStream.parse()).on 'data', (data) ->
  # sometimes we get piped arrays, sometimes we get one json obj per line
  if _(data).isArray()

  '#7f8c8d'
]

rnd_color = () ->
  #("#{srand.random().toFixed(2)}" for i in [0..2]).join(' ')
  COLORS[Math.floor(srand.random() * COLORS.length)]

stream = process.stdout
stream.write   """
  digraph {
