pub struct ZoomPath { /* private fields */ }Expand description
A smooth zoom-and-pan path between two viewport framings, after
van Wijk & Nuij (Smooth and efficient zooming and panning, 2003) —
the same path d3.interpolateZoom implements. A framing is
(cx, cy, w): the content-space point at the viewport’s center and
the content-space width the viewport shows (inner.w / zoom). The
path zooms out, translates, and zooms back in along a hyperbolic arc,
so mid-flight frames keep both endpoints’ context on screen instead
of tunneling across the canvas at full magnification.
Pure math with no clock: sample with a progress fraction t ∈ [0, 1]
and pace t however you like. length is the
perceptual path length S — the natural basis for a duration. This
is a Layer-3 primitive: the smooth ViewportRequests ride on it,
and a custom host or widget can sample it directly.
Implementations§
Source§impl ZoomPath
impl ZoomPath
Sourcepub fn new(start: (f32, f32, f32), end: (f32, f32, f32)) -> Self
pub fn new(start: (f32, f32, f32), end: (f32, f32, f32)) -> Self
The path from start to end, each a (cx, cy, w) framing with
w > 0 (non-positive widths are clamped to a tiny epsilon).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ZoomPath
impl RefUnwindSafe for ZoomPath
impl Send for ZoomPath
impl Sync for ZoomPath
impl Unpin for ZoomPath
impl UnsafeUnpin for ZoomPath
impl UnwindSafe for ZoomPath
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.