Homework 3: Time Series Visualization


Summary

For the first plot I added the ability to zoom and drag the plot around so that you could split. I was happy to find code that updates the axes as you zoom in and move around. For the second plot I implemented the brush example we looked at in class. I used the same dataset for both to be able to focus on implementing the visualizations.
I was once again pleasantly surprised by how professional D3's visualizations came out, even if it isn't as straightforward as I would like.

Preprocessing

In order to get the data into as nice a format as possible before working with it, I made sure to add a column of dates by month. This column is in the original dataset as rownames, so when you write to a csv it isn't saved. Adding it as a separate column was rather simple.

# create vector of months to add to dataframe
month <- seq(as.Date("1969-01-01"), by = "month", length.out = nrow(Seatbelts))

# add to dataframe
df['month'] <- month

# create dataset
df2 <- df[,c('month','DriversKilled')]

Interaction

Plot 1 has drag and zoom features, so make sure to click and drag and use your wheel mouse (or pad) to zoom in and out of it.
Plot 2 has brushing, so you can click and drag on the bottom chart which will filter the selection in the upper chart. From there you can drag the box and it will update what you are viewing in the top chart.

I implemented the following:

C Level - Basic Functionality

B Level - Moderate Functionality

See Plot 1 for:

A Level - Advanced Functionality

See Plot 2 for:

Steven Rea - MSAN 622