export_image {tidycwl} | R Documentation |
Export the workflow plot as PNG, JPEG, or PDF files
Description
Export the workflow plot as PNG, JPEG, or PDF files
Usage
export_image(file_html, file_image, ...)
Arguments
file_html |
File path to the HTML exported by |
file_image |
File path to the output image.
Should end with |
... |
Additional parameters for |
Value
Image file path
Note
This function uses webshot
to take
a screenshot for the rendered HTML of the graph.
It requires PhantomJS installed in your system.
You can use install_phantomjs
to install it.
Examples
if (interactive()) {
file_png <- tempfile(fileext = ".png")
flow <- system.file("cwl/sbg/workflow/gatk4-wgs.json", package = "tidycwl") %>% read_cwl_json()
get_graph(
flow %>% parse_inputs(),
flow %>% parse_outputs(),
flow %>% parse_steps()
) %>%
visualize_graph() %>%
export_html(tempfile(fileext = ".html")) %>%
export_image(file_png, vwidth = 2000, vheight = 3000, selector = "div.vis-network")
}
[Package tidycwl version 1.0.7 Index]