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. For example, this entity relationship model was generated from the phrase “a customer purchases a product from a web store”.
Generate diagrams of many different types from a text description via the template library in draw.io

As these smart generated template 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 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.
  3. Enter a basic description of your diagram in the text field, and press Enter or click OK.
  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

Alternatively, you can choose different types of diagrams and see different generated variations of the diagram in the Smart Templates section.

  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. Go to the Smart Templates section on the left of the template library.
    Generate a diagram from a text description via the template library dialog, or when you create a new diagram at draw.io
  3. Select the diagram type that you want to generate from the drop down list, then click Generate and wait for the preview to appear.
    Select the type of diagram that you want to generate in the template library in draw.io
  4. Click Generate again to generate a different diagram with the same phrase - you can do this as many times as you like. Here’s the same prompt as a sequence diagram.
    Click Generate to create a diagram from a text description in the template library in draw.iot
  5. Click Create if it’s a new diagram, or Insert if you are inserting a template.

Tip: Click on the magnifying glass in the top right of the preview to see a larger version of the generated diagram 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 template library in draw.io Generate a state diagram from a text description via the template library in draw.io
Generate a UML sequence diagram from a text description via the template library in draw.io Generate an entity relationship model from a text description via the template library 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 template library 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 template library 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.

  • PlantUML - class diagrams, state diagrams, activity diagrams, user diagrams, component diagrams and more.

  • Mermaid - all UML diagram types, as well as pie charts, flowcharts, organisation charts, Gantt 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 Try Again if the generation tool times out.

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

Smart templates in draw.io for Confluence and Jira

Smart templates are disabled by default if you are using the draw.io apps for Confluence or Jira Cloud. Ask your administrator to enable this option in the draw.io configuration.

Follow us on GitHub, Twitter, Facebook.

Share: