Skip to main content

CoordRadar

Struct CoordRadar 

Source
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: f64

Angle of the first spoke (radians, 0 = 12 o’clock, clockwise).

§radius_frac: f64

Outer radius as a fraction of half the panel’s smaller side; the rest is left for the spoke labels.

Implementations§

Source§

impl CoordRadar

Source

pub fn new() -> Self

Source

pub fn start(self, start: f64) -> Self

Rotate the first spoke to start radians (0 = 12 o’clock).

Source

pub fn radius_frac(self, frac: f64) -> Self

Outer radius as a fraction of half the panel’s smaller side.

Trait Implementations§

Source§

impl Coord for CoordRadar

Source§

fn transform(&self, (nx, ny): (f64, f64), plot_area: &Rect) -> (f64, f64)

Transform normalized (0..1, 0..1) coordinates to pixel coordinates.
Source§

fn gridlines(&self) -> bool

Whether to draw grid lines.
Source§

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

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)

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

Whether this coordinate system flips X and Y.
Source§

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)>

Zoom limits for x-axis (data coordinates). Clips viewport without filtering data.
Source§

fn zoom_y(&self) -> Option<(f64, f64)>

Zoom limits for y-axis (data coordinates). Clips viewport without filtering data.
Source§

fn set_domains(&mut self, _x: Option<AxisSpan>, _y: Option<AxisSpan>)

Supply the trained x/y axis spans after scale training. Coordinate systems that warp the axis (e.g. coord_trans) need this to map a normalized position back to a data value. Default is a no-op.
Source§

impl Default for CoordRadar

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V