LogoJuan Manuel Allo Ron

Creating Flowcharts and Mindmaps with ChatGPT

By Juan Manuel Allo Ron on Aug 12, 2024
Chat GPT, Graphviz and MermaidJS represented as 3 house emblems

I’ve been experimenting with ChatGPT and discovered a cool trick that lets you create diverse graph visualizations effortlessly.

Since ChatGPT excels in text generation, you can leverage its capabilities to generate graphs using domain-specific languages (DSL). Luckily, there are open-source tools like Graphviz and MermaidJS, and the best part is that ChatGPT is well-versed in these languages.

The recommended DSLs are:

  1. Graphviz
  2. MermaidJS

Ask ChatGPT to convert any text into one of these DSLs, and then use online visualization tools to turn them into actual images.

Recommended tools for visualization:

  1. GraphvizOnline: Excellent for Graphviz
  2. Mermaid Live: Ideal for MermaidJS

Crafting a Mind Map

Let’s walk through an example. I tasked ChatGPT with creating diagrams for both DSLs based on fruits and categories as our starting point:

Building a mind map

Let’s use an example to illustrate this. I asked chat GPT to put together a diagram on both DSLs for fruits. We use these fruits and categories as the starting point:

Fruits

  • Citrus: Oranges, Lemons, Limes
  • Berries: Strawberries, Blueberries, Raspberries, Blackberries
  • Tropical: Bananas, Pineapples, Mangoes
  • Stone Fruits: Peaches, Plums, Cherries
  • Melons: Watermelon, Cantaloupe

GraphViz

The code generated looks like this:

digraph G {
  node [style="filled", color="#00bcd4", fontcolor="#ffffff", shape="box"];
  edge [color="#4CAF50"];

  Fruits [label="Fruits"];
  
  Citrus [label="Citrus", shape="ellipse", color="#4CAF50"];
  Berries [label="Berries", shape="ellipse", color="#ff9800"];
  Tropical [label="Tropical", shape="ellipse", color="#FFC107"];
  StoneFruits [label="Stone Fruits", shape="ellipse", color="#E91E63"];
  Melons [label="Melons", shape="ellipse", color="#9C27B0"];

  Fruits -> Citrus;
  Fruits -> Berries;
  Fruits -> Tropical;
  Fruits -> StoneFruits;
  Fruits -> Melons;

  Oranges [label="Oranges"];
  Lemons [label="Lemons"];
  Limes [label="Limes"];
  Strawberries [label="Strawberries"];
  Blueberries [label="Blueberries"];
  Raspberries [label="Raspberries"];
  Blackberries [label="Blackberries"];
  Bananas [label="Bananas"];
  Pineapples [label="Pineapples"];
  Mangoes [label="Mangoes"];
  Peaches [label="Peaches"];
  Plums [label="Plums"];
  Cherries [label="Cherries"];
  Watermelon [label="Watermelon"];
  Cantaloupe [label="Cantaloupe"];

  Citrus -> {Oranges Lemons Limes};
  Berries -> {Strawberries Blueberries Raspberries Blackberries};
  Tropical -> {Bananas Pineapples Mangoes};
  StoneFruits -> {Peaches Plums Cherries};
  Melons -> {Watermelon Cantaloupe};
}

And the output looks like this:

Graphviz generated visualization

You can check both live

MermaidJS

The code on Mermaid looks like this:

graph TB
  A(Fruits)
  B[Citrus]
  C[Berries]
  D[Tropical]
  E[Stone Fruits]
  F[Melons]

  G[Oranges]
  H[Lemons]
  I[Limes]

  J[Strawberries]
  K[Blueberries]
  L[Raspberries]
  M[Blackberries]

  N[Bananas]
  O[Pineapples]
  P[Mangoes]

  Q[Peaches]
  R[Plums]
  S[Cherries]

  T[Watermelon]
  U[Cantaloupe]

  A --> B
  A --> C
  A --> D
  A --> E
  A --> F

  B --> G
  B --> H
  B --> I

  C --> J
  C --> K
  C --> L
  C --> M

  D --> N
  D --> O
  D --> P

  E --> Q
  E --> R
  E --> S

  F --> T
  F --> U

style A fill:#00bcd4,stroke:#fff,stroke-width:2px
style B fill:#4CAF50,stroke:#fff,stroke-width:2px
style C fill:#ff9800,stroke:#fff,stroke-width:2px
style D fill:#FFC107,stroke:#fff,stroke-width:2px
style E fill:#E91E63,stroke:#fff,stroke-width:2px
style F fill:#9C27B0,stroke:#fff,stroke-width:2px

And the image:

MermaidJS generated visualization

You can check both live here

Conclusion

The possibilities are endless with this powerful combo. Utilize it to transform your ChatGPT conversations into captivating visualizations.

I trust you found this nifty trick intriguing. Feel free to share your creations with me on X. Let’s visualize the world of ChatGPT together! 🚀


Catch up with me on X (twitter):@juan_allo

Chatgpt
Graph-visualization
Viz
Creativity
Visualization-tools
Information-design
Tech-tricks
Innovation
Learning
Creativity
Data
Tech-tools
Diagramming

Share

X Facebook Y Combinator LinkedIn Reddit Email

---

Similar Articles

A screenshot of my new blog in a floating laptop

Revamping my blog with Astro

Apr 13, 2024
I've decided to move from Wordpress to a custom setup. I'll share why I made this choice and the insights I've gained in this blog post!
An Artificial intelligence solving JS challenges in a computer

7 days of JS by ChatGPT

Jun 12, 2024
I decided to team up with ChatGPT to create a 7-day JavaScript challenge, inspired by the popular 30 days of JS. The results? Truly amazing!
Drum Kit player UI

Teaching LLMs to play the drums

May 12, 2024
In this experiment I created a text notation so ChatGPT, Claude.AI and Bard could create some music with it
A css stylesheet

Common CSS layouts in Tailwind

Jul 12, 2024
10 one-line layouts, meticulously reconstructed using Tailwind CSS classes

@2025 Juan Manuel Allo Ron. All Rights reserved