pub struct GeomText {
pub size: f64,
pub color: (u8, u8, u8),
pub alpha: f64,
pub hjust: f64,
pub vjust: f64,
pub fontfamily: String,
pub check_overlap: bool,
}Expand description
Text geometry — draws text labels at data positions.
Fields§
§size: f64§color: (u8, u8, u8)§alpha: f64§hjust: f64Horizontal justification: 0.0 = left, 0.5 = center (default), 1.0 = right.
vjust: f64Vertical justification: 0.0 = bottom, 0.5 = middle (default), 1.0 = top.
fontfamily: StringFont family name (informational; actual rendering depends on backend).
check_overlap: boolWhen true, skip drawing labels that overlap previously drawn labels.
Implementations§
Source§impl GeomText
impl GeomText
pub fn with_hjust(self, hjust: f64) -> Self
pub fn with_vjust(self, vjust: f64) -> Self
pub fn with_fontfamily(self, family: &str) -> Self
pub fn with_check_overlap(self, check: bool) -> Self
Trait Implementations§
Source§impl Geom for GeomText
impl Geom for GeomText
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.Auto Trait Implementations§
impl Freeze for GeomText
impl RefUnwindSafe for GeomText
impl Send for GeomText
impl Sync for GeomText
impl Unpin for GeomText
impl UnsafeUnpin for GeomText
impl UnwindSafe for GeomText
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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