Closed ugroempi closed 6 years ago
Hi Ulrike, sorry for the late answer, managed to implement something like that, now. See below:
library(sankeyD3)
# sankeyNetwork
URL <- "https://cdn.rawgit.com/christophergandrud/networkD3/master/JSONdata/energy.json"
Energy <- jsonlite::fromJSON(URL)
# Plot
Energy$nodes$font_color <- c("black", "red", "green")
Energy$nodes$font_size <- 5:10
sankeyNetwork(Links = Energy$links, Nodes = Energy$nodes, Source = "source",
Target = "target", Value = "value", NodeID = "name",
fontSize = 12, nodeWidth = 30,
NodeColor = "font_color",
NodeFontColor = "font_color", NodeFontSize = "font_size")
Thank you! Best, Ulrike
This would allow me to move node labels into colored nodes and still be readable. Being greedy, one could also have separate font options (most important: size; color might be the same) for the node labels and the node values.
Best, Ulrike