Skip to content

Commit

Permalink
how to extend ggplot2 while drowning
Browse files Browse the repository at this point in the history
  • Loading branch information
EvaMaeRey committed Nov 1, 2024
1 parent d7676f5 commit 0347455
Show file tree
Hide file tree
Showing 9 changed files with 2,929 additions and 301 deletions.
31 changes: 25 additions & 6 deletions 2024-10-24-wax-wick-candlestick/wax-wick-candlestick.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ library(tidyverse)
compute_group_wax <- function(data, scales){
data %>%
mutate(xend = x,
data |>
mutate(xmin = x,
y = open,
yend = close) %>%
mutate(loss_gain =
Expand All @@ -37,7 +37,7 @@ compute_group_wax <- function(data, scales){
compute_group_wick <- function(data, scales){
data %>%
data |>
mutate(xend = x,
y = high,
yend = low) %>%
Expand Down Expand Up @@ -75,11 +75,30 @@ to_plot %>%
default_aes = aes(color = after_stat(loss_gain))),
geom = GeomSegment)
to_plot %>%
ggplot() +
aes(x = date,
open = open,
close = close,
high = high,
low = low) +
tidyquant::geom_candlestick()
tidyquant::geom_candlestick
stock_data %>%
slice(1:200) %>%
ggplot() +
aes(x = date,
open = open,
close = close,
high = high,
low = low) +
tidyquant::geom_candlestick()
```

Expand Down
54 changes: 49 additions & 5 deletions 2024-10-24-wax-wick-candlestick/wax-wick-candlestick.html

Large diffs are not rendered by default.

749 changes: 749 additions & 0 deletions 2024-10-29-asa-cowy-fall-2024/asa-cowy-fall-2024.Rmd

Large diffs are not rendered by default.

1,224 changes: 1,224 additions & 0 deletions 2024-10-29-asa-cowy-fall-2024/asa-cowy-fall-2024.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: "another experiment"
author: "Evangeline Reynolds"
date: "`r Sys.Date()`"
output:
html_document:
toc: TRUE
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
options(tidyverse.quiet = TRUE)
```




## Intro Thoughts


## Status Quo

```{r}
library(tidyverse)
```

## Experiment

```{r}
library(tidyverse)
library(packcircles)
compute_panel_circlepack <- function(data, scales){
data_w_id <- data |>
mutate(id = row_number())
data_w_id |>
pull(area) |>
packcircles::circleProgressiveLayout(
sizetype = 'area') |>
packcircles::circleLayoutVertices(npoints = 50) |>
left_join(data_w_id) |>
mutate(group = id)
}
geom_packcircles <- function(...){
StatTemp <- ggproto("StatTemp", Stat,
compute_panel = compute_panel_circlepack)
geom_polygon(stat = StatTemp, ...)
}
gapminder::gapminder |>
filter(year == 2002) |>
ggplot() +
aes(area = pop/1000000) +
geom_packcircles() +
aes(fill = continent)
last_plot() +
facet_wrap(facet = vars(continent)) +
coord_equal()
ggcalendar::ggcalendar(dates_df = ggcalendar::df_month(month = 11))
ggcalendar::ggcalendar(dates_df = ggcalendar::df_month(month = 12))
```



## Closing remarks, Other Relevant Work, Caveats
477 changes: 477 additions & 0 deletions 2024-10-30-packcircles-in-script-geom/packcircles-in-script-geom.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "another experiment"
author: "Evangeline Reynolds"
date: "`r Sys.Date()`"
output:
html_document:
toc: TRUE
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
options(tidyverse.quiet = TRUE)
```




## Intro Thoughts


## Status Quo

```{r}
library(tidyverse)
```

## Experiment

```{r}
```



## Closing remarks, Other Relevant Work, Caveats
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ new_experiment_rmd <- function(name){
}
new_experiment_rmd(name = "flipbookr-outside-object")
new_experiment_rmd(name = "wax-wick-candlestick")
```
Expand Down
582 changes: 293 additions & 289 deletions README.md

Large diffs are not rendered by default.

0 comments on commit 0347455

Please sign in to comment.