In this Session…
Before you begin…
To follow along, download:
and the snapshot library:
How To GraphXR 8. Layout and Pinning
Before You Begin…
Ideally, you’ll have worked through Module 7. Preferences.
If you’re starting here, and you want to follow along, you’ll need to:
As we’ve already seen, layouts can help us discover and work with graph patterns in our project. With our data loaded, let’s first click the Pin/Release toolbar icon to return to the default force-directed layout.
The Layout panel includes tabs to adjust the default layout appearance, to work with Geometric and hierarchical layouts, and to create Parametric 3D scatterplots.
In addition to detailed controls in the Layout panel, the Quick Layout toolbar icon provides a one-click menu of often-used geometric layout options.
We’ll delve into the various layout options in detail in a moment.
A pin icon appears on the nodes arranged with the geometric grid layout, showing that they are pinned to that xyz location in the project space.
We use the Pin / Release toolbar icon to pin (or release) selected nodes.
When you select pinned nodes, the icon changes to Release. Simply click to release those nodes to the default force-directed layout. With no data selected, you can click to release (or pin) all the data.
To release all pinned data and return to a force layout in one click, open the Layouts panel and Geometric layout tab. Click on an empty part of the graph to de-select all data, and click the Release button.
Now let’s look at force-directed layout. It’s a dynamic physics simulation that arranges nodes and edges of your graph for reasonably good 3D visibility. Open the Layout panel and Force tab. Here you can adjust some of its key parameters. Adjustments affect all the data except for any pinned nodes.
Adjust the Link Strength slider to control how strongly the edges of the graph pull the nodes together. TIP: If the graph moves out of the view, click Center To or Fly Out toolbar icons.
Edge length can also be controlled by the Link Distance slider.
The Gravity slider controls how strongly all nodes are attracted to a central point.
The Charge slider adjusts how strongly nodes are attracted to each other. Moving the slider tothe left results in greater repulsive force between the nodes.
Use the Collision slider to separate nodes that overlap in the view. This is particularly useful in a 2D view, to un-stack nodes projected on top of one another.
Move the Z-Compress slider to the right to flatten the node layout so that it is more 2-dimensional.
A fully 2D layout can be useful, especially for reports. In the Project panel and Settings tab, click the 2D Mode checkbox. You’ll longer be able to rotate the view of the graph in 3D, and the Z-Compress slider will be hidden.
When you move nodes around the graph space by left click dragging them, the remaining unpinned nodes are rearranged. To prevent this, the Enable/Disable Force Layout toolbar toggle temporarily disables force layout.
To display nodes randomly distributed roughly within a 3D cube you can click the Enable/Disable Force Layout toggle (in the Layout panel or toolbar) then click Randomize Node Positions. Pinned nodes are not included.
Restore Default Settings resets slider controls to their defaults. The graph data also returns to the default force layout, again, except for any pinned nodes.
The Quick Layout menu available in the toolbar lets you apply many geometric layouts in one click, and to Expand or Contract a layout by a default scale factor.
For example, nodes can be arranged in hierarchical rings or trees around a central selection of nodes, and we can do this from the Quick Layout menu.
We’ll first select the Episodes nodes and Hide them temporarily, because we just want to see Character nodes arranged around their respective House nodes. The depth of hierarchical Ring or Tree layouts can be set in the Geometric layout panel, but not in a Quick Layout.
Next, select the House nodes, and in the Quick Layout menu choose Circle, and then Expand, as many times as you like to expand the circle layout. (While this isn’t necessary, it will make it easier to see the Ring layout you’ll apply next.)
With the House nodes still selected, click Quick Layout and choose Ring from the menu. The Character nodes are now arranged in rings around their respective House nodes.
With the House nodes still selected, choose Tree in the Quick Layout menu. The Character nodes are arranged in trees to the right of their respective House nodes.
Choose Ring again to return to the ring layout. Now click Show Hidden Nodes in the toolbar to restore our hidden Episode nodes.
We can experiment with adjusting the layout from here. For example:
Now go to the Layout → Geometric tab and click Release to return to the default force layout.
The Geometric layout tab provides more layout options, controls to position nodes precisely in the project space, and the ability to order nodes by a property value.
As with Quick Layout we can apply a Line, Grid, Circle, Spiral, Cube, or Spring layout to any selection of nodes. But here we can also order the nodes by a property value.
Select our House nodes, click the Order by Property checkbox, select the House Category and houseName property, and click the Ascend (or Descend) checkbox. Now click Line.
In the Legend, select Episodes. Order by seasonEpisode property and click Grid. For all geometric layouts, unselected and unpinned nodes stay in force layout around the selected nodes (unless you disable force layout using the toolbar icon).
In the Legend, select Characters nodes, order the nodes by the kills property, and click Circle..
Rotate, Scale, and Shift controls let you adjust the orientation, scale, and position of a selection in the 3D space. Select Character nodes and click Rotate Y to rotate the default 90 degrees. Select House nodes and click Expand (or Contract) to expand or contract the line layout by the default 1.5 times.
Select the Episodes category that’s in a grid layout and click the Shift Y button to shift the nodes up by the default 1.1 times.
You can enter positive or negative values for Rotate, Scale, and Shift, to reposition any selection of nodes precisely in the graph space.
At any time, you can choose a new layout for a selection of nodes or the entire graph. Select Characters nodes and click Cube to display the nodes in a 3D cube.
If no nodes are selected a geometric layout arranges all the nodes. To see this, deselect all nodes and click Spiral, then click Expand several times.
A Distribution layout spreads nodes grouped by a property value in the X, Y or Z direction. To illustrate, we’ll first go to the Project=>Category tab, choose Episodes and set seasonNumber as a caption.
Back in the Geometric layout tab, select Episodes nodes. Under Distribution, click the Spread Out checkbox and increase the Range to 6. Click Order by Property, choose seasonNumber, and click the Ascend and Number checkboxes.
Finally, click X to distribute the Episodes nodes by seasonNumber along the X-axis.
Now click Release to return to the force layout.
Quick Layout uses default settings for Ring or Tree layouts. Scroll down in the Geometric tab to see that we can set the Ego depth (i.e. the number of hops from the central node), scale the edge Length, and order nodes by a property value.
As we did before, lay out House nodes in a circle, ordered by houseName, then Expand the circle using the Quick Layout menu. Again, this simply makes it easier to see the results.
With the House nodes still selected, scroll down to the bottom of the panel.
Notice that with Ego depth set at 1, the Episodes nodes remain in force layout.
With House nodes still selected, click Tree. Character nodes are arranged in a tree pattern to the right of their respective House nodes. Click Left, Right, Up, or Down checkboxes and Tree again to re-orient the connected nodes.
Click Ring again to display our ring layout. You can also change orientation for rings (but it’s easier to see the effect in trees).
The rings or trees are laid out on a 2D plane, but other nodes can be positioned anywhere in the 3D project space. For example, select the Episode nodes and apply a Grid or Cube layout with nodes ordered by the seasonEpisode property.
At any time you can click Release to return all nodes to the default force layout. Any pinned nodes are automatically released.
Now open the Tree layout tab. Here you can arrange nodes as a hierarchy starting from any selection of nodes. Select House nodes and click Apply. The House nodes form the base of the tree and unselected nodes follow level by level according to their connection to the base nodes.
Select Episode nodes and click Apply. Now the Episode nodes form the base of the tree. This immediately separates out the many Character nodes that are not yet connected to an Episode.
Use the Axis slider and click Apply to scale the tree layout. To return to a force layout, click Reset.
Next we’ll go to the Parametric layout tab to create a 3D scatterplot. Use the X, Y, and Z dropdown menus to select properties, and click Apply. Your choices are saved, letting you apply that layout again.
Use the Axis slider to adjust the size of the 3D layout, and the Show Axes and Show Grid checkboxes to toggle the labeled axes and grid on and off.
We’ve selected properties that exist only on Episodes nodes (seasonNumber, millionViewers, and totalLines). Nodes without the properties (e.g. House or Character), or which have a null value are stacked up at the origin point.
To see a force layout of the nodes that don’t have the selected properties, click the Enable Force Layout toggle in the layout panel (not in the toolbar). Disable Force Layout returns us to our specified parametric layout.
Click Reset to return the entire graph to force layout.
We’ve seen how to lay out data in the project space for easier visualization and selection of graph patterns. Next, in Module 9: Time Series, we’ll look at exploring the graph by filtering on timestamp properties.
How To GraphXR: Module 9. Time Series.