Chapter 6 Interactive component

As we find that long-distance trips aren’t decreasing as much as other types, we decide to lend D3 to explore more on such kind of trips. Here we use dataset2 containing monthly statistics of some transportation methods suitable for long journeys, such as airline and railway.

First, we present an animated bar chart demonstrating comparison of total ridership of each method. The initial blue ones represent amounts in the 10 months before outbreak of COVID-19 (2019/05~2020/02) and pink ones for the next 10 months (2020/03~2020/12). With such an animation, we can see how drastically people’s use of public transportation drops. Something special here is that we also include the last two groups (Freight Rail-Intermodal Units (in millions) and Freight Rail-Carloads (in millions)) as a side fact to see how freight transportation changes during pandemic. Interestingly, from the plot we can tell that effct of COVID-19 on freight is not as large as that on our daily travelling life. What’s more, by hovering on the bar you are interested in, you could see the specific number!

Another thing about this chart is that comparison among different categories is not meaningful. Since dimension of each category is not on the same level, we rescale each category to produce this bar chart. For example, Airline is measure in 10 millions while ridership is in 100 millions. Please be aware of this while reading! For reference, this chart is developed following the tutorial here.

With D3, we also build a line chart with filter, through which we could choose a transportation method to see its time series over the 10 months. By functioning it as an interactive map, this would reduce a lot of area than in a static one and make us more focused on each plot. From this plot, we can get a more intuitive impression of how airline shrinks and how stable the freight traffic is.

Please also be aware of the different scale here! The measure of each category is slightly different from last section: Airline-International and Airline-Domestic are in 0.1 millions; Ridership - Fixed Route Bus and Ridership - Urban Rail are in millions; Freight-Rail Intermodal Units and Freight-Rail Carloads are in 10 thousands. And this part is developed from d3 gallery.