Skip to content

Commit 160962a

Browse files
Merge pull request #24 from pepijn-devries/work-in-progress
Fix for #23
2 parents 2349fdb + fe8e4f8 commit 160962a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

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.0006
4+
Version: 0.1.8.0007
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")),
@@ -46,7 +46,7 @@ Suggests:
4646
License: GPL (>= 3)
4747
Encoding: UTF-8
4848
LazyData: true
49-
RoxygenNote: 7.2.3
49+
RoxygenNote: 7.3.2
5050
Roxygen: list(markdown = TRUE)
5151
Collate:
5252
'draw_edges.r'

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
ggsankeyfier v0.1.8.0006
1+
ggsankeyfier v0.1.8.0007
22
-------------
33

44
* Added check workflow
55
* Added code coverage workflow and badge
66
* Improved test coverage
7+
* Fix for [issue #23](https://github.com/pepijn-devries/ggsankeyfier/issues/23)
78

89
ggsankeyfier v0.1.8
910
-------------

R/position_helpers.r

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
tidyr::pivot_longer(dplyr::any_of(c("node_id", "node_id_end")),
77
names_to = "which", values_to = "node_id") |>
88
dplyr::mutate(x_fix = ifelse(.data$which == "node_id", .data[["x"]], .data[["xend"]])) |>
9-
.group_across("PANEL", "x_fix", "node_id", "which") |>
9+
.group_across("PANEL", "connector", "x_fix", "node_id", "which") |>
1010
dplyr::summarise(node_size = sum(.data[["y"]])) |>
11+
.group_across("PANEL", "x_fix", "node_id", "which") |>
12+
dplyr::summarise(node_size = max(.data$node_size)) |>
1113
.group_across("PANEL", "node_id") |>
1214
dplyr::mutate(is_max = max(.data[["node_size"]]) == .data[["node_size"]]) |>
1315
dplyr::select(-"which") |>
@@ -244,7 +246,6 @@
244246

245247
data |>
246248
dplyr::rename_with(~gsub("_to$", "_end", .), dplyr::ends_with("_to")) |>
247-
# dplyr::rename(group_end = "group_to") |>
248249
dplyr::mutate(connector_end = "to") |>
249250
dplyr::left_join(nodes, by = c("PANEL", "connector", "edge_id")) |>
250251
dplyr::left_join(

0 commit comments

Comments
 (0)