Skip to content

Animation

StructChartGuruChartGuru
[Serializable]
public struct Animation

Describes how a chart value change animates. Modeled after SwiftUI’s Animation: static factories produce common curves; the fluent Delay/Speed/Repeat modifiers decorate the animation.

Usage:

chart.Animation = Animation.EaseInOut(0.35f);
chart.Animation = Animation.Spring(duration: 0.4f, bounce: 0.2f);
chart.Animation = Animation.Default.Delay(0.1f);

A ChartGuru.Chart with no Animation (null) applies changes instantly, matching Swift Charts’ behavior of not animating unless withAnimation / .animation is used.

public Animation.Kind Curve { get; }

No description is available for this member.

Returns

ChartGuru.Animation.Kind — No return description is available.

public Easing EasingPreset { get; }

Named easing Preset (only used by ChartGuru.Animation.Kind.Easing).

Returns

ChartGuru.Easing — No return description is available.

public float Duration { get; }

Base duration in seconds, before speed scaling.

Returns

System.Single — No return description is available.

public float Bounce { get; }

Spring bounce amount. Typical range [-0.3, 0.7]. Only used for spring curves.

Returns

System.Single — No return description is available.

public float Mass { get; }

No description is available for this member.

Returns

System.Single — No return description is available.

public float Stiffness { get; }

No description is available for this member.

Returns

System.Single — No return description is available.

public float Damping { get; }

No description is available for this member.

Returns

System.Single — No return description is available.

public float InitialVelocity { get; }

No description is available for this member.

Returns

System.Single — No return description is available.

public float DelaySeconds { get; }

No description is available for this member.

Returns

System.Single — No return description is available.

public float SpeedFactor { get; }

Speed multiplier. >1 = faster, <1 = slower.

Returns

System.Single — No return description is available.

public int Repeats { get; }

Total number of plays. Matches Apple’s repeatCount(_:) semantics: an autoreverse counts toward the total. 0 is the default (uninitialized) and is interpreted as “play once”. System.Int32.MaxValue = repeat forever. Example: RepeatCount(2, autoreverses: true) plays forward once, then in reverse.

Returns

System.Int32 — No return description is available.

