pub struct CoordFixed {
pub ratio: f64,
}Expand description
Fixed-ratio coordinate system — maintains aspect ratio.
Fields§
§ratio: f64Implementations§
Trait Implementations§
Source§impl Coord for CoordFixed
impl Coord for CoordFixed
Source§fn transform(&self, point: (f64, f64), plot_area: &Rect) -> (f64, f64)
fn transform(&self, point: (f64, f64), plot_area: &Rect) -> (f64, f64)
Transform normalized (0..1, 0..1) coordinates to pixel coordinates.
Source§fn is_flipped(&self) -> bool
fn is_flipped(&self) -> bool
Whether this coordinate system flips X and Y.
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 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.
Source§fn zoom_y(&self) -> Option<(f64, f64)>
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>)
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§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.Auto Trait Implementations§
impl Freeze for CoordFixed
impl RefUnwindSafe for CoordFixed
impl Send for CoordFixed
impl Sync for CoordFixed
impl Unpin for CoordFixed
impl UnsafeUnpin for CoordFixed
impl UnwindSafe for CoordFixed
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