VizWiz

Launch, grow, and unlock your career in data
Showing posts with label Donald Trump. Show all posts

November 26, 2020

How to Create U.S. Electoral Cartograms

No comments

I don't remember how I came across the set of cartograms I'm going to show you how to create. Alas, I wanted to recreate this mesmerising set of cartograms that Noah Veltman created based on election maps from various media outlets.


Noah's page contains the vector files for each map. I saved them individually and prepped the data in Alteryx so that I could build the polygons in Tableau. Download the workflow here.


I needed to create two branches because some of the States are divided up into parts. For example, Maine in the NPR map has four blocks since Maine allocates each of its four electoral college votes separately. This required the same steps to be reproduced twice. For those States with multiple blocks, I had to split out each block, pivot them, then split those results, and pivot one more time.

Once I had the CSV, it was pretty easy to build in Tableau.

  1. X on the Columns
  2. Y on the Rows (and reverse the axis)
  3. Set both X and Y to AVG
  4. Change the mark type to Polygon
  5. Add the Path field to the Path shelf (this tells table how to connect the edges of the polygon)
  6. Add the State field to the Detail shelf

From there, it was some formatting for the colors, etc. This process, I would think, would work for any SVG (vector) file. This was a fun little project. I learned a lot!

February 12, 2019

Makeover Monday: When did President Trump spend the most Executive Time?

No comments
I've already written about what works and what doesn't about the original visualization (read it here) and since the two current The Data School cohorts had to create a Makeover Monday viz in an hour, I thought I should do the same.

I wanted to create a calendar view that only show the Executive Time. It's easy enough to filter to just that data, however, there are days when there was no executive time, which led to holes in the calendar. To overcome this, I created an Excel spreadsheet with every day from 1 December 2018 through 31 January 2019, then I joined the two data sets, ensuring that my Excel spreadsheet was the primary data source so that all dates would be in the data set (in other words, NOT an inner join).

From there, creating the calendar was simple, adding the color was simple. I spent most of my time fiddling with the formatting.

Click on the image below for the interactive version.

February 11, 2019

Makeover Monday: How President Trump Spends His Executive Time

No comments
Axios published a fascinating article and data set last week with details of President Trump's hourly schedule. To say "Executive Time" is a major part of his day would be a gross understatement. The article doesn't give any specifics about how that time is actually spent, however it does provide some interesting insight:

  • Trump usually spends the first 5 hours of the day in Executive Time.
  • He spends his mornings in the residence, watching TV, reading the papers, and responding to what he sees and reads by phoning aides, members of Congress, friends, administration officials and informal advisers.
  • Trump doesn't take an intelligence briefing until 11am or 11:30am, and they only last 30 minutes.

The list, sadly, goes on. The viz they posted that we're making over this week is this simple stacked bar chart.


What works well?


  • Using a color that stands out over the others to highlight executive time
  • The title tells me what the viz is about.
  • The subtitle provides context as to the amount of data that the chart summarizes.
  • Simple labeling
  • Including the total time at the bottom and stretching the lines to the ends of the stacked bar chart

What could be improved?

  • It's hard to compare the executive time to all other time. A percentage would be helpful.
  • Would the stacked chart be better as a horizontal bar chart with two rows?

What I did

  • I wanted to look at the frequency of executive time by hour of day and day of week. Does Trump spend the same amount of executive time each day?
    RESULT: The first couple heatmaps looked terrible, but visualizing by weekday looks ok.
  • Do big numbers help tell the story in the data?
    RESULT: Yes, they help summarize the data well, but didn't help my end product.
  • Are there any trends in the data? That is, is executive time increasing or decreasing? Or has it been consistent?
    RESULT: The trends are not very useful.

In the end, I thought visualizing the data as stacked bar charts by weekday looked the best. I built quite a few charts that turned out completely useless. However, there comes a point when something is good enough. That's where I ended up. Click on the image below for the interactive version.

September 10, 2018

Makeover Monday: Spending at Trump Properties in Washington D.C.

No comments
I think it's very safe to say that Donald Trump is the most controversial President ever. This week's data comes from ProPublica, who explain part of the reason why people doubt Trump's commitment to the country over himself:
Since Watergate, presidents have actively sought to avoid conflicts between their public responsibilities and their private interests. Every president since Jimmy Carter sold his companies or moved assets into blind trusts or broadly held investments – until now. Donald Trump never did this, despite his expansive holdings. He stands to gain personally when groups pay his companies. 
Let's start by looking at the chart created by ProPublica:


