Setting up Draw.io

Draw.io

Context

ASAM uses Draw.io for creating custom diagrams for standards and documentation. The user can choose to use the web access (recommended) or install the software locally. ASAM provides a custom Draw.io library which contains custom standard image elements and visualization structures that can be reused in new diagrams. To be able to access the ASAM asset library, follow the instructions below.

Result

The user can access Draw.io with the ASAM asset library connected to create and edit diagrams.

Prerequisites

How

Draw.io can be used either locally (through the dedicated app 'Draw.io Desktop' or through the 'Visual Studio Code Extension') or online through the Draw.io web app.

  • Remote setup

  • Draw.io Desktop app

  • Draw.io VSCode extension

The use of Draw.io through the web browser does not require any setup.
Just use the provided link.

  1. Download the app from here.

  2. Check out the asset library repository

  3. Open the draw.io app and either create a new diagram or open any existing one

  4. Click File  Open Library…​

  5. Select the xml file from the asset library repository (local) and click Open.

drawio import library
Figure 1. Import ASAM Draw.io library into Desktop.

The Draw.io extension for Visual Studio Code allows for easy creation and assisted editing of drawio and other files supported by Draw.io within Visual Studio Code. For shortcuts and tips, see the documentation of the extension. You can access this documentation when you click on the extension in the marketplace.

Search and find the extension 'Draw.io Integration'
Figure 2. Draw.io Integration (id: hediet.vscode-drawio)
The Draw.io extension does not support remote custom libraries as of now. For this reason, it is recommended to create and make larger edits to drawio files through the web app.
At this time, the VS Code extension does not provide url links to libraries. The only option to add the library is to download a copy and add it manually.
  1. Install the drawio extensions in VSCode

  2. Check out the asset library repository

  3. In Visual Studio Code, access the extension settings for Draw.io Integration and open the 'settings.json' file

  4. Add the following lines and replace <<filepath/filename>> with the path to the downloaded library file (.xml):

        "hediet.vscode-drawio.customLibraries": [
            {
                "libName": "ASAM Standard Library",
                "file": "<<filepath/filename>>",
                "entryId": "ASAM"
            }
        ],
    Remove the comma after the last bracket ("]") if there is no other line before the closing curly bracket ("}").
  5. Activate the library from any drawio file through "More Shapes…​", selecting the ASAM Standard Library and confirming the selection

drawio import library vscode
Figure 3. Import ASAM Draw.io library into VSCode extension.