pub struct CoordRadar {
pub start: f64,
pub radius_frac: f64,
/* private fields */
}Expand description
Radar / spider-chart coordinates (coord_radar()).
x (usually discrete — one spoke per level) maps to angle, with the first
level at 12 o’clock and levels running clockwise; y maps to the distance
from the centre, which is the y scale’s value 0 (the y scale is trained
to include 0). Geoms connect points with straight segments: geom_polygon
draws closed, filled series polygons and geom_line closes its path.
Gridlines become rings (polygons through the spokes at the y breaks) and
spokes, with the x levels labelled around the outside.
Fields§
§start: f64Angle of the first spoke (radians, 0 = 12 o’clock, clockwise).
radius_frac: f64Outer radius as a fraction of half the panel’s smaller side; the rest is left for the spoke labels.
Implementations§
Trait Implementations§
Source§impl Coord for CoordRadar
impl Coord for CoordRadar
Source§fn transform(&self, (nx, ny): (f64, f64), plot_area: &Rect) -> (f64, f64)
fn transform(&self, (nx, ny): (f64, f64), plot_area: &Rect) -> (f64, f64)
Transform normalized (0..1, 0..1) coordinates to pixel coordinates.
Source§fn is_polar(&self) -> bool
fn is_polar(&self) -> bool
Whether this is a non-linear polar system (bars become radial sectors,
so geoms that draw rectangles must tessellate their edges into an arc).
Source§fn is_radar(&self) -> bool
fn is_radar(&self) -> bool
Radar coordinates: straight segments between spokes, closed paths, and
ring/spoke guides instead of cartesian axes. Default false.
Source§fn train_scales(&mut self, scales: &mut ScaleSet)
fn train_scales(&mut self, scales: &mut ScaleSet)
Inspect / adjust the trained scales once training is complete (e.g.
coord_radar anchors the radius at 0 and counts its spokes). Default:
no-op.Source§fn is_flipped(&self) -> bool
fn is_flipped(&self) -> bool
Whether this coordinate system flips X and Y.
Source§fn polar_theta_is_x(&self) -> bool
fn polar_theta_is_x(&self) -> bool
For a polar system, whether the x aesthetic maps to angle (
theta="x").
When false (theta="y", pies), the y aesthetic is the angle, so sector
tessellation must sweep the y edge instead of the x edge.Source§fn zoom_x(&self) -> Option<(f64, f64)>
fn zoom_x(&self) -> Option<(f64, f64)>
Zoom limits for x-axis (data coordinates). Clips viewport without filtering data.
Auto Trait Implementations§
impl Freeze for CoordRadar
impl RefUnwindSafe for CoordRadar
impl Send for CoordRadar
impl Sync for CoordRadar
impl Unpin for CoordRadar
impl UnsafeUnpin for CoordRadar
impl UnwindSafe for CoordRadar
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