~ draw.io Tutorial ~

draw.io interface with BITS Corporation ER diagram

draw.io direct link: https://www.draw.io/ or https://app.diagrams.net/

For the data and privacy conscious: https://diagram.new

Table of Contents

What is draw.io?

draw.io is a free, online diagramming tool that we will use to create ER diagrams.

Authorize draw.io to Google Drive

For file management purposes, I recommend that you link your hawaii.edu Google account with draw.io so all your work is automatically saved to your Google Drive. If you do not want to link your hawaii.edu Google account with draw.io, you can use this link instead: https://diagram.new. However, you will need to actively download and upload diagrams if you need to make edits to your diagrams in the future. See the No Permissions for draw.io section.

After authorizing draw.io to your Google Drive, you can revoke the permissions to draw.io at any time, see the Managing Google Permissions section.

  1. Go to https://www.draw.io/.
    You will be presented with this menu:
    where to save menu
  2. Click on Google Drive.
  3. A small dialog box will appear:
    authorize draw.io to your google account
  4. Click on Authorize
  5. A small pop-up will appear:
    blank sign in
  6. Enter your full hawaii.edu e-mail address, then click Next.
    Your full hawaii.edu e-mail address includes the @hawaii.edu. For example, mine is emeyer@hawaii.edu.
    filled in sign in
  7. You will be taken to the UH system login page, proceed to login with your UH username and password.
  8. After logging in, you will be asked to sign in to draw.io using your Google account.
    Click Continue.
    authorize draw.io to your google account
  9. In the next window, click on Select All. This will make it easier to save, open, and edit diagrams on draw.io from your Google Drive. Then click Continue.
    draw.io permissions to your Google Drive
  10. You can always change your permissions after this class, see the section Managing Google Permissions.
  11. Then you'll be presented with this menu:
    create new or open existing diagram
  12. Now, when you go to draw.io, you'll be able to start a new diagram or open an existing one from your Google Drive. You can also open any draw.io files directly from your Google Drive instead of having to go to draw.io.

Managing Google Permissions

If you no longer wish to grant draw.io permission to your Google Drive, use this link: https://myaccount.google.com/connections

Click on draw.io, then click on Delete all connections you have with draw.io, then Confirm

You can also manage permissions for all third-party add-ons at the link above.

(Back to Top)

Light Mode / Dark Mode Appearance

By default, draw.io uses the mode you have set on your local computer. If you wish to toggle between Light Mode and Dark Mode, use the Appearance toggle in the upper right hand corner of the draw.io application.

appearance toggle for light mode and dark mode

(Back to Top)

Create New Diagram

Note: The following steps assume you have linked your hawaii.edu Google Drive with draw.io.

  1. Go to https://www.draw.io/.
  2. Click on Create New Diagram.
  3. You will be presented with this menu:
    new diagram dialog box
  4. Give your diagram a name.
    For example:
    diagram name BITS Corporation
  5. Click Create.
  6. You'll be taken into the draw.io application. Next, go to the File menu, then click Save.
    You should be presented with the following:
    where to save the diagram window
  7. You can use the Where drop-down menu to choose where in your Google Drive to save the diagram. Leaving the option on Google Drive - My Drive will save directly in your Google Drive.
  8. After choosing where to save the diagram, click Save.
  9. As you make changes to the ER-diagram, draw.io will automatically save your progress at each change, much like using Google Doc.
    draw.io interface ready to work

(Back to Top)

draw.io Main Interface

(Back to Top)

Landscape Orientation

To ensure there is enough room on the drawing area for ER-diagram, it is best if the orientation is set to Landscape.

setting drawing area orientation to landscape

Entity Relation Shapes

All the relevant shapes that are needed to create an ER-diagram from scratch can be found in Entity Relation and the UML category. Depending on your screen size, you may need to scroll down through the shape categories on the left side.

shapes in the Entity Relation and UML sections

Creating an Entity

To create an entity, use the following shapes:

  1. Title - for the name of the entity (Found in the UML category)
    title shape in the UML category
  2. Entity - for the attributes of the entity (Found in the Entity Relation category)
    entity shape in the Entity Relation category

