splitbrain / dokuwiki-plugin-graphviz

Create Graphviz graphs from within DokuWiki
http://www.dokuwiki.org/plugin:graphviz
12 stars 15 forks source link

svg graphs and links #12

Closed EugeneKiver closed 9 years ago

EugeneKiver commented 9 years ago

Is there a way to get svg graphs with hyperlinks using graphviz? GraphViz plugin for mediaWiki has this functionality as well as documentation on how to enable it. I was looking for something similar for dokuwiki for several days, but haven't found anything. I'm currently getting png images, without any hyperlinks functionality.

MichaelKling commented 9 years ago

Checkout this pull request: https://github.com/splitbrain/dokuwiki-plugin-graphviz/pull/5

I implemented that support in this fork https://github.com/ascendro/dokuwiki-plugin-graphviz 3.5 years ago. Unfortunatly splitbrain only did minor commits regarding translation and comments and did not react to it.

EugeneKiver commented 9 years ago

Thank you very much Michael, I came across your posts in pull request #5 previously but I wasn't able to make use of it, again due to the lack of examples or documentation (but mainly lack of wiki knowledge).

Can you please provide the example, because Im not sure where to put -Tcmap command. So what I've done (I'll be specific in my steps to possibly save some time for other people who also new to dokuwiki and its plugins) :

  1. Uninstall the official graphviz if you have it 1.1 Go to Admin panel in your dokuWiki 1.2 Open Extension Manager 1.3 In installed plugins tab, find graphviz and click uninstall
  2. Install Michael's fork 2.1 Go to https://github.com/ascendro/dokuwiki-plugin-graphviz 2.2 Press "Download ZIP" button on the right 2.3 Open Extension manager again (in Admin panel) 2.4 Open Manual Install tab 2.5 Press Browse button in Upload Extension field and select downloaded file in step 2.2 2.6 Press install button 2.7 You should see green notification on the top saying something like "Successfully installed"
  3. Add graph to wiki page (edit and save page) (I believe this is where I'm wrong)

<graphviz dot -Tcmap> digraph graph_name { node1 [URL=”http://www.google.com”] node1 -> node2 }

Thank you

MichaelKling commented 9 years ago

In the dokuwiki administration -> settings -> plugin settings you need to set the path to your dot tool For example: /usr/bin/dot

If you do not know wher dot is located run "which dot"

If you do not have dot run "apt-get install graphviz" (on ubuntu systems) or google

Now in your wiki page You need to put your graphivz syntax into Tags.

For example:

===== Link Test ====

<graphviz>
digraph G {
node1 [URL="http://www.google.com"]
node1 -> node2
}
</graphviz>
EugeneKiver commented 9 years ago

Thank you! It works now.