What works well?

  • Colors are easy to distinguish
  • Good interactivity for additional information
  • Filter options are obvious and easy to use
  • Sizing the blocks gives you relative comparisons
  • Good use of annotations
  • Stacking the blocks makes it obvious there were more records in one month versus another

What could be improved?

  • Using size for the blocks makes exact comparisons difficult
  • Include a title
  • Include a subtitle with additional context
  • Provides the user the ability to ask "How does this affect me?"

What I did

  • I explored the data quite a bit, before focusing on Washington. I did this because I saw a large increase in spending after Trump was elected.
  • Use simple colors like the original
  • Compare spending during the Campaign vs since Trump has been President
  • Use BANs to call out the import information

With that, here's my viz for Makeover Monday week 37:

December 13, 2017

Alabama's Special Election: The 13 Counties that Swung the Vote

No comments
Unless you've been living under a rock, you know that Democrat Doug Jones defeated Republican Roy Moore in a special election in Alabama yesterday because the first Democrat to win a U.S. Senate seat in Alabama since 1992.

To help me understand where Senator Jones won, I downloaded the election results from Wikipedia (for the 2016 Presidential election) and from The New York Times (for the 2017 Special Election).

My Goals

  1. Understand the change county-by-county across the two elections
  2. Emphasize the counties that switched from Republican to Democrat

I was struggling with the wording of my dashboard, so I posted it on Convo for feedback from my colleagues. Here's what I posted:


The feedback was fast and furious, just the way I give it to them. Essentially this view wasn't terribly clear, especially the map. Ben Moss basically told me that I created a confusing (a.k.a. crap) viz and suggested using a blue color palette instead to emphasize the change towards the Democrat in each county.


Better, but this could easily mislead the reader into thinking that every county was won by the Democrat. Ravi Mistry suggested grey instead.


Nope! That doesn't work either. So back to the drawing board I went. Ben Jones and Jonni Walker were visiting The Data School today so I asked for their feedback. Ben suggested directional arrows and pointed me to his blog post for creating the arrow shapes I needed.

The next step was to take the slope graph and make it directional arrows, focusing only on those counties that switched from Republican to Democrat. From there, it made sense to split the map into two by election to give side-by-side maps and shade the counties by the party that won and the percentage of the vote.

Lastly, I cleaned up the titles and I was done. Fun exercise and I learned quite a bit about directional arrows and the Democratic stripe that goes straight through the middle of Alabama.

July 19, 2017

Trump is Historically Unpopular

3 comments
On the train this morning I was catching up on some reading and ran across this post from FiveThirtyEight about Trump's approval rating compared to past presidents at the 175-day mark. In the article, there's this table of the ratings:


The table is ok in that it lists the presidents in descending order by net approval rating. However, I thought a visual display would be more effective. I used Google Sheets to import the table and quickly connected it to Tableau and built a slope graph to more effectively display the data.

It only took about 15 minutes to build this, so I'm surprised FiveThirtyEight didn't include a visual. I wonder what their reasoning is for including a chart vs. a table. What do you think? Which view works better for you?

July 17, 2017

Makeover Monday: Comparing White House Salaries

8 comments
Politics is always a risky topic. but what the heck! Why not? This week for Makeover Monday we are looking at the salaries of White House employees for the past two administrations. Let's first review the original visualisation from NPR:


What works well?

  • Binning the salaries makes it easy to see the distribution
  • Colors are consistent across the charts
  • Including summary numbers for context
  • Including a note for the outlier
  • Linking to the source
  • Titles clearly show me that we're only looking at one year for each President
  • Charts are consistently formatted and scaled
  • Light grid lines help guide the eye
  • Good title and subtitle

What could be improved?

  • Are the bar chart colors necessary?
  • Overall, the chart is misleading as the maximum allowable salary has changed.
  • Comparisons are harder than necessary.
  • What does the Y-axis mean?

What were my ideas?

  • Adjust the salaries so that they account for the change in the maximum allowable salary.
  • Bucket the employees by how far they are from the max salary
  • Keep the idea of binned data from the original and play with the bins to see what works well.
  • Use color to highlight
  • How can we add context?

With that, here's my Makeover Monday week 29. Click on the image for the interactive version.

January 16, 2017

Makeover Monday: The Tweeting Habits of President-Elect Trump

On January 20th, we’ll have a new President of the United States. With Inauguration Day just a few days away, it seemed appropriate to look at the tweet of President-Elect Trump for Makeover Monday week 3. BuzzFeed News analyzed all the accounts Donald Trump retweeted during his presidential campaign and created this visualisation to accompany it (Note: The visualisation was trimmed for this blog) -


