pub struct KamadaKawaiOptions<'a> {
pub maxiter: Option<usize>,
pub epsilon: f64,
pub kkconst: Option<f64>,
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 Kamada–Kawai layouts (Graph::layout_kamada_kawai and
Graph::layout_kamada_kawai_3d).
The Default uses 50 n iterations (the C documentation asks for at
least 10 n; 50 n is the default of the R and Python interfaces),
epsilon = 0 (always run all the iterations), kkconst = n (as the C
documentation recommends), unit edge lengths, a circular (spherical in
3D) start and no bounds.
Fields§
§maxiter: Option<usize>Maximum number of iterations; None means 50 n.
epsilon: f64Stop when the maximum energy change falls below this value (0.0,
the default, performs all maxiter iterations).
kkconst: Option<f64>The vertex attraction constant; None means the number of vertices.
weights: Option<&'a [f64]>Positive edge lengths used in the shortest path computation
(higher weight: farther vertices). None means unit lengths.
initial: Option<&'a Matrix>Starting positions (n × 2, or n × 3 for the 3D version). None
starts from a circle (sphere) of radius 0.36 sqrt(n), or from a
random layout when some bounds are given.
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> KamadaKawaiOptions<'a>
impl<'a> KamadaKawaiOptions<'a>
Sourcepub fn with_weights(self, weights: &'a [f64]) -> Self
pub fn with_weights(self, weights: &'a [f64]) -> Self
Sets the edge lengths.
Sourcepub fn with_initial(self, initial: &'a Matrix) -> Self
pub fn with_initial(self, initial: &'a Matrix) -> Self
Sets the starting positions.
Trait Implementations§
Source§impl<'a> Clone for KamadaKawaiOptions<'a>
impl<'a> Clone for KamadaKawaiOptions<'a>
Source§fn clone(&self) -> KamadaKawaiOptions<'a>
fn clone(&self) -> KamadaKawaiOptions<'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 KamadaKawaiOptions<'a>
impl<'a> Debug for KamadaKawaiOptions<'a>
Source§impl<'a> Default for KamadaKawaiOptions<'a>
impl<'a> Default for KamadaKawaiOptions<'a>
Source§fn default() -> KamadaKawaiOptions<'a>
fn default() -> KamadaKawaiOptions<'a>
Source§impl<'a> PartialEq for KamadaKawaiOptions<'a>
impl<'a> PartialEq for KamadaKawaiOptions<'a>
Source§fn eq(&self, other: &KamadaKawaiOptions<'a>) -> bool
fn eq(&self, other: &KamadaKawaiOptions<'a>) -> bool
self and other values to be equal, and is used by ==.