Hi,
plan is to render a organization chart for my using the App "Graphviz". The data comes from SQL-Query using the App "SQL for Confluence".
The Macro "graph-from-table" doesen't work for me, because I need special formated objects/labels to display as you can see below.
The following data was generated in a Confluence User Macro using Javascript and stored on page in this html tag:
<p id="GVFINALDATA"></p>
Here is the Data from the Confluence User Macro:
digraph {
graph [fontname = "arial"];
node [shape = record, fontname = "arial"];
edge [fontname = "arial"];
"xxx"[label="{Namexxx|{Typ: xxx|ID1: xxx|ID2: xxx}}"];
"yyy"[label="{Nameyyy|{Typ: yyy|ID1: yyy|ID2: yyy}}"];
... more lines of labels ...
"xxx" -> "yyy";
... more lines of relations ...
}
I tested Velocity and also Javascript to generate the data. The problem is always the last step, copying the data into the body of the graphviz macro.
It works, if I hand over pre defined data using velocity (server site) to the Macro.
#set ($data = 'digraph { graph [fontname = "arial"]; ... more lines ...}')
<ac:structured-macro ac:macro-id="fe3a6021-d09b-495b-8079-7b33c223cba1" ac:name="graphviz" ac:schema-version="1">
<ac:plain-text-body><![CDATA[$data]]></ac:plain-text-body>
</ac:structured-macro>
But it doesent't work using Javacript at client site - I know it's to late, the page already exists.
So, the question is, how can I call the Macro "graphviz" using javascript on client site and passing the data into the body?
Or is it possible to use velocity in a new User Macro, which reads the data from the existing html paragraph like using "document.all.GVFINALDATA.innerHTML" in Javascript?
Many thanks for your help.
Reguards Jörg
Is Graphviz available as a Confluence plugin?
Yes, it is.
Graphviz Diagrams for Confluence
by Bob Swift Atlassian Apps (an Appfire company)
We use it on-premises, Server-Version.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've additional information but not the solution...
The following example works...
AJS.toInit(function() {
document.getElementById('GVOUTPUT').innerHTML = '$action.getHelper().renderConfluenceMacro("{cheese}")';
})
But not the one with the Call for the "graphviz"...
AJS.toInit(function() {
document.getElementById('GVOUTPUT').innerHTML = '$action.getHelper().renderConfluenceMacro("{digraph:"Test XXX Test"}")';
})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.