pub struct GeomTextRepel {
pub size: f64,
pub color: (u8, u8, u8),
pub alpha: f64,
pub fontface: FontFace,
pub repel: RepelParams,
}Expand description
Text labels repelled away from each other and from their points
(ggrepel::geom_text_repel). Requires x, y, label; an empty / NA
label is not drawn but its point is still avoided (as in ggrepel).
Fields§
§size: f64§color: (u8, u8, u8)§alpha: f64§fontface: FontFace§repel: RepelParamsImplementations§
Source§impl GeomTextRepel
impl GeomTextRepel
Sourcepub fn box_padding(self, px: f64) -> Self
pub fn box_padding(self, px: f64) -> Self
Padding (px) around label boxes when testing overlaps.
Sourcepub fn point_padding(self, px: f64) -> Self
pub fn point_padding(self, px: f64) -> Self
Padding (px) around the labelled points.
Sourcepub fn point_size(self, px: f64) -> Self
pub fn point_size(self, px: f64) -> Self
Radius (px) of the points to avoid.
Sourcepub fn force_pull(self, force: f64) -> Self
pub fn force_pull(self, force: f64) -> Self
Spring strength back to the point.
Sourcepub fn max_overlaps(self, n: usize) -> Self
pub fn max_overlaps(self, n: usize) -> Self
Drop labels overlapping more than n labels/points.
Sourcepub fn min_segment_length(self, px: f64) -> Self
pub fn min_segment_length(self, px: f64) -> Self
Minimum label–point distance (px) that gets a segment.
Sourcepub fn direction(self, d: RepelDirection) -> Self
pub fn direction(self, d: RepelDirection) -> Self
Restrict movement to one axis.
Sourcepub fn max_labels(self, n: usize) -> Self
pub fn max_labels(self, n: usize) -> Self
Label-count cap of the force layout.
Sourcepub fn segment_color(self, color: (u8, u8, u8)) -> Self
pub fn segment_color(self, color: (u8, u8, u8)) -> Self
Segment colour.
Trait Implementations§
Source§impl Default for GeomTextRepel
impl Default for GeomTextRepel
Source§impl Geom for GeomTextRepel
impl Geom for GeomTextRepel
Source§fn draw(
&self,
data: &DataFrame,
coord: &dyn Coord,
scales: &ScaleSet,
_theme: &Theme,
backend: &mut dyn DrawBackend,
) -> Result<(), RenderError>
fn draw( &self, data: &DataFrame, coord: &dyn Coord, scales: &ScaleSet, _theme: &Theme, backend: &mut dyn DrawBackend, ) -> Result<(), RenderError>
Draw this geometry.
Source§fn required_aes(&self) -> Vec<Aesthetic>
fn required_aes(&self) -> Vec<Aesthetic>
Required aesthetics.
Source§fn default_stat(&self) -> Box<dyn Stat>
fn default_stat(&self) -> Box<dyn Stat>
Default stat for this geom.
Source§fn default_position(&self) -> Box<dyn Position>
fn default_position(&self) -> Box<dyn Position>
Default position adjustment.
Source§fn default_params(&self) -> GeomParams
fn default_params(&self) -> GeomParams
Non-mapped visual defaults.
Source§fn set_series_color(&mut self, _color: (u8, u8, u8))
fn set_series_color(&mut self, _color: (u8, u8, u8))
Apply a brand/primary color to this geom’s single-series default (its
color or fill). The build pipeline calls this only when the layer has
no color/fill aesthetic mapped, so an explicit mapping always wins. The
default is a no-op; series geoms override it.Source§fn include_zero_baseline(&self) -> bool
fn include_zero_baseline(&self) -> bool
Whether this geom draws from a 0 baseline, so the Y scale should include
0 even when
y is explicitly mapped (bars/columns/area/histograms — as
in ggplot2). Default false.Source§fn allows_infinite(&self) -> bool
fn allows_infinite(&self) -> bool
Whether
-Inf/Inf position values are meaningful for this geom
(ggplot2: “extend to the panel edge”). Rows with infinite positions are
otherwise dropped with a warning before stats run. NaN is always
dropped. Default false; geom_rect returns true.Source§fn setup_data(&self, _data: &mut DataFrame)
fn setup_data(&self, _data: &mut DataFrame)
Geom-specific data preparation after the stat and position steps but
before scale training (ggplot2’s
GeomX$setup_data) — e.g. a tile adds
its xmin/xmax/ymin/ymax extents so continuous scales train on
them. Default: no-op.Source§fn inherit_aes(&self) -> bool
fn inherit_aes(&self) -> bool
Whether the layer inherits the plot-level aesthetic mapping (ggplot2’s
inherit.aes). Reference-line geoms return false, as in ggplot2, so a
plot-level color/x/y mapping does not leak into a geom_hline.
Default true.Auto Trait Implementations§
impl Freeze for GeomTextRepel
impl RefUnwindSafe for GeomTextRepel
impl Send for GeomTextRepel
impl Sync for GeomTextRepel
impl Unpin for GeomTextRepel
impl UnsafeUnpin for GeomTextRepel
impl UnwindSafe for GeomTextRepel
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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