ColorIsFake Midterm

Chaitrika, Priscilla, and Eve's Data Visualization Site

Visualizations

In my visualizations, I chose to focus on 'preparation time': how long it takes fire department units to prepare for a call, or the difference between when a call is sent from a 911 dispatcher (dispatch time) and when the unit leaves the station (response time). I focus on three of the most common types of incidents - medical incidents, structure fires, and traffic collisions - and only on the preparation time for the first response vehicle dispatched to any given call.

For each, I separate the data by weekday and hour of the day, then calculate the average preparation time for all matching responses. Average preparation time is encoded as color, and the number of matching responses is encoded as the height of the bar.

So, higher bars represent higher call volumes at a given time on a given weekday. Darker bars represent a longer preparation time during that same interval.

Interactivity

Each of these visualizations has two types of interactivity: data-on-demand hover tooltip and overview + detail brushing.

The user can hover their cursor over any bar (including in the overview) to view more detailed information about the data it represents.

The user can also adjust which years the visualization is including data from. Move the edges of the overview plot's brushed area by clicking and dragging, then release to update the main plot.







Findings and Relevance to Overall Theme

Examining the processing time at different times during the week shows discrepancies in how efficiently the system is able to respond to different incidents. The visualizations show that the fire department is more or less prepared to send help to where it's needed depending on what time of day and what day of the week it is.

Many of these times when processing times are higher happen during periods of the week when fewer incidents take place, but some have high rates of incidents AND high average processing time (such as medical incidents at 2AM on Saturday and Sunday). This demonstrates times when the fire department is less effective for the people who need it then.

On the other hand, exploring the data using the detail + overview interactivity reveals that the SF Fire Department's preparation times have decreased over the past two decades, despite rising call volumes. Especially for Medical incidents, today the system has a lower average preparation time than twenty years ago, which is a good thing for San Franciscans and worth celebrating!

Data Wrangling

After loading the entire dataset (downloaded February 20, 2020: 35 columns and 5210953 rows) into Tableau, worksheet created for each visualization (based on data downloaded in February 2020) into Tableau, I created a worksheet to export the data I needed for my final visualization. It was created as follows:

  • Filtered by Call Type : removed all but "Medical Incident", "Structure Fire", and "Traffic Collision".
  • Filtered by Year of Entry Date and Time : removed 2000 and 2020
  • Filtered by Unit Sequence in Call Dispatch : kept only 1
  • Filtered by Processing Minutes (Response Date and Time minus Dispatch Date and Time) : kept only 0 to 60
  • Filtered by Neighborhood : removed "none"
  • Added Hour of Entry Date and Time as a column
  • Added rows in the following order: Call Type, Year of Entry Date and Time, Weekday of Entry Date and Time, Sum of Number of Records
  • Added Average of Processing Minutes as a mark for color.

I then exported the data used by tableau for that worksheet (Worksheet > Export > Data), and saved it as a file onto my computer. I used Sublime Text to convert the file from tab-separated-value format to comma-separated-value. Next, I opened the file in Microsoft Excel, then saved it back as a .csv file to fix its text encoding. Finally, I opened the csv file in Atom and used it to convert from carriage return line format to standard unix line format.

Once I had the data in a format to add to d3, I did further wrangling with Javascript to filter by year, depending on the brushing performed by the user. This gets re-run each time the user brushes on the overview of a visualization.

Inspirations

I was inspired by Mike Bostocks's Focus + Context example for my the brushed overview interactivity.

I used Professor Sophie Engles lectures and examples extensively for reference.

I used Susie Lu's D3 Legend package.