Add both to the drawing area and position the Title shape above the Entity shape as shown:

Example Consultant Entity

After creating the entity, you may want to group the title with the entity shape. Select both the title and entity shape, then right-click and choose Group or Ctrl+G. The advantage of doing this is that you can duplicate the entity to create another one instead of starting from scratch. Also, if you need to re-position the entity on the drawing area, you don't have to keep selecting both the title and entity shape.

Video Example Independent Entity (Consultant Entity)

Video Example Dependent Entity (OrderLine Entity)

(Back to Top)

Creating a Relationship

To create the relationship line between 2 entities, use an appropriate relationship line. It actually doesn't matter which you initially choose because you can modify the cardinality symbols later.

Since the most common relationship is 1 to Many, choose that shape.

selecting the 1 to many relationship shape

Attach the ends of the relationship on the border of its respective columns. You should feel the line snap to the side of the entity. The snap is successful if you move the entity shape, the relationship line should also move. If the relationship line does not move with the entity, try again to attach the relationship line to the border of the entity. Be sure to place the line adjacent to the appropriate column name, do NOT place it randomly along the border of the entity.

Example Consultant-Client Relationship, 1 to Many using Crow's foot notation

The relationship between Consultant and Client is a non-identifying relationship. The relationship line is dashed instead of solid.

The Consultant and Client entities are independent entities, therefore the relationship between them is non-identifying. Non-identifying relationships are signified by a dashed line.

A relationship between an independent (sharp rectangle) and dependent (rounded rectangle) entity is an identifying relationship. Identifying relationships are signified by a solid line. For example, the relationship between WorkOrders and OrderLine is an identifying relationship.

Video Example Non-Identifying Relationship (Consultant-Client)

Video Example Identifying Relationship (WorkOrders-OrderLine)

(Back to Top)

ER-Diagram Title

Finally, add a title to your ER-diagram.

Use the Title shape. Use a big font size, such as 35pt, and center the title at the top of the diagram.

Helpful Tips

(Back to Top)

Exporting Your Diagram

When you are done creating an ER-diagram, export it to an output format. By default, draw.io does not save using an output file format. An output file format is a .pdf or .png. Export your ER-diagram to your computer so you can distribute the ER-diagram or submit to Laulima.

  1. Click on File menu.
  2. Go to Export as.
  3. Choose PDF...
  4. You will be presented with this menu:
    • Selection Only - will export only what you have currently selected. This option is disabled if nothing is currently selected.
    • Crop - the smallest area containing everything
    • Grid - add the gridlines to the export
    • Include a copy of my diagram - allows the output file to be re-uploaded to draw.io for further edits
    • Transparent Background - allows the background to be transparent if not filled in. Leaving this unchecked will fill the background with white.
  5. Use the same options shown in the picture above.
  6. Click Export.
  7. You will be presented with this menu:
    where to save the pdf
  8. In the Where: drop-down, choose Device.
  9. Click on Save.
  10. Depending on your browser settings, your browser may download the PDF directly to your Downloads folder, or ask you where to save the PDF.
  11. To turn in the ER-Diagram for the assignment, locate the PDF on your computer and upload it to Laulima.

(Back to Top)

No Permissions for draw.io

If you don't want to give draw.io permission to your Google Drive, you will need to manually download the .xml or .drawio file as well as the output file format (ex. pdf). The source file (the file that will allow you to edit the diagram later) will either be an .xml or .drawio file.

  1. Go to https://www.draw.io/.
  2. Save diagrams to: choose Device.
  3. If you are creating a new diagram, click Create New Diagram.
    • Give your ER-diagram a name.
  4. If you are editing an existing diagram, click Open Existing Diagram.
    • Navigate to where the file is located on your computer and open it.
  5. Make the necessary edits or create your ER-diagram from scratch.
  6. Follow the steps in Exporting Your Diagram.

(Back to Top)

BITS Corporation ER-Diagram Example

The exported PDF of the ER-diagram can be found here. Feel free to upload the PDF to draw.io and play around with it.

(Back to Top)