Version: Unity 6.6 Alpha (6000.6)
Language : English
Types of nested graphs
Add comments to graphs

Organize with nested graphs

Organize complex graphs with nested graphs, or subgraphs.

Large, complex graphs can be difficult to understand. To simplify a graph, you can collapse part of it into levels of nested graphs, called subgraphs. This makes the overall graph easier to read. You can also focus on the content within the subgraphs with less visual distraction.

This information covers nested graphs only. For information on other ways to organize graphs, refer to Organize graphs.

Prerequisites

Your graph needs to have support for subgraphs enabled, before you can use subgraphs.

Use subgraphs

Create subgraphs to simplify the graph. Expand subgraphs to undo the nesting and return the content to a higher level of the graph.

Create a subgraph

To create a local subgraph, use one of the following methods:

  • Right-click on the canvas, then select Create Empty Local Subgraph.
  • Right-click a placemat’s heading/title, and select Convert to Local Subgraph.
  • Right-click a node or nodes, then select Create Local Subgraph from Selection.

To add another local subgraph if one exists in the graph:

  1. Right-click on the canvas, then select Add Node. The Add a graph node window appears.
  2. Double-click on the local subgraph.

To create an asset subgraph, you must already have a graph asset with a valid subgraph type. To create the asset subgraph, use one of the following methods:

  • Drag a graph asset from the Project window into the Graph window.

  • Create the asset subgraph from the Add a graph node window:

    1. Right-click on the canvas, then select Add Node. The Add a graph node window appears.
    2. Double-click on the asset subgraph.

A subgraph node appears. It has a different shape from other nodes. A subgraph node has a tab on top.

Open and close a subgraph

To view a subgraph in detail and interact with its contents, open the subgraph. You can open the subgraph through one of these methods:

  • Right-click the subgraph node, then select Open Local Subgraph.
  • Double-click the subgraph node.
  • Select the Enter Subgraph icon on the subgraph node.

After you open the subgraph, the canvas and the MiniMap window show only the contents of the subgraph.

To close the subgraph and return to a higher level of the graph, use the breadcrumbs at the top of the Graph view to select the graph or subgraph you want to view.

After you close the subgraph, the canvas and the MiniMap window show the level of the graph that you selected.

Extract a subgraph

To return the contents of a subgraph to a higher level of the graph:

  1. Navigate to the level of the graph with the subgraph node.

  2. Extract the contents of the subgraph through one of the following steps:

    • Right-click the subgraph node, then select Extract Contents to Placemat.
    • Select the subgraph node, then press Shift+Ctrl+U on the keyboard.

After you extract the subgraph, its contents appear on a placemat. The name of the subgraph becomes the placemat title. If you extract a subgraph that had subgraphs nested inside it, the nested subgraphs will appear as subgraph nodes on the placemat.

Convert a subgraph

You can convert a local subgraph to an asset subgraph, or convert asset subgraph references to local subgraphs.

To convert a local subgraph to an asset subgraph:

  1. Navigate to the level of the graph with the local subgraph node.
  2. Right-click the local subgraph node, then select Convert to Asset Subgraph. The file explorer appears.
  3. Specify the graph asset you want to use for the subgraph, then select Save. The local subgraph node becomes an asset subgraph node. The asset subgraph node references the graph asset you specified.

To convert asset subgraph references to local subgraphs:

  1. Navigate to the level of the graph with the asset subgraph node.
  2. Right-click the asset subgraph node, then select Unpack to Local Subgraph. The asset subgraph node becomes a local subgraph node. The local subgraph node contains a copy of the content that was in the asset subgraph.

Delete the subgraph

To delete the subgraph and its contents:

  1. Navigate to the level of the graph with the subgraph node.
  2. Delete the node through one of the following methods:
    • Right-click the subgraph node, then select Delete.
    • Select the subgraph node, then press Del on the keyboard.

After you delete the subgraph, the subgraph node and its contents disappear from the graph.

Additional resources

Types of nested graphs
Add comments to graphs