pub struct FruchtermanReingoldOptions<'a> {
pub niter: usize,
pub start_temp: Option<f64>,
pub grid: LayoutGrid,
pub weights: Option<&'a [f64]>,
pub initial: Option<&'a Matrix>,
pub minx: Option<&'a [f64]>,
pub maxx: Option<&'a [f64]>,
pub miny: Option<&'a [f64]>,
pub maxy: Option<&'a [f64]>,
pub minz: Option<&'a [f64]>,
pub maxz: Option<&'a [f64]>,
}Expand description
Parameters of the Fruchterman–Reingold layouts
(Graph::layout_fruchterman_reingold and
Graph::layout_fruchterman_reingold_3d).
The Default follows the igraph documentation: 500 iterations, a start
temperature of sqrt(n) / 10, automatic grid selection, unit weights, a
random start and no coordinate bounds.
use igraph::layout::FruchtermanReingoldOptions;
let weights = [1.0, 2.0, 3.0];
let opts = FruchtermanReingoldOptions { niter: 1000, ..Default::default() }
.with_weights(&weights);
assert_eq!(opts.niter, 1000);Fields§
§niter: usizeNumber of iterations (default 500).
start_temp: Option<f64>Start temperature: the maximum movement of a vertex along one axis in
one step; it decreases linearly to zero. None means sqrt(n) / 10.
grid: LayoutGridWhether to use the faster, less accurate grid-based variant (2D only;
LayoutGrid::AutoGrid, the default, uses it above 1000 vertices).
weights: Option<&'a [f64]>Positive edge weights multiplying the attraction along edges (higher
weight: closer vertices; an isolated edge of weight w has length
w^(-1/3)). None means unit weights.
initial: Option<&'a Matrix>Starting positions (n × 2, or n × 3 for the 3D version); None
starts from a random layout.
minx: Option<&'a [f64]>Per-vertex minimum x coordinate (-inf means no bound).
maxx: Option<&'a [f64]>Per-vertex maximum x coordinate (+inf means no bound).
miny: Option<&'a [f64]>Per-vertex minimum y coordinate (-inf means no bound).
maxy: Option<&'a [f64]>Per-vertex maximum y coordinate (+inf means no bound).
minz: Option<&'a [f64]>Per-vertex minimum z coordinate (3D only).
maxz: Option<&'a [f64]>Per-vertex maximum z coordinate (3D only).
Implementations§
Source§impl<'a> FruchtermanReingoldOptions<'a>
impl<'a> FruchtermanReingoldOptions<'a>
Sourcepub fn with_weights(self, weights: &'a [f64]) -> Self
pub fn with_weights(self, weights: &'a [f64]) -> Self
Sets the edge weights.
Sourcepub fn with_initial(self, initial: &'a Matrix) -> Self
pub fn with_initial(self, initial: &'a Matrix) -> Self
Sets the starting positions.
Sourcepub fn with_niter(self, niter: usize) -> Self
pub fn with_niter(self, niter: usize) -> Self
Sets the number of iterations.
Trait Implementations§
Source§impl<'a> Clone for FruchtermanReingoldOptions<'a>
impl<'a> Clone for FruchtermanReingoldOptions<'a>
Source§fn clone(&self) -> FruchtermanReingoldOptions<'a>
fn clone(&self) -> FruchtermanReingoldOptions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for FruchtermanReingoldOptions<'a>
impl<'a> Debug for FruchtermanReingoldOptions<'a>
Source§impl Default for FruchtermanReingoldOptions<'_>
impl Default for FruchtermanReingoldOptions<'_>
Source§impl<'a> PartialEq for FruchtermanReingoldOptions<'a>
impl<'a> PartialEq for FruchtermanReingoldOptions<'a>
Source§fn eq(&self, other: &FruchtermanReingoldOptions<'a>) -> bool
fn eq(&self, other: &FruchtermanReingoldOptions<'a>) -> bool
self and other values to be equal, and is used by ==.