code: func ComposeDot(w io.Writer, g *Graph, a *DotAttributes, c *DotConfig) {
  	builder := &builder{w, a, c}
  
  	// Begin constructing DOT by adding a title and legend.
  	builder.start()
  	defer builder.finish()
  	builder.addLegend()
  
  	if len(g.Nodes) == 0 {
  		return
  	}
  
  	// Preprocess graph to get id map and find max flat.
  	nodeIDMap := make(map[*Node]int)
  	hasNodelets := make(map[*Node]bool)
  
  	maxFlat := float64(abs64(g.Nodes[0].FlatValue()))
  	for i, n := range g.Nodes {
  		nodeIDMap[n] = i + 1
  		if float64(abs64(n.FlatValue())) > maxFlat {
  			maxFlat = float64(abs64(n.FlatValue()))
  		}
  	}
  
  	edges := EdgeMap{}
  
  	// Add nodes and nodelets to DOT builder.
  	for _, n := range g.Nodes {
  		builder.addNode(n, nodeIDMap[n], maxFlat)
  		hasNodelets[n] = builder.addNodelets(n, nodeIDMap[n])
  
  		// Collect all edges. Use a fake node to support multiple incoming edges.
  		for _, e := range n.Out {
  			edges[&Node{}] = e
  		}
  	}
  
  	// Add edges to DOT builder. Sort edges by frequency as a hint to the graph layout engine.
  	for _, e := range edges.Sort() {
  		builder.addEdge(e, nodeIDMap[e.Src], nodeIDMap[e.Dest], hasNodelets[e.Src])
  	}
  }
docs: // ComposeDot creates and writes a in the DOT format to the writer, using
  // the configurations given.