Fix bug in the `diagrams` tool where the name of the generated graph when using the DOT language could be invalid