Parameters
Macro Specific Parameters
Parameter | Default | Macro Browser Label | Description |
---|---|---|---|
showData | false | Show the rendered data | Shows the rendered body data after the graph. |
direction | TB | Direction of graph (rankdir) | Sets the graphviz rankdir parameter
|
node | Node parameters | Sets the graphviz node parameter. The default node attributes are taken from the default Flowchart Macro behavior. By specifying the node parameter, you can override these defaults or add additional default attributes. See the Graphviz Documentation for information on attributes and settings. | |
edge | Edge parameters | Sets the graphviz edge parameter. The default edge attributes aretaken from the default Flowchart Macro behavior. By specifying the edge parameter, you can override these defaults or add additional default attributes. See the Graphviz Documentation for information on attributes and settings. | |
replace | Replace variables | A comma separated list of key:value pairs that will be used to convert column values to attributes. If a column value for an attribute column matches one of the keys, the associated value will replace the column value. This makes it easy to associate attributes to column data. If more than one attribute needs to be specified for a key, enclose the value in a single quote so that the comma gets treated as a attribute separator. | |
tables | all | Table ids or numbers to include | Comma separated list of table ids and/or table numbers contained within the body of the macro that will be used as the data for the graph. |
columns | Column numbers to include | Allows selection of the columns of the table that will be used for the graph. It must be a comma separated list of 1 or more positive integers in any order. The default value of blank represents columns=1,2,3,4,5,6,7,8,9. If the table does not contain the column indicated, it will be ignored. For example, if columns=3,13 then column 3 will be used for the source node and column 13 will be used for the target node of the relationship. All other columns will be ignored. |
The following parameters are available with all Graphviz macros:
Macro editor label | Default | Description | Macro parameter |
---|---|---|---|
Template | Enables users to pick a pre-configured template and make simple changes as per their requirement. Since 3.2.
| template | |
Output type | png | Specifies the output type to be generated by Graphviz. Since 2.1.0.
| output |
Location of <type> source (Where 'type' includes Graphviz/ UML) | Specifies the source from where the macro reads the data.
Graphviz recognizes the commands only when you nest the commands under "noformat", "wiki-markup", "code", or "code-pro" macros, for the sources mentioned below:
| script | |
Show <type> markup code (Where 'type' includes Graphviz/ UML) | False | Shows the markup code, Graphviz or UML, below the generated graph. Useful for fixing syntax errors or to see the markup that is generated by macro processing or macros like the Space graph macro. | showCode |
Attachment name | Specify the name of the attachment to use, create or update. Use of attachments is optional but can be useful for linking from other places and to work with the Cache macro to improve display performance. Examples:
| attachment | |
Attachment version | new | Specifies how the generated graph is persisted as an attachment.
| attachmentVersion |
Attachment comment | Specify the comment on the attachment that is created or updated. | attachmentComment | |
Attachment versions to keep | Limits the number of attachment versions of a file that is attached to a page. If the maximum number of attachments exceeds the limit, then the oldest version is deleted. Since version 3.2. This parameter is only applicable if you select new from the drop-down list under Attachment version in the macro editor. | attachmentLimit | |
Thumbnail | False | Used when an attachment is specified, and output is PNG, JPG, or GIF. Renders graph as a thumbnail.
| thumbnail |
Render wiki markup macros in body | False | Used to render wiki markup macros found in the body before processing as Graphviz markup. This is useful to run macros from Scripting for Confluence or similar that can produce Graphviz markup as output. Since 3.2. This parameter is not available in the Graph from table and Space graph macros. | macros |
Layout | dot | Specifies which default layout algorithm to use. Since 3.2.
This parameter is not available in the PlantUML macro. | layout |
Profile | Specify a profile to be used with the macro. Administrators set up profiles to connect to other applications such as GitHub or GitLab. Profiles contain a basic set of parameters used to access a remote location such as the type of URL, user credentials, and so on. Some profiles may be restricted. Since 3.4.
| profile | |
URL to <macro> file (Where 'macro' includes Graphviz/ Diagraph/ Graph/ PlantUML) | Specifies the URL link to the Graphviz file. Administrators may restrict use. Since 3.2.
| URL | |
URL user (Removed) | Specify the user name to access the specified URL via basic authentication. Since 3.2. Removal notice Please note that the URL user and URL user password parameters were removed (see Deprecation notice: URL user and URL user password parameters). We recommend using profiles to access external data. | user | |
URL user password (Removed) | Specify the user password to access the specified URL via basic authentication. Since 3.2. Removal notice Please note that the URL user and URL user password parameters were removed (see Deprecation notice: URL user and URL user password parameters). We recommend using profiles to access external data. | password | |
URL connection timeout | Specify the time in milliseconds used to increase the wait time to access the specified URL on slower connections. Since 3.2. | timeout | |
File encoding | Specify the encoding of the file attachment if it is different from the Confluence default (like Windows-1252, UTF-8, MacRoman). Since 3.2. | encoding | |
Enable scroll bar | true | Used to enable scroll bar for the data generated by Graphviz. Since 3.4.1 | enableScroll |
Height of the scroll bar | 550px | Specify the height of scroll (applicable when scroll bar is enabled). Since 3.4.1 | scrollHeight |
For multiple macro sources (i.e. template, attachment, and URL), the order of precedence is URL > attachment > template.
Points to remember about profiles:
- Only raw URLs must be given in either, the URL field in profiles or the URL to Graphviz/Diagraph/Graph/PlantUML file field, in the macros. A raw URL is defined as the part of the URL following the domain information and includes the query string, if present. For example, in the URL string http://www.contoso.com/articles/recent.aspx, the raw URL is /articles/recent.aspx.
- It is recommended to specify absolute URLs to access files from public locations and to use profiles to access files from private sources. For example, a raw URL that can access a Graphviz file in a public Bitbucket repository is valid. But to render a file located in a private repository, we recommend using a profile.
- Profiles are a means to access and retrieve contents from external applications such as Bitbucket, GitLab or GitHub. A profile already contains the base URL and the required credentials (user credentials or an access token) to access the relevant application.
- This method allows multiple users to access a profile across pages and instances of the macro.
Parameters - all are optional
- displayData - Default is false. Set to true to show the rendered body data after the graph. This is useful to see the results of a sql macro for instance.
- showWiki - Default is false. Set to true to show the generated wiki markup that is rendered to show the graph.
- node - The default node attributes are: shape=rect, style=filled, fillcolor=lightyellow, fontname="Verdana", fontsize=9. The default attributes are taken from the default Flowchart macro behavior. By specifying the node parameter, you can override these defaults or add additional default attributes. See the Graphviz Documentation for information on attributes and settings.
- edge - The default edge attributes are: arrowsize=0.8. The default attributes are taken from the default flowchart macro behavior. By specifying the edge parameter, you can override these defaults or add additional default attributes. See the Graphviz Documentation for information on attributes and settings.
- direction - The default layout direction is top to bottom (TB). Set direction=LR to layout in a left to right direction. This is equivalent to the rankdir setting.
- columns - Allows selection of the columns of the table that will be used for the graph. It must be a comma separated list of 1 or more positive integers in any order. The default is columns=1,2,3,4,5,6,7,8,9. If the table does not contain the column indicated, it will be ignored. For example, if columns=3,13 then column 3 will be used for the source node and column 13 will be used for the target node of the relationship. All other columns will be ignored.
- tables - Comma separated list of table ids and/or table numbers contained within the body of the macro that will be used as the data for the graph. Defaults to all tables found in the body.
- replace - A comma separated list of key:value pairs that will be used to convert column values to attributes. If a column value for an attribute column matches one of the keys, the associated value will replace the column value. This makes it easy to associate attributes to column data. If more than one attribute needs to be specified for a key, enclose the value in a single quote so that the comma gets treated as a attribute separator.
- ... - All other parameters are passed through to Graphviz for setting any global Graphviz parameter. Some common examples are:
- ranksep - Separation in inches between nodes.
- bgcolor - Background color.
- size - Size specified as width, height in inches. Example: size="3,5".
Usage
Simple
{graph-from-table} | A | B | | A | C | {graph-from-table}
Relationship and node attributes
Note that headings are ignored
{graph-from-table} || heading 1 ignored || heading 2 ignored || | A node | B node | label="relationship 1", style=dashed | style=normal | fillcolor=lightblue | | A node | C node | | A node | D node | style=invis | {graph-from-table}
Multiple tables and using parameters
{graph-from-table:node=fillcolor=lightblue,fontsize=20|edge=style=bold,color=red| replace=key1:'style=dashed, color=blue', key2:style=invis|ranksep=2.0} | A node | B node | | shape=polygon,sides=8,peripheries=3 | | | A node | B node | | style=dashed | | A node | C node | | A node | D node | key2 | Here is a second table | E | F | key1 | | F | G | key1 | {graph-from-table}
Subgraphs - clusters
{graph-from-table:direction=LR|ranksep=1.5|node=fillcolor=lightblue,fontsize=20| edge=style=bold,color=red|replace=key1:style=dashed} | A node | B node | label="r1" | | | 100 | key1 | | F | G | key1 | | | 100 | label="cluster 100" | | X | Y | key1 | | | 200 | label="cluster 200" | 2000 | label="cluster 2000" | {graph-from-table}
Using SQL
{graph-from-table:direction=LR|edge=color=blue|displayData=true} {sql:dataSource=ConfluenceDS} select PARENTID, TITLE from CONTENT where PARENTID is not NULL {sql} {graph-from-table}
Screenshots
There are no images attached to this page. |