In [1]:
#include the HypergraphsPlot.jl in julia folder.
include("julia/HypergraphsPlot.jl")
Out[1]:
Main.HypergraphsPlot
In [2]:
#generate a random hypergraph with 20 nodes and 5 hyperlinks with random values.
h = HypergraphsPlot.generatehg(20,5)
Out[2]:
20×5 SimpleHypergraphs.Hypergraph{Int64,Nothing,Nothing}:
1 nothing nothing 1 nothing
nothing nothing nothing nothing nothing
1 nothing 1 nothing nothing
nothing nothing nothing nothing nothing
1 nothing nothing nothing 1
nothing nothing nothing nothing nothing
1 nothing 1 nothing nothing
nothing nothing nothing nothing 1
nothing nothing 1 nothing nothing
1 nothing nothing nothing nothing
nothing nothing nothing nothing nothing
nothing nothing nothing nothing nothing
1 nothing nothing nothing 1
1 nothing nothing nothing nothing
nothing nothing nothing 1 nothing
nothing nothing nothing nothing nothing
nothing nothing nothing 1 nothing
1 nothing nothing nothing 1
nothing nothing nothing nothing nothing
nothing 1 nothing nothing 1
In [3]:
#plot the hypergraph with color-edge visualization
HypergraphsPlot.plot(h,type="color-edge")
Out[3]:
In [4]:
#plot the hypergraph with radal visualization
HypergraphsPlot.plot(h,type="radal")
Out[4]:
In [5]:
#plot the hypergraph with venn visualization
HypergraphsPlot.plot(h,type="venn")
Out[5]:
In [6]:
#you can also plot the hypergraph using a JSON file descriptor
HypergraphsPlot.plot("newData.json",type="color-edge")
Out[6]:
In [7]:
#or specifing some preferences
HypergraphsPlot.plot(h,type="color-edge",colorNodes="red",colorEdges="blue",sizeNodes="10")
Out[7]:
In [ ]: