Det här tillägget har inte testats med någon av de 3 senaste huvudversionerna av WordPress. Det kanske inte längre underhålls och kan ha kompatibilitetsproblem när det används tillsammans med nyare versioner av WordPress.



GraphViz is a powerful tool for visualising network and tree structures that connect objects.

This WordPress plugin provides a shortcode mechanism to create GraphViz graphics within blogs, using the shortcode mechanism.

It’s working is based on the viz.js code as provided by Mike Daines:

Special thanks goes to chrisy as author of TFO Graphviz, e.g. for providing the inspiration for this readme:

How to use WP GraphViz

The shortcode syntax is:

[wp_graphviz <options>]
 <DOT code>

Where <options> is anything from this list. All are entirely optional:

  • id="<id>"

    Provides the identifier used to link the generated image to an image map. If you use the simple option then it also provides the name of the generated DOT graph container (since GraphViz uses this to generate the image map). If not given then an identifier is generated with the form wp_graphviz_N where N is an integer that starts at one when the plugin is loaded and is incremented with use.

  • output="<png|gif|jpg|svg>"

    Indicates the desired image format. Defaults to png.

  • simple="yes|no"

    The simple option provides a very basic DOT wrapper around your code such that the following is possible:

    [wp_graphviz simple="yes"] a -> b -> c; [/wp_graphviz]

    The generated code would look like:

    digraph wp_graphviz_1 {
        a -> b -> c;

    See the id option for a description of where the name of the digraph comes from. simple defaults to no.

  • title="<title>"

    Indicates the title of the image. This is used in the alt and title attributes of the image reference. This defaults to an empty string. Note that image maps may indicate a title string which will appear in tool-tips.


  • This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets directory take precedence. For example, /assets/screenshot-1.png would win over /tags/4.3/screenshot-1.png (or jpg, jpeg, gif).


  1. Upload wp-graphviz.php to the /wp-content/plugins/ directory
  2. Activate the plugin through the ’Plugins’ menu in WordPress
  3. Use shortcode [wp_graphviz]<dot code>[/wp_graphviz] in your posts or pages

Vanliga frågor

What is GraphViz?

GraphViz is a way of generating visualisations of structural relationships between objects.
Almost any kind of diagram where something connects to something else can be drawn and automatically laid out using the DOT language.

How do I use this plugin?

Use the [wp_graphviz] shortcode. Various uses are explained in the ”How to use” section.

How do I write DOT?

The online documentation for GraphViz is terse and not especially helpful, in particular the DOT language page is only helpful if you happen to be able to read an approximation of BNF.

There are however several other introductions to Graphviz and DOT, including an excerpt on the O’Reilly site.
Another approach would be to look at the examples in the Graphviz gallery.

If in doubt, find an example and experiment with it.


10 februari 2018
I tried the 2 other available GV plugins. Only this one: – generates svg (plus png of course) which is a must for me, – accepts complete existing dot files (I have a lot of those, and I’d rather not spend time ”simplifying” them), – doesn’t put its (c) mark at the bottom of every graph (one of the others did, quite an intrusive self promotion), – is self contained (one other relies on a binary GV installation, but can’t find the executable because php runs chrooted here). THANKS to the author!
Läs alla 3 betyg

Bidragsgivare och utvecklare

”WP-GraphViz” är programvara med öppen källkod. Följande personer har bidragit till detta tillägg.

Bidragande personer

”WP-GraphViz” har översatts till 1 språk. Tack till översättarna för deras bidrag.

Översätt ”WP-GraphViz” till ditt språk.

Intresserad av programutveckling?

Läs programkoden, kika på SVN-filförvaret eller prenumerera på utvecklarloggen via RSS.



  • Tested for WordPress 6.2.2.


  • Tested for WordPress 5.4.


  • Tested for WordPress 5.0.


  • Replaced viz.js with viz-lite.js to reduce footprint only supporting dot and svg options.
  • Fixed shortcode handling keeping only those that work with viz-lite.
  • Disabled wptexturize for WP_GraphViz shortcode.
  • Formal version, tested for WP 4.7.4.
  • Fixed translations.


  • Fixed translation handling using localization functions.


  • Formal version, tested for WP 4.6.1.
  • Added shortcode parameters.


  • Formal version, tested for WP 4.0.
  • Added icon-128×128.png to support plugin icons.


  • First formal version, improved reference data.
  • Updated the viz.js library to latest version.


  • First version starting the plugin.