Posted in Uncategorized

Choose Your Own Research Adventure: A Resource Guide for the UBC Information Literacy Tutorial

When I was earning my MLIS from UBC, I took a Teaching and Learning Enhancement-funded (TLEF) position to work with Katherine Miller on revising the Land and Food Systems Information Literacy Tutorial. We developed a Choose Your Own Adventure-style tutorial module to assess students’ familiarity with certain tools and resources and to inform decisions about the ongoing development and sustainability of the tutorial and its integration with LFS course content.

This format was chosen because it was not intrusive, largely enjoyable to students, and flexible – giving students additional help when desired and skipping ahead to more relevant content when it was not. Building the tutorial in a survey platform provided rich insight into the decision-making of students during the research process, which allowed us to revise the format of the tutorial and switch over to a more sustainable tool going forward.

We suggest this kind of gamification as less invasive and more informative alternative to pre- and post-testing, which merely tests recall of information, puts a significant time and effort burden on students, and offers only limited utility to the librarians responsible for developing and maintaining the content. Embedding Choose Your Own Adventure-style content in a more traditional/linear tutorial can give you a balance of assessment and sustainability, and help serve students with a variety of different learning styles.

Links:

Want a template for your own work? Download the Twine File as using Save Link As  to save the file to your computer. To modify or edit the content, visit Twinery.org on your own browser and import the file. This tutorial is licensed with Creative Commons Attribution Share Alike.

Thinking about making your own from scratch? Learn from our trials and errors and check out the overview of key tools below:

Tools Overview

Narrative Development Tools

Twine

Twine is a free, open source tool built for Choose-Your-Own-Adventure-style branching narratives. It’s one of the easiest tools to manage, track, and revise the various content paths you develop, and the simple [[double bracket]] branching makes it an easy drafting tool, as well.

However, Twine does not have any tracking ability built into the program. There are instructions for using Google Analytics as a tracker here, but even with the ability to track clicks, the data is fairly complex and difficult to interpret.

Twine can also be used as a rudimentary visualization tool, as it allows you to zoom out to a structural-level view of your content as your drafting. This creates a node-link visualization that you can manually arrange without having to create each box and link by hand (as with Excel or Tableau).

twine

  • A brief tutorial on Twine is available here.

Survey Tools

FluidSurvey was the survey tool supported by UBC and has robust tracking and embedding capabilities, as well as the ability to easily copy surveys, collaboratively write, and customize URLs. However, any survey tool with “skip logic” or branching functionality, which makes questions appear and disappear based on user selections, could work for this kind of project. However, the conditional rules quickly become complex to navigate, and it’s very hard to draft within the survey tool itself.

twinecompare

Quest

Quest is an interactive fiction tool that is designed for exploratory environments, rather than a directed path. For example, in Quest you build a room with objects in it (a library with a book) and users have a text-based game (“pick up book”, “look at book”, “read book”) for which you have drafted various responses.

 Visualization/Analysis/Reporting Tools

As far as I know, there are no “out of the box” tools to work with this kind of data. A list of the analysis and visualization tools we used in this project are described below, but all take a fairly significant degree of effort before you can find insights in the data.

Tableau

In Tableau, we were able to create an overview of the tutorial structure that would provide the text of each node on hover and show the different paths through the content. The template was labor intensive to create, but allows you to filter the results, orient yourself within the content, and see the overall user response to the module.

overview

The initial dashboard template was designed as part of Tamara Munzner’s Information Visualization Fall 2015 course. A copy of the final paper explaining and rationalizing the visualization choices in the dashboard above is available online here.

Excel

The first attempt to visualize the LFS CYOA tutorial was made in Excel. The image below is a screenshot of the flowchart we designed to understand the various paths through the tutorial. This was hand-created and arranged using the shapes and arrows tools.

flowchart

Arbor.js

This was a force-directed algorithm available online that uses a two-character arrow -> to connect the points on a node-link graph. Nodes can be color coded, as below, and manually or automatically arranged (and the amount of “gravity” and attraction/repulsion between nodes can be adjusted dynamically). However, this layout was also not very intuitive, as users experienced the narrative linearly, even if we did not design it that way.

forcedirect

Additional Resources

Interactive Fiction Database: A catalogue of Interactive Fiction/Choose Your Own Adventure-style games available to play online. To narrow the range of possibilities, check out this Top 50 list, past winners from the annual IF Competition, or XYZZY Award winners.

One Book, Many Readings: Beautiful analysis of printed CYOA books that offers some insight into the structure of CYOA narratives and is an enjoyable read in its own right.

Standard Patterns in Choice-Based Games takes a closer look at the structure of interactive narratives.

Choice Of Games offers Choose Your Own Adventure-style narratives in ebook form (Choice Of the Dragon is personally beloved). They have two posts (here and here) about their format that are worth checking out.

While none of these offer a step-by-step guide to the dashboard above, there are two Data+Science posts on Sankey Diagrams (here and here) and a post at Clearly and Simply on Network Graphs (here) that were essential in putting together the Tableau visualizations.

