Adem's Dev Journey

Generate diagrams using ChatGPT

26 Feb 2023 | 1 min read

🔊 PLAY THIS ARTICLE

Hey there! In this short post, we’ll explore how to generate diagrams using ChatGPT. Let’s get started.

PlantUML

PlantUML is an open-source tool that allows you to generate diagrams using a simple text-based language.

It supports a wide range of diagrams, including:

  • Sequence diagram
  • Usecase diagram
  • Class diagram
  • Object diagram
  • Activity diagram (here is the legacy syntax)
  • Component diagram
  • Deployment diagram
  • State diagram
  • Timing diagram

Read more about PlantUML here plantuml.com

How to generate diagrams using ChatGPT

To generate diagrams using ChatGPT, use the following prompts

Using PlantUML, generate a UML use case diagram for [YOUR_APP_IDEA_HERE]
Using PlantUML, generate a UML class diagram for [YOUR_APP_IDEA_HERE]
Using PlantUML, generate a UML Sequence diagram for [YOUR_APP_IDEA_HERE]

Example:

Using PlantUML, generate a UML use case diagram for a hotel reservation system

After generating the diagram, you can copy the text and paste it in the PlantUML editor to generate the diagram.

http://www.plantuml.com/plantuml/uml/

Conclusion

In this post, we explored how to generate diagrams using ChatGPT. I hope you found it useful. If you have any questions, please leave a comment below.