Open oskjoh opened 3 years ago
It seems the labels are only duplicated when there is a mix of integers and NA
s in the node's next_x
.
It seems it is not specific to geom_alluvial_text()
, it also happens with geom_sankey_label()
for example:
df_plot %>%
ggplot(aes(x = switch_nr, next_x = next_x, node = produktnamn, next_node = switch_to, fill = produktnamn, label = produktnamn)) +
geom_sankey(flow.alpha = .5) +
geom_sankey_label(size = 3, color = "white") +
scale_fill_viridis_d() +
theme_sankey(base_size = 18)
I'm trying to illustrate an alluvial chart where different persons (identified with id numbers) test different products over time. In each node, they can choose to stay (next_node = NA) or continue towards another node. The alluvial chart itself looks fine. However, the node labels are sometimes duplicated multiple times for each fill category.
I've provided a reprex with sample data below:
Created on 2021-05-11 by the reprex package (v2.0.0)