Earlier this month, Bobby Smiley and I gave a workshop called “Introduction to Data Visualization” as part of the Michigan State University Digital Humanities Workshop series for Fall 2015. Attendees came from an especially wide range of units across campus, so it seemed like the right topic to turn into a tutorial for future use. The tutorial below covers everything we introduced in the workshop, including:
- Getting set up with Tableau Public and loading in data
- Creating a map
- Creating an area chart
- Creating a tree map
- Compiling a dashboard
- Publishing to the web
The data used for this tutorial comes from my personal research (see here for more) and comes from the Roman de la Rose Digital Library. It shows locations of surviving manuscript copies of one medieval book, the “Roman de la Rose” and includes information about the manuscripts, such as: the institution where the book currently is held; the approximate date of its creation; whether the manuscript has any illustrations, etc.
It is important to note from the start that Tableau is a commercial software, and as such operates on a freemium basis. A Public account is free to use, but you have to save your workbooks publicly to the web. A Desktop account, which allows you to keep data and visualization private, is a whopping $999/user. There is a Tableau Academic option, which allows for free Desktop accounts for the classroom.
Part 1 – Getting set up
- Download Tableau Public for free at public.tableau.com
- Create a free profile at public.tableau.com (this step is required to publish your data to the web and thereby to save it)
- Download the csv datafile found at go.cal.msu.edu/tableau
- Open Tableau and click “text file”
- Open the csv file you just downloaded
- Tableau will look like this:
In the bottom half of the screen, we see the same information from the csv spreadsheet, and the top row shows column names as well as types of information. Note the icons below Latitude and Longitude. Below Longitude is a small globe, which indicates that Tableau recognizes the column’s information as geographic data. However, the icon below Latitute is a hash – this means that Tableau thinks this data is numeric, not geographic. Let’s fix Tableau’s error.
- Select the small hash icon below Latitude, and select “Latitude” in the “Geographic Role” section. Note that the icon then changes to the small globe, just like the Longitude column.
When working with your own data, you may have different types of geographic information – note that you have other ways to ID this info – area code, city, etc.
- Once the data types are all correct, click the orange “Go to worksheet” button in the center of the screen.
Part 2: Creating a Map
- You are given a blank workspace. On the left of the screen are each of the data columns/types. Those identified as strings (Abc) are listed under “Dimensions.” Other types of data (Numbers or Geo) are listed under “Measures.” For our purposes, “Date end” and “Date start” are listed as Numbers (#), but later we will treat them like strings. So, control click on them and drag them into “Dimensions.”
- Let’s put this data on a map. Control/Command click on “Latitude” and “Longitude.” Once you have selected one or more data type from either Dimensions or Measures, the “Show Me” box in the top right of your workspace will highlight with a blue box any visualization types that work with the data types you have selected. For Latitude and Longitude, we see that the map visualization is highlighted in blue. Click on the map.
- Now we can see a map, with a single point on it. Tableau has taken an average of all the Longitude and Latitude data (note the green boxes toward the top of the screen. Let’s fix this by telling Tableau to plot each point in the dataset. Select “Id” from “Dimensions” and drag and drop it onto the “Detail” box.
- Now we can see a map with many points around the world. Let’s size the points based on how many manuscripts (items) are at each location (based on Lat/Long). Select “Id” from “Dimensions” again and drag and drop it onto the “Size” box.
- Now we can get a sense of what places in the world have the highest density of these manuscripts. I have zoomed into show Europe for the moment because it has the most items in the dataset. Let’s add in some more information to the map. Let’s color the bubbles based on the number of manuscripts at each location that have at least one illustration. Select “Number of illustrations” from “Measures” and drag and drop it onto the “Color” box.
Now the bubbles show color gradation along a spectrum. See the “SUM(Number of illustrations)” box toward the lower left of the screen.
- You can adjust the color etc by clicking on the small drop down arrow in the “SUM(Number of illustrations)” box. Click on “Edit Colors…”
Change the color by clicking on the drop down “Palette” bar. You can change the display from showing color gradations on a continuous scale to showing points in 5 (or any number) of color buckets. To do so, check the “Stepped Color” box and adjust the number of steps you want to break down the color variation by. In the “Advanced” section, you may adjust the “Start”, “End”, and/or “Center” color values to correct for extreme outliers.
- Select “Institution” from the “Dimensions” pane and drag and drop it onto the “Label” box. Now the map displays labels for each Lat/Long point on the map. In the center pane, click on the drop down arrow of the “Institution” box, and select “Show Quick Filter.”
- A pane with a list of all institutions on the map now displays next to the map. This is a way to filter the information to only see manuscripts on the map from one or several institutions.
- At the bottom of the screen, double click on the “Sheet 1” tab and rename it.
Part 3: Creating an Area Chart
- Next to the tab you just renamed, click on the small graph tab. This will open a new workspace. Let’s create another visualization.
- Control/command click on the “Date start” field from “Dimensions” and “Number of Records” field from “Measures.” See how the “Show Me” box adjusts to select the best visualization for the data types selected. Click on the highlighted bar chart visualization.
- Tableau puts the dates on the Y-axis (Rows) and Number of records in the X-axis (Columns). At the top of the screen, switch those two by dragging and dropping.
- Let’s change the type of graph to an Area chart. In the “Marks” area, click on the drop down box and select “Area” instead of “Automatic.”
- Now that you have an area chart, rename the sheet. Then, click on the tab next to it to create another workspace.
Part 4: Creating a Tree Map
- Drag “Number of Records” into the “Column” bar at the top of the screen. Then, drag “Institutions” into the “Row” bar at the top of the screen.
- Tableau automatically creates a horizontal bar chart. Note how in the “Show Me” area has the bar chart option highlighted in blue. Select the Treemap visualization instead.
- Add in the number of items for each box shown by dragging and dropping the “Number of records” into the “Label” box.
- Now you have a tree map with labels. Rename the worksheet. Then click on the tab in the bottom right of the screen. This will open a Dashboard for displaying your visualizations.
Part 5: Compiling a Dashboard
- You will have a blank screen, which looks similar to the worksheets. First, adjust the size of the working area by clicking on the dropdown box in the lower left to change “Size” from “Range” to “Automatic.”
- Then, drag and drop each of your worksheets into the central work area. Note how the filters and legend information for each visualization is now detached from its original visualization type and clustered on the right of the dashboard.
- When you click on any of the content boxes on the dashboard, note the gray bar at the top. Move the box around within the dashboard by clicking and dragging the top center of the box. Delete the box from the dashboard [this will not delete the information, just your ability to see it on this particular dashboard] by clicking on the X in the top right. Resize the boxes as you like by dragging any of the four sides.
- Notice how the tree map only fills up only part of it’s content box. Click on the drop down arrow in the top right, and select “Entire View” under “Fit.” Now the tree map takes up the entire space of its box.
- Pair up any legend information you want to display on top of its relevant visualization. To move the “Number of illustrations” color gradation box onto the map, select the “Number of illustrations” box, click on the drop down arrow in the top right, and select “Floating.” Then drag the box over to the map area.
- To save space on the dashboard, eliminate the titles of each content box. Click on the drop down arrow in the top right of the box and uncheck “Show Title.”
- The “Institutions” checklist on the right of the dashboard currently only filters information to the map. To have it filter information for all 3 of the visualizations, click on the drop down arrow in the top right of the box and select “All Using This Data Source” under “Apply to Worksheets.”
Uncheck the “Null” box in the “Institutions” list and note how the tree map in particular adjusts to now show only manuscripts that have a listed institution.
- Add a title to the Dashboard by dragging and dropping the “Text” button from the left center of the screen to wherever you want to put it on the dashboard. Format the text as you would in Word. Then resize the content box as you would any other.
- Add a data source box at the bottom of the dashboard using the same method of dragging and dropping “Text” to where you want it. Then, change the name of the dashboard in the bottom tab from “Dashboard 1.”
Part 6: Publish to the Web
- Select “Save to the web” by clicking on File in the main menu. Tableau will prompt you to sign in to your account.
- Tableau will open a tab in a browser and display your dashboard. Scroll down, and edit the title, description, etc as you like. Uncheck the box “Allow workbook and its data to be downloaded by others” if you do not want to provide access to the data to the public.
- Once you are done editing, click Save, and you can see your visualization. It is fully interactive, just like from within the Tableau interface. Share it via the URL you see. You may also share by embedding the visualization directly into your own website.
- REMEMBER that with a Tableau Public account, any visualization that you publish will be publicly accessible. The only way to save a worksheet and/or dashboard with a Public account is to publish to the web.One way to reduce the visibility of your visualization and thereby to increase privacy is to go to your profile, hover over the visualization, and click on the eye icon in the top right. This will make the visualization not display publicly on your profile.
If you are concerned about privacy, you may take a screenshot of your visualization. Another option is to explore Tableau’s academic accounts. Find out more at tableau.com/academic.