I want to create layouts for vertices with varying dimensions, and I get unexpected results:
use rust_sugiyama::{configure::Config, from_vertices_and_edges};
fn main() {
let vertices = [(0, (40.0, 8.0)), (1, (7.0, 3.0)), (2, (39.0, 3.0))];
let edges = [(0, 1), (0, 2)];
let layouts = from_vertices_and_edges(
&vertices,
&edges,
&Config {
vertex_spacing: 6.0,
..Default::default()
},
);
for (layout, width, height) in layouts {
println!("Coordinates: {:?}", layout);
println!("width: {width}, height: {height}");
}
}
This prints:
Coordinates: [(0, (22.75, 0.0)), (1, (37.5, 11.5)), (2, (0.0, 11.5))]
width: 2, height: 2
Meaning node 2 with width 39 actually overlaps with node 1 by 1.5 units, even though I specified a vertex spacing of 6.
The visual result in my application looks like:
I think this is probably related to this comment : #18 (comment) , @andriyDev any thoughts here?
I want to create layouts for vertices with varying dimensions, and I get unexpected results:
This prints:
Meaning node 2 with width 39 actually overlaps with node 1 by 1.5 units, even though I specified a vertex spacing of 6.
The visual result in my application looks like:
I think this is probably related to this comment : #18 (comment) , @andriyDev any thoughts here?