pub struct Transform {
pub pitch: f64,
pub yaw: f64,
pub scale: f64,
pub x: i32,
pub y: i32,
}
Expand description
Transformations to be applied to your chart. Is modified by user input(if the mouse is enabled) and used by Chart::draw() and your builder callback.
Chart::draw() applies the scale and the x/y offset to your plot, so unless you want to create some effects on your own you don’t need to worry about them.
If you are creating a 3d plot however you will have to manually apply the pitch and yaw to your chart with the following code:
ⓘ
chart.with_projection(|mut pb| {
pb.yaw = transform.yaw;
pb.pitch = transform.pitch;
pb.scale = 0.7; // Set scale to 0.7 to avoid artifacts caused by plotter's renderer
pb.into_matrix()
});
Fields§
§pitch: f64
Pitch of your graph in 3d
yaw: f64
Yaw of your graph in 3d
scale: f64
Scale of your graph. Applied in Chart::draw()
x: i32
X offset of your graph. Applied in Chart::draw()
y: i32
Y offset of your graph. Applied in Chart::draw()
Trait Implementations§
impl Copy for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
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