Advertisements
Posted in Uncategorized

Copy/Paste Text from Tableau to the Clipboard: A Quick Tableau Hack

If you’ve ever tried to copy/paste a line of text from a Tableau visualization, you’ve probably discovered that Tableau renders all text in visualizations as images. Even if you set “text” as the visualization type, it will still render as an image of the text that cannot be copied to the clipboard.

If you want your users to be able to copy a line of text – or even a small handful of text values –there’s a workaround you can build that allows them to do so. Because the titles of workbooks are rendered as text that can be copy/pasted, we can allow the user to select one comment at a time and copy paste from a separate location. It’s not an ideal solution by any means – and you can vote up an improved text feature request here [find link] – but it might work as a stopgap measure.

  1. Create a new worksheet and drag the field you would like to copy/paste (e.g. “Comment”) to Rows. If your users will be selecting a numeric value, you can construct a contextual phrase by concatenating a few values in a calculated field:
    "The value on "+STR([Date])+" was "+STR([Value])
  2. Drag the new workbook onto the dashboard with the primary visualization and edit the title of your new view:
    • Insert>[Comment]
    • This should now say “All”
  3. Add a new dashboard actions by going to Dashboard>Actions. This will allow users to select a single comment and have the text show up in the title of your new workbook.
    • Add Action>Filter
    • Source sheet: Your original visualization
    • Target Sheets: Your new workbook
    • Run on: Select
    • Clearing will: Exclude all values
    • The title should now say “None”
  4. Test your dashboard to see that the action works. When you select a value from your source sheet, the title should change to the text value you have selected.
  5. Now hide the data in the underlying file so that only the title is visible.
    • Uncheck “show header”
    • Under Format: remove shading, lines, and turn text white
    • Resize window to fit the space allotted
  6. Add instructions to make this action clear to your users (e.g. “select a value above to copy/paste text from here)

highlight

Posted in Uncategorized

Library Space Assessment in Tableau: A Step by Step Guide to Custom Polygon Maps and Dashboard Actions

This slideshow requires JavaScript.

Introduction

Libraries need a tool for understanding observational space count data that’s as flexible as the spaces they’re trying to assess. Endless rows of numbers are difficult to interrogate or understand with any degree of nuance – whether that’s observing how one area is used compared to the whole, or how popular a particular kind of seating is by time of day.

Interactive visualization provides one solution to this problem. By building a map of the space and connecting it to the data, libraries are able to quickly see patterns and query them on the fly. The ability to subdivide and cross-section your data allows you to answer the questions you’re particularly interested in and supports finding new answers to the questions you develop.

This tutorial presents two methods for building interactive Space Assessment dashboards in Tableau. If you already have observation data, you should be able to select the method that best matches your needs and the format of your data. If you’re considering a space assessment project, thinking about the desired visualization can help identify collection methods and sampling schedules that will better answer the questions you have about your space.

Sample Projects

Overview

If you’re fairly comfortable with Tableau, don’t like detailed instructions, or just want to jump right in, here’s a quick reference version of the tutorial below:

  1. Gather the key information for your project: floorplan map, seating capacity for each area, and the observation data
  2. Use the GitHub tool or Drawing Tool to trace polygons over your floorplan. If you are making the map with icons, also place those coordinates at this time
  3. Export the polygon data. Give each shape the same name as the space has in the observation data. If you have icons, create a new column to tag those coordinates with the supplementary information, such as the type of seating the icon represents
  4. Combine all of your data sources into a single Excel workbook with separate tabs for each data source. Ensure that the Location field shows up in each tab, and that the naming is consistent across all sources.
  5. In Tableau, drag the X Coordinate to Columns and the Y Coordinate to rows. Change the mark type to Polygon, then add Path ID to Path and Location Name to details.
  6. For icons, also drag the Seating Type to details, and duplicate the X and Y pills to create a dual axis map. Change this mark type to Shape, and assign each seating type the appropriate icon from the custom shapes window. NULLs along the edge of the polygon should be assigned a transparent pixel.
  7. Color underlying map by location (categorical color scheme) or number of people (sequential color scheme) and add the underlying floorplan under the Background Images menu
  8. Synchronize axis and uncheck “show header” to remove axis

1. Data Prep

The instructions for Tableau assume you are working with a normalized dataset. If you don’t have normalized data, follow these instructions to manipulate your data into the appropriate format. If you’re not sure what normalized data looks like, check out the example below:

Cross-tab Data 

crosstab
This is the format that you often see when you export observation data from Google Forms or other survey programs. In order to build the maps and visualizations shown above, we need to normalize the data so it looks like the example below.

If you’ve used Tableau’s “Data Interpreter” to normalize data in the past,  you will still need to pre-process the data before uploading, as the built in tool only supports one pivot and we’ll end up needing four.

Normalized Data

normalized

