I think in many instances, people who design dashboards are taking for granted a skillset and level of knowledge that they themselves have, but may be less developed in the end user. In my experience, a dashboard or any type of interactive data display is only helpful to the extent that it meets people where they are, fills in background information that’s necessary for understanding what’s being displayed, and - in a setting where dashboards are being built for a specific target audience - actually, directly and in an easily digestible format, addresses what people need to know. In my job, we use a browser-based portal with a software that we pay for to create budget dashboards for specific managers, but the nature of the software is such that the design is very much pre-set and doesn’t allow for a lot of customization. Generally, people that already have a strong working knowledge of key principles of budget monitoring find the dashboards useful, and people who lack a strong base of theoretical understanding find them overwhelming and difficult to use. Teaching people to interpret the dashboards in a way that will be helpful to their work really ends up being about teaching them about how the budget and financial processes function at our organization.
library(tidyverse)
library(plotly)
library(dplyr)
library(geofacet)
library(scales)
unemployment <- read_csv("data/unemployment.csv")
Do the following:
Make a plot. Any kind of plot will do (though it might be easiest
to work with geom_point()).
Make the plot interactive with ggplotly().
Make sure the hovering tooltip is more informative than the default.
Good luck and have fun!
unemployment <- read_csv("data/unemployment.csv")
unemployment <- unemployment %>%
group_by(state) %>%
mutate(avg = (mean(unemployment)/100))
unemployment <- unemployment %>%
arrange(state, date) %>%
group_by(state) %>%
mutate(pct_change = (last(unemployment) - first(unemployment))/first(unemployment)) %>%
mutate(first_rate = (first(unemployment))/100) %>%
mutate(last_rate = (last(unemployment))/100) %>%
mutate(peak = (max(unemployment))/100) %>%
ungroup()
unemployment <- unemployment %>%
mutate(fancy_label = paste0("State: ", state, "<br>", "Region: ", region, "<br>", "Average unemployment 2006-2016: ", label_percent(accuracy = 0.1)(avg), "<br>", "Jan 2006 unemployment rate: ", label_percent(accuracy = 0.1)(first_rate), "<br>", "Peak unemployment rate: ", label_percent(accuracy = 0.1)(peak), "<br>", "Dec 2016 unemployment rate: ", label_percent(accuracy = 0.1)(last_rate), "<br>", "Percent change in unemployment 2006-2016: ",label_percent(accuracy = 0.1)(pct_change)))
unemployment_static <- unemployment |>
ggplot(aes(x = date, y = unemployment, text = fancy_label)) +
geom_line(linewidth = 1) +
facet_geo(~ state) +
theme_void() +
labs(title = "Unemployment Rate by State 2006-2016") +
theme(strip.background = element_blank(),
strip.text.x = element_blank())
ggplotly(unemployment_static, tooltip = "text")