Comments (2)
Hi,
This case is interesting. First, we can pass individual options to nodes/edges data.frame, and global option for all nodes / edges with visNodes
and visEdges
.
So you can't do that :
visNetwork(nodes, edges) %>% visNodes(color = list(background = c("yellow","pink","blue"),
border = "black"))
But just assign one background and border color with this way :
visNetwork(nodes, edges) %>% visNodes(color = list(background = "blue",
border = "black"))
color
can be a simple option with one value, or have a more complex definition. In your first example, it seems that the definition of color
in data.frame overwrite the visNodes
options.
Since 0.2.1, you can now pass complex options (list) directly in data.frame like this :
nodes <- data.frame(id = 1:3,
color.background = c("lightblue","red","blue"),
color.border = "black")
edges <- data.frame(from = c(1,2), to = c(1,3))
visNetwork(nodes, edges)
and so :
nodes <- data.frame(id = 1:3,
color.background = c("lightblue","red","blue"))
edges <- data.frame(from = c(1,2), to = c(1,3))
visNetwork(nodes, edges) %>% visNodes(color = list(border = "black"))
What is SE ?
from visnetwork.
Makes sense! I'll specify the color.background
and color.border
in the node
data.frame
directly from now on, thanks.
SE == StackExchange, sorry for unnecessary abbreviations
from visnetwork.
Related Issues (20)
- Placement of network in hierarchical layout
- Set the label of nodes into the nodes
- why the color in network shows different with my settings HOT 1
- visLegend: different color for NA values?
- edges: weight & color in docs
- visOptions height adds a footer HOT 1
- groupname not shown in legend if many groups
- visIgraphLayout: undefined columns selected HOT 1
- Adding Two Search Bars to Networks
- Specifying Order of Points in visNetwork
- Can't change figure size in R markdown HOT 1
- Network background image
- arrows.to.type Documentation HOT 1
- Node labels cause extreme node sizes, and can't use ellipsis on node labels HOT 1
- Default colors listed in visNodes() documentation still incorrect
- Edge Labels in VisNetwork?
- Display information of the nodes when an edge is selected HOT 1
- Highlight Edges with Color Column HOT 1
- Access network instance from script
- HOWTO receive event when node is selected HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visnetwork.