Provides access to visualization data and features for a graph.
Create a Context through Registry.CreateVisualizationContext. The context remains valid until you call Context.Dispose.
While the context is alive, you can apply visualization changes (such as fill amounts and animations) to nodes in the associated graph.
Each context has a unique Context.VisualizationContextId assigned at creation, which lets you distinguish ownership when multiple consumers operate on the same graph.
Disposing the context unregisters it from the Registry and clears any visualization data added through it.
Additional resources: Registry, NodeReference, GraphMotion
// Create a visualization context for a graph, then drive a node's visual state. Context context = Registry.CreateVisualizationContext(graphGuid); NodeReference nodeRef = context.GetNodeReference(nodeID); nodeRef.FillAmount = 50f;
// Clean up when no longer needed. context.Dispose();
| Property | Description |
|---|---|
| IsGraphLoaded | Indicates whether the graph identified by the associated Graph.Guid is currently loaded. |
| IsValid | Indicates whether this context can still be used. The value becomes false after Context.Dispose is called. |
| Motion | The animation system used to drive progress animations on nodes in this visualization context. |
| NodeCustomizationEnabled | Whether node customizations are displayed in the graph canvas. |
| PortPreviewEnabled | Whether the port preview feature is enabled for this visualization context. Enabled by default. |
| VisualizationContextId | The unique identifier for this context. |
| Method | Description |
|---|---|
| ClearAllVisualization | Clears all visualization data associated with this context. |
| Dispose | Releases this context and clears all associated visualization data. |
| GetNodeReference | Returns a NodeReference that identifies the node with the given ID within this visualization context. |
| GetPortReference | Retrieves a reference to a port in the graph associated with this context, using the port's unique identifier. |