Gemiddeld gevorderde interactieve datavisualisatie met plotly in R
Adam Loy
Statistician, Carleton College
Tijdelijke selectie
vorige selecties worden vergeten

Blijvende selectie
selecties stapelen op


shared_data <- world2014 %>% SharedData$new()
p1 <- shared_data %>%
plot_ly(x=~urban/population, y = ~co2, text = ~country) %>%
add_markers()
p2 <- shared_data %>%
plot_ly(x=~income, y = ~co2, text = ~country) %>%
add_markers()
subplot(p1, p2, titleX = TRUE, shareY = TRUE) %>%
hide_legend()
Schakel blijvende selectie in met highlight()
subplot(p1, p2, titleX = TRUE, shareY = TRUE) %>%
hide_legend() %>%
highlight(persistent = TRUE)


Voeg dynamic = TRUE toe om een kleurschrift te openen
subplot(p1, p2, titleX = TRUE, shareY = TRUE) %>%
hide_legend() %>%
highlight(persistent = TRUE, dynamic = TRUE)
Directe manipulatie
selectie door interactie met de grafiekelementen

Indirecte manipulatie
selectie via een query buiten de grafiek


world_indicators %>%
SharedData$new(key = ~country) %>%
plot_ly(x = ~year, y = ~income, alpha = 0.5) %>%
group_by(country) %>%
add_lines()
world_indicators %>%
SharedData$new(key = ~country, group = "Select a country") %>%
plot_ly(x = ~year, y = ~income, alpha = 0.5) %>%
group_by(country) %>%
add_lines() %>%
highlight(selectize = TRUE)

Gemiddeld gevorderde interactieve datavisualisatie met plotly in R