Generate diagrams