If you don’t have normalized data but are comfortable with manipulating data, check out this quick normalization trick in Excel and check back in at the next step. Otherwise, you can follow along with the sample cross-tab data to work though the data processing steps below:

  1. Unmerge all cells
  2. Fill in empty dates with the appropriate value
  3. Insert a column between Time and “Printing Scanning Info Desk”
  4. Concatenate Date and Time using the following formula: =CONCATENATE(A3,”?”,B3) and copy formula to all cells
  5. Using another concatenate formula or with copy/paste, combine the location with the study information. Instead of:  merged we want: unmerged
  6. Use the method here to normalize your data. Select only the concatenated field on the left and the newly combined field names, as in the example below:highlighting
  7. In your new, normalized workbook, insert new columns between “Row and Column” and “Column and Value”
  8. Select the “Row” column and navigate to Data>Text to Columns>Delimited and type ? into Other.  If Excel reformatted your dates into a series of numbers, you can manually format the cell to ensure your dates have copied correctly. Repeat for the “Column” column.
  9. Rename your fields as below:
    • Row → Date
    • New Column 1 → Time
    • Column → Location
    • New Column 2 → Group/Individual Study
    • Value → Count

2. Custom Polygon Coordinates

Tableau uses longitude and latitude for its out of the box GIS mapping. When you need a custom map such as a floorplan, it uses an XY coordinate plane to recognize and draw polygon shapes.

Using an external tool to find the edges of your polygon is much easier than trying to find this data within Tableau. When you use these tools, you will generally upload an image of your map to the program and draw (by clicking on the corners of the location) the shapes you want. The program will then give you the coordinates of every point you clicked and the order in which you clicked them, which you can give to Tableau as your XY coordinate plane.

The following instructions walk you through the two most popular tools of this type. You will need:

Bryant B. Howell’s Open Source GitHub Tool

This is an open source program that runs off your hard drive to allow you to draw polygons over an image. You must store the code and the desired images in the same folder.

  1. Create a new folder on your computer for storing mapping files and data
  2. Follow this link and save the code provided to the folder you just created. (I right-click the Raw button and “save link as” from there, but you can also copy the code into a program such as Notepad ++ and save as an html file type)
  3. Copy the map(s) of the desired location into your mapping folder.
  4. Open the html file from your folder and follow the instructions from there.
  5. If you are making a normal location map, draw a polygon around each location where you collected data
  6. If you are making a map with icons, draw the polygon around each location, and also select the desired locations for your icons before closing your shape. Don’t worry if your polygon shape starts to looks funny – we’ll fix it in Tableau!
  7. After you “Output Polygons,” copy/paste the data back into Excel

Power Tools for Tableau: Drawing Tool

This tool is a free, browser-based polygon tool that works with online images with a direct URL. You have to provide your name, email, phone number, and company in order to access the tool, but it also has features such as grid overlay, snap to existing point, and align with previous point.

  1. Follow this link and provide the requested credentials.
  2. Share the URL to the desired map and click “load image”
  3. For perfect corners, make sure the”Align with previous point” and “show grid line” options have been selected
  4. Follow the provided instructions
  5. If you are making a normal location map, draw a polygon around each location where you collected data
  6. If you are making a map with icons, draw the polygon around each location, and also select the desired locations for your icons before closing your shape. Don’t worry if your polygon shape starts to looks funny – we’ll fix it in Tableau!
  7. Click “Output Polygons” and copy/paste the data into Excel

Shapefile

If you have a shapefile map of your library or location, you could also use one of the Shapefile To Tableau Conversion tools to generate the coordinates your map:

Polygon Processing 

Once you have the XY coordinates for your polygons, create a new tab in your space count data file and paste the data into the worksheet.

  1. Rename the Shape or Identifier field to “Location” (or whatever you call “Location” in your data file)
  2. Check that the names of each shape mirror the name of the location in your data file. Capitalization, spelling, and spaces matter!
  3. If you are making a map with icons, create a new column and tag each icon location (the XY coordinates where the icon will appear) with the type of activity you want the icon to represent. Leave the points marking the edge of the polygon shape blank.

Custom Shape Library

If you are creating a polygon map with icons, you will need to add at least one custom shape to your library. If you would like your icons to be more informative than “triangle” or “square,” you can search for custom icons at www.flaticon.com or www.iconfinder.com or use the package below:

carrel       Carrel

opendoor      Study Room

roundtable       Table

workstation       Computer Workstation

lounge       Lounge Chairs

floor       Sitting on the Floor

transparantpixel       Transparent Pixel (for edges)

Once your desired shapes are selected, you need to create a custom shapes menu. Navigate to Documents>My Tableau Repository>Shapes. Create a folder called Library Icons and add image files of the desired icons. Be sure to include a transparent pixel (file provided above), as you will need this to hide points along the edges of your shapes.

3. Custom Mapping in Tableau

Join all worksheets on Location field. If you have used the same field names across all data sources, Tableau should detect the connection automatically. However, you can also manually edit the connection using the Join menu below:

blend

Polygon Location Map

  1. Drag the X field to Columns and the Y field to Rows
  2. Change the mark type to Polygon
  3. Drag Path ID to Path and drag Location to Detail or Color.

