{"id":13566264,"url":"https://github.com/grantshandy/fdg","last_synced_at":"2025-05-15T13:07:36.170Z","repository":{"id":40385930,"uuid":"472928823","full_name":"grantshandy/fdg","owner":"grantshandy","description":"A Force Directed Graph Drawing Library","archived":false,"fork":false,"pushed_at":"2025-03-06T01:39:14.000Z","size":122823,"stargazers_count":208,"open_issues_count":4,"forks_count":20,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-12T22:56:12.654Z","etag":null,"topics":["force-directed-graphs","fruchterman-reingold","graph","graph-theory","graphs","simulation","visualization"],"latest_commit_sha":null,"homepage":"https://grantshandy.github.io/fdg","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grantshandy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-22T20:33:57.000Z","updated_at":"2025-05-08T23:21:31.000Z","dependencies_parsed_at":"2023-12-17T03:26:36.690Z","dependency_job_id":"4db27d0e-db79-49f6-893f-6a06865e0e4c","html_url":"https://github.com/grantshandy/fdg","commit_stats":{"total_commits":212,"total_committers":6,"mean_commits":"35.333333333333336","dds":0.07547169811320753,"last_synced_commit":"4223c1ac242ca259dec51bdd9e28e55e939dc109"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantshandy%2Ffdg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantshandy%2Ffdg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantshandy%2Ffdg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantshandy%2Ffdg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grantshandy","download_url":"https://codeload.github.com/grantshandy/fdg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["force-directed-graphs","fruchterman-reingold","graph","graph-theory","graphs","simulation","visualization"],"created_at":"2024-08-01T13:02:05.714Z","updated_at":"2025-05-15T13:07:31.136Z","avatar_url":"https://github.com/grantshandy.png","language":"Rust","funding_links":[],"categories":["Apps or visualizations","Rust"],"sub_categories":["Apps or visualizations: On top of macroquad"],"readme":"# fdg\nA [(force-directed)](https://en.wikipedia.org/wiki/Force-directed_graph_drawing) [graph drawing](https://en.wikipedia.org/wiki/Graph_drawing) library for Rust. *Convert any [`petgraph::Graph`](https://docs.rs/petgraph/latest/petgraph/graph/struct.Graph.html) into a pretty picture!*\n\n![screenshot](./.github/screenshot.png)\n\nThe goal of this library is to create some idiomatic building blocks for writing fast graph drawing algorithms in Rust. I hope to implement more algorithms such as [ForceAtlas2 (2014)](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679) and [Kamada-Kawai (1989)](https://citeseerx.ist.psu.edu/document?repid=rep1\u0026type=pdf\u0026doi=b8d3bca50ccc573c5cb99f7d201e8acce6618f04). I also want to experiment with [generating the layouts with SIMD, parallelization, and GPU compute](https://github.com/grantshandy/fdg/issues/15).\n\nThe library is currently undergoing a complete rewrite with more performant algorithms and a more generic API (now supports computing in N dimensions 😉). The pre 1.0 version is now located in the `old` branch.\n\nContributions always welcome!\n\n## Usage\n```rust,ignore\nuse fdg::{fruchterman_reingold::FruchtermanReingold, Force, ForceGraph};\n\n// your dataset: Into\u003cStableGraph\u003c(), ()\u003e\u003e\n\n// Initialize a ForceGraph in 2 dimentions with random node positions from -10.0..=10.0.\nlet mut graph: ForceGraph\u003cf32, 2, (), ()\u003e = fdg::init_force_graph_uniform(dataset, 10.0);\n\n// Apply the Fruchterman-Reingold (1991) force-directed drawing algorithm 100 times.\nFruchtermanReingold::default().apply_many(\u0026mut graph, 100);\n// Center the graph's average around (0,0).\nCenter::default().apply(\u0026mut graph);\n\n// Render nodes:\nprintln!(\"nodes:\");\nfor (_, pos) in graph.node_weights() {\n    println!(\"{pos:?}\");\n}\n\n// Render edges:\nprintln!(\"edges:\");\nfor edge_idx in graph.edge_indices() {\n    let (source_idx, target_idx) = graph.edge_endpoints(edge_idx).unwrap();\n\n    println!(\"{edge_idx:?}: {:?} to {:?}\", \u0026graph[source_idx].1, \u0026graph[target_idx].1);\n}\n```\n**See [basic.rs](./examples/basic.rs)...**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantshandy%2Ffdg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrantshandy%2Ffdg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantshandy%2Ffdg/lists"}