visNetwork (version 0.1.1)

visEdges: Network visualization edges options


Network visualization edges options. For full documentation, have a look at visDocumentation.


visEdges(graph, title = NULL, value = NULL, label = NULL, length = NULL,
  width = NULL, dashes = NULL, hidden = NULL, hoverWidth = NULL,
  id = NULL, physics = NULL, selectionWidth = NULL,
  selfReferenceSize = NULL, labelHighlightBold = NULL, color = NULL,
  font = NULL, arrows = NULL, smooth = NULL, shadow = NULL,
  scaling = NULL)


: a visNetwork object
: String. Default to undefined. The title is shown in a pop-up when the mouse moves over the edge.
: Number. Default to undefined. When a value is set, the edges' width will be scaled using the options in the scaling object defined above.
: String. Default to undefined. The label of the edge. HTML does not work in here because the network uses HTML5 Canvas.
: Number. Default to undefined. The physics simulation gives edges a spring length. This value can override the length of the spring in rest.
: Number. Default to 1. The width of the edge. If value is set, this is not used.
: Array or Boolean. Default to false. When true, the edge will be drawn as a dashed line. You can customize the dashes by supplying an Array. Array formart: Array of numbers, gap length, dash length, gap length, dash length, ... etc. The array is repeated
: Boolean. Default to false. When true, the edge is not drawn. It is part still part of the physics simulation however!
: Number or Function. Default to 0.5. Assuming the hover behaviour is enabled in the interaction module, the hoverWidth determines the width of the edge when the user hovers over it with the mouse. If a number is supplied, this number will be added to the
: String. Default to undefined. The id of the edge. The id is optional for edges. When not supplied, an UUID will be assigned to the edge.
: Boolean. Default to true. When true, the edge is part of the physics simulation. When false, it will not act as a spring.
: Number or Function. Default to 1. The selectionWidth determines the width of the edge when the edge is selected. If a number is supplied, this number will be added to the width. Because the width can be altered by the value and the scaling functions, a
: Number. Default to false. When the to and from nodes are the same, a circle is drawn. This is the radius of that circle.
: Boolean. Default to true. Determines whether or not the label becomes bold when the edge is selected.
: Named list or String. Default to named list. Color information of the edge in every situation. When the edge only needs a single color, a color value like 'rgb(120,32,14)', '#ffffff' or 'red' can be supplied instead of an object.
  • "color"


  • font
  • "size"
  • "face"
  • "background"
  • "strokeWidth"
  • "strokeColor"
  • "align"
  • arrows
  • "scaleFactor"
  • "middle"
  • "from "
  • smooth
  • "type"
  • "roundness"
  • "forceDirection"
  • shadow
  • "size"
  • "x"
  • "y"
  • scaling
  • "max"
  • "label"
  • "min"
  • "max"
  • "maxVisible"
  • "drawThreshold"
  • "customScalingFunction"


  • "enabled"

See Also

visNodes for nodes options, visEdges for edges options, visGroups for groups options, visLayout & visHierarchicalLayout for layout, visPhysics for physics, visInteraction for interaction, ...


Run this code
nodes <- data.frame(id = 1:3)
edges <- data.frame(from = c(1,2), to = c(1,3))

visNetwork(nodes, edges) %>% visEdges(arrow = 'from')

visNetwork(nodes, edges) %>% visEdges(arrow = 'to, from')

visNetwork(nodes, edges) %>% visEdges(arrow =list(to = list(enabled = TRUE, scaleFactor = 2)))

visNetwork(nodes, edges) %>% visEdges(smooth = FALSE)

visNetwork(nodes, edges) %>% visEdges(smooth = list(enabled = TRUE, type = "diagonalCross"))

visNetwork(nodes, edges) %>% visEdges(width = 10)

visNetwork(nodes, edges) %>% visEdges(color = list(hover = "green")) %>%
 visInteraction(hover = TRUE)

visNetwork(nodes, edges) %>% visEdges(color = "red")

visNetwork(nodes, edges) %>% visEdges(color = list(color = "red", highlight = "yellow"))

visNetwork(nodes, edges) %>% visEdges(shadow = TRUE)

visNetwork(nodes, edges) %>% visEdges(shadow = list(enabled = TRUE, size = 5))

Run the code above in your browser using DataLab