To render a graph inline in your post, wrap the graph definition in dot tags like this:
[dot] digraph {a -> b} [/dot]
The block form is also supported:
[dot]
digraph {
a -> b
}
[/dot]
Animated transitions between graphs
An animated transition between multiple graphs is shown when more than one graph is added to the same paragraph of a post and there is only whitespace between them:
[dot] digraph {bgcolor=lightblue a -> b} [/dot]
[dot] digraph {bgcolor=lightblue a -> b; a -> c} [/dot]
[dot] digraph {bgcolor=lightblue a -> b; a -> c; b -> c} [/dot]
or
[dot]
digraph {
a -> b
}
[/dot]
[dot]
digraph {
a -> b
a -> c
}
[/dot]
[dot]
digraph {
a -> b
a -> c
b -> c
}
[/dot]
Paragraphs are separated by blank lines, so this will generate three separate graphs:
[dot] digraph {bgcolor=lightblue a -> b} [/dot]
[dot] digraph {bgcolor=lightblue a -> b; a -> c} [/dot]
[dot] digraph {bgcolor=lightblue a -> b; a -> c; b -> c} [/dot]
@pfaffman Apologies for not seeing this post and acting on it earlier. I must have turned off notifications by mistake. I noticed this problem myself back in the day, but hadn’t time to deal with it then, didn’t remember that I had posted this and wasn’t aware of anybody else using it.
I installed this component, (Discourse 3.2.1)
copied the example above into a new post, it does not render as a graph,
could someone confirm, if this one works now, thanks…
this is caused by “Content Security Policy” thing…
not sure what to add in “content security policy script src” setting to make it work… could someone help, thanks…
thanks @Arkshine
our hosted instance does not include the graphviz plugin for the plan
tried adding these 3 files into the " content security policy script src" setting, it does not work…
If you are satisfied with single static graphs, the discourse-graphviz-theme-component is probably enough, but if you want to use animated transitioning between graphs and be able control various aspects of the graph rendering, you might want to try the D3 Graphviz Theme Component. You can see it in action at:
hey, @magjac
I’d like to try the D3 one for animation, but I got the issue above with the content security policy thing as posted above, some settings change to make it work ?
our instance is on 3.2.1 now. thanks…