Open the [Command Palette] then select “Graphviz: Open Preview to the Side”.
Click icon on the editor panel to trigger
Default view is the full view of go mod graph
Select one mod, it will show the view of this dependency.
It shows like go mod why [mod]
Mouse wheel up / +
Mouse wheel down / -
Toggle 100% zoom
Mouse double click / Space
Mouse drag / Left / Right / Up / Down / A / D / W / S
Zoom to 100%
Move to center
There are three zooming modes: Fixed, Fit and Auto Fit.
Fixed: The zoom ratio does not change when the source changes or the window size changes.
Fit: The graph is scaled to align to the border of the visible view area.
Auto Fit: When the view area is big enough to contain a 100% sized graph, the graph will be set a zoom ratio of
100%, otherwise the graph is scaled to fit into the view area.
To export the generated graph, click the “Export” button on the top right corner.
string | null
null means to use the “dot” program in your PATH environment variable, or a string value to indicate the “dot” program you want to use.
"dot" | null
The layout engine to use. null means to use the “dot” layout engine. Currently, only the “dot” engine is supported.
Make sure the extension can find the “dot” program. You can set graphvizPreview.dotPath option to the path of the dot
executable, or make sure the directory containing the dot program is in your PATH environment variable.
To set the graphvizPreview.dotPath option, go to File → Preference → Settings.
The base code is forked from Graphviz-Preview, which is a extension to preview Graphviz (DOT) files