# CreateVisualizationContext(Hash128)

> Creates and registers a new visualization context.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor.GraphVisualization](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization.md)
* **Assembly:** UnityEditor

```csharp
public static Context CreateVisualizationContext(Hash128 graphID)
```

### Parameters

**** (\[Hash128]\(/engine/6000.6/script-reference/unityengine/hash128)): The authoring graph's ID, accessible through [Graph.ID](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graph/id.md). For subgraphs, use the root graph ID.

### Returns

| Type                                                                                               | Description                                                                                                                                                                                                                                                                                                                                           |
| -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Context](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/context.md) | The newly created [Context](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/context.md), registered with the [Registry](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/registry.md) and associated with the provided `graphID`. Use it to apply visualization data to nodes in that graph. |

### Remarks

The authoring graph's ID is used to associate the visualization context with a specific graph. For subgraphs, using the root graph ID associates the context with the entire graph hierarchy. A unique identifier for the context is accessible through [Context.VisualizationContextID](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/context/visualizationcontextid.md). Dispose of the returned [Context](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/context.md) when it is no longer needed. Throws an ArgumentException when the provided graph ID is not valid.

### Examples

```csharp
using Context context = Registry.CreateVisualizationContext(graphGuid);
NodeReference nodeRef = context.GetNodeReference(nodeID);
nodeRef.FillAmount = 50f;
```
