Skip to content

renzocom/hyperplot

Repository files navigation

hyperplot

A short high-level library to plot hypergraphs and O-information analysis based on HyperNetX, xgi and networkx.

Visualization functions:

Authors: Renzo Comolatti and Daniele Marinazzo

Hyperplot functions to visualize hypergraphs:

polygons(edges, nodecolors=nodecolors, nodelabels=nodelabels) # based on xgi library

two_rows(edges, nodelabels=nodelabels, nodecolors=nodecolors, column_spacing=2.5, nodesize=0.11) # based on hypernetx library

areas(edges, nodelabels=None, nodecolors=None, edgecolors=None, linewidth=1) # based on hypernetx library

planar(edges, nodes, nodelabels=nodelabels) # based on networkx library

analysis.py

Functions in this script load O-information analysis output from HOI library by creating a 'data' structure (dict) that is passed to the plotting functions, e.g. plot_polygons(data), that wrap around Hyperplot functions.

Installation

(Tested on python 3.7)

git clone https://github.com/renzocom/hyperplot.git

cd hyperplot

pip install -e .

Next, we need to install the modified versions of HypernetX (https://github.com/pnnl/HyperNetX) and xgi (https://github.com/ComplexGroupInteractions/xgi) which we will clone inside hyperplot directory:

git clone https://github.com/renzocom/xgi.git

cd xgi

pip install -e .\[all\]

cd ..

git clone -b new_viz https://github.com/renzocom/HyperNetX.git

cd hypernetx

pip install .

Getting started

Once installed open the jupyter notebook and try running the cells that plot the Empathy and Eating Disorders datasets.

About

Short library to plot high-order interactions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published