Dual Axis Polygon Map with Icons

  1. Follow the instructions for the Location map. Then:
  2. Drag seating to the Detail mark
  3. Copy the X on Columns and Y on Rows by selecting the pill and Ctrl + Drag Right, or by dragging the field onto each shelf a second time
  4. Right click each pill and select “Dual Axis” to combine the shapes into a dual axis chart
  5. Change the secondary mark type to Shape
    axis-polygon
  6. Edit the shapes so that all NULL values are the transparent icon, and the remaining seating types are assigned an appropriate icon

Background Images

To add the underlying map, go to Map>Background Images and select your data source. Click “Add Image” and select the file from your computer. You will need to know the size of your final image – you can check the exact size in pixels in a program like Microsoft Paint – and add the total value of the width (X) with 0 for Left and the width of the image for Right, and the height (Y) with the bottom at 0 and the height of the image for Top. Hit OK.

You can modify the transparency of your image under the Color menu to see the underlying map.

You can also choose whether you want the map to be colored by the number of students in each area (a Choropleth map) or to use categorical color by location. If you choose to color by location, it will be easier to identify each location in the corresponding charts, but harder to see high and low traffic patterns in the building. The reverse is true for the Choropleth map, as in the example below:

categoryvschoropeth

You may want to modify the look of your polygons by adding or removing the border or halo around each polygon. You can find these options under “Effects” in the Color menu.

Depending on how you shape your data, you may need to take the AVG instead of SUM for each vertex, or disaggregate measures.

avgdisaggregate

4. Visualizing Capacity  

Because the questions asked in space assessment projects can be so contextual, I am not going over how to create specific views in Tableau. I assume most of the people interested in custom mapping are already pretty familiar with the basics and can create the supporting visualizations they need. However, because we used a blended data source, I do want to go over how data blending affects working with capacity.

When we blend data sources, duplication of fixed values becomes a slight problem. Tableau automatically uses SUM to aggregate, but a capacity of 25 will be duplicated for every count. After 4 counts, it would show a SUM of 100 (4*25). You can use “Average” to quickly compute the correct capacity for each location, as shown below:

capcity-duplication

You could also use a FIXED LOD calculation: {FIXED [Location]: AVG(Capacity)}. Note that with LOD calculations, any filters must be Added to Context to work as intended. I have never run into a problem with the standard Average calc, however, so I tend to stick with that.

5. Dashboard Actions in Tableau

Once you’ve created the desired visualizations to correspond with  your map, it’s time to make it interactive! Drag your map and your visualizations onto a new dashboard and arrange the windows as you see fit.

In Tableau, adding interactivity is done through Dashboard Actions. This is what tells Tableau that an action taken in one workbook should effect other workbooks on the same dashboard. Tableau has three kinds of Dashboard Actions:

  • Highlight: A highlight action makes the selected field pop out across all views in your dashboard. Tableau draws your attention by changing the field name to yellow and dimming all other information in the worksheet.
  • Filter: A filter action excludes all values that do not match your selection. It can be used to look at a particular section of data in more detail by limiting the available information to only the values that match your selection.
  • URL: A URL action directs you to an external link when selected. You can use this to direct users to a more detailed explanation of your observation methods, for example, or to tweet about the results they find – but these actions are not particularly relevant to this tutorial.
  • Tableau also allows interactivity with dropdown filters, checkboxes, and radial menus that can apply across all worksheets or selected worksheets on your dashboard. Like URL actions, these can certainly be used in your space assessment dashboard, but are not covered in this tutorial.

In general, remember that highlighting will preserve context while filtering will reduce the amount of information available.

There are two ways to apply dashboard actions in Tableau.

Generated Dashboard Actions

Generated dashboard actions are applied from the dashboard itself, not from the Dashboard Actions menu. These can be generated by adding a color legend or selecting “Use as Filter” on a worksheet.

Highlight Actions are automatically applied from color legends and,  by default, highlight all values on your dashboard with the same color palette.

Filter actions can also be applied easily; when you select a workbook on your dashboard, there’s a small icon on the upper right that you can toggle on and off to use as a filter:
filterimg

Generated dashboard actions work well on many dashboards, however, they work less well in this context. Having a large custom map effectively replaces a small color legend as the obvious trigger for a highlight action, and the filter toggle automatically filters all charts by all fields. This combination means you could end up with situations like below:

filtereffect
You can see that a selection on the map excludes all bars that show the count of students in other areas and resizes the axis to the maximum space available. Because there is no matching field to highlight in the line chart, the values are greyed out and hard to see.

The solution to this is to use the Dashboard Actions menu.

Dashboard Actions Menu 

To access this menu, go to your dashboard and select Dashboard>Actions. This will pull up the list of current actions on your workbook, where you can see the menu-created and Tableau (generated) actions all in one place. Selecting Add Action will allow you to select the kind of action you prefer.

dashboard-actions-menu

The Source Sheets section allows you to select the worksheet(s) in which your user must make a selection. Highlight actions can have multiple sources; filter actions can only have one source – but you can add multiple filters that will allow every worksheet to affect every other sheet. The Target Sheets allow you to specify which workbooks the action affects.

