com.xpn.xwiki.plugin.graphviz
Class GraphVizMacro

java.lang.Object
  extended by org.radeox.macro.BaseMacro
      extended by org.radeox.macro.BaseLocaleMacro
          extended by com.xpn.xwiki.plugin.graphviz.GraphVizMacro
All Implemented Interfaces:
Comparable, org.radeox.macro.LocaleMacro, org.radeox.macro.Macro

public class GraphVizMacro
extends org.radeox.macro.BaseLocaleMacro

Macro used to invoke GraphViz and render its output on a XWiki page.

For it to work properly, you must have the GraphViz plugin enabled and configured. See the xwiki.plugin.graphviz.dotpath and xwiki.plugin.graphviz.neatopath parameters in xwiki.cfg.

The content of the macro is the source code for the graph, using the GraphViz DOT language.

The parameters are as follows:

  1. type: [dot] or neato. Specifies which engine will be used to produce the graph.
  2. title: Title attribute for the image (floating text box when you hover it). Do not specify it if you want to use GraphViz tooltip attribute. With the tooltip attributes you can generate different text values for different regions of the image.
  3. height: Image height in pixels.
  4. width: Image width in pixels.
  5. alt: Alternative text (alt attribute) for the image, in case it cannot be rendered by the browser.
  6. format: This attribute specifies what will be GraphViz output and also how it will be rendered in the HTML.
    The HTML output of the macro will be one of the following, depending on this attribute:
  7. useMap: true or [false]. If present and true, and if the output is an image, indicates that an image link map must be produced by GraphViz ("cmapx" format), and the IMG tag must reference it. Anonymous graphs will provoke errors if this attribute is true, so don't forget to name them. This parameter will have no effect if format specifies anything that doesn't produce an IMG tag to be rendered. SVG images can contain embedded links in the file itself, there's no need for an extra map tag.

Version:
$Id: 4a39ef9188cddf15fdb420bf97ad344274aab06a $

Field Summary
 
Fields inherited from class org.radeox.macro.BaseMacro
description, initialContext, paramDescription
 
Constructor Summary
GraphVizMacro()
           
 
Method Summary
 void execute(Writer writer, org.radeox.macro.parameter.MacroParameter params)
           
 String getLocaleKey()
           
 
Methods inherited from class org.radeox.macro.BaseLocaleMacro
getName, setInitialContext
 
Methods inherited from class org.radeox.macro.BaseMacro
compareTo, getDescription, getParamDescription, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphVizMacro

public GraphVizMacro()
Method Detail

getLocaleKey

public String getLocaleKey()

execute

public void execute(Writer writer,
                    org.radeox.macro.parameter.MacroParameter params)
             throws IllegalArgumentException,
                    IOException
Specified by:
execute in interface org.radeox.macro.Macro
Specified by:
execute in class org.radeox.macro.BaseMacro
Throws:
IllegalArgumentException
IOException


Copyright © 2004-2013 XWiki. All Rights Reserved.