Description Usage Arguments Details Note Examples
Launch a Shiny application providing an interactive visualisation of static or dynamic network data.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
dataset |
R object containing (dynamic) network data. See Usage and Details for description of available methods. |
... |
other arguments passed to/from other methods |
This function launches a Shiny application. Currently there are two
applications implemented: for static network data, and for dynamic network
data. Which one is launched depends on the class of dataset
.
Static and dynamic application have a very similar interface. In the leftmost column you will find a set of sliders with which various layout parameters can be specified. These are mostly specific to the d3 library which is used for network visualization. See for explanations.
To the right of the sliders there is a column of dropdown lists with which it is possible to assign vertex and edge attributes found in data to various graphical elements.
# Layout and other d3 properties
Graph layout has some predefined properties that can be changed through the controls in the app. See sections below for more information. To launch the shiny app use functions described below.
TODO describe all d3 properties in detail.
Link distance, charge and vertex size are calculated depending on total number of nodes.
# Handling vertex and edge attributes
To the right of the sliders there are several dropdown lists with which vertex- and edge attributes can be assigned to graphical features like vertex size, vertex color and so on.
Vertices and edges properties of the visualised object can be reflected as
well. Controls in R properties
section enable this. Logical and
character network's vertices properties can be reflected by color nodes,
numeric ones by the size of the node. Edge properties can be reflected by
edge thickness. All of the available properties may be added to the tooltip
information, which is shown on node mouseover.
(TODO: Describe the static application)
If dataset
is of class "network", it is converted to "igraph" object
using asIgraph
.
(TODO: Describe dynamic application)
For dynamic visualisations, user may also set the time interval between each timepoint. It is by default 3000ms (3s). To play with the visualisation, use the controls below the graph. It is also possible to pause a visualisation and freeze the graph by pressing spacebar.
(TODO non-usage-specific notes, e.g. performance etc.)
For visualisations with large number of vertices, nodes size can be pretty small. For this reason, there is a zooming control that lets you change the scale. You can also move the whole graph in every direction. As gestures may be interferring with the dragging, it's not possible to drag the nodes when zooming is on.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# static network of class 'igraph'
data(karate, package="igraphdata")
d3net(karate)
# static network 2
data(flo, package="network")
g <- graph.adjacency(flo, mode="directed")
d3net(g)
# dynamic network
data(harry_potter_support, package="networkDynamicData")
d3net(harry_potter_support)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.