Interactivity

Exercise 11 — PMAP 8551, Fall 2024

Author

Kelly Cronin

Published

November 21, 2024


Task 1: Reflection

Before this class, I have definitely seen examples of both good and bad dashboards. Good dashboards are clear and focused, they use minimalistic design to effectively communicate the data. Bad dashboards, on the other hand, are cluttered with too much data or unnecessary visuals. Bad dashboards may be visually interesting, but if they are confusing they are effectively useless. For example, I have seen dashboards with multiple pie charts and excessive color coding that makes it difficult to understand the data being presented. Good dashboards prioritize communication over flashy visuals. Explorable explanations are incredibly helpful as they allow the viewer to interact with the data and look closer in their area of interest. Users can uncover patterns or trends that might not be apparent in a normal explanation. Explorable explanations can also more effectively communicate the data if it requires user interaction, rather than a static graphic which the viewer can only look at.

Task 2: Interactive plots

library(tidyverse)
library(gapminder)
library(scales)
library(plotly)
library(htmlwidgets)

# Load data here

Do the following:

  1. Make a plot. Any kind of plot will do (though it might be easiest to work with geom_point()).

  2. Make the plot interactive with ggplotly().

  3. Make sure the hovering tooltip is more informative than the default.

Good luck and have fun!

GDP_2007 <- gapminder |> 
  filter(year == 2007)
plot <- ggplot(GDP_2007, aes(x = continent, y = gdpPercap, color = continent)) +
  geom_jitter(width = 0.2) +
  scale_y_log10(labels = scales::comma) +
  labs(
    title = "GDP Per Capita by Continent (2007)",
    x = "Continent",
    y = "GDP Per Capita (log scale)",
    color = "Continent") +
  theme_bw()
plot

interactive_plot <- ggplotly(plot)
htmlwidgets::saveWidget(interactive_plot, "Cronin.html")
ggplotly(plot)

Task 3:

Create a Quarto dashboard in a new .qmd file that shows a plot (static or interactive) in at least three chart areas. See the example for this session for resources on creating dashboards in Quarto.