-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nodes Font Color #287
Comments
This works for me... library(networkD3)
library(htmlwidgets)
net <- forceNetwork(Links = MisLinks, Nodes = MisNodes, Source = "source",
Target = "target", Value = "value", NodeID = "name",
Group = "group", opacity = 1, fontSize = 24,
fontFamily = "helvetica", opacityNoHover = 1)
customJS <-
'function() {
d3.selectAll(".node text").attr("stroke-width", ".5px").attr("stroke", "#fff");
}'
htmlwidgets::onRender(net, customJS) can you provide a minimal reproducible example to demonstrate the problem you're having? |
That really worked for me, cjyetman! Thank you very much. Any clues on how to change de text colour inside the customJS function? |
I don't know for sure the attribute or CSS names and values off the top of my head, but you can add more commands like .attr("font-color", "blue") or .style("font-color", "blue") to the existing chain above |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! I'm having trouble with my nodes labels. Nodes and nodes labels have the same colors when using forceNetwork. This was addressed in this issue , but I couldn't solve my problem. Any thoughs on how to solve this?
The text was updated successfully, but these errors were encountered: