pub struct RepelParams {Show 16 fields
pub box_padding: f64,
pub point_padding: f64,
pub point_size: f64,
pub nudge_x: f64,
pub nudge_y: f64,
pub force: f64,
pub force_pull: f64,
pub max_iter: usize,
pub max_time: Duration,
pub max_overlaps: usize,
pub min_segment_length: f64,
pub seed: u64,
pub direction: RepelDirection,
pub max_labels: usize,
pub segment_color: Option<(u8, u8, u8)>,
pub segment_width: f64,
}Expand description
Shared layout parameters of GeomTextRepel / GeomLabelRepel.
Fields§
§box_padding: f64Padding (px) around each label’s box when testing for overlaps
(ggrepel box.padding).
point_padding: f64Padding (px) around each data point (ggrepel point.padding); also
the gap left between a segment and its point.
point_size: f64Radius (px) of the data points labels must avoid (match the point
layer’s size; GeomPoint’s default is 3).
nudge_x: f64Horizontal nudge of the starting position, in data units (numeric x).
nudge_y: f64Vertical nudge of the starting position, in data units (numeric y).
force: f64Strength of the repulsion between overlapping boxes.
force_pull: f64Strength of the spring pulling a label back to its point.
max_iter: usizeMaximum relaxation iterations.
max_time: DurationWall-clock bound for the relaxation (a safety net — the layout is
deterministic as long as it converges or hits max_iter first).
Ignored on wasm32, which has no monotonic clock.
max_overlaps: usizeDrop labels that still overlap more than this many other labels or
points after the layout (ggrepel max.overlaps, default 10).
min_segment_length: f64Draw a segment when the label box is farther than this (px) from its
point (ggrepel min.segment.length).
seed: u64Seed of the tie-breaking jitter; equal seeds give equal layouts.
direction: RepelDirectionMovement axis.
max_labels: usizeAbove this many labels the force layout is skipped (it is O(n²) in the worst case) and labels are placed greedily, dropping overlaps.
segment_color: Option<(u8, u8, u8)>Segment colour; None = the label’s text colour.
segment_width: f64Segment width (px).
Trait Implementations§
Source§impl Clone for RepelParams
impl Clone for RepelParams
Source§impl Debug for RepelParams
impl Debug for RepelParams
Auto Trait Implementations§
impl Freeze for RepelParams
impl RefUnwindSafe for RepelParams
impl Send for RepelParams
impl Sync for RepelParams
impl Unpin for RepelParams
impl UnsafeUnpin for RepelParams
impl UnwindSafe for RepelParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more