pub trait Coord: Send + Sync {
// Required method
fn transform(&self, point: (f64, f64), plot_area: &Rect) -> (f64, f64);
// Provided methods
fn gridlines(&self) -> bool { ... }
fn is_flipped(&self) -> bool { ... }
fn is_polar(&self) -> bool { ... }
fn polar_theta_is_x(&self) -> bool { ... }
fn zoom_x(&self) -> Option<(f64, f64)> { ... }
fn zoom_y(&self) -> Option<(f64, f64)> { ... }
fn set_domains(&mut self, _x: Option<AxisSpan>, _y: Option<AxisSpan>) { ... }
fn is_radar(&self) -> bool { ... }
fn train_scales(&mut self, _scales: &mut ScaleSet) { ... }
}Expand description
Trait for coordinate systems.
Required Methods§
Provided Methods§
Sourcefn is_flipped(&self) -> bool
fn is_flipped(&self) -> bool
Whether this coordinate system flips X and Y.
Sourcefn 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).
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".