Visualize SPR workflow and status.
plotWF is the general function
that creates the plot.
renderPlotwf are used in Shiny UI and server
respectively, similar to
plotWF( sysargs, width = NULL, height = NULL, elementId = NULL, responsive = TRUE, branch_method = "auto", branch_no = NULL, layout = "compact", no_plot = FALSE, plot_method = "svg", out_format = "plot", out_path = NULL, show_legend = TRUE, mark_main_branch = FALSE, rstudio = FALSE, in_log = FALSE, rmarkdown = "detect", verbose = FALSE, show_warns = FALSE, plot_ctr = TRUE, pan_zoom = FALSE, exit_point = 0 ) plotwfOutput( outputId, width = '100%', height = '400px' ) renderPlotwf( expr, env = parent.frame(), quoted = FALSE )
object of class
string, a valid CSS string for width, like "500px", "100%".
string, a valid CSS string for height, like "500px", "100%".
string, optional ID value for the plot.
bool, should the plot be responsive? useful in Rstudio built-in viewer, Rmarkdown, Shiny or embed it into other web pages.
string, one of "auto", "choose". How to determine the main branch of the workflow. "auto" will be determined by internal alrgothrim: Branches connecting the frist and last step and/or the longest will be favored. "choose" will list all possible branches and you can make a choice.
numeric, only works if
branch_method == "choose". Specify a
branch number to be the main branch instead of choosing from the prompt. This
option can be good if you are in a non-interactive mode, e.g. rendering Rmd.
string, one of "compact", "vertical", "horizontal", "execution".
bool, if you want to assgin the plot to a variable and do not want
to see it interactively, change this to
string, one of "svg", "png", how to make plot, use svg or png to embed the plot.
string, one of "plot", "html", "dot", "dot_print"
plot: directly open your viewer or browser of the plot
html: save the plot to a html file
dot: save the plot in DOT language, need a dot engine to remake the plot
dot_print: directly cat the DOT code on console
string, if the
out_format is not "plot" or "dot_print",
provide a path of where to save the plot.
bool, show plot legend?
bool, color the main branch on the plot?
bool, if you are using Rstudio, open the built-in viewer to see the
plot? Default is no, open the browser tab to see it plot. The default viewer is
too small to see the full plot clearly, so we recommend to use the browser tab.
However, if you are using this plot in Shiny apps, always turn
rstudio = TRUE.
bool, is this plot been made in a SPR log file? If
TRUE will add
links of steps to the corresponding log sections.
are you rendering this plot in a Rmarkdown document? default value is
"detect", this function will determine based on current R environment, or you
can force it to be
bool, turn on verbose mode will give you more information.
bool, print the warning messages on the plot?.
bool, allow panning and zooming of the plot? Use mouse wheel
or touch pad to zoom in and out of the plot. You need to have internet
Cannot be used with
responsive = TRUE together. If both
responsive will be automatically set to
numeric, for advanced debugging only, see details
string, shiny output ID
An expression that generates a plotwf, like
The environment in which to evaluate
expr a quoted expression (with
This is useful if you want to save an expression in a variable.
compact: try to plot steps as close as possible.
vertical: main branch will be placed vertically and side branches will be placed on the same horizontal level and sub steps of side branches will be placed vertically.
horizontal: main branch is placed horizontally and side branches and sub steps will be placed vertically.
execution: a linear plot to show the workflow execution order of all steps.
return intermediate results at different points and exit the function
0: no early exit
1: after all branches are found, return tree
2: after the new tree has been built, return new nodes
3: after dot translation, return graph string