8 Layout and Pinning In this Session… Before you begin… Using Layouts to organize and visualize data: Pinning and Releasing nodes Using Force directed, Parametric, Geometric,and Tree layouts. Using the Quick Layout toolbar menu for geometric layout. To follow along, download: HowTo_08START_2_14.graph… and the snapshot library: HowTo_08START_2_14.graph… Slide Text 3 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. 4 The Layout panel includes tabs to adjust the default layout appearance, to work with Geometric and hierarchical layouts, and to create Parametric 3D scatterplots. 5 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. 6 We’ll delve into the various layout options in detail in a moment. First, though, we’ll look at pinning to understand how it affects working with layouts. Open the Project panel and Settings tab, and deselect Hide Pin Icon. 7 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. In addition, nodes that are moved manually (using left click + drag)are pinned.The number of currently pinned nodes appears on the badge next to the icon. 8 We use the Pin / Release toolbar icon to pin (or release) selected nodes. Pinned nodes are not included when you apply or adjust a force layout, and that may be what we want. But we can always release pinned nodes if desired. 9 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. 10 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. 11 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. 12 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. 13 Edge length can also be controlled by the Link Distance slider. 14 The Gravity slider controls how strongly all nodes are attracted to a central point. 15 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. 16 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. 17 Move the Z-Compress slider to the right to flatten the node layout so that it is more 2-dimensional. 18 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. 19 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. 20 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. 21 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. Now let’s look at our other layout options. 22 The Quick Layout menu available in the toolbar lets you apply many geometric layouts in one click, and to Expand or **Contrac**t a layout by a default scale factor. 23 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. 24 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. 25 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.) 26 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. NOTE: If you don’t select central nodes, GraphXR chooses for you. 27 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. 28 Choose Ring again to return to the ring layout. Now click Show Hidden Nodes in the toolbar to restore our hidden Episode nodes. 29 We can experiment with adjusting the layout from here. For example: • Select House nodes and move them using left click + drag. • Select Episode nodes and apply a Spiral (or other) layout. • Expand or Contract any selection of nodes, or all nodes. 30 Now go to the Layout → Geometric tab and click Release to return to the default force layout. 31 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. 32 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. 33 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. 34 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). 35 In the Legend, select Characters nodes, order the nodes by the kills property, and click Circle.. 36 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. 37 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. 38 You can enter positive or negative values for Rotate, Scale, and Shift, to reposition any selection of nodes precisely in the graph space. 39 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. 40 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. 41 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. 42 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. 43 Now click Release to return to the force layout. 44 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. 45 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. 46 With the House nodes still selected, scroll down to the bottom of the panel. For Ego depth, enter 1, and for the edge Length, enter 6. Click Order by Property and select Character and the kills property. Now click Ring. 47 Notice that with Ego depth set at 1, the Episodes nodes remain in force layout. 48 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. 49 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). 50 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. 51 At any time you can click Release to return all nodes to the default force layout. Any pinned nodes are automatically released. 52 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. 53 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. 54 Use the Axis slider and click Apply to scale the tree layout. To return to a force layout, click Reset. 55 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. 56 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. 57 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. 58 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. 59 Click Reset to return the entire graph to force layout. 60 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.