Insert an image to use it as a template and rebuild the diagram in a top layer
View, Hide, and Lock specific layers
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.
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.
Open a new diagram and add another layer
Open the Layers dialog by clicking on View in the menu bar and selecting Layers.
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 the checkbox 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
Select the layer Level 1 – Template in the Layers dialog so the image is added to the right layer (layer is then highlighted blue).
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.
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.
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
Click on the Level 2 – Diagram layer to activate it.
Create the diagram using shapes, text and connectors.
Insert the two additional images (WD-40, fabric tape), that you downloaded earlier, resize and position them.
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.
Save the diagram.
When you have all layers visible in your diagram, it should look like this:
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.