Smart diagram generation for more template diagrams

draw.io 20 Mar 2023

Share:

When you create a new diagram with the draw.io web editor, you can now choose to use our new smart diagram generator instead of one of our existing templates. Describe your diagram in a text phrase, and the tool will generate a diagram based on what it parses.
Generate diagrams of many different types from a text description via the template library in draw.io

As these generated diagrams have not been vetted by a human, there are no guarantees it will useful as a template for your particular diagram. But the generated diagram can serve as inspiration, or a starting point from which you can draw the diagram you actually need.

Tip: You can generate endless variations of a diagram from the same phrase.

Generate a template diagram in draw.io

  1. Create a new diagram - go to our online diagram editor - or click on + in the toolbar and select Template to insert a generated diagram.
  2. Click on the Generate box in the template library.
    Generate diagrams of many different types from a text description via the template library in draw.io
  3. Enter a basic description of your diagram in the text field, and press Enter or click OK.
    Generate diagrams of many different types from a text description via the template library in draw.io
  4. Click Insert or Create to add it to the drawing canvas.

Generate diagrams of many different types from a text description via the template library in draw.io

Make sure you write what type of diagram you want to generate at the start of the prompt. In this example, the prompt was:
sequence diagram - a customer purchases a product from a web store

You can also generate a diagram via the menu and the toolbar:

  • Use the shape search field above the Scratchpad - type in your prompt and select Generate.
    Generate diagrams of many different types from a text description via the search field in draw.io

  • Open the generate dialog via Arrange > Insert > Generate in the menu, or click on the sparkle tool, and then type in your prompt there.
    Generate diagrams of many different types from a text description via the menu and toolbar in draw.io

Tip: Hover over the generated diagram or click on the magnifying glass in the top right of the template preview or below the generated diagram to see a larger version before adding it to the drawing canvas.

You can now edit, add to, delete, and style the shapes and connectors in the generated diagram.


Different types of generated diagrams

Here are some different types of diagrams generated from the phrase “a customer purchases a product from a web store”.

Generate a flowchart from a text description via the diagram generate dialog in draw.io Generate a UML sequence diagram from a text description via the diagram generate dialog in draw.io
Generate a state diagram from a text description via the diagram generate dialog in draw.io Generate an entity relationship model from a text description via the diagram generate dialog in draw.io

Of course, that phrase won’t generate something useful for certain types of diagrams, like this Gantt chart.
Generate a Gantt chart from a text description via the diagram generate dialog in draw.io

And because the previous phrase makes no sense when describing a mindmap, here’s “types of technical diagrams for IT workers”.
Generate a mindmap from a text description via the diagram generate dialog in draw.io

Open all of these generated examples in a multi-page diagram in our diagram viewer

More ways to generate diagrams from text

In draw.io, there are many different ways to generate diagrams automatically from text.

  • Mermaid - all UML diagram types, as well as pie charts, flowcharts, organisation charts, Gantt charts, Sankey diagrams, pie charts and more.

  • Entity diagrams - from SQL code.

  • CSV data into diagrams - with formatting information to create flowcharts, mindmaps, org charts, directed graphs and more.

Troubleshooting generated diagrams

Some diagram types lend themselves more naturally to text descriptions. Flow charts, sequence diagrams and mind maps are easier to generate than git graphs from a text description.

As this tool is not a human and can not know what is logical to include in a diagram, there are no guarantees you will generate a diagram that is fit for purpose.

This feature uses a third party service to parse your phrase, and it can get somewhat overloaded at times.

  • Click Refresh if the Generation dialog process times out.

  • If the keywords in your phrase cannot be adequately parsed to generate a diagram, you may receive an “Diagram not found” error or a basic flowchart template. Try another descriptive phrase and regenerate your diagram.

Generated diagrams in draw.io for Confluence and Jira

Diagram generation features are disabled by default if you are using the draw.io app for Confluence Cloud. Ask your administrator to enable this option in the draw.io configuration.

Follow us on GitHub, Twitter, Facebook.

Share: