我想使用 ggplot2 和 plotly 创建一个 sankey 图并使用 ggplotly 调用。我需要一些带有一些关键链接的好的工作示例。我已经在情节中实现了一个,这就是我实现的快照。请帮助和感谢。
编辑脚本:
library(googleVis)
datSK <- data.frame(From=c(rep("r1","r2","r3","r4","r5","r6","r7")),
To=c(rep(c("Blood Test", "Check Out", "Discuss Results","MRI SCAN",
"Registration","Triage and Assessment","XRay"))),
Weight=c(237,492,495,236,500,500,261))
Sankey <- gvisSankey(datSK, from="From", to="To", weight="Weight",
options=list(
sankey="{link: {color: { fill: '#d799ae' } },
node: { color: { fill: '#a61d4c' },
label: { color: '#871b47' } }}"))
plot(Sankey)