View source: R/ndtvAnimationWidget.R
ndtvAnimationWidget | R Documentation |
Wrapper functions to provide ndtv-d3 animation as an htmlwidget
for use within an RStudio "shiny" web application. These functions are not normally called by R users directly. For example shiny app template code please see the 'server.R' and 'ui.R' files at https://github.com/statnet/ndtv/tree/master/htmlWidgetShinyTest
ndtvAnimationWidget(out, options, width = NULL, height = NULL)
renderNdtvAnimationWidget(expr, env = parent.frame(), quoted = FALSE)
ndtvAnimationWidgetOutput(outputId, width = "100%", height = "500px")
out |
the data structure describing the network animation. produced internally by |
options |
usually the |
width |
Display width for the widget. Must be a valid CSS unit (like "100%", "400px", "auto") or a number, which will be coerced to a string and have "px" appended. |
height |
Display eight for the widget. Must be a valid CSS unit (like "100%", "400px", "auto") or a number, which will be coerced to a string and have "px" appended. |
outputId |
See |
expr |
An expression that does any necessary network processing and generates an HTML widget (usually via |
env |
The environment in which to evaluate expr. See |
quoted |
Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable. See |
The ndtv-d3 interactive HTML5 network animation can normally be produced via render.d3movie(...,output.mode='htmlWidget')
. These functions are wrappers to make it possible to embed the animations as part of a 'Shiny' (https://shiny.posit.co/) web application.
renderNdtvAnimationWidget
should be used as the wraper for the render.d3movie
call within the app's server.R
file and ndtvAnimationWidgetOutput
is the corresponding ui component to include in the ui.R
file. See htmlwidgets-shiny
ndtvAnimationWidget
initializes the widget, usually called automatically inside render.d3movie
when output.mode='htmlWidget'
.
skyebend@uw.edu
htmlwidgets-package
, render.d3movie
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.