Table of Contents
mindmap Plugin
Compatible with DokuWiki
2011-05-25, 2012-01-25
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to graphviz
This plugin allows you to turn your DokuWiki namespaces into mindmaps.
The output of the mindmap can be:
- a PNG image, using Graphviz dot graphs
- an XML file using the Graph Exchange XML Format
Requirements
Google Chart Tools
Per default, the Graphviz dot output is sent to the Google Chart Tool Graphviz Charts, which turns the dot format into a PNG picture. It is possible to use your own Graphviz dot binary by setting the configuration parameter 'path'.
If you do not use your own binary, the plugin will only be able to render the PNG image with a connection to Google.com. This is the default setting.
Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
How it works
Using the syntax parameters, a list (including in-between linkage) of pages and (optionally) media is gathered. Depending on the configured format, this data list is turned into a PNG image or an XML file.
Per default, the output is a dot graph, which will be turned into a PNG image using the Google Chart Tools API or, optionally, via your own Graphviz binary.
If you selected Graph Exchange XML Format, the page/media list will be turned into an XML file, which can be interpreted by tools such as Gephi.
Example / Usage
{{mindmap>dokuwiki#depth=3}}
This will get all pages within the dokuwiki namespace up to 3 levels deep and turn it into a dot graph.
{{mindmap>dokuwiki#depth=3&format=gexf}}
This will get all pages within the dokuwiki namespace up to 3 levels deep and turn it into Graph Exchange XML Format file.
{{mindmap>dokuwiki,plugin#depth=3}}
This will get all pages within the dokuwiki and plugin namespaces up to 3 levels deep and turn it into a dot graph.
Demonstration
View the Online Demonstration
Syntax
{{mindmap>namespace[,namespace]#key=value[,key=value]}}
namespaces | Namespaces for which to create the Mindmap. | required |
---|---|---|
key | the parameter key to set | optional |
value | the parameter value to set | optional |
You can set more than one element at once by using an &
delimiter.
Available parameters
Key | Type | Comments | |
---|---|---|---|
depth | number | Determines how deep the plugin should look for links between pages. | optional |
format | string | Determined the ouput format of the mindmap. Available values: dot, gexf'. Default: dot. | optional |
include_media | string | This allows you to include media files in your mindmap. Available values: ns for namespace, all* for all, none* for none (Default). It is recommended this is not used when depth > 0. | optional |
height | number | Allows you to set the output height. Default: 0 (ignore). | optional |
width | number | Allows you to set the output width. Default: 0 (ignore). | optional |
use_cached_pages | onoff | Allows you to determine if only cached pages are regarded or if the cache should be rebuilt. Important Depending on the number of pages that are available in your namespaces, and the depth that you have selected, it can be very costly to turn this parameter off. Available values: 1 for on (Default), 0 for off. | optional |
Configuration and Settings
Key | Type | Comments | |
---|---|---|---|
graphviz_path | string | The path to your local graphviz dot binary (eg. /usr/bin/dot ). Leave empty to use remote rendering at google.com. | optional |
use_plugin_path | onoff | Set this if you wish to manually set the path of the plugin. This may be necessary if you use .htaccess nice urls to fix broken images/links. | optional |
plugin_path | string | The path of the mindmap plugin (eg. http://yourwiki/lib/plugins/mindmap). The path can also be relative to a page you are displaying (eg. lib/plugins/mindmap/ ) | optional |
Deprecated parameters
Key | Type | Comments |
---|---|---|
path | string | The path parameter in Version 1.0 was renamed to 'graphviz_path' in Version 1.0 |
Acknowledgements
I used the graphviz Plugin by Carl-Christian Salvesen and Andreas Gohr for reference.
Development
Change Log
- 2011-10-11: Version 1.1
- Removed caching of files.
- dot and png files are no longer cached.
- Images are no longer resized no the server.
- Configuration parameter 'path' was renamed to 'graphviz_path' to avoid missunderstanding.
- Images are now shown using the configured 'height' and 'width' parameters. A link to the original image is added if the 'height' or 'width' parameter is set.
- 2011-10-08: Hotfix (updated original Version 1.0)
- I added two configuration parameters ('use_plugin_path' and 'plugin_path'), which enable you to modify the location of the mindmap plugin manually. This can be used to fix broken images/links if you are using .htaccess nice urls.
- 2011-10-07: Version 1.0
- Initial release
Known Bugs and Issues
- dot path do not work, replace path with graphviz_path:
if ( $this->getConf('graphviz_path') ) { // Local build $cmd = $this->getConf('graphviz_path');
- Vielleicht ein Fehler in syntax.php und im Browser Aufruf.
Hallo,ich versuche, das Tool seit einiger Zeit zu nutzen, aktuell scheitere ich allerdings an einigen vermutlichen Fehlern oder mache etwas anderes falsch. Deshalb suche ich jetzt einmal hier Hilfe. Grundsätzlich finde ich die Idee des Plugins klasse, und möchte es deshalb gerne nutzen.
Folgendes Problem: wie oben beschrieben, habe ich in der syntax.php Änderungen vorgenommen. Zeile 247 geändert in $cmd = $this→getConf('graphviz_path'); Nach Aufruf meldete der Apache Server immer einen invalid/missing Parameter -K beim Aufruf von dot. Ich bin nach Recherche darauf gestoßen, dass Zeile 249 m.E. noch einen weiteren Fehler enthält. $cmd .= ' -K'.$data['layout']; habe ich geändert in $cmd .= ' -K'.$data['format'];
Nach dieser Änderung verschwand der Fehler in meiner /var/log/apache2/error_log.
Leider funktioniert das Plugin danach immer noch nicht. Jetzt scheint die generierte Datei fehlerhaft zu sein. Sie kann innerhalb Dokuwiki nicht aufgerufen bzw. geöffnet werden. Bin hier aber mit meiner Analyse am Ende. Gibt es Möglichkeiten, um herauszufinden, was nicht läuft?
Der Aufruf im Browser sieht wie u.a. aus: <img src=“/dokuwiki/lib/plugins/mindmap/img.php?namespaces=heldennotizen&height=100&width=100&align=left&format=dot&depth=3&include_media=none&use_cached_pages=0” class=“medialeft” alt=“” width=“100” height=“100” align=“left”>
Schönen Abend Jens
ToDo/Wish List
- Create an image map, so that the resulting image is 'clickable'.
FAQ
Discussion
Do you know Beats Biblionet? Beat has programmed it all himself (at leasts that's what he claims) and he has integrated a clickable graphic representation of related items. For example, the term “Bildung” (http://beat.doebe.li/bibliothek/w00470.html) is semantically connected in his “Zettelkasten” with a number of other terms and these connections are displayed in a SVG which thus helps to immidiately switch to related topics.
Visualising the output
There're several ways to visualise the data output by this plugin. sigma.js and gexf-fs are both JavaScript libraries that take the GEXF XML files and draw graphs using a HTML <canvas>
element, so it should be possible to integrate them into a live DokuWiki site (for example, to display a clickable, graphical sitemap). Tools in other languages can be found from the GEXF format website.