-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
I get the following compiler error when trying to use fdg::init_force_graph_uniform with a graph defined as StableGraph<(), (), Undirected>:
18 | let mut force_graph: fdg::ForceGraph<f32, 3,(), ()> = fdg::init_force_graph_uniform(graph, 10.0);
| ----------------------------- ^^^^^ the trait `From<StableGraph<(), (), Undirected>>` is not implemented for `StableGraph<_, _>`, which is required by `StableGraph<(), (), Undirected>: Into<StableGraph<_, _>>`
| |
| required by a bound introduced by this callHere's example code that reproduces the issue:
use fdg::{petgraph::{prelude::{StableGraph, StableUnGraph}, Undirected}, Force};
fn main() {
let mut graph: StableGraph<(), (), Undirected> = StableGraph::default();
// let mut graph: StableUnGraph<(), ()> = StableGraph::default();
// Add nodes to the graph
let mut nodes = Vec::new();
nodes.push(graph.add_node(()));
nodes.push(graph.add_node(()));
nodes.push(graph.add_node(()));
nodes.push(graph.add_node(()));
// Add edges
graph.add_edge(nodes[0], nodes[1], ());
graph.add_edge(nodes[1], nodes[2], ());
graph.add_edge(nodes[2], nodes[3], ());
println!("{:?}", graph);
let mut force_graph: fdg::ForceGraph<f32, 3,(), ()> = fdg::init_force_graph_uniform(graph, 10.0);
fdg::simple::Center::default().apply(&mut force_graph);
}I'm currently using v1.0.0, i.e. my Cargo.toml contains this:
[dependencies]
fdg = { git = "https://github.com/grantshandy/fdg", version = "1.0.0" }Are undirected graphs supposed to be supported, or is the algo somehow limited to directed graphs?
BTW, thanks for the awesome library.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels