com.xpn.xwiki.plugin.graphviz
Class GraphVizMacro
java.lang.Object
org.radeox.macro.BaseMacro
org.radeox.macro.BaseLocaleMacro
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:
- type: [dot] or neato. Specifies which engine will be used to produce the graph.
- 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.
- height: Image height in pixels.
- width: Image width in pixels.
- alt: Alternative text (alt attribute) for the image, in case it cannot be rendered by the browser.
- 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:
- object html tag for: svg, svgz.
- The text as output by GraphViz for: canon, dot, xdot, imap, cmapx, imap_np, cmpax_np, plain, plain-ext. Remember
that for some of these formats, like cmpax and cmapx_np, the text will actually be HTML code.
- img html tag for anything else. Caution: Not all formats supported by GraphViz can be referenced by an IMG
tag. Depending on the format you choose this macro may not produce a valid result.
- 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 $
Fields inherited from class org.radeox.macro.BaseMacro |
description, initialContext, paramDescription |
Methods inherited from class org.radeox.macro.BaseLocaleMacro |
getName, setInitialContext |
Methods inherited from class org.radeox.macro.BaseMacro |
compareTo, getDescription, getParamDescription, toString |
GraphVizMacro
public GraphVizMacro()
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–2014 XWiki. All rights reserved.