When using the forceNetwork
function from the networkD3
R package, is there a way to change the text color in the legend to white?
This is my code snippet:
library(networkD3)
forceNetwork(Links = subLinkList, Nodes = subNodes,
Source = "root", Target = "children",
Value = "linkValue", NodeID = "nodeName",
Nodesize = "nodeSize", Group = "nodeGroup",
colourScale = JS(colorScale), charge = -500,
opacity = 1, opacityNoHover = 1, fontSize = 25,
fontFamily = "Calibri",
linkDistance = JS('function(){d3.select("body").style("background-color", "#144370");return 200;}'),
linkWidth = 3, linkColour = "white",
legend = TRUE, bounded = TRUE, zoom = TRUE)
I attempted this approach:
linkDistance = JS('function(){d3.select("body").style("background-color", "#144370").legend.text("fill", "white");return 200;}')