-
Notifications
You must be signed in to change notification settings - Fork 205
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
How to use saveWidget to save a crosstalk result as local HTML file? #266
Comments
The easiest thing might just be to place that code in an R Markdown document and render it. That said, I know there is a way to do it from plain R but can't recall the specifics. @timelyportfolio ? |
If you call for the widget in RStudio there is an Export option to "Save
as webpage. . . "
…On 4/10/2017 6:28 AM, JJ Allaire wrote:
The easiest thing might just be to place that code in an R Markdown
document and render it.
That said, I know there is a way to do it from plain R but can't
recall the specifics. @timelyportfolio
<https://github.com/timelyportfolio> ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#266 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIc65HDgeoSmw42uM2IIhgJSLSVQs83xks5rugQxgaJpZM4M4Ygn>.
|
Actually I think you can just do this: library(crosstalk)
shared_iris <- SharedData$new(iris)
hw <- bscols(
d3scatter(shared_iris, ~Petal.Length, ~Petal.Width, ~Species, width="100%", height=300),
d3scatter(shared_iris, ~Sepal.Length, ~Sepal.Width, ~Species, width="100%", height=300)
)
htmltools::save_html(hw) |
If that does not work, see rstudio/htmltools#73, and let me know. |
Thanks everybody. save_html works. I tried like: hw$children can return the divs but seems no way to get the dependency scripts. |
The error will likely go away if you restart your R process. Every time I've seen that it's because devtools has tried and failed to completely unload an old version of a package. |
And for the record, I agree with |
Is there any way to programmatically save a selfcontained HTML file from this code snippet:
By default a However, using RStudio's export option "Save as webpage. . . " a standalone HTML file is produced. - How is it done?
which might be expected. Any hints are very welcome! - Cheers |
@ismirsehregal Did you ever figure out how RStudio's "Save as webpage" option creates a sole HTML file? |
@danielludolf RStudio requires installing library(markdown) before "Export -> Save as Web Page..." can be used. However, I've been using
|
How to use htmlwidgets::saveWidget to save a crosstalk result like
library(crosstalk)
shared_iris <- SharedData$new(iris)
hw <- bscols(
d3scatter(shared_iris, ~Petal.Length, ~Petal.Width, ~Species, width="100%", height=300),
d3scatter(shared_iris, ~Sepal.Length, ~Sepal.Width, ~Species, width="100%", height=300)
)
?? how to save hw as a local HTML file
Thanks!
The text was updated successfully, but these errors were encountered: