Using Draw.io in VSCode
Sometimes flowcharts and diagrams can be helpful for documenting your code. A great solution for editing diagrams in VS Code is Draw.io.
There is a VS Code plugin for Draw.io that allows you to edit diagrams in VS Code. You can install it by going to Extensions in the File menu and searching for Draw.io for VS Code.
The best image format to use is .svg. If you are using a Mac, you can use the File > Export Image menu item to export the diagram to a .svg file. Save the file into your project folder. Then you will be able to edit the file in VS Code using the Draw.io plugin.
The following diagram shows an example that was created using Draw.io.
Steps
- Install Draw.io
- Install the Draw.io plugin for VS Code
- Create a blank diagram
- Save the diagram as a .svg file in your VS Code project folder
- Open the .svg file in VS Code and make changes to the diagram
- Include a reference to the .svg file in your markdown file like this:
![diagram01](./diagram01.drawio.svg)