The two actions above would lead to a result like this:

dashboard-actions
With a filter applied to the line chart, you can see how the number of users change over time in the selected area only; using a highlight action on the bar chart preserves the context of the rest of the building, but helps the selected value pop out.

 

In general, your steps to creating a dashboard action are below:

  1. Navigate to Dashboard>Actions and select “Add action”
  2. Select either the filter or highlight action to reduce (filter) or feature (highlight) information
  3. In the Source Sheets menu, select the sheet(s) where the action must be taken by the user
  4. In the Target Sheets menu, select the sheet(s) where the effect of the action will be shown.
  5. Decide whether the action affects all fields in your workbook or selected fields and modify your action accordingly.

Troubleshooting

If your actions aren’t working as expected, these questions may help you find the problem:

  • Is everything suddenly dim? Is your highlight having no effect at all? Check if the desired field (e.g. Location) is on all sheets. If not, add the field to the view and see if your action works now.
  • Did your data disappear? Check if your filter affects All Fields. If so, there may be fields (like time of day) that aren’t showing on some views (like the map). Use Selected Fields to set the fields that should be affected and ignore those that shouldn’t.
  • Did you filter when you meant to highlight? You’ll have to create a whole new action – there’s no easy way to switch one the action is created.

Resources

A list of all tools, links, and downloads mentioned in this tutorial can be found below:

A note on versioning:

In Tableau 10, you can use data blending across all locations. You will be able to drag separate files (data, polygons, capacity) and blend on location.

For Tableau 9 and earlier, adding the data as different tabs in an Excel workbook will still enable you to blend as above. Avoid using relationships to merge data across data sources in this case, as will give you some difficulty as you try to compute % occupancy across two data sources (capacity and data)

Additional Resources

There are quite a few other resources and tutorials to work with custom polygon data. When I was learning, I consulted the Creating Custom Polygons on a Background Image instructions at Tableau and Behold. The Tableau blog also came out with a recent post about custom polygons and US Congressional Districts and they points to several other projects and tutorials at the end of the post.

Posted in Dashboard Spotlight

Tableau Mobile Iron Viz 2016

You are more likely to see a sheep on the cover of a board game box than you are to see a group of women. —Erin Ryan, of the Cardboard Republic

I used this Iron Viz as an excuse to explore some data I’ve been meaning to work with for a long time. A friend of mine shared this article on Gender Representation in Board Game Cover Art‏ a few months ago, and I’ve been looking at my games slightly differently  ever since.

Of course, while the gender stat is somewhat shocking – and it only gets worse for people of color – few people are interested in buying a game simply for the fact that it features a woman on the cover. A lot of the follow-up discussions we’ve had has been about representation more broadly – Do I have any games by female designers? How do I find more stuff created by women?

And finding games you might enjoy is enough of a challenge in and of itself! There are thousands of new games published every year and while Board Game Geek can be a helpful reference, the proliferation of titles like “Top Game of [unit of time],” “help me find a game,” “2-players my wife will enjoy?,” and “Masterpost of [game type] games!” speak to the difficulty of using it as a recommendation tool.

Enter RecommEngine!

desktop-view

In this Tableau visualization, I have experimented with using visual analytics to inform and guide board game selection. Selecting games you know and enjoy at the top (or the top left on desktop) will give you an overview of some of the game designers and game mechanics you enjoy, as well as the ability to see how many of the selected games fall into the various bins of game length and number of players. Each of these categories works as a filter, so you can see which of your games are by a particular designer (are they the really good ones or the kinda meh ones?) or quickly narrow down your options for board game night based on the games available, how many people you have, and the time commitment they’re willing to invest.

As you scroll, you pass a few visualizations that range from informative to comical on the gender representation of your game library. I did quite a bit of digging into the depths of the Board Game Geek website to find how and where women were involved in the back end of game design. I wanted to paint a slightly more nuanced picture of the industry, and to give people the tools to explore that nuance for themselves.

celebration
Cause for celebration

In the middle of the dashboard – whichever device you use – you find the radar chart overview. Earlier this year, Edward Kung did a Principal Components Analysis of Board Game Geek rankings and identified four “genes” that mark particular kinds of players. He shared the top 10 positive and negative indicators for each category on his blog, which I applied to the list of games I had compiled to build a high-level overview of the selected games. My visual encoding choice was directly informed by Kung’s original, here, but I also wanted it to have the look and feel of a personality test, which tells you about yourself in a way that you can (theoretically) use to inform your decisions going forward. The graph on the left (“Your Results”) shows the result of the selections and filters that were applied based on your original knowledge and input; the graph on the right (“Selected Game(s)”) gives you an overview of the new recommendations so you can assess the fit (the theory being that it’s a lot easier to compare one shape to another shape than to remember the intersecting sets and filters that inform a recommendation!).

shapes

At the bottom – or the right side of the screen on desktop – you can use the information you’ve learned (or already knew) to find new games. Selecting mechanics on this side applies an intersection filter; a selection of “Co-operative games” and “Bluffing” will show you only games that have both mechanics, rather than all co-operative games and all bluffing games. The same filters for designer; number of players; length of game are available here, to minimize the scrolling.