public bool Autoreverses { get; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public bool IsRepeating { get; }

True when the animation plays more than one cycle (counting autoreverses).

Returns

System.Boolean — No return description is available.

public float C1x { get; }

Cubic Bézier first control-point X (only used by ChartGuru.Animation.Kind.TimingCurve).

Returns

System.Single — No return description is available.

public float C1y { get; }

Cubic Bézier first control-point Y (only used by ChartGuru.Animation.Kind.TimingCurve).

Returns

System.Single — No return description is available.

public float C2x { get; }

Cubic Bézier second control-point X (only used by ChartGuru.Animation.Kind.TimingCurve).

Returns

System.Single — No return description is available.

public float C2y { get; }

Cubic Bézier second control-point Y (only used by ChartGuru.Animation.Kind.TimingCurve).

Returns

System.Single — No return description is available.

public float EffectiveDuration { get; }

Effective duration after speed scaling.

Returns

System.Single — No return description is available.

public static Animation Default { get; }

SwiftUI .default — since iOS 17 this is a critically damped spring rather than an ease curve. Equivalent to .smooth, i.e. .spring(duration: 0.5, bounce: 0).

Returns

ChartGuru.Animation — No return description is available.

public static Animation Linear(float duration = 0.35)

No description is available for this member.

Parameters

Name Type Description
duration System.Single

Returns

ChartGuru.Animation — No return description is available.

public static Animation EaseIn(float duration = 0.35)

No description is available for this member.

Parameters

Name Type Description
duration System.Single

Returns

ChartGuru.Animation — No return description is available.

public static Animation EaseOut(float duration = 0.35)

No description is available for this member.

Parameters

Name Type Description
duration System.Single

Returns

ChartGuru.Animation — No return description is available.

public static Animation EaseInOut(float duration = 0.35)

No description is available for this member.

Parameters

Name Type Description
duration System.Single

Returns

ChartGuru.Animation — No return description is available.

public static Animation Spring(float duration = 0.5, float bounce = 0)

SwiftUI-style spring. bounce ranges from -1 (overdamped) through 0 (critically damped, no overshoot) to 1 (very bouncy). Typical values: 0 to 0.3.

Parameters

Name Type Description
duration System.Single
bounce System.Single

Returns

ChartGuru.Animation — No return description is available.

InterpolatingSpring(float, float, float, float)

Section titled “InterpolatingSpring(float, float, float, float)”
public static Animation InterpolatingSpring(float mass = 1, float stiffness = 100, float damping = 10, float initialVelocity = 0)

Classical spring parameterized by mass/stiffness/damping/initialVelocity.

Parameters

Name Type Description
mass System.Single
stiffness System.Single
damping System.Single
initialVelocity System.Single

Returns

ChartGuru.Animation — No return description is available.

public static Animation Bouncy(float duration = 0.5, float extraBounce = 0)

No description is available for this member.

Parameters

Name Type Description
duration System.Single
extraBounce System.Single

Returns

ChartGuru.Animation — No return description is available.

public static Animation Smooth(float duration = 0.5, float extraBounce = 0)

No description is available for this member.

Parameters

Name Type Description
duration System.Single
extraBounce System.Single

Returns

ChartGuru.Animation — No return description is available.

public static Animation Snappy(float duration = 0.5, float extraBounce = 0)

No description is available for this member.

Parameters

Name Type Description
duration System.Single
extraBounce System.Single

Returns

ChartGuru.Animation — No return description is available.

public static Animation SpringResponse(float response = 0.55, float dampingFraction = 0.825)

A spring animation parameterized by perceptual response and damping fraction. Mirrors SwiftUI’s .spring(response:dampingFraction:blendDuration:). response is the stiffness expressed as a perceptual duration in seconds (lower = snappier). dampingFraction of 1 is critically damped (no bounce), lower values bounce more.

Parameters

Name Type Description
response System.Single
dampingFraction System.Single

Returns

ChartGuru.Animation — No return description is available.

TimingCurve(float, float, float, float, float)

Section titled “TimingCurve(float, float, float, float, float)”
public static Animation TimingCurve(float c1x, float c1y, float c2x, float c2y, float duration = 0.35)

An animation created from a cubic Bézier timing curve. Mirrors SwiftUI’s .timingCurve(::::duration:). Control points are in [0, 1].

Parameters

Name Type Description
c1x System.Single
c1y System.Single
c2x System.Single
c2y System.Single
duration System.Single

Returns

ChartGuru.Animation — No return description is available.

public static Animation FromEasing(Easing easing, float duration = 0.35)

Creates a named easing animation for UI Toolkit and custom authoring surfaces. The named curves use the standard Penner-style formulas behind their labels instead of collapsing to generic ease-in/ease-out/ease-in-out curves.

Parameters

Name Type Description
easing ChartGuru.Easing
duration System.Single

Returns

ChartGuru.Animation — No return description is available.

public Animation Delay(float seconds)

Return a copy that starts seconds after being triggered.

Parameters

Name Type Description
seconds System.Single

Returns

ChartGuru.Animation — No return description is available.

public Animation Speed(float factor)

Return a copy that plays at factor× speed.

Parameters

Name Type Description
factor System.Single

Returns

ChartGuru.Animation — No return description is available.

public Animation RepeatCount(int count, bool autoreverses = true)

Repeat the animation for the given total number of plays. Matches SwiftUI’s repeatCount(_:autoreverses:): autoreverses count toward the total. A value of 1 plays forward once and never reverses (even with autoreverses true); 2 plays forward then in reverse; 3 plays fwd/rev/fwd; etc.

Parameters

Name Type Description
count System.Int32
autoreverses System.Boolean

Returns

ChartGuru.Animation — No return description is available.

public Animation RepeatForever(bool autoreverses = true)

Repeat forever until cancelled, matching SwiftUI’s repeatForever.

Parameters

Name Type Description
autoreverses System.Boolean

Returns

ChartGuru.Animation — No return description is available.

public float Evaluate(float t)

Evaluate the animation curve at t in [0, 1], returning the eased progress value. Spring curves can overshoot beyond 1 before settling.

Parameters

Name Type Description
t System.Single

Returns

System.Single — No return description is available.

public bool Equals(Animation other)

No description is available for this member.

Parameters

Name Type Description
other ChartGuru.Animation

Returns

System.Boolean — No return description is available.

public override bool Equals(object obj)

No description is available for this member.

Parameters

Name Type Description
obj System.Object

Returns

System.Boolean — No return description is available.

public override int GetHashCode()

No description is available for this member.

Returns

System.Int32 — No return description is available.

public override string ToString()

No description is available for this member.

Returns

System.String — No return description is available.