What works well?

  • The bubbles are ordered from largest to smallest from left to right in a Z-pattern making it pretty simple who he tweets the most.
  • Colouring inactive accounts so they are easier to identify


What could be improved?

  • Bubble charts are notoriously hard to use for comparison; a simple bar chart would be so much easier to read.
  • The viz lacks insight or a story.
  • The article has some in-depth writing; would have been great to include that in the visualisation.


I must admit that I struggled a bit this week. I was trying too many charts and had trouble focusing my story. On top of that, I messed up the TDE that I created for everyone. Note that when you use the DATEPARSE function hh means hour in am/pm (1~12) whilst HH means hour in day (0~23). I had used hh initially which made it look like Trump takes lunch off from Twitter.

I really liked Eva’s idea of using the Montserrat font that’s on Trump’s website, so I’ve knicked that idea. I also wanted to stick to Twitter’s official color palette and try as much as possible to quantify and simplify the amount of tweets that Trump produces. With these in mind, here’s my Makeover Monday week 3 visualisation:

December 1, 2016

Makeagain Monday: Share of Wealth vs. Immigrant Population

No comments

Makeover Monday participant Will Chen created this chart for week 48 that compares the share of wealth of different groups to the immigrant population. If you’re not following Will, you should. He’s been creating videos of his Makeover Monday process.


Instantly, I saw a more compelling story and decided to take his viz and iterate. In just a few steps, I changed his viz into a story about the how the change in wealth of the top 0.5% seems to trend along with the percentage of immigrants in the U.S.


Correlation does not mean causation, however, it does lead me to think…will President-elect Trump’s stance on immigration lead to less wealth for him and his peers? I guess we’ll find out in a few years. The Tableau version is embedded below.

October 17, 2016

Makeover Monday: A State by State Look at Trump vs. Clinton

No comments
I had an idea as I headed into work this morning for another view for the election data for Makeover Monday week 42. I wanted to look at the latest forecast (i.e., Oct 12) and look at the discrepancy by State. I also really enjoyed this because it went from idea to created in about 15 minutes.

I think this view helps show much better than my last version that gap between Clinton and Trump. I also included a sorting option so you can look at it from different perspectives.

October 16, 2016

Makeover Monday - Trump vs. Clinton: A Race for the Presidency

No comments
This week for Makeover Monday we look at election forecasting data by Drew Linzer and visualised both on his website (Votamatic.org) and on Daily Kos Elections. I first met Drew back in 2012 when I asked him to come speak at Facebook. When I tell people who Drew is, I say that he does the same kind of work as Nate Silver, except he's transparent about how his models work.

Given that we're nearing the end of the election cycle (thank god!), we thought it would be a good time to see how the races are stacking up. First, let's look at the viz from Daily Kos:


What works well?

  • The interactivity is amazing!
  • Nice summary on the left
  • The dots for the polls add nice context
  • Simple and easy to understand
  • Great overall design
  • Great use of color

What could be improved?

  • I wish the most recent results would stay on the line chart as I hover over another date. Yes, I know they are on the left, but then my eyes have to move back and forth.

For my version, I wanted to learn how to create small multiple tile maps, so I went straight to Matt Chamber's blog. I added a couple bells and whistles to it too:

  • I added a reference line on each state at 50% to help show if one of the candidates has more than half the vote.
  • I included bar charts in the tooltips.

I really like the line chart by Daily Kos, so I rebuilt that as well. I decided to use a parameter for alternative date because this allowed me to address the issue of not seeing the latest forecast as well. I color coded the lines based on whether they are above or below the date picked by the user.

Once again, I've learned a ton working on Makeover Monday. Click on the image for the interactive version.

March 16, 2016

Can Anyone Stop Trump in the Race for the Republican Nomination?

1 comment

As the race for the Republican nomination slowly drags us towards the scary place that is Donald Drumpf, I thought I would take a look at how the candidates have trended in the opinion polls. This post was inspired by this viz from FiveThirtyEight. They used a trellis chart to show all of the candidates and I’ve been wanting to learn how to build these charts.

Big shout out to Graeme Wiggins for helping me make my trellis calculations much simpler and dynamic so they resize based on the number of candidates. I’ll create a video for how to create these charts in a future Tableau Tip Tuesday. This was quite tricky to build.

The FiveThirtyEight viz is really good, but in my version I wanted to include more:

  1. All of the polls and an option to filter to a specific poll
  2. Choose between the average of the polls or a 2 week moving average
  3. Filter out the candidates that are no longer in the race
  4. An additional view that allows you to compare polls