Struct FunctionPlane
pub struct FunctionPlane {
pub canvas: Rect,
pub center: Point,
pub scale: f64,
pub major_spacing: f64,
}Expand description
A function plot’s viewport: center is the world point under the canvas
centre and scale the pixels per world unit (y up in world space).
Fields§
§canvas: Rect§center: Point§scale: f64§major_spacing: f64Target on-screen distance between major grid rules, in logical pixels; the step itself snaps to the nearest 1-2-5 value.
Implementations§
§impl FunctionPlane
impl FunctionPlane
pub fn new(canvas: Rect, center: Point, scale: f64) -> FunctionPlane
pub fn new(canvas: Rect, center: Point, scale: f64) -> FunctionPlane
A plane whose major rules land roughly an inch (72 px) apart.
pub fn with_major_spacing(self, spacing: f64) -> FunctionPlane
pub fn major_step(&self) -> f64
pub fn major_step(&self) -> f64
The major grid step in world units: the 1-2-5 step nearest to
Self::major_spacing on screen at the current zoom.
pub fn paint_grid(
&self,
scene: &mut Scene,
transform: Affine,
text_renderer: &mut TextRenderer,
theme: &Theme,
ground: AlphaColor<Srgb>,
)
pub fn paint_grid( &self, scene: &mut Scene, transform: Affine, text_renderer: &mut TextRenderer, theme: &Theme, ground: AlphaColor<Srgb>, )
Paint the grid clipped to the canvas: minor and major rules, the axes
through the world origin (when it is on screen), and numeric labels at
major steps in Caption tabular figures. ground is the canvas fill
the rules derive their edge against. A label that would touch its
neighbour is skipped, and every label stays whole inside the canvas.
Trait Implementations§
§impl Clone for FunctionPlane
impl Clone for FunctionPlane
§fn clone(&self) -> FunctionPlane
fn clone(&self) -> FunctionPlane
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for FunctionPlane
impl Debug for FunctionPlane
§impl PartialEq for FunctionPlane
impl PartialEq for FunctionPlane
impl Copy for FunctionPlane
impl StructuralPartialEq for FunctionPlane
Auto Trait Implementations§
impl Freeze for FunctionPlane
impl RefUnwindSafe for FunctionPlane
impl Send for FunctionPlane
impl Sync for FunctionPlane
impl Unpin for FunctionPlane
impl UnsafeUnpin for FunctionPlane
impl UnwindSafe for FunctionPlane
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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