Learn R Programming

InteractiveIGraph (version 1.0.6.1)

MenuAddItems: Adjustment Functions

Description

An internal function that helps to control bottom menu items.

Usage

MenuAddItems(Items, MenuLine='Info', g=g)

Arguments

g
an object of the class InteractiveIGraph.
MenuLine
the string that correspond to the bottom menu line ("Info", "A", "G", "Log")
Items
The list with menu iltem structure.

Details

Just add an item to the menu.

See Also

CommandList, Adjustment Functions.

Examples

Run this code
gOrg <- erdos.renyi.game(15, 1/10,  directed = TRUE)
V(gOrg)$comment = paste("Some comment about vertex with number:", V(gOrg)) 


ExtraInfo.New <- function(type="V", ProgId=0, g=g){  # taisytina  
msg = ""
  
  if(type=="V"){  
    vid = which(V(g)$ProgId == ProgId)
    msg = paste(",", V(g)[vid]$comment)
  }
  if(type=="E"){
    msg = ", E..."    
  }
  if(type=="G"){
    msg = ", G..."    
  }
    
  Item = list(list(label=msg, RegionParams=list(XBufCof = 0, YBufCof=0.2), RecParams=list(lwd = NA, border=NA), TextParams=list(cex=0.8)))
  g <- MenuAddItems(Items=Item,  MenuLine='Info', g=g)  
  
  return(g)
}

if(interactive()){
  g = InteractiveIGraph(gOrg, ExtraInfo=ExtraInfo.New)
}

Run the code above in your browser using DataLab