[ANN] GraphMakie.jl - Plotting graphs... with Makie!

I’m happy to announce GraphMakie.jl, a graph¹ plotting package on top of Makie!
Make sure to check out the docs!

It currently it supports:

  • 2D and 3D network plots
  • edge and node labels
  • a lot of the cool coloring stuff from Makie
  • some prebuilt interactions like dragging of nodes

The node layout is powered by NetworkLayout.jl which got its own big update with an updated interface in the 0.4 release which plays nicely with GraphMakie (and potentially other graph plotting packages). The available layouts can be found in the docs of NetworkLayout.jl.
You can also easily define your own layouts which are based on other packages such as LayeredLayouts.jl (see DAG example) or extracting positions from a MetaGraph.

This package is still in an early stage and might break often until the interface settles. Feel free to suggest features and open issues and PRs :slight_smile:


¹ the networky kind

76 Likes

This looks great!

Thanks a lot for this. Great work?

That stress on a truss example is premium business. Well done!

2 Likes

Does this support adjacency matrix inputs? So it can be used without LightGraphs?

No it has LighGraphs as a dependency and it will be hard to get rid of: Internally I use the ordering of the edges(g) iterator of LighGraphs to define the order of the edges (i.e. for the color arguments). I thought that compared to a heavy plot lib one needs anyway the additional LightGraphs dep isn’t to bad.

While this library looks great I cannot figure out how to add anything to the graph plot.

Suppose I have:

g = SimpleWeightedDiGraph(rand(3,3))
fig = graphplot(g)

How to add, for an example a rectangle to the plot.
I tried using GeometryTypes and the function poly!(fig, Rectangle(0,0,0.5,0.5)) but this throws an error.

You should start reading this to get familiar with the basic makie types Basic Tutorial

Rectangles are done with Rect from GeometryBasics

3 Likes

Can we use LaTeX in labels with GraphMakie.jl?

Makie has LaTeX label support via GitHub - Kolaru/MathTeXEngine.jl: A latex math mode engine in pure Julia.

have you tried?

1 Like