code: func (g *Graph) selectTopNodes(maxNodes int, visualMode bool) Nodes {
  	if maxNodes > 0 {
  		if visualMode {
  			var count int
  			// If generating a visual graph, count tags as nodes. Update
  			// maxNodes to account for them.
  			for i, n := range g.Nodes {
  				tags := countTags(n)
  				if tags > maxNodelets {
  					tags = maxNodelets
  				}
  				if count += tags + 1; count >= maxNodes {
  					maxNodes = i + 1
  					break
  				}
  			}
  		}
  	}
  	if maxNodes > len(g.Nodes) {
  		maxNodes = len(g.Nodes)
  	}
  	return g.Nodes[:maxNodes]
  }
docs: // selectTopNodes returns a slice of the top maxNodes nodes in a graph.