Simple script for plotting images into SVG files taking Gephi exported GEXF files as inputs.
- Python 3 (Python 2 not supported)
- Python modules 'Pillow' and 'svgwrite'.
Input file characteristics
- GEXF graph file: script was developed taking in GEXF files generated by Gephi (0.9.2), which are marked as GEXF 1.3. The file should contain the position of the nodes and nodes should have attributes 'type', 'file' and 'link'. Image nodes should be have their 'type' attributes set to 'image'.
- Image files: image files should be placed in a folder and have its absolute path indicated in the configuration file. Filenames must match the nodes' 'file' attribute.
- Download the script from this page, unzip and place the script files in some directory.
- Install module requirements using pip. From terminal, go to the script's folder and call:
pip install -r requirements.txt
If you have more than one version of python installed, you may need to call pip for python3:
python3 -m pip install -r requirements.txt
pip3 install -r requirements.txt
- Rename config_sample.txt to config.txt and edit the settings according to your use of the script (see section below)
The config file contains several options which are all described in its comments. Edit the file according to the instructions below. These are the mandatory options that should be set for each use of the script. Other options can be left as default.
- InputGraph: should be set to the absolute path of the GEXF file.
- InputImageFolder: should be set to the absolute path of the folder containing the images.
Run the script "plotter.py" in a terminal window. To run in terminal, move to the script's directory and type
or, depending on how your Python is installed
Check the terminal for possible errors and for progress reporting.
Terminal scripts can be interrupted by pressing Ctrl+C.
Script by André Mintz. Feb 2018.
As-is software, no support or warranty provided.