我使用以下代码创建了一个交互式可视化:
library(networkD3)
nodes = data.frame("name" = c("node1", "node2","node3", "node4", "node5", "node6", "node7"))
links = as.data.frame(matrix(c(
0,1,7937,
0,2,6990,
0,3,2483,
1,4,2120,
2,4,666,
3,4,282,
1,5,4583,
2,5,5657,
3,5,731,
1,6,1234,
2,6,756,
3,6,1470), byrow = TRUE, ncol = 3))
names(links) = c("source", "target", "value")
sankey <- sankeyNetwork(Links = links, Nodes = nodes,
Source = "source", Target = "target",
Value = "value", NodeID = "name",
fontSize= 12, nodeWidth = 15)'
这是我第一次使用 networkD3 包(或任何交互式包),并且在玩耍中我发现要保持它的交互性,它必须作为网页发布(或者有其他方式吗??)但是通过查看包的文档我看不到添加标题或标题/评论的方法。我想分享这个工作回合,所以需要解释每个级别在已发布网页上的理想含义