Skip to content

Latest commit

 

History

History
65 lines (48 loc) · 2.77 KB

README.md

File metadata and controls

65 lines (48 loc) · 2.77 KB

Vimwiki-Graphviz

Yet Another VimWiki Graph Generator

Generate a stylish graphical chart from your vimwiki links. Creating an image of your second brain.

Usage

Place the VimWiki-Graphviz.sh script inside your vimwiki root. Run the script.

./VimWiki-Graphviz.sh > MyGraph.txt

or generate a networkmap layout:

./VimWiki-Graphviz.sh -n > MyGraph.txt

Paste the output in any dot viewer like this one. (Note that not all dot viewers support sfdp layout, but no matter, we can do it ourselves).

Do it yourself

Install the graphvis package for your distro.

Then generate an image based on the script's output:

dot -Tpng MyGraph.txt -o MyGraph.png

Then you can open the PNG file with your favorite image viewer, or automate it like this:

dot -Tpng MyGraph.txt -o MyGraph.png && sxiv MyGraph.txt

Flags

  • -h Help Msg
  • -n Network Map Layout
  • -v Vonorai overlap (defaults to prism)
  • -x Scalexy overlap (defaults to prism)
  • -m Crawk MD files. (Only if your wiki is in Markdown)

Output

Run the script without arguments to get a SFDP type layout. gr1

Run the script with -n to get a Network Map type layout. gr2

Run with -v to get a voronai overlap style. layout-1-voronoi-

Run with -x to get a scalexy overlap style. layout-1-scalexy-

Notes

If you're on windows, consider using the python version of this script. I may or may not provide a batch version in the future. You can define more layouts and change the colors. The script should be easy to read and alter (minus the regex) if you know a little bash.

This script was inspired by a similar script, yet that one uses perl and outputs a plain graph that can turn out to be a vertically stretched out graph that is basically useless. I have converted the nasty perl bit into sed and elevated the functionality of the script to support layouts and work with wiki files as well as markdown files.
This script should run on any posix machine.

I chose these layouts and colors to mimic obsidians graph looks (even though I literally only saw it once). It's nice to see one's second brain and how complex it has gotten in time.

It's a pretty thing to look at. Like all arts, this script is quite useless. (Oscar Wylde)