Skip to content

Latest commit

 

History

History
52 lines (43 loc) · 2.13 KB

README.md

File metadata and controls

52 lines (43 loc) · 2.13 KB

image-network plotter

Simple script for plotting images into SVG files taking Gephi exported GEXF files as inputs.

Requirements

  • 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.

Installation

  1. Download the script from this page, unzip and place the script files in some directory.
  2. 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

or

pip3 install -r requirements.txt
  1. Rename config_sample.txt to config.txt and edit the settings according to your use of the script (see section below)

Configuration

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.

  • Input
    1. InputGraph: should be set to the absolute path of the GEXF file.
    2. InputImageFolder: should be set to the absolute path of the folder containing the images.

Execution

Run the script "plotter.py" in a terminal window. To run in terminal, move to the script's directory and type

python plotter.py

or, depending on how your Python is installed

python3 plotter.py

Check the terminal for possible errors and for progress reporting.

Terminal scripts can be interrupted by pressing Ctrl+C.

Credits

Script by André Mintz. Feb 2018.

Disclaimer

As-is software, no support or warranty provided.