Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderNdtvAnimationWidget() does not work if your network does not contain temporal information #48

Open
Dekermanjian opened this issue Jan 24, 2022 · 1 comment

Comments

@Dekermanjian
Copy link

renderNdtvAnimationWidget() will return a blank iFrame of the widget if you do not have any temporal information. Is there any way to render in a Shiny app a network constructed by render.d3movie() where animation output controls are disabled by default?

@skyebend
Copy link
Contributor

skyebend commented Mar 5, 2022

I have not tried inside a shiny app, but the ndtv-d3 vignette has an example of rendering a static network that can still be interacted with in the browser without the timeline controls:

data(emon)
totalStaff<-emon[[5]]%v%'Volunteer.Staff'+emon[[5]]%v%'Paid.Staff'
sizeScale<-ifelse(is.na(totalStaff),1,totalStaff/100+1)
render.d3movie(emon[[5]],
    vertex.tooltip=paste("<strong>",emon[[5]]%v%'vertex.names',"</strong><br>",
      "Decision Rank Score:",emon[[5]]%v%'Decision.Rank.Score',"<br>",
      "Command Rank Score:",emon[[5]]%v%'Command.Rank.Score',"<br>",
      "Formalization:",emon[[5]]%v%'Formalization',"<br>",
      "Location:",emon[[5]]%v%'Location',"<br>",
      "Sponsorship:",emon[[5]]%v%'Sponsorship',"<br>"),
    vertex.cex=sizeScale,
    vertex.col=grDevices::adjustcolor(as.color(emon[[5]]%v%'Sponsorship'),alpha.f=0.5),
    edge.tooltip=paste('Frequency:',emon[[5]]%e%'Frequency'),
    edge.lwd='Frequency',
    edge.col='#00000055',
    )

It does seem like the html vignette intended to illustrate this functionality is not displaying correctly in the package, but you should be able to download and view in browser from https://github.com/statnet/ndtv/blob/master/ndtv_d3_vignette/ndtv-d3_vignette.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants