r - using ggvis view_static to export html file and dependencies -
I am using ggvis (0.4) to create a simple scatter plot, that I want to show on the website. I am using view_static to generate the HTML file. I can say that I set the dest parameter to specify the html file and the target directory for dependency. However, no matter what I have kept, I end up with files in my TMP directory. For example, if I type
library (ggvis) test_plot & lt; - mtcars% & gt;% ggvis (~ wt, ~ mpg)%>% layer_point (< / Pre>) View_static (test_plot, dest = tempfile (pattern = 'ggvis_test'))
I hope my file should have something like
my / path / tmp / rtmpzw3qDp / ggvis_test7b3166824329 / index .html. Instead, it ismy / path / tmp / rtmpzw3qdp / viewhtml7b3166824329 / index.html, so I have not adopted the pattern specified.Ideally, I use the
visual_static (test_plot, dest = tempfile (pattern = '~ / target_dir'))and output directory in my home directorytarget_dirFind.Is there something wrong when I'm calling
view_static, or is there another way to import HTML or embed it somewhere?Edit - this is one of the factors
I have submitted one for gegb development site - Winston Chang has confirmed that the
destparameter It is now deprecated, however, as a workaround it was used for aview_staticandhtml_printexample.outfile & lt; - mtcars% & gt;% ggvis (~ wt, ~ mpg)%>% view_static ()%> htmltools :: html_print () outfile # [1] "/tmp/Rtmps5hgoi/viewhtml266b14fd08f8/index.html "To get the location of the output file and then copy from there into the target directory. works fine.
It does not seem that you are doing something wrong here view_static The content is:
& gt; Ggvis :: view_static function (x, plot_id = rand_id ("plot_"), dest = tempfile (pattern = "ggvis")) {spec & lt; - as.vega (x, dynamic = FALSE) htmltools :: browseable (ggvisLayout Plot_id, length (x $ control)> 0, spec, shiny = FALSE)} It does not seem to pass dest on anything (true hold for that)
Comments
Post a Comment