How to: Browse and Navigate Graph Documents
In Visual Studio Ultimate, you can perform different tasks to help you explore the nodes and links on a graph document.
Certain layouts are more suitable than other layouts for specific tasks. To select a suitable layout to explore code on the graph, perform these steps:
To select a layout for the graph
If the graph toolbar is not visible, on the View menu, point to Toolbars, and then click Directed Graph.
On the graph toolbar, select a task and a layout from the following table:
Explore architectural layers in the code
Left to right
Right to left
Top to bottom
Bottom to top
Show nodes as a tree structure.
The graph tries to arrange nodes so that most of the dependencies flow in the specified direction.
Explore concepts or natural clusters in the code
Show nodes as clusters.
The graph arranges the most dependent nodes near the center of the clusters and the least dependent nodes near the outside of those clusters.
Explore dense areas of dependencies in the code
Dependency Matrix View
Show nodes as rows and columns in a matrix. Dependencies are represented as cells at the intersections of the row and column that they connect. Cell colors represent different kinds of dependencies.
The graph arranges rows and columns alphabetically or by the number of links per node.
To arrange rows alphabetically, next to Dependency Matrix View, click Sort Rows By Display Name. To arrange rows by the number of links, click the same button again, which will have the tooltip: Sort Rows By Link Density.
To arrange columns alphabetically, click Sort Columns By Display Name. To arrange columns by the number of links, click the same button again, which will have the tooltip: Sort Columns By Link Density.
To see dependencies regardless of their direction, click Show Reflexive View. To see dependencies based only on direction, click the same button again, which will have the tooltip: Hide Reflexive View.
If you select tree layout or quick clusters layout, you can also select modes to perform the following tasks:
Explore the flow of dependencies through the code
Show only those linked nodes that are on the same path as the selected nodes. If no nodes are selected, then the graph selects the primary hub.
Circular links do not appear in this mode. Instead, nodes that participate in circular relationships are copied so that they appear on both sides of the selected nodes. Dependencies that are more than one level away from the selected node will not necessarily appear in order because the graph layout is based on the shortest path from the selected node.
To turn on this mode, click Turn on Butterfly Mode. To turn off this mode, click the same button, which now shows the tooltip: Turn off Butterfly Mode. You cannot undo butterfly mode.NoteDeleting selected nodes in this mode causes connected nodes to disappear from the graph. This occurs because the selected nodes no longer exist on the graph. To restore the missing connected nodes, turn off butterfly mode.
To change the center of the butterfly layout, double-click another node.
Explore the local neighborhood around selected nodes
Neighborhood Browse Mode
Show only those nodes that are specific number of links away from selected nodes.
To turn on this mode, click the Neighborhood Browse Mode drop-down list, and then select the level of nodes that you want to see.NoteTo change the center of the neighborhood, double-click another node.
To turn off this mode and see all nodes, click the Neighborhood Browse Mode drop-down list, and then select All.
When there are too many links to see the details of the graph, use the following tasks to browse the graph more easily:
Perform these steps
Drag the graph left, right, up, or down
Press and hold CTRL as you drag the graph.
Zoom in or out of the graph
Press and hold CTRL as you rotate the mouse wheel.
- or -
Click the plus sign (+) or the minus sign (-) on the graph toolbar.
To zoom in on a specific area, use the right mouse button to draw a rectangle around the area.
Select recently selected nodes
To select a previously selected node, on the Visual Studio toolbar, click the Navigate Backward drop-down list, point to the current graph, and then select a node.
To select a node that was selected after the current one, click Navigate Forward.
Find the source or target of a link
Use this method when there are too many links to easily see the source or target of a specific link.
Find a node by name
Perform these steps
Show or hide the contents of a group
To expand a single group, right-click the node, point to Group, and then click Expand. You can also click the chevron button to expand the group.
To expand all groups, right-click the graph, point to Group, and then click Expand All.
To collapse a single group, right-click the node, point to Group, and then click Collapse.
- or -
Click the chevron button to collapse the group.
To collapse all groups, right-click the graph, point to Group, and then click Collapse All.
To expand or collapse a selected group by using the keyboard, click the PLUS key (+) or the MINUS key (-).
To expand or collapse everything inside a selected group, press and hold the SHIFT key while you click the PLUS key (+) or the MINUS key (-).
View the properties of a node or link
Point to the node or link until the tooltip appears.
For example, the tooltip for an aggregated link lists the kinds of individual dependencies that it represents.
- or -
Right-click the node or the link, and then click Properties.
Examine the dependencies behind a link
This applies only when each end of the link is connected to an assembly. If the assembly information has been removed from the graph, then nothing will happen.
Examine a node more closely
Double-click the node.
- or -
Right-click the node, and then click View Content.
In butterfly or neighborhood browse mode, double-clicking a node makes that node the center of the graph.
View the items that a node or link references
Available only when the Reference attribute is set for the node or link in the graph's .dgml file. For more information about how to add references to items from nodes or links, see How to: Edit and Customize Graph Documents.
If the node or link references a single item, double-click the node or link.
- or -
Move the mouse pointer over the link, and then click the plus sign (+).
If the node or link references multiple items, right-click the node or node, point to Goto, and then click a reference.