Adding Structure to Your Diagrams in Microsoft Visio 2013

  • 5/15/2013

Finding containers and lists in Visio

Several Visio 2013 templates take advantage of the properties of containers and lists to enhance ease of use and to add valuable features. In this section, you will discover three examples.

Swimlanes

One of the most prominent examples of list and container usage is for cross-functional flowcharts, also known as swimlane diagrams. (Refer to Chapter 4, “Creating Flowcharts and Organization Charts,” for more information about this type of diagram.)

The swimlane add-in was completely redesigned for Visio 2010 in order to take advantage of both lists and containers, with the net effect that a cross-functional flowchart (CFF) is a list of containers! The Visio 2010 structure is also used for Visio 2013 swimlane diagrams:

  • The framework that holds swimlanes is a list.

  • Each swimlane is a container.

httpatomoreillycomsourcemspimages1697296.jpg

In this exercise, you will create part of a swimlane diagram to understand how lists and containers are used.

  1. Click the top edge of the CFF, and then type Sample Swimlane Diagram. Because the CFF structure is a list, the text you typed appears in the list heading.

  2. Click the rectangle at the left end of the upper swimlane, and then type Accounting. Because the swimlane is a container, your text appears in the container heading.

  3. Click the rectangle at the left end of the lower swimlane, type Legal, and then press the Esc key. The following graphic shows the results of steps 1, 2, and 3.

    httpatomoreillycomsourcemspimages1697298.png
  4. Drag a Process shape into the Accounting swimlane. Notice that the swimlane shows the green border that you previously learned was characteristic behavior for containers.

    httpatomoreillycomsourcemspimages1697300.png
  5. Drag a Decision shape into the Legal swimlane and position it to the right of the Process shape in the Accounting lane.

  6. Drag the AutoConnect arrow on the right side of the Process shape to link that shape to the Decision shape.

    httpatomoreillycomsourcemspimages1697302.png
  7. Position the cursor just outside the CFF frame at the junction between the Accounting and Legal swimlanes (the pointer is visible in the following graphic).

    httpatomoreillycomsourcemspimages1697304.png

    The presence of the list insertion bar on the boundary between the Accounting and Legal lanes provides visible evidence that you are working with lists. Also, be sure to note the blue insertion triangle that appears at the end of the insertion bar. Clicking the blue insertion triangle automatically adds the default insertion object at the insertion bar location.

  8. Click the blue insertion triangle, shown in the previous graphic. Visio inserts a new swimlane between the other two and maintains all existing connections between shapes in the lanes.

    httpatomoreillycomsourcemspimages1697306.png
  9. Click in the heading area of the Accounting swimlane and drag it down below the Legal lane. Visio moves the Accounting lane to the end of the list and maintains the connections between shapes within and across all swimlanes.

    httpatomoreillycomsourcemspimages1697308.png

Adding, deleting, and rearranging swimlanes is more predictable and logical in Visio 2013, because containers and lists provide the underlying structure.

Swimlane diagrams derive another benefit from being built as containers: shapes in the container know they are contained. To find evidence of this, examine the Function field in the shape data for any flowchart shape in a swimlane. As an example, the following graphics show the shape data for the process shape (on the left) and decision diamond shape (right) from the preceding graphic. The value in the Function field is derived dynamically from the swimlane heading; if you change the value of the swimlane title, the Function field will be updated for all contained shapes.

httpatomoreillycomsourcemspimages1697310.jpg

Wireframes

Visio 2013 includes a revamped set of user interface (UI) design shapes that were initially introduced in Visio 2010. For this chapter, the key point of interest about the redesigned shapes is that many of them are either containers or lists.

Software designers use wireframe shapes to create mockups of dialog boxes and other visual elements that will be displayed by their applications. When you use Visio 2013 to create a mockup of a dialog box, you will find that the Dialog Form shape is a container. Consequently, as you add buttons and controls to your dialog form, they become container members. If you move, copy, or delete your dialog box, all of the contained shapes are included. If you have ever created a UI mockup using Visio 2007 or earlier, it won’t take more than a moment or two of experimentation to realize how significant an improvement this is.

Some Visio 2013 UI shapes are lists, including, not surprisingly, the List Box control. When you drop one into a dialog form container, the list is prepopulated with three list members. You can add, delete, and resequence list members by dragging them, as you learned in Adding shapes to lists earlier in this chapter.

