Skip to content

Commit 2349fdb

Browse files
Merge pull request #22 from pepijn-devries/work-in-progress
Work in progress
2 parents c7c6204 + 9c0dabe commit 2349fdb

13 files changed

+218
-4
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
^README\.Rmd$
55
^data-raw$
66
^doc$
7+
^gallery$
78
^Meta$
89
^man-roxygen$
910
^_pkgdown\.yml$

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
inst/doc
66
/doc/
77
/Meta/
8-
/pkgdown/
98
/docs/
109
docs

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: ggsankeyfier
22
Type: Package
33
Title: Create Sankey and Alluvial Diagrams Using 'ggplot2'
4-
Version: 0.1.8.0005
4+
Version: 0.1.8.0006
55
Authors@R: c(person("Pepijn", "de Vries", role = c("aut", "cre", "dtc"),
66
email = "pepijn.devries@outlook.com",
77
comment = c(ORCID = "0000-0002-7961-6646")),
@@ -27,7 +27,7 @@ Depends:
2727
R (>= 4.1.0)
2828
Imports:
2929
dplyr,
30-
ggplot2 (>= 3.5.0),
30+
ggplot2 (>= 3.4.4),
3131
grid (>= 4.1.0),
3232
gridBezier,
3333
methods,

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ggsankeyfier v0.1.8.0005
1+
ggsankeyfier v0.1.8.0006
22
-------------
33

44
* Added check workflow

gallery/gallery.r

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
library(ggplot2)
2+
library(ggsankeyfier)
3+
theme_set(theme_light())
4+
5+
es_sub <-
6+
ecosystem_services |>
7+
subset(RCSES > 0.005) |>
8+
pivot_stages_longer(c("activity_realm", "biotic_realm", "service_section"),
9+
"RCSES", "service_section")
10+
11+
pos <- position_sankey(v_space = "auto", order = "ascending", align = "justify")
12+
pos_txt <- position_sankey(v_space = "auto", order = "ascending", align = "justify",
13+
nudge_x = -.1)
14+
15+
p <-
16+
ggplot(
17+
data = es_sub,
18+
mapping = aes(x = stage, y = RCSES, group = node,
19+
edge_id = edge_id, connector = connector)) +
20+
geom_sankeyedge(aes(fill = RCSES), position = pos) +
21+
geom_sankeynode(position = pos) +
22+
scale_fill_viridis_c(option = "turbo") +
23+
geom_text(aes(label = node), stat = "sankeynode", pos = pos_txt,
24+
hjust = 1, angle = -30, cex = 2.5) +
25+
scale_x_discrete(expand = expansion(add = c(0.65, 0.15))) +
26+
scale_y_continuous(expand = expansion(add = c(0.15, 0.15))) +
27+
labs(fill = "risk\nlevel", y = "risk level")
28+
29+
ggsave("gallery/pepijn-devries-ggsankeyfier.png", print(p), width = 350, height = 300, units = "px",
30+
dpi = 60)
34.9 KB
Loading
23.2 KB
Loading

pkgdown/favicon/favicon-96x96.png

10.9 KB
Loading

pkgdown/favicon/favicon.ico

14.7 KB
Binary file not shown.

pkgdown/favicon/favicon.svg

Lines changed: 163 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)