As this was a mobile contest, I wanted to limit the need for filtering as much as possible. While the initial input on both sides is fairly user/filter-intensive, the rest of the interaction is all done through dashboard actions and calculations (…I had to figure out LOD Expressions for this!). In case the number of games or the length of the filter was still too intimidating, I’ve provided a few pre-selected lists as buttons underneath so you can get a feel for how it works before tediously checking and unchecking a preferences list.

Clicking any particular game (whether in the recommendations side or the preferences side) will give you access to the Board Game Geek page as well as a pre-selected tweet with #ironviz 😉
click

Limitations

There are some major limitations to this dashboard as a recommendation tool. I’m still disappointed that I could not figure out a way to turn the selection filter at the top into an exclusion filter at the bottom. Because of that, there’s really no way to prevent games you already know and like from appearing as recommendations. While I imagine that makes the preference analysis seem more accurate, it’s can be pretty frustrating if you’re really searching for something new.

There is also no weighting of your selection – every game you select factors evenly into the analysis below. You may kinda like one game and LOVE another, but all of the “Top” categories are determined by number of games that fall into the group, not the strength of preference.

Still want to check it out despite the limitations? Check it out by clicking here or on the image below!

header

Other Board Game Recommenders

Don’t like RecommEngine? That’s fine! we’re sad to see you go, but here are some other tools that might be more to your liking:

Tools and Data

While the final dataset required a lot of hand-compiling and curation, the following tools and sources were essential for inspiration, technique, and methodology:

Finally, special thanks to everyone who tested the dashboard, gave me feature suggestions and game suggestions, links to compelling articles, and generally kept me playing board games all these years: Matt, Ryan, Brie, other Ryan, Chloe, Andy,  Noah, Jared, Brandon, Keith, Cole…it takes a village – which incidentally looks like a fun game we should try 🙂

Posted in Excel, Intro to Tableau

Preparing Data for Tableau

Data preparation is one of the hardest and least-discussed Tableau skills, as it’s all done before you ever open the program. Getting your data into the right shape to create the views you want is almost always going to be the bulk of your visualization work. And when you go from a workshop or instruction session to using your own data, or when you try to follow a tutorial step-by-step, but your data is in a different shape, you can start running into frustrating barriers. What you thought as a “knowledge of Tableau” problem might just be a data problem.

So, how do you know if your data is headache-free?

Cross-Tab Data

Much of the data we see in libraries comes in this format. It reduces duplication in data entry and allows you to quickly compare high-level aggregated totals. However, Tableau prefers raw/normalized data as its strength is in aggregating, grouping, and performing calculations on the data itself.

If you load a cross-tab dataset in Tableau, the program will try its best to give you something to work with, but it won’t be intuitive, nor will it match any of the instructions you find online. As you see in the image above, Tableau reads each column in the data as its own field—treating July as a different category of information from August. Dragging and dropping these fields into Tableau will give you some basic information – you will be able to see how many visitors came in July – but as soon as you try to add more than one month, you’ll start to get frustrated.

Tableau is looking for data in a machine-readable format, known as:

Normalized data

This is the preferred format for use in Tableau. Reformatting the data in this way will make working with the information in Tableau much more intuitive, and you will be able to build more robust visualizations and dashboards.

This is a normalized version of the data above. As you can see, the information has been reshaped so that each different kind of data is in a new column – year, month, library, and visitor count. There is a lot of duplication in the data entry (year and branch, in particular), but once the data is in Tableau, the program correctly interprets the different types of information in the file.

How do you normalize data?

Quick data normalization in Excel