In this exercise, you will use the Wireframe template to build a prototype of a simple dialog box that looks like the one in the following graphic. Even if you aren’t a UI designer, you should find this exercise useful in learning more about the behavior of containers and lists.

httpatomoreillycomsourcemspimages1697312.png
  1. Drag a Dialog form shape from the Dialogs stencil, drop it on the page, and then zoom in so you can work with the shape.

  2. Drag a Dialog button shape from the Dialogs stencil and glue it to a connection point in the upper-right corner of the dialog form.

    httpatomoreillycomsourcemspimages1697314.png

    When you drop a Dialog Button shape onto the page, it automatically opens the Shape Data dialog box.

  3. In the Shape Data dialog box, click OK to accept the default value for Type.

    httpatomoreillycomsourcemspimages1697316.png
  4. Drag another Dialog button shape into the dialog form container and glue it to the left end of the previous one; when the Shape Data dialog box opens, click Maximize in the Type list, and then click OK. Repeat a third time and select Minimize in the Type list.

    The top of your dialog form container now looks like the following graphic.

    httpatomoreillycomsourcemspimages1697318.png
  5. Drag a Panel shape from the Dialogs stencil and drop it onto the page below (not inside) the dialog form. You need to drop it outside the dialog form, because it is too large to fit inside, and you want it to become a member of the Dialog container. (If a shape doesn’t fit inside a container, it will not become a container member.)

  6. Use the Size & Position window or the resize handles to change the width of the Panel shape to approximately 3 inches (75 mm) and its height to about 1.25 inches (30 mm).

  7. Drag the Panel shape into the dialog form and position it in the bottom center.

    httpatomoreillycomsourcemspimages1697320.png
  8. Drag an Upper tab item shape from the Dialogs stencil, position it as a Boundary shape at the upper-left corner of the panel container, type Tab 1, and press Esc.

    By attaching the Upper tab item shape to the boundary of the panel container, you have “welded” them together. If you reposition the panel container, the tab follows along.

    httpatomoreillycomsourcemspimages1697322.png
  9. Drag another Upper tab item shape from the Dialogs stencil, position it as a Boundary shape to the right of the previous tab, type Tab 2, and press Esc.

  10. Drag a List box from the Controls stencil and position it in the upper-left corner of the panel container as shown in the following graphic.

    httpatomoreillycomsourcemspimages1697324.png
    httpatomoreillycomsourcemspimages1697326.png
  11. Select the uppermost Text item and type A, select the middle Text item and type D, and then select the bottom Text item and type E.

  12. Position the cursor just to the left of the Column 1 list shape, between the A and D labels.

    httpatomoreillycomsourcemspimages1697328.png
  13. Click the blue insertion triangle twice to add two entries to the List Box shape, and then type B into the upper item and C into the lower one.

    httpatomoreillycomsourcemspimages1697330.png
  14. Click once on the outer edge of the Dialog form shape to select it.

  15. On the Format tab of the Container Tools tool tab set, in the Size group, click Fit to Contents. The Dialog form container shrinks to fit the size of the Panel container located within it.

    httpatomoreillycomsourcemspimages1697332.png

The dialog box mockup you’ve created in this exercise isn’t going to win any design awards. If you wanted to create a real mockup, you would add additional controls, text, colors, and themes. However, by completing this exercise, you have created a practical application for nested containers and lists, and have an example of a container with a border shape.

Legends

In Chapter 10, “Visualizing your Data”, you learned about data graphics and created a legend for your data graphics. A data graphics legend is actually a structure consisting of an outer list, one or more containers as list members, and lists within those containers. For example, the same legend is shown in both of the following graphics. The structure is loosely visible on the left. However, after drawing a bounding box around the entire legend, the structure is very apparent on the right: the legend consists of three containers (Legend, Owner, Risk) and two lists, all of which are outlined in green.

httpatomoreillycomsourcemspimages1697334.png

If you return to the data graphics diagram you created in Chapter 10 (or open the Data graphics legends_start file in the Chapter11 practice files folder), you will find that you can add, delete, rename, and move legend components. Throughout your changes, however, the legend maintains its overall structure because of the nested containers and lists.