chialiyun / DiagramsPreviewerVSCExt

Visual Studio Code Extension to preview Diagrams (Diagram as a Code)
MIT License
6 stars 0 forks source link
visual-studio-code-extension

Diagrams Previewer extension for Visual Studio Code

An extension to preview Diagrams (Diagram as a Code) while editing the code in VSCode.

Features

Usage

The extension can be activated with

  1. Toggle Preview (Command+Shift+P for Mac, Ctrl+Shift+P for Windows)
  2. Command Preview Diagrams to load the diagrams on a separate window on the right

Configurations

We provide the following settings to the extension:

type default
diagramspreviewer.pythonCommand string default 🆕 option: "VS Code Python Interpreter". This option will use the interpreter set on VS Code's python extension and it will be applicable to any platform (Windows / Mac).

The other options will only apply to Mac platform.

Requirements (Set up)

Make sure you have installed the following before activating the extension:

Windows

Mac

Demonstration

Demonstration GIF

Source Code Example:

from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB

with Diagram("Web Service",show=False): # It is recommended to set "show" to false to prevent the pop out of the diagram in your image viewer
    ELB("lb") >> EC2("Production") >> RDS("Accounts")
    ELB("lb") >> EC2("UAT") >> RDS("Accounts")
    ELB("lb") >> EC2("Dev") >> RDS("Accounts")

Release Notes

Please refer to CHANGELOG.md.

Show Support

If you find this extension helpful, please star the repo and leave a review to help others find it easily too!

You may buy me a coffee if you would like to show some support in my open-source journey. It will be greatly appreciated! 🥰

Buy Me A Coffee