Skip to content

ChartTransition

ClassChartGuruChartGuru
public sealed class ChartTransition

The one transition driver of a chart renderer. It owns timing (delay, duration, repeats and autoreverse), the presented value of every mark and the source state a new transition starts from. Data transitions pair marks by MarkKey (or the chart's Chart.TransitionMapping) and retarget from the presented state when they start while another one runs. All buffers grow with the largest chart and are reused, so starting and running a transition allocates nothing once warm.

public ChartTransition(Chart chart)

Creates the driver for chart.

Parameters

NameType
chartChartGuru.Chart

public bool TryGetCurrentColor(int index, out Color color)

Presented color of the mark at index while colors animate.

Parameters

NameType
indexSystem.Int32
colorUnityEngine.Color

Returns

System.Boolean

StartType(ChartType, ChartType, Animation)

Section titled “StartType(ChartType, ChartType, Animation)”
public void StartType(ChartType sourceType, ChartType targetType, Animation animation)

Starts a cross-fading chart-type morph from sourceType to targetType.

Parameters

NameType
sourceTypeChartGuru.ChartType
targetTypeChartGuru.ChartType
animationChartGuru.Animation

StartType(ChartType, ChartType, MorphOptions)

Section titled “StartType(ChartType, ChartType, MorphOptions)”
public void StartType(ChartType sourceType, ChartType targetType, MorphOptions options)

Starts a chart-type morph with options (animation, style, point mapping and completion callback). The chart has already switched to targetType; values stay at their targets while the renderer morphs the marks between the two types. A running type morph finishes first.

Parameters

NameType
sourceTypeChartGuru.ChartType
targetTypeChartGuru.ChartType
optionsChartGuru.MorphOptions
public void StartEntry(Animation animation)

Grows every mark in from zero, the entry animation hosts play when a chart first appears.

Parameters

NameType
animationChartGuru.Animation
public void Complete()

Ends the running transition on its target and raises ChartTransition.Completed.

public void Cancel()

Stops the running transition without raising completion; the chart then draws its target.

public void Dispose()

Releases the native buffers; do not use the instance afterward.

public ChartTransitionKind Kind { get; }

What the running or last transition animates.

Returns

ChartGuru.ChartTransitionKind

public bool IsRunning { get; }

True while a transition runs.

Returns

System.Boolean

public float Progress { get; }

Progress through the current cycle in [0, 1].

Returns

System.Single

public float EasedProgress { get; }

Progress after the animation curve; springs may overshoot 1 briefly.

Returns

System.Single

public ChartType SourceType { get; }

Chart type the transition starts from.

Returns

ChartGuru.ChartType

public ChartType TargetType { get; }

Chart type the transition ends on.

Returns

ChartGuru.ChartType

public bool IsTypeMorph { get; }

True while a chart-type morph runs.

Returns

System.Boolean

public bool IsEntryAnimation { get; }

True while the entry animation (Chart.ReplayEntryAnimation(Animation?)) grows every mark in from zero.

Returns

System.Boolean

public ChartMorphStyle MorphStyle { get; }

Visual style of the running type morph.

Returns

ChartGuru.ChartMorphStyle

public PointMapping PointMapping { get; }

How the running transition pairs source and target marks.

Returns

ChartGuru.PointMapping

public Vector2 SourceXDomain { get; }

Effective X domain the axes animate from during a data transition.

Returns

UnityEngine.Vector2

public Vector2 SourceYDomain { get; }

Effective Y domain the axes animate from during a data transition.

Returns

UnityEngine.Vector2

public NativeArray<float> CurrentValues { get; }

Presented value of every mark of the chart, by mark index: the value renderers draw while the transition runs. Entering marks start from zero. The array is a view into reused storage; do not keep or dispose it.

Returns

Unity.Collections.NativeArray{System.Single}

public bool HasAnimatedColors { get; }

True while mark colors animate (heat-map cells).

Returns

System.Boolean

public event Action<ChartTransition> Started

Raised when a transition starts, including when it retargets a running one.

Returns

System.Action{ChartGuru.ChartTransition}

public event Action<ChartTransition, float> Progressed

Raised with the cycle progress in [0, 1] every time a running transition advances.

Returns

System.Action{ChartGuru.ChartTransition,System.Single}

public event Action<ChartTransition> Completed

Raised when a transition reaches its target; not raised when it is retargeted or cancelled.

Returns

System.Action{ChartGuru.ChartTransition}