Description Usage Arguments Details Value See Also Examples
Special functions that control the behaviour of InteractiveIGraph.
1 2 3 4 5 | PlotAdjustment.default(g)
ExtraInfo.default(type="V", ProgId=0, g=g)
BottomMenuAdjustment.default(g)
|
g |
an object of the class |
type |
the type of active object. Might be "V", "E", "G". |
ProgId |
The id of the active object. |
The user may create its own functions and replace the default funcions to change the behavor of the InteractiveIGraph. See examples.
Adjustment functions must return an object of the class InteractiveIGraph.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 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){
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.