Chapter 8 Linked Charts

MultiNav also provides additional flexible options for creating linked charts. The link is created by setting the same ‘link_id’ paramter in multiple charts. The linked charts can be effectvie when knitting rmd files into html pages for creating dashboard page with many linked charts.

Note: The link is created based on the sensor id (having an id column in summary datasets or variable name in detailed datasets).

First, let’s load some sensors data and calculate sensor scores:

library(MultiNav)
data <- DendrometerSensors
uni_matrix<-Calc_uni_matrix(data)

data<-cbind(seq_id=as.numeric(row.names(data)), data)

8.1 Adding linked charts to “scores” display

There is an option to add additional linked scatter charts to the “scores” display. To do so, set the parameter link_id. All charts sharing the same link_id will be connected.

Hover over any point to see the link in action.

MultiNav(data,type = "scores",link_id="link_a")



MultiNav(uni_matrix,type = "scatter","quantile_25", "quantile_75" , link_id="link_a")

8.2 Scatter Plot with linked line chart

Link a scatter plot with a line chart then add additonal linked scatter plots.

Example I:

MultiNav(uni_matrix,type = "scatter_and_linked_line",
         "min", "max", raw_data = data, link_id="link_b")


MultiNav(uni_matrix,type = "scatter","mad", "median" , link_id="link_b")



** Example II**
Adding functional box plot as background to the line chart.
Basically it is the same example as before, only we calculate custom quantiles and pass them to the linked scatter plot, with the quantiles parameter.

quantiles_matrix<-Calc_quantiles_matrix(data)

MultiNav(uni_matrix,type = "scatter_and_linked_line",
         "min", "max", raw_data = data, link_id="link_c",
         quantiles= quantiles_matrix)


MultiNav(uni_matrix,type = "scatter","mad", "median" , link_id="link_c")



Note: the quantiles dataset, can be created with aid of the data pre-processing function Calc_quantiles_matrix().

8.3 Network graph With linked line charts

Creates a network graph with force layout and a linked line chart. There is an option to add functional boxplot as a background for the line chart, and also option to add additional linked scatter plots.

library(igraph)

exclude.vars <- match(c("seq_id"), names(data)) 
cor<-cor(data[,-exclude.vars ],use="pairwise.complete.obs")

g  <- graph.adjacency((1-cor)*150,weighted=TRUE, diag=FALSE,mode= "upper")
network <- get.data.frame(g)
head(network)
##   from  to     weight
## 1  101 102   5.259130
## 2  101 103   5.546034
## 3  101 104 278.719913
## 4  101 105   9.891307
## 5  101 106  11.771402
## 6  101 107   7.889799
MultiNav(network,type = "network_and_linked_line",
          raw_data = data, link_id="link_d",
         quantiles = quantiles_matrix)