Usage
forceNetwork(Links, Nodes, Source, Target, Value, NodeID, Group,
height = NULL, width = NULL, colourScale = "d3.scale.category20()",
fontsize = 7, linkDistance = 50,
linkWidth = "function(d) { return Math.sqrt(d.value); }", charge = -120,
linkColour = "#666", opacity = 0.6)
Arguments
Links
a data frame object with the links between the nodes. It should
include the Source
and Target
for each link. These should be
numbered starting from 0. An optional Value
variable can be included
to specify how close t
Nodes
a data frame containing the node id and properties of the nodes.
If no ID is specified then the nodes must be in the same order as the Source
variable column in the Links
data frame. Currently only a grouping
variable is allowed.
Source
character string naming the network source variable in the
Links
data frame.
Target
character string naming the network target variable in the
Links
data frame.
Value
character string naming the variable in the Links
data
frame for how wide the links are.
NodeID
character string specifying the node IDs in the Nodes
data frame.
Group
character string specifying the group of each node in the
Nodes
data frame.
height
numeric height for the network graph's frame area in pixels.
width
numeric width for the network graph's frame area in pixels.
colourScale
character string specifying the categorical colour
scale for the nodes. See
https://github.com/mbostock/d3/wiki/Ordinal-Scales.
fontsize
numeric font size in pixels for the node text labels.
linkDistance
numeric or character string. Either numberic fixed
distance between the links in pixels (actually arbitrary relative to the
diagram's size). Or a JavaScript function, possibly to weight by
Value
. For example:
linkDistance = "function(d)
linkWidth
numeric or character string. Can be a numeric fixed width in
pixels (arbitrary relative to the diagram's size). Or a JavaScript function,
possibly to weight by Value
. The default is
linkWidth = "function(d) { return Math.sqrt(d.value);
charge
numeric value indicating either the strength of the node
repulsion (negative value) or attraction (positive value).
linkColour
character string specifying the colour you want the link
lines to be. Multiple formats supported (e.g. hexadecimal).
opacity
numeric value of the proportion opaque you would like the
graph elements to be.