diff --git a/courses/07_time_text.Rmd b/courses/07_time_text.Rmd index 7387a2e..f3e70e0 100644 --- a/courses/07_time_text.Rmd +++ b/courses/07_time_text.Rmd @@ -20,6 +20,16 @@ library(dplyr) library(stringi) ``` +class: center, middle, title + +# Visualisation de données textuelles et temporelles + +### 2019-2020 + +## Dr. Antoine Neuraz + +### AHU Informatique médicale +#### Hôpital Necker-Enfants malades,
Université de Paris --- class: center, full diff --git a/courses/07_time_text.html b/courses/07_time_text.html index b54be0b..f5aaa3d 100644 --- a/courses/07_time_text.html +++ b/courses/07_time_text.html @@ -1,8 +1,8 @@ - + Cours 07 - Données temporelles et textuelles - + @@ -162,11 +162,29 @@ class: full, center [interactive](https://visual.ly/community/interactive-graphic/business/house-hunting) --- +class: center ## Gapminder <iframe width="800" height="400" src="https://www.youtube.com/embed/BPt8ElTQMIg" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> + +--- +## divide and conquer + +![](img/walmart.png) + +--- +## Streamgraph + +![](img/streamgraph.png) + +--- +class: center +## Eventflow + +<iframe width="800" height="400" src="https://www.youtube.com/embed/ZN1BefRmBMc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> + +[Eventlow](https://hcil.umd.edu/eventflow/) - - - + + + + + + + + diff --git a/courses/lab7-temporal_data_files/figure-html/unnamed-chunk-2-1.png b/courses/lab7-temporal_data_files/figure-html/unnamed-chunk-2-1.png new file mode 100644 index 0000000..f5bb355 Binary files /dev/null and b/courses/lab7-temporal_data_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/courses/lab7-temporal_data_files/figure-html/unnamed-chunk-3-1.png b/courses/lab7-temporal_data_files/figure-html/unnamed-chunk-3-1.png new file mode 100644 index 0000000..2aba262 Binary files /dev/null and b/courses/lab7-temporal_data_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/courses/line-charts.Rmd b/courses/line-charts.Rmd deleted file mode 100644 index 6fc154b..0000000 --- a/courses/line-charts.Rmd +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: "Line charts for population data" -output: rmarkdown::html_vignette -vignette: > - %\VignetteIndexEntry{bar-chart-race} - %\VignetteEngine{knitr::rmarkdown} - %\VignetteEncoding{UTF-8} ---- - -```{r setup, include=FALSE} -knitr::opts_chunk$set(echo = TRUE) -library(vizoR) -library(ggplot2) -library(gghighlight) -library(dplyr) -``` - - -```{r} - -data("us_city_populations") - -n_cities = 5 - -top_cities <- us_city_populations %>% filter(Rank <= n_cities) %>% - select(City, State, Region) %>% distinct() - -to_plot <- filter(us_city_populations, City %in% top_cities$City) -to_plot <- us_city_populations - -last_ranks <- to_plot %>% filter(Year == max(Year)) %>% - mutate(last_rank = Rank) %>% select(City, last_rank) - -to_plot <- left_join(to_plot, last_ranks, by= 'City') - -right_axis <- to_plot %>% - group_by(City) %>% - top_n(1, Year) %>% - ungroup() %>% - top_n(n_cities, -last_rank) - -ends <- right_axis %>% - pull(Population) - -labels <- right_axis %>% - pull(City) - -``` - -```{r} -ggplot(to_plot, aes(x=Year, y = Population, group = City, color = Region)) + - geom_line(size=1) + - #geom_text(data = subset(to_plot, Year == 2010), aes(x=Inf, y = Population, label=City), hjust = 1) + - scale_x_continuous("", expand=c(0,0))+ - scale_y_continuous("", - labels=scales::comma_format(big.mark = " "), - sec.axis = sec_axis(~ ., breaks = ends, labels = labels ))+ - theme_elegant() + - theme(legend.position = "bottom", - plot.margin = unit(c(1,3,1,1), "lines"), - axis.line.y = element_blank(), - axis.line.x = element_blank(), - axis.ticks.x = element_line(), - panel.grid.major.y = element_line(color= 'grey90', size = .2) ) + - gghighlight(max(last_rank) <= n_cities, use_direct_label = FALSE, label_key = City) - -``` - -```{r} - -data("base_pop") - -n_cities = 10 - -# create the ranks based on census populations -base_pop<- base_pop %>% - group_by( annee) %>% - arrange(desc(population)) %>% - mutate(rang = 1:n()) %>% - ungroup() - -top_cities <- base_pop %>% filter(rang <= n_cities) %>% - select(ville, dep , region) %>% distinct() - -to_plot <- filter(base_pop, ville %in% top_cities$ville) -#to_plot <- base_pop - -last_ranks <- to_plot %>% filter(annee == max(annee)) %>% - mutate(last_rank = rang) %>% select(ville, last_rank) - -to_plot <- left_join(to_plot, last_ranks, by= 'ville') - -right_axis <- to_plot %>% - group_by(ville) %>% - top_n(1, annee) %>% - ungroup() %>% - top_n(n_cities, -last_rank) - -ends <- right_axis %>% - pull(population) - -labels <- right_axis %>% - pull(ville) - -``` - -```{r} -ggplot(to_plot, aes(x=annee, y = population, group = ville, color = region)) + - geom_line(size=1) + - #geom_text(data = subset(to_plot, Year == 2010), aes(x=Inf, y = Population, label=City), hjust = 1) + - scale_x_continuous("", expand=c(0,0))+ - scale_y_continuous("", - labels=scales::comma_format(big.mark = " "), - sec.axis = sec_axis(~ ., breaks = ends, labels = labels ))+ - theme_elegant() + - theme(legend.position = "bottom", - plot.margin = unit(c(1,3,1,1), "lines"), - axis.line.y = element_blank(), - axis.line.x = element_blank(), - axis.ticks.x = element_line(), - panel.grid.major.y = element_line(color= 'grey90', size = .2) ) + - gghighlight(max(last_rank) <= n_cities, use_direct_label = FALSE, label_key = ville) - -```