Radial Network
A radial network also known as the is Reingold-Tilford Tree network, is a type of network visualization where nodes are arranged in a circular or radial layout. In a , radial network the root node is the center present at the centre of the network and the parent node present at is outside of the circular graph. Radial network visualization is particularly useful when we want to display hierarchical relationships between nodes, such as organizational structures, family trees, or classification hierarchies.
Syntax:
radialNetwork(List, height = NULL, width = NULL, fontSize = 10, fontFamily = “serif”, linkColour = “#ccc”, nodeColour = “#fff”, nodeStroke = “steelblue”, textColour = “#111”, opacity = 0.9, margin = NULL)
Arguments:
- List – A hierarchical list object with a root node and children.
- height – Numeric height for the network graph’s frame area in pixels.
- width – Numeric width for the network graph’s frame area in pixels.
- font Size – Numeric font size in pixels for the node text labels.
- font Family – Font family for the node text labels.
- link Colour – A character string specifying the color you want the link lines to be.
- node Colour – A character string specifying the color you want the node circles to be.
- nodeStroke – A character string specifying the color you want the node perimeter to be.
- textColour – A character string specifying the color you want the text to be before they are clicked.
- opacity – The numeric value of the proportion opaque you would like the graph elements to be.
- margin – An integer or a named
list
/vector
of integers for the plot margins.
For example, consider there is a group of employees working in an organization for the development of the firm. So, they require communication in a circulated manner for sharing of information among them. For this type of scenario, we can use a Radial network(tree network). An organization manager, employer, employee, HR, etc., can be represented as a node of the network and the sharing of information among them and their relationship can be represented as the links(edges).
#Load library
library(networkD3)
Data <- paste0(
"https://cdn.rawgit.com/christophergandrud/networkD3/",
"master/JSONdata//flare.json")
## Convert to a list format
Flare <- jsonlite::fromJSON(Data, simplifyDataFrame = FALSE)
# Use a subset of data for more readable diagram
Flare$children = Flare$children[1:3]
radialNetwork(List = Flare, fontSize = 10, opacity = 0.9)
radialNetwork
Output:
Load the library using library(networkD3).
- Create a variable ‘Data’ and concatenate both the URLs.
- Create a variable ‘Flare’ and store a json formated data.
Create a radial network using radialNetwork() and assign the values “Flare” to List, add fontSize 10, add opacity 0.9.
networkD3 package in R
Data-driven document Network is an R package for creating network graphs which are used for 3-dimensional visualizations of data as network graphs. In R Programming Language networkD3 plots are created using the networkD3 package.
Table of Content
- Simple Network
- Force Network
- Sankey Network
- Radial Network:
- Dendro network
- Chord Network
To use a package in R programming we have to install the package first. For installing the R package in R studio use the command install.packages(“name”). Follow the following steps to get the packages installed on your system.
install.packages('networkD3')