Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor release #45

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: ggtrace
Title: Trace and Highlight Groups of Data Points
Version: 0.0.0.9000
Version: 0.1.0
Authors@R:
c(person(given = "Ryan",
family = "Sheridan",
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ggtrace 0.1.0 (2021-10-22)
* rewritten to conform to ggplot2 extension guidelines
73 changes: 0 additions & 73 deletions vignettes/geom-point-trace.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -138,76 +138,3 @@ p +
background_params = list(color = NA, fill = "grey85")
)
```

```{r POINT GROUP ORDER, eval = FALSE}
library(colorblindr)

# geom_point_trace should keep groups in the order they appear in the data
clrs <- c(palette_OkabeIto, "grey40", "pink")
names(clrs) <- str_c("c", 1:10)

# Groups plotted in alphabetical order, likely due to use of draw_group instead of draw_panel
# trace_position does not affect this behavior
# groups can be reordered with fct_relevel
clusters %>%
# mutate(cluster = fct_relevel(cluster, names(clrs))) %>%
ggplot(aes(UMAP_1, UMAP_2, fill = cluster)) +
# scale_fill_manual(values = clrs) +
# geom_point(size = 2)
geom_point_trace(
trace_position = signal < 1,
stroke = 2
)
```

```{r LINE GROUP ORDER, eval = FALSE}
clrs <- c(
"SMI" = "purple",
"DAX" = "red",
"FTSE" = "blue",
"CAC" = "orange"
)

stocks %>%
mutate(name = fct_relevel(name, c("SMI", "CAC", "DAX", "FTSE"))) %>%
ggplot(aes(day, value, color = name)) +
# scale_color_manual(values = clrs) +
geom_path(size = 3)

geom_path_trace(
trace_position = day < 500 | day > 1500,
stroke = 3
)

# Out of order when position used with path_trace or step_trace, expect SMI, CAC, DAX, FTSE
# fct_relevel does not affect order
# geom_line_trace works
stocks %>%
group_by(name) %>%
mutate(mean_val = mean(value)) %>%
ungroup() %>%
arrange(desc(mean_val)) %>%
mutate(name = fct_inorder(name)) %>%
# mutate(name = fct_relevel(name, c("SMI", "CAC", "DAX", "FTSE"))) %>%

ggplot(aes(day, value, color = name)) +
scale_color_manual(values = clrs) +
# geom_path(size = 4)

geom_path_trace(
# trace_position = day < 500 | day > 1500,
stroke = 2
)

stocks %>%
mutate(name = fct_relevel(name, c("SMI", "CAC", "DAX", "FTSE"))) %>%
ggplot(aes(day, value, color = name)) +
scale_color_manual(values = clrs) +
# geom_path(size = 4)
geom_path_trace(
trace_position = day < 500 | day > 1500,
stroke = 2
)
```