14

  1. Create a pivot table with multiple consolidation ranges. This requires use of the PivotTable and PivotChart Wizard (ALT + D + P is the keyboard shortcut), not the default icon in the ribbon.
    • Select “Multiple consolidation ranges”
    • Select “I will create the page fields”
    • Select the entire table for the range and click “add”
  2. Finish the wizard (remaining choices will not matter) and uncheck the Column and Row fields from the resulting PivotTable. You should see a single cell with a total Value
  3. Double click this value. The normalized data will appear in a new workbook with the row IDs on the left, the column headers in the middle, and the values on the right.
    • Rename the default column headers (“Row, ” “Column,” “Value” to something more meaningful.
    • Filter for blank values and delete the empty cells

This normalization trick can be used in combination with other Excel tricks for fairly sophisticated wrangling without the need for specialized tools or programs. Stay tuned for an overview of more advanced data wrangling in Excel, focusing on Concatenate, Text to Columns, and Trim.

 

Posted in Dashboard Spotlight

Tableau Politics IronViz 2016

TableauDash

Like a lot of people, I struggled to come up with an interesting way into the “Politics” theme for this month’s Iron Viz. I’m much more interested in the subjective and rhetorical aspects of politics than in polling numbers and electoral projections, and rhetoric doesn’t visualize easily. I was researching Tableau cartograms as a possible entry point when I realized the winner of the 2012 Politics IronViz had done precisely that.

And (ugh) it was amazing.

But I’d started looking into distortion as a possible visualization mechanic, and from there – eventually – everything else seemed to come together.

The Facts

This visualization is a set of 3 dashboards, with a little over 50 worksheets feeding them. There are 21 dashboard actions governing the appearance and disappearance of the information and I don’t even want to think about how many hours went into the formatting alone.

I use 9 data sources, though a few of them just populate descriptive fields, and there is a ton of redundancy in the blending and joins. I am positive there is a better way to put this together, but – much like my first cross stitch pattern – I decided I cared more about the presentation side than the back end.

The Data

Because this dashboard was going to be such a subjective project and I was going to have an outsize role in the data transformation, I had a three key criteria for the data:

  • All sources had to support comparison between Clinton and Trump. There was a lot of interesting data about one or the other, but I was not going to use it – however tempting.
  • All data should come from nonpartisan or bipartisan sources. If a nonpartisan source couldn’t be found, the trend, at least, should be confirmed with an outside source and data from an organization with the opposite stance must be used elsewhere.
  • All qualitative information had to be coded by an organization. I could quantify the codes, if necessary, but I would not be doing the initial evaluation and, ideally, neither would any one individual.

The data I ended up using for this visualization was pulled from the following sources:

The Visualization

Design Philosophy

I wanted this dashboard to unfold, like a newspaper, the more you interacted with it. I hoped that the unexpected central visualization would invite more nuanced reaction to political information than we tend to express in debates, and I embraced the subjectivity of the process – using much more emotional language than is perhaps analytically rigorous in the hope piquing interest and curiosity. I also wanted to be able to answer as many surface questions as possible – hence the volume of text within the dashboard and the underlying sources available at a click.

The Distortion Trick

The central effect was achieved by running a photo of each candidate through a cross-stitch generator to get, essentially, a coordinate plane of their faces. I used a color detector to translate thread color to HTML hex codes, which I added to a custom color palate in the Tableau preferences file.

I then decoded the pattern using, essentially, the reverse of Jewel Loree’s “Cross Stitch Viz Art” method – starting with the image and coding the color/symbol in each cell.

Once the normalized data is in Tableau, it’s basically building a scatterplot and assigning the appropriate colors to the appropriate code (protip: alphabetize the colors before you add them to the preferences file).

Playing around with the size and opacity will get you somewhere on the spectrum of photo-realism to uncanny valley, which I found the most reliable way to get the “distortion” effect. It isn’t exactly a data-driven amount of mutation, but I found that 6 rough bins was about as much as people could distinguish – especially since I didn’t want to start from something crystal-clear¹.

gradient

From there, I was able to blend each bin with the corresponding bin of the coordinate plane I was using for the primary interaction. It takes a bit of fiddling, but in the end it’s essentially just sheet swapping based on a filter action that triggers on select.

grid

The grids were built by finding the average/median of each measure (whichever made more sense with the data source) and plotting them on the xy plane. I made sure the bins were approximately equal between candidates, but weighed certain information more heavily. As you can see above, guessing in the right quadrant would get you a more positive result than a “closer” guess in the wrong quadrant (I considered each 0 axis as a tipping point) and guessing one measure correctly would be considered “half right,” even when it’s only a few marks away from “cartoonishly inaccurate.”

If there’s interest (…even if there’s not), I expect to make a much more detailed tutorial of this in the near future.

As I discuss a little more below, these grids and the distortion view were both backed by data, but ultimately created by a subjective author and only meaningful with personal reflection. I kind of imagine the process where you’re clicking around trying to feel your way toward the most accurate point as a space to interrogate not just the the gap between what you perceive and the view you’re seeing, but the data beneath the view, and my own role as the author of the dashboard.

The Rotating Quote

A small detail I’m rather fond of is the rotating quote at the top of the page. I used  Joshua Milligan’s random number generator, which mashes up Microsoft Visual Basic with the NOW() calculation, to give you a new result every time you refresh (in theory. In practice it looks like there’s a cache the server will use for awhile). I assigned the variable to the text and used RANK to pull just a single quote. It’s not half as complicated as the process above, but I hadn’t seen much discussion of random numbers except as a proof of concept, so I was pleased to work this one out.

Everything Else

Because the central visualization was so complex, I wanted to rely on very simple visual encoding for all the supplementary data. The grids themselves are sparsely designed – kind of inspired by Nolan charts. Bar charts, line graphs, and scatterplots pop up beneath the top view as soon as you make a selection, which allow you to view the underlying statements with a click (full text and ranking on hover). Also available is some information about the data, it’s limitations and interpretation, and its sources. If the underlying theme of last week’s Information + Conference hadn’t been “foreground the underlying complexity and messiness of data – for justice!”, I might have favored a cleaner look, but once you bring up data literacy to a librarian…

Anyway, I was definitely grateful to have hit on “newspaper” as a design theme early, because the small font and short columns ended up being absolutely necessary to fit it all in.

I knew exposing the actual data feeding each dashboard was essential to understanding and interpreting your result, but after showing it to a few friends early in the process, their primary comments were about finding and looking into the underlying statements made by each candidate (and the snarkiness of the Politifact comments) – another heartwarming information literacy moment.

On Distortion and Subjectivity

As someone who is building a career on data literacy and visualization, I can’t help but feel a little uneasy submitting for critical review something in which the encoding is so subjective and the primary data sources have been manipulated to the point of near unrecognizability.

In defense of distortion, I want to quote Tamara Munzner, who says “distortion is less problematic with familiar shapes, like geographic maps of known places, because people can interpret the distortion as a change to a known baseline.”² Although she is talking more specifically about fisheye lenses and cartograms, the iconography of this year’s presidential  candidates are incredibly pervasive, and I believe they provide a recognizable baseline from which some approximation of difference can be measured. Especially when, as I’ve been repeating to myself throughout this process, “it’s all so subjective anyway.”

And as to that subjectivity – this dashboard hangs on the premise that perceptual distortion can be quantitatively measured and visualized. I’m not confident in that stance in a scientific way, but I think the value in a more subjective approach is that the meaningful differences and relationships between categories are the ones identified and interpreted by the user. Political discourse in particular can run in deeply entrenched ruts, and questioning a result and having the opportunity to learn more is a process I hope might be less prone to instinctive hostility. Curiosity before defensiveness, perhaps.

In the end, this is as much a rhetorical project as it is a visualization. It’s certainly not free from bias, and while I’ve used widely-available political data to support the results, I deliberately foregrounded subjectivity and emotional language (not “the median value of Hillary’s statements when ranked from most to least truthful” but “honesty”) for effect. I really enjoyed working on it. I hope you like it too.

Click here to view the visualization on Tableau Public.

TableauDash

References

¹ It’s a political election, and there is record-breaking antipathy between partiespolarization, and dislike of both candidates.

² Munzner, Tamara. (2014). Visualization Analysis and Design. A K Peters Visualization Series, CRC Press.

Posted in Tableau Basics

Interacting with Tableau Dashboards

There’s a lot of material out there on building visualizations and dashboards in Tableau, but what do you do the first time someone sends you a link and expects you to use it? This handout guides you through some of the basic ways you can interact with data using Tableau so that you can conduct on-the-fly analysis to answer your questions.

What is a Dashboard?

A data dashboard brings together different measures and ways of looking at data to give you a fuller picture of the information. Instead of toggling between different pages or worksheets, a dashboard puts key information side by side so you can begin to understand the different aspects of the information at a glance.

Well-designed dashboards try to anticipate the questions you may have, and allow you to drill down into more specific analysis or filter the results by specific categories.

While you can export and print out a static version of a dashboard by using the menu at the lower right of any Tableau dashboard, interactivity is a key benefit to using the dashboard live.

tableau banner

Depending on the space available, there may or may not be explanatory text telling you how to use the dashboard and where you can click. If there isn’t an explanation, though, there are a few standard things you can expect to see.

Tooltips, or: Extra Information on Hover

When you hover over any mark in Tableau (a point on a line, a bar in a graph, or a number in a table) there is usually some additional context provided. It may tell you the exact numbers that go into a calculation, give more information about the data used, or simply clarify the exact point you’ve selected if there is a lot of information in one view.

 

Highlighting

Highlighting allows you to quickly identify where the same piece of information lives in each separate view. Some dashboards will provide highlighting on hover, some when you click, and some will have a color legend off to the side. Again, this behavior is determined by the dashboard designer.

In the examples above, a selection on the map has highlighted the same information in each other view. Tableau will dim the other information to make the highlighting really stand out, but you can see from context where each piece of information falls in the ranking. In the other example, selecting a particular year from the color legend makes the lines for each measure pop out for quick identification and comparison.

Filters

In Tableau, filters can appear as drop down menus, radio buttons, check boxes, or search windows. The appearance is determined by the dashboard designer and should support the kind of analysis that might be desired.

Menu Options

If the designer has enabled it, clicking when you see a tooltip will bring up a menu options screen. This works similarly to the filters above – “Keep only” will show you only the information that matches your selection. However, unlike filters, the “Exclude” option allows you to remove results from the dashboard. In the example below, you could exclude information about TLC, an external service provider, to focus only on the services offered in-house.

7

Where else can I click?

Everywhere! Clicking on something won’t always change the views, but Tableau has something called “Dashboard Actions” that allow the designer to set cause and effects – highlights, filters, exclusions – based on user actions. Usually these work like filters that don’t take up extra space – if you click on a bar graph labeled “Transfer Students,” the rest of the information in the dashboard will often change to reflect only your selection. You can apply multiple filters and conditions this way – everything all works together. Occasionally, additional charts and graphs may appear and disappear based on your selections – it’s all programmed by the dashboard designer to support the use they think you will need.

 Help! How do I undo something I just did – or reset back to the beginning?

You can undo or redo any actions – or reset the dashboard back to its default state – by using the menu on the lower left of any Tableau dashboard.

6