How to implement graph visualization program?
- Free and open-source
- Easy to use, lots of functions
- Can be compiled with custom modules in CPP
➡ Idea: compile Godot engine with modified KaHIP (CPP):
- With KaHIP it’s possible to build Graph class that can be used directly in Godot Engine
- Access to KaHIP graph structure and functions
- Write time-consuming algorithms in CPP, use GDScript GDScript (Godot’s scripting language) for rest
Graph Structure
Graph is saved as folder containing:
- Metis adjacency list file
- Vertex coordinates file
- Additional vertex set or partition list file
➡ Read in graph as Metis adjacency list → save in compiled
graph class
➡ Read in graph coordinates → change graph class vertex
coordinates
Graph Visualization in Godot Game Engine
- Draw edges using line primitive (every two vertices one line)
- Draw edges using triangle primitive (every two vertices 2 triangles → 1 thick line)
- Use arrow sprite for edge arrows
- Use mesh for better performance
- Draw graph using node sprite MeshInstance2D, arrow sprite MeshInstance2D, connect vertices with ArrayMesh
- Change colors of nodes/arrows by modulating, change colors of edges by redrawing mesh