View source: R/zDepricated_2_render.r
render_plotly | R Documentation |
, see ggtour
.
Takes the result of array2df()
and animations them via {plotly}
into a self-contained HTML widget.
render_plotly(fps = 8, html_filename = NULL, save_widget_args = list(), ...)
fps |
Frames animated per second. Defaults to 8. |
html_filename |
Optional, saves the plotly object as an HTML widget to
this string (without the directory path).
Defaults to NULL (not saved). For more output control use |
save_widget_args |
A list of arguments to be called in
|
... |
Passes arguments to |
render_
for ...
arguments.
ggplotly
for source documentation of tooltip
.
saveWidget
for more control of .html output.
library(spinifex) message("It's suggested to switch to the proto api, see `?ggtour` to get started.") ## Setup dat_std <- scale_sd(wine[, 2:6]) clas <- wine$Type bas <- basis_pca(dat_std) mv <- manip_var_of(bas) mt_array <- manual_tour(basis = bas, manip_var = mv) mt_df_ls <- array2df(basis_array = mt_array, data = dat_std) render_plotly(frames = mt_df_ls) require("ggplot2") render_plotly( frames = mt_df_ls, axes = "bottomleft", fps = 10, aes_args = list(color = clas, shape = clas), identity_args = list(size = 1.5, alpha = .7), ggproto = list(theme_bw(), scale_color_brewer(palette = "Set2"))) ## Saving a .gif, may require additional setup if(FALSE) ## Don't accidentally save file render_plotly(frames = mt_df_ls, axes = "bottomleft", fps = 10, html_filename = "myRadialTour.html")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.