fdg-sim
A force-directed graph simulation for Rust.
Visit the project page for more information.
Crates
Name | Version | Docs | License | Description |
---|---|---|---|---|
fdg-sim |
Runs the layout engine (simulation) and manages the position of nodes. | |||
fdg-macroquad |
A demo visualizer that lets you interact with the graph in real time. (View Online) | |||
fdg-img |
A simple SVG renderer for your graphs. | |||
fdg-wasm |
A simple Webassembly wrapper of fdg-sim for use in Javascript. |
Basic Example
use ;
What are N
, E
, and Ty
?
You may notice that structs and types like Simulation
, ForceGraph
, and Force
have generic type parameters <N, E, Ty>
.
N
: The node weight (data stored in theNode
'sdata
).E
: The edge weight (data stored directly in the graph's edges).Ty
: The edge type,Directed
orUndirected
(set by default).
These type names from the petgraph documentation here. Because Ty
is set by default, you won't have to mess with it most of the time.