code: public static void writeHeader(Writer writer, int dpi, String rankDir, String id, List<String> attribLines) throws IOException {
          // Default settings
          if (attribLines == null) {
              attribLines = new ArrayList<>();
          } else {
          	attribLines = new ArrayList<>(attribLines);
          }
          attribLines.add("node [shape=box];");
          // add ...
  
          // DPI and Rankdir
          StringBuilder header = new StringBuilder("digraph " + id + " {\n");
          if (dpi > 0) {
              header.append("dpi=").append(dpi).append(";\n");
          }
          header.append("rankdir=").append(StringUtils.isNotBlank(rankDir) ? rankDir : "LR").append(";\n");
  
          // Additional lines
          for (String line : attribLines) {
              line = line.trim();
              header.append(line).append(line.endsWith(";") ? "\n" : ";\n");
          }
          DotUtils.writeln(writer, header.toString());
      }
docs: Write the header structure.
  
  @param writer A writer where the header is written to.
  @param dpi The resulting resolution, can be 0 for using the default DPI-setting of dot
  @param rankDir The direction of the graph, can be null
  @param id The id of the graph, cannot be null, needs to start with a alphabetical character, can contain numbers, alphabetic characters and underscore only.
  @param attribLines Additional attributes, can be null
  
  @throws IOException if writing to the Writer fails