ndtv
ndtv copied to clipboard
include first-appearence positioning option in ndtv or example in docs
(imported from statnet trac ticket #770)
This came up with some work Jimi Adams was doing, probably would be useful for others as well. Example below only works if vertices have only a single spell, would need something much more complex if they enter and exit more than once.
# find the the first value from the coordinate by quering for the
# entire time range using the 'earliest' rule
compute.animation(Dyn_drug_failures,animation.mode='MDSJ')
# get the values at those times
firstX<-get.vertex.attribute.active(Dyn_drug_failures,'animation.x',onset=-Inf,terminus=Inf,rule='earliest')
firstY<-get.vertex.attribute.active(Dyn_drug_failures,'animation.y',onset=-Inf,terminus=Inf,rule='earliest')
saveVideo(render.animation(Dyn_drug_failures,render.par=list(initial.coords=cbind(firstX,firstY)),render.cache='none',displaylabels=FALSE))