---
description: A utility for capturing and displaying data in the Graph View
---

# Graph

This behavior is used in the Unity Editor only for capturing and displaying data in the Timeflow [Graph View](../../../user-guide/timeflow-view/graph-view). Use the Graph tool to help visualize animation for analysis and troubleshoot issues.

{% hint style="success" %}
To add a Graph tool, right-click on an object in the Timeflow view and select from the context menu: Add Tool > Graph
{% endhint %}

{% hint style="info" %}
Please note that this behavior is for analysis only and does not presently provide any utility for baking, converting, or exporting data. &#x20;
{% endhint %}

Graph can be used in one of two ways; either use Channel Link to route data into the Graph channel, or use scripting to send data from your own custom scripts. Both methods are explained in more detail below.&#x20;

## Using Channel Link

Drag the channel link well to connect the Graph channel with an input source. This can be used to connect to any numeric value channel.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FLGAO93gBQZSzclRpWOll%2Fimage.png?alt=media&#x26;token=a9b6abac-990c-49ce-a500-572c97b5b5f4" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Graph only displays singular float values. If connected to a multi-numeric property, you may select which axis/attribute to display. When connected to an int or other non-float value, it is converted to floating point for display purposes.&#x20;
{% endhint %}

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2F2worXpeZSMymftmj8UVR%2Fimage.png?alt=media&#x26;token=a87b364a-379c-4084-8382-7e767da2df45" alt=""><figcaption><p>Click the pencil icon on the Channel Link to edit the link and select an input axis.</p></figcaption></figure>

## Capturing Data

Initially the graph data is empty and will not show anything in the Graph View until data has been captured. Select the object to view the Graph settings in the Inspector, which provides the primary controls for recording data.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FpiQqB7LztxyPyTzJmQQf%2Fimage.png?alt=media&#x26;token=f9785c8f-c0b8-4efa-86be-c6523efe2330" alt=""><figcaption></figcaption></figure>

### Start Recording

The Graph component only records values when recording is enabled. Press Start Recording to begin recording values. This also starts playback in the Timeflow view for convenience.&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FuWR7VSg9WricvS6uPEQB%2Fimage.png?alt=media&#x26;token=8e8d966e-4eb2-4554-b45a-815e4970a661" alt=""><figcaption><p>The controls are highlighted in red while recording.</p></figcaption></figure>

### Work Area Only

Use the [Work Area](../../../user-guide/timeflow-view/toolbar/work-area) to capture data in a specific region of time. This is helpful to isolate a specific moment in an animation and to limit data being captured to that time range, while preserving data outside of the range.&#x20;

{% hint style="info" %}
Note that when Work Area Only is toggled, it also affects the work area setting in the Timeflow view accordingly. Looping is also disabled in the view so that recording doesn't repeat and overwrite itself, with playback instead stopping at the end of the work area or timeline duration and recording ending.
{% endhint %}

### Resume

If enabled, playback resumes from the current time. Otherwise if Resume is disabled, pressing Start Recording rewinds to the beginning of the Work Area if in use, or the beginning of the timeline.&#x20;

### Clear Data

Press this button any time to clear the captured data. If Work Area Only is enabled, only the data in the work area is cleared. This operation is undoable.

### Clear On Record

If enabled, the data is cleared automatically when recording starts. This is helpful to prevent overlapping captured data.

{% hint style="info" %}
Data is captured based on the actual frame rate of playback and the [Time Tolerance](../../../../user-guide/menus-and-shortcuts/preferences#time-tolerance) setting in the [Timeflow Preferences](../../../user-guide/menus-and-shortcuts/preferences), as well as the local [Update Settings](../../../user-guide/timeflow-editor/update-settings) of the Graph behavior.  It is possible for example to use [Force Framerate](../../../../user-guide/timeflow-editor/update-settings#force-framerate) or other update setting to capture data at specific time intervals. Unless Strict Tolerance is used, graph data may actually be captured between frames.
{% endhint %}

## Displaying Data

Data is displayed in the Graph View similar to other channels, however the graph data cannot be selected or manipulated and is only for display.&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FfZNid0JuJRETLKD7ES7G%2Fimage.png?alt=media&#x26;token=8b44ec36-aaad-4fb8-88f7-50fe89b63fe7" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Use the shortcut key F to fit the graph data in view.
{% endhint %}

## Scripting Graph Data

This method is useful for visualizing data generated from custom scripts to expose otherwise abstract data into a visual form for inspection. This can be helpful to diagnose issues with timing and interpolation that may be too difficult to spot with logging or other debugging methods.

To integrate this with your own custom script, get a reference to the Graph component and simply call RecordValue(float value). Use the above interface in the Graph inspector to start and stop recording, or control it with your script.

Please refer to the Graph component script for further reference and code comments.

Assets/AxonGenesis/Timeflow/Behaviors/Tools/Graph.cs

{% hint style="success" %}
Graph Example

You may also refer to the example scene provided with a basic scripting example:

Assets/AxonGenesis/Timeflow/Examples/Scenes/Tools/Graph.unity
{% endhint %}
