-
Notifications
You must be signed in to change notification settings - Fork 124
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
Color problems in nodes #473
Comments
The following is a minimally reproducible example where I have removed all of the code that converts the raw data into node and edges. I have also left out code that adjusts the physics. library(visNetwork) Build nodesnodes <- data.frame( Build edgesedges <- data.frame( Code where color worksBuild nodesnodes <- data.frame( Build edgesedges <- data.frame( |
In simple html brown4 gives They works:
Their color doesn't work:
brown4 doesn't seem exist in in https://www.w3.org/wiki/CSS/Properties/color/keywords |
@TimothyEbert Just in case you're still trying to use "brown4", you just need to use rgb/rgba for colors that don't have a CSS color keyword. I've found that using hex values instead of color names is a good habit to get into if you're working with packages that rely on CSS (e.g. I've demonstrated three different options in my suggested fix below. If this works for you, I reckon this issue should be marked as closed since it isn't particularly package-specific.
|
I am using RStudio running on a PC (DELL Latitude 7440) using R 4.4.1 and RStudio version 2024.4.2.764.
I am making network plots with 6 nodes.
I assign custom colors to the nodes and edges.
The problem is that some colors appear to cause problems where some edges and nodes to not appear with the right color. I check the edges data frame, and the colors are correct but an edge with one color in the data frame will print as a different color.
This graph is good:
If I change to "brown4" then I get this:
Is there a pallet that does not have problems, or what is causing this issue?
The text was updated successfully, but these errors were encountered: