#force-directed-graph #renderer #graphics #force-directed

emerge

A library for building and rendering force directed graphs

5 releases

0.1.4 Jul 21, 2025
0.1.3 Jul 7, 2025
0.1.2 Jun 24, 2025
0.1.1 Jun 24, 2025
0.1.0 Jun 24, 2025

#136 in Simulation

MIT/Apache

5MB
658 lines

Emerge

A Rust library for force-directed graphs. Uses physics simulations to let clear, stable network structures emerge naturally.

emerge - force directed graph.gif

Features

  • 2D directed graph rendering
  • Natural node position due to physics based simulation
  • Click and drag to navigate around the graph

Usage

use emerge::graph::{default_window_conf, render_graph, Graph};

#[macroquad::main(default_window_conf)]
async fn main() {
    let mut graph = Graph::new();

    graph.add_node("Albania");
    graph.add_node("Cambodia");
    graph.add_node("Cameroon");
    graph.add_node("Nigeria");

    graph.add_directed_edge("Cambodia", "Albania");
    graph.add_directed_edge("Cameroon", "Nigeria");
    graph.add_directed_edge("Nigeria", "Albania");

    render_graph(graph).await;
}

Examples

Dependencies

~14MB
~331K SLoC