pub fn layout_merge_dla(layouts: &[&[[f64; 2]]]) -> IgraphResult<Vec<[f64; 2]>>Expand description
Merge multiple 2D layouts into a single combined layout using DLA placement.
Each component layout is covered by a bounding circle. The largest component is placed at the origin, then subsequent components are placed using a DLA (Diffusion Limited Aggregation) random walk that finds a position touching an already-placed component.
§Arguments
layouts— slice of component layouts, each aVec<[f64; 2]>.
Returns a single merged layout containing all vertices from all components in order.
§Examples
use rust_igraph::layout_merge_dla;
let layout1 = vec![[0.0, 0.0], [1.0, 0.0], [0.5, 0.5]];
let layout2 = vec![[0.0, 0.0], [1.0, 1.0]];
let merged = layout_merge_dla(&[&layout1, &layout2]).unwrap();
assert_eq!(merged.len(), 5);
assert!(merged.iter().all(|p| p[0].is_finite() && p[1].is_finite()));