Graphviz Diagram PreviewAdds Graphviz (DOT) support to VS Code's built-in Markdown preview. Diagrams are drawn by graphviz-renderer, the same library that renders Graphviz on reonarudo.github.io. Requires VS Code 1.101 or later; older versions stay on 0.1.0. Write DOT source in a fence tagged
Only
Fence attributesAn optional attribute block after the tag adjusts how one diagram is presented:
Values are quoted. A mistyped or malformed attribute never costs you the diagram: it is ignored, and a note is written to the Graphviz Diagram Preview output channel.
Viewing the sourceEvery diagram carries a small button in its top corner that flips the fence between the diagram and the fence's text, highlighted the way the preview shows any other code block. A flipped fence stays flipped while you edit the document, after Markdown: Refresh Preview, and when the preview is reopened; flip it back to see the diagram again. The button is a reader's control: a fence cannot be written to open in source view. Errors and limitsA DOT syntax error is shown in place of the diagram, with the offending source line. Layout is limited to 3 seconds per diagram and 64 000 characters of source; a graph that takes longer shows a timeout message until its source changes. Graphviz warnings (unknown shapes, fonts without metrics) go to the output channel. Links ( FontsGraphviz measures text with built-in width tables, so labels fit their shapes
only for these families: Times / Times New Roman, Helvetica / Arial,
Courier / Courier New, DejaVu Sans, Consolas, Nunito, Trebuchet. Other fonts are
measured as Times, and a warning is written to the Graphviz Diagram Preview
output channel. Name a single family — a CSS-style list such as
DevelopmentRequires Node 22 or newer (see
LicenseMIT for this extension; Graphviz, shipped inside graphviz-renderer, is EPL-2.0 — see THIRD_PARTY_NOTICES.md. |

