A package that renders htmltools tag graphs much, much faster than the normal methods.
Just pass your tag object to the fastrender
function; it's approximately equivalent to calling htmltools::doRenderTags
(which is itself a lower-level, less featureful version of htmltools::renderTags
).
> bigtags <- tags$select(name="foo", lapply(1:5e4, function(i) {tags$option(value=i, i)}))
> system.time(renderTags(bigtags))
user system elapsed
27.242 0.195 27.509
> system.time(doRenderTags(bigtags))
user system elapsed
11.292 0.141 11.590
> system.time(fastrender(bigtags))
user system elapsed
0.155 0.004 0.161
fastrender is not, today, a drop-in replacement for htmltools::renderTags
. The latter has a number of features that are not currently supported in this package:
tags$head()
is not respectedtags$singleton()
is not respectedas.tags
tags$button(class="btn", class="btn-default")
)As a result, this package should only really be used for simple-yet-large object graphs. htmlwidgets in particular will probably not work.
devtools::install_github("jcheng5/fasttags")
GPL >=2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.