draw.io Training – Exercise 7: Create a diagram with layers and images

By |2023-02-08T12:20:54+01:00May 11th, 2021|learning|
Reading Time: 9 min

What you are going to learn in this tutorial

  • Create, Rename, and Rearrange layers in draw.io
  • Insert an image to use it as a template and rebuild the diagram in a top layer
  • View, Hide, and Lock specific layers
  • Delete layers

Introduction

Building your diagram by using layers allows you a lot more flexibility – you can switch between different views of your diagram, group related elements and protect them from being modified when you work in a different layer.

You can display all of the layers at once, or switch them off individually – they are still in your diagram, just hidden. In this exercise, you’ll create a diagram in a top layer, following an image ‘template’ that you paste into the background layer.

Tutorial

Download all of the images you need for this tutorial

Use the following images to help you build your layered diagram. Right click on each image to save them to your computer.

Engineering Flowchart - template imageFabric tapeWD-40

Open a new diagram and enable layers

In the Diagram editor, open the Layers dialog by clicking on View in the menu bar and selecting Layers.

In the Board editor, open the layers dialog by clicking on Hamburger in the menu bar and selecting Layers. The Hamburger icon is shown here, highlighted by the orange circle.

Add another layer by using the plus icon in the Layers panel dialog.

  • Layers are arranged hierarchically. If the level is located at the top of the list, it also overlaps above all other layers.
  • To show or hide a layer, click on the eye icon next to the layer’s name.

Double click on the name of a layer (in the Layers dialog) to rename the layer.

  • Rename the top layer Level 2 – Diagram
  • Rename the bottom layer Level 1 – Template

Insert an image to use it as a template

  1. Select the layer Level 1 – Template in the Layers dialog so the image is added to the right layer (layer is then highlighted blue).
  2. Drag & Drop the engineering flowchart image you downloaded on your drawing canvas. The image will automatically be added to the template layer. Alternatively you can use the plus icon in the toolbar, and select Image. When you now select the image, a black dot in the Layers panel tells you, if you added it to the correct layer.
  3. Select the image and reduce the opacity following Format panel > Style tab > Opacity to 30%. This makes it easier to differentiate between your template layer and the final diagram you are about to build.
  4. When you are done, click on the lock symbol of the Level 1 – Template layer to lock it. You won’t be able to make changes to a layer after it has been locked. Click again to unlock.

Create your diagram

  1. Click on the Level 2 – Diagram layer to activate it.
  2. Create the diagram using shapes, text and connectors.
  3. Insert the two additional images (WD-40, fabric tape), that you downloaded earlier, resize and position them.
  4. Disable the display of the Level 1 – Template layer. You can also select the layer and click on the trash bin symbol in the layer dialog if you like.
  5. Save the diagram.

When you have all layers visible in your diagram, it should look like this:

Engineering flowchart with layers

When to also use layers

Layers are an essential feature if you want to create interactive diagrams. With layers you can e.g. build a button navigation and show/hide shapes via mouse click.

Infographics are best built in layers – that way you can work on a specific section without risking that you move or change something in the rest of the diagram. Read more about creating infographics in draw.io.

Be sure to check out our Youtube playlist on layers to learn all about layers and the layer dialog panel. You are well on your way to becoming a draw.io diagramming expert! Next up, let’s make our diagrams interactive with links and tooltips.

Tutorial exercise 8: Adding links and tooltips to your diagram

Share This Story, Choose Your Platform!

About the Author: