Exercise 5: Building a Categorical Map

COVE Data Definition Exercises

Learning Objectives

In the Exercise 4 you built a numeric data map. Now it’s time to learn how to define categorical maps, which visualize non-numeric data series, for example:

  • Home, School, Work, Vehicle
  • Low, Medium, High

The first series above is non-sequential (or qualitative).  The second series is sequential.  COVE supports both types of series. (For more on this topic, see Example Categorical Maps.)

This exercise also demonstrates how to add data columns to tooltips and the data table, while reinforcing some skills from the last exercise, such as setting up filter controls.

(For explanations of the concepts demonstrated in this series of exercises, see Defining Data for Visualization.  For descriptions of the other exercises in this series, see the Exercise Index.)

Source Data

This exercise uses the same source data you used for the previous exercise. This time, however, the data series to be visualized is the Status column (rather than Cases per 100K). To see the full source data file, click the link below the image.

Screen capture of source data in Excel

View source file [XLS – 332 KB]

Visualization You’re Building

Below is an example of the categorical map you’re building. Note the following:

  • As with the last exercise, filter controls are required for the columns Year, Sex, and Age Group.
  • While not visualized, Cases per 100K displays in tooltips and the data table.
  • The map has two special classesNot Applicable and In Progress. (The legend is not unified, so only two classes display for 2018.)

Step-by-Step Instructions

Create the Content Item

  1. From the WCMS content (folder) browser, select New Content Item, and when prompted, select Data Visualization.
  2. Click the button Open Visualization Editor.
  3. On the Choose Visualization Type tab, select United States (State- or County-Level) under Maps.

Import the Data

  1. On the Import Data tab, select Load from URL and then copy and paste the following URL:
    https://wwwdev.cdc.gov/wcms/4.0/cdc-wp/data-presentation/data/exercise-data/us-map-3-filters.csv
  2. Click Load.
  3. Select Vertical for the Orientation.
  4. When asked whether there are multiple series, select No.  (Data maps are inherently single-series.)
  5. Click Configure your visualization.

Configure Your Visualization

  1. In the Type panel change the the Data Classification Type to Categorical.
  2. In the General tab, set the Title and other supporting text as you wish.
  3. In the Columns panel, select State as the Geography column and Status as the Data column.  Note that the map begins with three regular data classes.
  4. While in the Columns panel, click Add Special Class.  Select Status as the Data Key, with NA as the Value and “Not Available” as the Label.
  5. Add a special class for the Status value “In Progress.”  Now the legend should show only one regular class, for the value Active.
  6. Also in the Columns panel, click Add Column.  Select Cases per 100K and check Show in Data Table and Show in Tooltips.  Also add the Label “Cases per 100K.”
  7. In the Filters panel, add and configure the filter controls for Year, Sex, and Age Group.

Fine-Tune the Visualization

Take a minute to compare your chart to the example at the top of the page.  Note the following:

  1. Are the filter controls in the correct order and accurately labeled?  In the Filters panel, adjust the filter settings as needed (order, labels, etc.).
  2. The special classes may be listed first in the legend. In the Legend panel, check Show Special Classes Last and Single Column Legend.  Also, make certain your legend has a Title.
  3. Interact with your map and note the tooltip text.  The word “State:” is not necessary, but it would be nice to have a label for the Status.
  4. In the Columns panel, for the geography column, check Hide Geography Column Name in Tooltip.  (Any time you can remove visual clutter, do it!)
  5. Also in the Columns panel, add the Label “Status” for the Data column.
  6. Select a state again to see the differences in the tooltips.
  7. In the Visual panel, adjust the palette as you like.  (The example map uses the second non-sequential palette from the left.)

General Tips

  • COVE offers a hex grid layout, which solves the issue of the great size differential among the states (often called “the Alaska effect”).  To see how this option changes your map, check Display as Hex Map in the Type panel.  Note that DC is part of this layout.  If the source file has no data for DC, the district is shaded light gray. Because the map produced by this exercise has two special classes, we avoided the hex layout because it creates three shades of gray, which may be difficult to distinguish for some users.  See example hex map.
  • The two map exercises in this series provide a solid introduction to map building with COVE, but there are a lot more features to explore, for example:

Next Exercise

Exercise 6 takes us back to charts.  This exercise walks you through the building of a single-series chart with confidence intervals.  (If you don’t have a need to show confidence intervals, we still recommend this exercise because single-series charts are defined a bit differently from multi-series charts.)