How to use Makie to visualize network data in 3D?

I have a custom node type and I want to be able to present data dynamically in real time. Maybe I should do it in another language? Hope a simple example. Thx!!!

I wonder if it’s possible to hook up one of the graph plotting libraries to Makie.

GitHub - JuliaPlots/GraphMakie.jl: Plotting graphs with Makie is currently actively developed by @hexaeder and is making great progress :slight_smile:
It’s still in alpha but already has quite a bit of functionality and docs!

1 Like

It seems that the answer is Yes! :slightly_smiling_face:

Thx! But it only support 2D visualization at current stage. I will study this package and try to do something with myself. :grin:

Yes you’re right I havn’t focused on 3D layouts yet but I certainly will improve that area. There is a very small bug to fix for this, I am working on it.
What do you mean by “custom node type”? Whicht type of data to you want to display? I am very interested to hear about real world use cases to develop GraphMakie further.

I’m very excited to share my idea with you. Yes, what I want is to visualize a neural-like network(not CNN those things, but conceptual network). A thinking Brain! (I’m working on AGI)。
Oh, so-called “my custom node type” is just a julia struct with some infomation. sorry for my poor english. :sweat_smile:

If you use the master branch of GraphMakie
] add https://github.com/JuliaPlots/GraphMakie.jl#master
you should be able to plot rudimentary 3d graphs now. It should work with any layout function which takes the adjacency matrix of the graph and returns a list of Point3f0.

using GLMakie
using GraphMakie
using LightGraphs

g = SimpleGraph(8)
add_edge!(g, 1, 2)
add_edge!(g, 2, 3)
add_edge!(g, 3, 4)
add_edge!(g, 4, 1)

add_edge!(g, 5, 6)
add_edge!(g, 6, 7)
add_edge!(g, 7, 8)
add_edge!(g, 8, 5)

add_edge!(g, 1, 5)
add_edge!(g, 2, 6)
add_edge!(g, 3, 7)
add_edge!(g, 4, 8)

cube = (adj_matrix) -> [Point3f0(0,0,0),
                        Point3f0(0,1,0),
                        Point3f0(1,1,0),
                        Point3f0(1,0,0),
                        Point3f0(0,0,1),
                        Point3f0(0,1,1),
                        Point3f0(1,1,1),
                        Point3f0(1,0,1)]

f, lscene, p = graphplot(g, layout=cube, node_size=30)

For more featurers I have to read up on some 3D plotting with makie…

2 Likes