pub struct GraphMotion { /* private fields */ }Expand description
图谱画布动效状态机。所有取样都是纯函数:now 来自 motion_now(cx)。
Implementations§
Source§impl GraphMotion
impl GraphMotion
pub fn set_reduced(&mut self, reduced: bool)
pub fn reduced(&self) -> bool
pub fn node_entered(&mut self, id: NodeId, now: f64)
Sourcepub fn node_exited(&mut self, id: NodeId, now: f64)
pub fn node_exited(&mut self, id: NodeId, now: f64)
逻辑上立即隐藏;绘制层保留到退场渐变结束。
pub fn is_exiting(&self, id: NodeId, now: f64) -> bool
pub fn exit_sample(&self, id: NodeId, now: f64) -> Appear
pub fn prune(&mut self, now: f64)
pub fn animating(&self, now: f64) -> bool
pub fn enter_sample(&self, id: NodeId, now: f64) -> Appear
pub fn has_entering(&self, now: f64) -> bool
pub fn drop_enter(&mut self, id: NodeId)
Sourcepub fn dim_factor(&self, now: f64) -> f32
pub fn dim_factor(&self, now: f64) -> f32
当前淡出强度 0..=1(0 = 无淡出)。取样结束后收敛为终值。
pub fn dim_animating(&self, now: f64) -> bool
Sourcepub fn animate_view(
&mut self,
from: &Viewport,
to: &Viewport,
center: Vec2,
now: f64,
) -> bool
pub fn animate_view( &mut self, from: &Viewport, to: &Viewport, center: Vec2, now: f64, ) -> bool
从 from 平滑过渡到 to(中心 + 缩放);reduced motion 返回 false 表示立即跳转。
pub fn cancel_view(&mut self)
pub fn view_animating(&self) -> bool
Trait Implementations§
Source§impl Debug for GraphMotion
impl Debug for GraphMotion
Auto Trait Implementations§
impl Forget for GraphMotion
impl Freeze for GraphMotion
impl Move for GraphMotion
impl RefUnwindSafe for GraphMotion
impl Send for GraphMotion
impl Sync for GraphMotion
impl Unpin for GraphMotion
impl UnsafeUnpin for GraphMotion
impl UnwindSafe for GraphMotion
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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 moreSource§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
Source§type NoneType = T
type NoneType = T
The type of the none-equivalent value that
NoneValue::null_value produces.Source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().