Editing diagrams