Skip to content

Commit

Permalink
some updates
Browse files Browse the repository at this point in the history
  • Loading branch information
EvaMaeRey committed Aug 7, 2019
1 parent 5448cf7 commit 5a1440a
Show file tree
Hide file tree
Showing 529 changed files with 5,095 additions and 9 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The incremental code/result reveal provided by flipbooks may help you digest lon
- [leaflet for R (interactive maps)](https://evamaerey.github.io/little_flipbooks_library/leaflet/leaflet#1)
- [ggplot themes](https://evamaerey.github.io/little_flipbooks_library/taming_themes_in_ggplot/taming_ggplot_themes.html)
- [racing barchart](https://evamaerey.github.io/little_flipbooks_library/racing_bars/racing_barcharts.html)
- [#tidytuesday highlights](https://evamaerey.github.io/little_flipbooks_library/tidytuesday_highlights/tidytuesday_highlights.html)
- [easing gallery for gganimate](https://evamaerey.github.io/easing_gganimate/easing_examples.html)


Expand Down
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 5 additions & 2 deletions about/what_the_flipbook.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Flipbooks"
author: Evangeline Reynolds, August 7, 2019
output:
html_document:
df_print: paged
Expand Down Expand Up @@ -90,9 +91,11 @@ I'm currently working on a paper to describe the format and describing the imple
The feedback on the flipbook format has been tremendously encouraging, and a big motivation to keep working on this project. The flipbook was a [top story on Hacker News](https://news.ycombinator.com/item?id=19356354) and was featured as a highlight in the [R Weekly](https://www.r-craft.org/r-news/r-weekly-2019-07-flipbook-package-building/) newsletter.


Some of the most encouraging feedback about flipbooks has come from individuals, via Twitter. They come from around the world, seen below, and their comments can be viewed [here]
Some of the most encouraging feedback about flipbooks has come from individuals, via Twitter. Ther comments can be viewed [here]().
https://evamaerey.github.io/little_flipbooks_library/about/testimonials_value_added
OriThey come from around the world

().```{r, results='asis'}
```{r, results='asis'}
library(tidyverse)
load("data_products/tweets.Rdata")
df %>%
Expand Down
9 changes: 3 additions & 6 deletions about/what_the_flipbook.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />


<meta name="author" content="Evangeline Reynolds, August 7, 2019" />


<title>Flipbooks</title>
Expand Down Expand Up @@ -1634,6 +1635,7 @@


<h1 class="title toc-ignore">Flipbooks</h1>
<h4 class="author">Evangeline Reynolds, August 7, 2019</h4>

</div>

Expand Down Expand Up @@ -1670,9 +1672,6 @@ <h3>Use in traditional presentations</h3>
<p>An additional adaptation of the parsing and reveal code allows users to slowly reveal the components of a plot without also featuring the code to produce the plot in <a href="https://evamaerey.github.io/little_flipbooks_library/minimal_example/minimal_example" target="_blank">minimal example #2</a>, a strategy that Hans Rosling used in his stunning presentations, and a technique that is recommended by data journalist Mona Chalabi and Harvard Professor of Government Matthew Blackwell.</p>
</div>
</div>
<div id="for-reference" class="section level2">
<h2>For reference</h2>
</div>
<div id="whats-next" class="section level2">
<h2>What’s next</h2>
<div id="supporting-new-user-adoption-examples-templates-and-r-package" class="section level3">
Expand All @@ -1690,10 +1689,8 @@ <h3>Paper</h3>
<div id="reception" class="section level2">
<h2>Reception</h2>
<p>The feedback on the flipbook format has been tremendously encouraging, and a big motivation to keep working on this project. The flipbook was a <a href="https://news.ycombinator.com/item?id=19356354">top story on Hacker News</a> and was featured as a highlight in the <a href="https://www.r-craft.org/r-news/r-weekly-2019-07-flipbook-package-building/">R Weekly</a> newsletter.</p>
<p>Some of the most encouraging feedback about flipbooks has come on Twitter, with people writing in from around the world.</p>
<p>Where do these enthusiastic folks come from?</p>
<p>Some of the most encouraging feedback about flipbooks has come from individuals, via Twitter. Ther comments can be viewed <a href>here</a>. <a href="https://evamaerey.github.io/little_flipbooks_library/about/testimonials_value_added" class="uri">https://evamaerey.github.io/little_flipbooks_library/about/testimonials_value_added</a> OriThey come from around the world</p>
<p>Houston, TX | Strijtem, Flanders (Belgium) | Rotterdam, The Netherlands | Utah, USA | Buenos Aires | Utah, USA | Chicago, IL | España | Washington, DC | España | Chicago | Baltimore, MD | South Africa | Aalborg, Denmark | Dresden, Germany | Orlando, FL | Philadelphia, PA | Oslo, Norway | Omaha, NE | Rotterdam, The Netherlands | UK | Switzerland | Turners Falls, MA | Montpellier, France | San Francisco, CA | San Francisco, CA | Hong Kong | Fairfax, Virginia USA | Bundoora,Victoria, Australia | Ile-de-France, France | Bundoora,Victoria, Australia | On Your Left || Bridge 4 | Chicago | Lansing, MI | Austin, TX | New York, NY | United States | United Kingdom | Chicago | Palmerston North, New Zealand | Coventry/Birmingham | Cambridge, MA | Strasbourg, France | Sydney, New South Wales | Dublin City, Ireland | RTP, NC | Tallahassee, Florida, USA | Princeton, NJ | Carrboro, NC | Yokohama City Tsurumi Ward | Rio | Boston | Sheffield/Leeds | moon | Singapore | London, England | Lisbon, Portugal | Ghana. | Vancouver, BC | Santa Barbara, CA | Houston, TX | Waco, Texas | Victoria, British Columbia | Austin, TX | Quincy, MA | Chicago, IL | Dallas, TX | Canada | Utrecht | Paris, France | Philadelphia, PA | Sydney, New South Wales | Toronto, Canada | Utrecht, The Netherlands | Ho Chi Minh, Viet Nam | Lima, Peru | Sydney | Sydney, Australia | roFL</p>
<p><a href>Here</a> is what they had to say.</p>
</div>


Expand Down
File renamed without changes.
184 changes: 184 additions & 0 deletions hex_sticker_build/hex_sticker_build.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
---
title: "Hex Stickers"
author: "Gina Reynolds, May 2019"
output:
xaringan::moon_reader:
lib_dir: libs
css: ["kunoichi", "ninjutsu"]
nature:
ratio: 34:10
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---


```{r setup, include=F}
knitr::opts_chunk$set(fig.width = 2, message = F, warning = F,
comment = "", cache = F, fig.align = "center")
options(tibble.print_max = 20)
```




---

# Introduction

This is a minimal example to demonstrate how to create a flipbook that will walk through data wrangling and plots pipelines made with the Tidyverse. The functions that make this possible are the work of Emi Tanaka, Garrick Aden-Buie and myself, and are built for Xaringan, an Rmarkdown file type for creating presentation slides; the functions make use of the function `knitr:::knit_code$get()`.

Interested in more flipbooks? Check out

- [the ggplot flipbook](https://evamaerey.github.io/ggplot_flipbook/ggplot_flipbook_xaringan.html)
- [The Tidyverse in Action](https://evamaerey.github.io/tidyverse_in_action/tidyverse_in_action.html)

For more about Xaringan:

- [Xaringan presentation slides](https://slides.yihui.name/xaringan/)

The sequential workflow of the Tidyverse makes incremental display of pipelines ideal:

- [www.tidyverse.org](https://www.tidyverse.org/)


---

# Set up

Okay. Let's load the the `reveal for xaringan` functions for "flipbooking" and the `tidyverse`.

```{r, cache = F}
source(file = "https://raw.githubusercontent.com/EvaMaeRey/little_flipbooks_library/master/xaringan_reveal_parentheses_balanced.R")
library(tidyverse)
```






---

# Where we are going:

We'll create this plot. I have **echo** set to FALSE in the code chunk options here so that you don't see the code, and **eval** to TRUE so that the plot output is produced. The code chunk is given the name "gapminder2007", and this is used in the in apply_reveal function, which breaks down code by wrangling and plot statements.

```{r gapminder2007, echo = F, eval = T, fig.height=5}
library(magick)
library(bunny)
url <- "https://raw.githubusercontent.com/dmi3kno/bbox/master/data-raw/fantasy-4065903_1920.jpg"
image_read(path = url) %>%
image_convert("png") ->
p2_clouds
```



---

# How do we get there?

In the next slide, we'll walk through the code that produces this plot, and the output along the way. We use the code `apply_reveal("gapminder2007")` in-line to access the code from the code chunk called *gapminder2007*.

---

`r apply_reveal("gapminder2007")`


---

# Other pipeline connectors

The reveal functions are also written to recognize the pipe, `%>%`, and reverse assignment operator `->`, at the end of a line as reveal break points. An example follows.

```{r gapminder2007pipe, echo = F, eval = T, fig.height=5}
p2_clouds %>%
image_crop("1200x900+0+0") %>%
image_convert(colorspace = "Gray") %>%
image_threshold("white", "40%") %>%
image_threshold("black", "30%") ->
up_hand
p2_clouds %>%
image_crop("1200x1200+750+870") %>%
image_convert(colorspace = "Gray") %>%
image_threshold("white", "40%") %>%
image_threshold("black", "30%") ->
down_hand
image_canvas_hex(border_color="#0d4448",
border_size = 2,
fill_color = "#ede6f2") ->
hex_canvas
image_canvas_hexborder(border_color="#0d4448",
border_size = 4) ->
hex_border
up_hand %>%
image_colorize(50, "grey") %>%
image_blur(20,10) ->
up_hand_shadow
down_hand %>%
image_colorize(50, "grey") %>%
image_blur(20,10) ->
down_hand_shadow
```


---

`r apply_reveal("gapminder2007pipe")`

---

# Hide code

You might be interested in showing the evolution of a plot, without focusing on the code. Let's see an example of this.

Consider the case where you want to show the x-axis, then add the y-axis, show one data point, and then add the rest of the data.

Building up plots slowly in presentations has been a technique employed by Hans Rosling and Mona Chalabi. Matthew Blackwell tweeted this advice in 2018 -- it resonated with a lot of folks!


---

To do this, we prep a code chunk with our plot, defining where we want breaks in display to come with the statement **#REVEAL** at the end of the key lines.


```{r, gapminder2007plotonly, eval = F}
hex_canvas %>%
bunny::image_compose(up_hand_shadow,
offset="+40+460",
gravity = "northwest")%>%
bunny::image_compose(down_hand_shadow,
offset="+30+390",
gravity = "southeast")%>%
bunny::image_compose(up_hand,
offset="+20+440",
gravity = "northwest")%>%
bunny::image_compose(down_hand,
offset="+20+380",
gravity = "southeast")%>%
image_annotate("bbox", size=450,
gravity = "center",
font = "Aller",
color = "#0d4448") %>%
bunny::image_compose(hex_border,
gravity = "center",
operator = "Over") ->
img_hex
```
---

Then, we'll use the name of this code chunk in a reveal function "apply_reveal", with `show_code` set to F, and `user_reveal_defined` set to T.

---

`r apply_reveal(chunk_name = "gapminder2007plotonly")`



```{css, eval = TRUE, echo = F}
.remark-code{line-height: 1.5; font-size: 70%}
```


Loading

0 comments on commit 5a1440a

Please sign in to comment.