Your final lab assignment in this course is to design an interactive geovisualization using Tableau. While this lab draws heavily on concepts discussed in Lesson 9, you will be incorporating knowledge from throughout the course in your design. Unlike other labs, Lab 9 is a two-week assignment.
In Week One, you should develop an idea and gather data for your lab, and complete the example Tableau Story tutorial (Visual Guide Part 1). This tutorial is ungraded, but will teach you the basics of working in Tableau. You will then create your own Tableau Story using your own data. The Lab 9 Visual Guide Part 2 contains tips and tricks for working in Tableau beyond what is covered in Part 1, and a wealth of additional resources are available via the web.
Submit the link to your Story (hosted on Tableau Public) as a text comment. There is no PDF deliverable for this lab.
A rubric is posted for your review.
Please refer to the Lesson 9 Lab Visual Guides: Part 1 and Part 2.
In this lab, we will design an interactive geovisualization with Tableau. The final result will be a Tableau Story similar to the one about Airbnb data in Portland we discussed in Lesson 9.
To begin, open the Age_andSex_AFF_ACS_2017 [6] Excel file. This file has multiple fields (columns) of data for each state in the United States. It was created by making minor edits to a CSV file downloaded from the US Census Bureau's American Community Survey (ACS). If you're not sure what data to use for your own project, the ACS is a good place to start.
The most important component of this Excel sheet is the State column—Tableau will automatically recognize and map several geographies, such as States, Countries, Zipcodes, and Coordinates (lat/long). You may choose to map another geography (e.g., counties, census tracts, block groups) for your own Lab, but using one of these geographies is more advanced and will not be covered here.
Open Tableau Desktop and Connect to the Excel File (Figure 9.2.). The file has already been formatted properly for import. If you like, you can select "Extract" to extract the data. If not, you will be prompted to do so later, before publishing your Story online.
Select Sheet 1 at the bottom of the page to open a Tableau worksheet.
Before continuing, save your file as a Tableau Workbook file (the default file type). As with projects in ArcGIS Pro, you should regularly save as your work.
You should now see a screen similar to the one in Figure 9.3. State should be listed among your tables, and your measures should list the many fields of data that were included in your Excel file.
The distinction between table and measures in Tableau is important. A table is an element, such as a state, year, company, etc. that you are interested in viewing data about. A measure is that data, such as % insured, or a number of products sold. For geographic data, a table is always the geographic unit (e.g., state, country) and a measure is the data to be mapped. Tableau often correctly identifies the table and measures in your data, though occasionally you may have to convert one to the other. In this example, all measures and tables were correctly identified.
Now it's time to make your first map! Click and drag the State table into the middle of your worksheet (Figure 9.4). Tableau will automatically recognize this geography and create a map.
Drag a measure of interest onto an appropriate visual variable in the Marks section (Figure 9.5). In this example, “Percent Female; Estimate; AGE 85 years and over” is dragged to the Color box. You might choose another mark (symbol) type such as size if you were mapping count values (such as the TOTAL number of 85+ yr old females, rather than the rate).
Select “Edit Colors” to choose a different color palette – remember to choose a color progression appropriate for the progression of your data! You can use the “advanced” menu to make further edits.
Recall that the focus of this lab is to create an interactive map/dashboard with coordinated views. Here, we create a bar chart with the same data as our map. The intent of this is to show the same data in two different ways. Eventually, we will connect the map and graph so that the user can explore one via the other.
To create a graph, first, create a new worksheet. Then drag one measure (e.g., “Percent Female; Estimate; AGE 85 years and over”) and one table (here, "State") to Columns and Rows section. It doesn't matter which is which - switching them will simply change the orientation of your graph.
You may notice that when you add your measure (here, % female 85+) to a graph/chart/map in Tableau, the default measurement is SUM (see Figure 9.7). Since in our data we have only one value per state, the sum is equivalent to the original value. Thus, changing this is not necessary. If you had an Excel file with multiple rows for each state, Tableau would sum those values and display that calculated value - you may, in that case, want to display the average in each state instead. You can change how your measures are calculated by clicking on the colored green oval "pill" of the measure you want to change.
Once we've created a graph, it's time to add color! Drag the same data measure from the sidebar to the Color box in the Marks section to color your bars according to that data—as the length of the bar already represents this value, adding color here is called dual encoding. Edit your color scheme so that it matches the one from your map. Your color schemes (map and graph) should be equivalent, as we are only going to create one legend for our dashboard.
The last step before adding our visualizations to a dashboard is to clean up their design. Add chart/map titles (if you wish), shorten and clarify axis labels, and simplify tooltips (Figure 9.8). Adjust font size and style as appropriate.
Click the "New Dashboard" icon at the bottom of the screen (Figure 9.9) to create a Tableau Dashboard. This is what we will use to connect our map and graph. Drag your two worksheets onto the dashboard and re-arrange as you wish. Experiment with different arrangements of elements (e.g., map, graph, legend) on the dashboard.
Note: I have increased the size of my dashboard for demo purposes - you will likely want to use a standard size, and these are listed in the Size dropdown menu. The size of your dashboard on your screen vs. on the web will depend on the resolution of your laptop screen. It may take a bit of trial and error to get yours to appear the correct size.
You can use the Objects menu (bottom left) to add other elements, such as images, text, and blank layout elements to your dashboard. In Figure 9.10, a text object was used to add explanatory text, and an empty object was used to insert a margin above the legend.
To connect your map and graph, use the Actions menu (Figure 9.11). Here, Highlight is used to connect your map and graph upon user selection of an element on either. This is the default action if you do not customize anything, but you are welcome to use a different action or actions if you choose.
Your graph and map should now be connected! Example connection upon user interaction shown in Figure 9.12.
Once this is complete, create two more worksheets (one map; one graph) for another measure (I chose % Males 85+). When this is complete, you will have two similar dashboards that visualize your two chosen variables (e.g., % Females 85+, % Males 85+). You may choose to use the same legend and color scheme for both dashboards or switch it up – just keep in mind design principles from this course.
Select "New Story" at the bottom of the page to create a Tableau Story. While Tableau dashboards can contain multiple worksheets, Tableau stories can contain multiple dashboards.
Here, we create simple Story: Drag your first dashboard to the center of your new Story, then add a New Blank Story point. Use that new Story point to add your 2nd dashboard. Add an overall Story title and Story point titles (shown in the clickable grey boxes) as you wish.
Once you're happy with your Story design, you're ready to publish to Tableau Public. Make sure you've saved your work first! You will need to sign into (or create) your Tableau Public account before you can publish your work.
To publish to Tableau Public, use the menu structure to go to Server -> Tableau Public -> Save to Tableau Public (Figure 9.14). If you make changes to your Story, you can "re-publish" it at any time to update the online version.
When publishing your Story, you may be presented with a notice that a Data Extract is required (Figure 9.15). If so, simply select Create Data Extract in the window, and save the extracted data as suggested. Then repeat the above steps (Figure 9.14) to publish.
This example can be found here: Aging in the United States, a Tableau Story by Cary Anderson. [1] Use this link to check and see how your results from this visual guide/tutorial compare! If you do not see the "Create Data Extract" option as shown in Figure 9.15, then look at this link [7] to a help page with steps on how to do it. About midway down the webpage is the "Create an extract" section and it worked to publish part 1.
Credit for all screenshots is to Cary Anderson, Penn State University. Screenshots from Tableau Desktop, data source: US Census Bureau, the American Community Survey.
There are several geographies that Tableau will automatically recognize: States, Countries, Zipcodes, and Coordinates (lat/long). The process for Countries and Zipcodes is the same as States, which was demonstrated in the tutorial (Visual Guide Part 1). Shown below is a spreadsheet of school locations in Philadelphia, PA, which includes point location data (lat/long coordinates).
Lat/long data in the above spreadsheet is shown in the X and Y columns. To make things easier, I'm going to rename these latitude and longitude. Clean up anything else as needed. I edited one zipcode that was improperly formatted.
Recall from Part 1 that dimensions are elements such as States that you want to visualize data about, and measures are the variable data we want to display. In this example, Tableau categorized latitude and longitude as measures, but we would like to use them as dimensions. To change a data type from a measure to a dimension, simply drag it to the dimensions section.
Once you have longitude and latitude dimensions, you can add them to the columns and rows sections (respectively) to create your point locations map! Use the Marks menu (Figure 9.18) for adjusting symbol size, shape, etc.
We previously discussed cleaning up tooltips in Tableau. Tooltips will automatically describe data displayed on your map, but you may want to add additional data to them. For example, here we have mapped all schools and colored them by their school type. If we want to add the school name to the tooltip but not to the map, we can drag that measure directly to the Tooltip box in the Marks section to add it.
There are many options for altering the design of graphs and charts as well. For example, you can "drag to resize" a chart (Figure 9.21). Note in this example that the categorical color palette matches the one from the map - this is a good way to make comparisons easier for your viewers.
You can also change how your measures are calculated (and thus, displayed). In Part 1, each dimension (state) had only one row in the data table, so it didn't matter whether we mapped the sum or the average - they were the same value. In this second example, we could visualize the sum, or total enrollment for each type of school, (as in Figure 9.21) but it would be more interesting to show the average enrollment for each school type. You can alter how a measure is calculated as shown in Figure 9.22 below.
Though the examples in the lab instructions only use maps and bar charts, there are many other charts available in Tableau that you might create. The example shown below is a treemap. Click the "Show Me" menu to view all chart options. You also can look online for more advanced customization options - for example, there are tutorials that discuss how to create hexbin maps.
The data you use may have multiple types of geographies. For example, though we have only mapped the schools from this Philadelphia Schools dataset as points so far, the data also listed the zipcode for each school. Zipcodes are one of the geographies that Tableau automatically recognizes, so we can use this to create a graduated symbol or choropleth map to compare with our point locations map.
To do this, as we did with the States dimension in Part 1 of the Visual Guide, simply drag the Zipcode dimension onto the map.
To symbolize this map, drag your measure of interest to the color section of the Marks window, as shown below. Tableau will likely automatically created a choropleth (they call this a "filled map") but you can change this as well.
Tableau provides quite a few options for advanced customization. For example, you may want to use a color palette, such as one from ColorBrewer [8] or CARTOColors [9], that is not included in Tableau. Follow the instructions here: Create Custom Color Palettes [10] to add your own custom color palette.
Another (simpler) customization you can make is to change the basemap used in your Tableau map. The default light grey Tableau map, for example, does not provide much locational context. We can instead use a basemap from Mapbox. Log into your Mapbox Studio account, and find a map - you should select "Share & use" as shown in the top-right corner of Figure 9.27 below. This will lead to a URL you will paste into Tableau.
Instructions are also listed in Mapbox for adding a map to Tableau. You should follow these instructions (click Map > Background Maps > Map Services > add > Mapbox Maps; paste the share URL). Once you paste the URL, the other fields in Tableau will auto-populate.
Tableau dashboards can become fairly complex, but for this lab, we will not include too many pieces. Figure 9.29 is an example of a dashboard that compares two maps and a bar chart. See Part 1 of this visual guide for a refresher on how to create a Tableau dashboard.
As you work, try out different arrangements of maps and charts, as well as different chart types. In Figure 9.30 below, the graphics shown in this guide have been divided into two dashboards: one about enrollment by zipcode, and one about enrollment by school type. Each of these dashboards was then added to the overall Tableau Story as a story point (the two story points are Enrollment and Types).
Once you've designed your story, the last step is to shorten and clarify axis labels, simplify tooltips, adjust font sizes and styles, etc.
This example can be found here: Schooling in Philadelphia, a Tableau Story by Cary Anderson. [11] Note that you can download the workbook to practice with if you so choose.
Credit for all screenshots is to Cary Anderson, Penn State University. Screenshots from Tableau Desktop, data source: OpenDataPhilly, School Facilities [12]
Links
[1] https://public.tableau.com/profile/cary.anderson#!/vizhome/Lab9_Part1_Tutorial/Story1
[2] https://public.tableau.com/profile/cary.anderson#!/vizhome/Philly_Schools/Story1
[3] https://www.lynda.com/Tableau-tutorials/Tableau-10-Essential-Training/500540-2.html
[4] https://onlinehelp.tableau.com/current/pro/desktop/en-us/maps_howto_simple.htm
[5] https://onlinehelp.tableau.com/current/pro/desktop/en-us/maps_options.htm
[6] https://pennstateoffice365.sharepoint.com/:x:/s/GEOG486FIles/EaAD-Y1tRtBKnns9fJZfCOAB7CFXkenb2d_Ud9ob-NVCug
[7] https://help.tableau.com/v2020.3/pro/desktop/en-us/extracting_data.htm
[8] http://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3
[9] https://carto.com/carto-colors/
[10] https://onlinehelp.tableau.com/current/pro/desktop/en-us/formatting_create_custom_colors.htm
[11] https://public.tableau.com/views/Philly_Schools/Story1?:embed=y&:display_count=yes
[12] https://opendataphilly.org/datasets/schools/