Forwards the diagram to dot and write file.