Friday, May 20, 2016

Creating a graph for OD&D

Here some advices to create your own graph with free softwares. Its the equivalent of LaTeX, but for visual diagrams. You just need to modify the code in dot language (very simple) and Graphviz will automatically layout the graph. The example of code is about OD&D.

  1. Install:
    1. Graphviz (!website very slow).
    2. Notepad++
  2. Setup Notepad++
    1. Set up Path variable :
      1. For Windows : Open the Start Menu. > Right-click on Computer and click Properties. > Click Advanced system settings. > Make sure you're on the Advanced tab. > Click Environment Variables. > Under System variables, scroll to find the Path Variable. Click on Path and then click Edit.
      2. Add : ;C:\Program Files (x86)\Graphviz2-38\bin
    2. Setup Graphviz for Notepad++
      1. Notepad++: Plugins > Plugins Manager > Show Plugin Manager : Search and install NppExec plugin
      2. Configure NppExex: Plugins > NppExex > Execute > write this (one line):
        dot « $(FULL_CURRENT_PATH) » -Tpng -o « $(CURRENT_DIRECTORY)\$(NAME_PART).png
        it will launch dot and create a PNG. You can replace with Tpdf to create a PDF.
      3. Save the script.
    3. Setup the syntax coloring in Notepad++
      1. Downloard graphviz-notepad-udl.xml.
      2. Notepad++: Language > Create User Define Language > Import : select the xml. Restart Notepad++.
  3. Practice graph creation :
    1. Download exemple.gv
    2. Open exemple.gv with Notepad++
    3. [Modify content at will]
    4. Plugins > NppExec > OK … a PNG file is created. Watch exemple.png.
Sources: Steinweb., Grevian, TBallantyne. Useful link for the colors here.

No comments:

Post a Comment