Discourse Graphviz

AI-generated summary

The Discourse Graphviz plugin, now included in Discourse core, enables users to create graphs in posts using the DOT language and the Viz.js library. To use it, users can wrap their graph code in [graphviz] bbcode tags, with an optional engine attribute (defaulting to ‘dot’). The plugin converts SVG previews to PNG when posts are cooked. While it is disabled by default, it can be enabled via site settings. tobiaseigen notes that self-hosting users should remove the plugin from their app.yml before upgrading. cmdntd reports an error with the latest version of Discourse, requiring the plugin to be disabled for a rebuild. Moin confirms the plugin’s inclusion in Discourse core.

:discourse2: Summary Discourse Graphviz provides the ability to add graphs to posts using the DOT language.
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

Features

This plugin uses the Viz.js library to render graphs.
To embed a graph use [graphviz] [/graphviz] bbcode. Optionally you can define layout engine attributes: [graphviz engine=neato]. If engine is not defined, it defaults to the dot engine.
See the Graphviz site for documentation and more examples.

Example

[graphviz engine=circo]
graph {
    a -- b;
    b -- c;
    c -- d;
    d -- e;
    e -- g;
    a -- g;
    a -- c;
    a -- d;
    a -- e;
    b -- d;
    b -- e;
    b -- g;
    c -- e;
    c -- g;
    d -- g;
}
[/graphviz]

Screenshot

SVG from the preview will get converted to png when post is cooked:

Note

:warning: This plugin is disabled by default, after installing be sure to enable it via site settings.

CHANGELOG

TODO

Last edited by @tobiaseigen 2025-07-16T21:36:06Z

Last checked by @tobiaseigen 2025-07-16T21:13:24Z

Check documentPerform check on document:
47 Likes

:partying_face: This plugin is now bundled with Discourse core as part of Bundling more popular plugins with Discourse core. If you are self-hosting and use the plugin, you need to remove it from your app.yml before your next upgrade.

4 Likes

This plugin has error in the latest version of discourse

I must disable this to rebuild app (discourse)

It’s was recently added to Discourse core

1 Like