dag_render {causact} | R Documentation |
Render the graph as an htmlwidget
Description
Using a causact_graph
object, render the graph in the RStudio Viewer.
Usage
dag_render(
graph,
shortLabel = FALSE,
wrapWidth = 24,
width = NULL,
height = NULL,
fillColor = "aliceblue",
fillColorObs = "cadetblue"
)
Arguments
graph |
a graph object of class |
shortLabel |
a logical value. If set to |
wrapWidth |
a numeric value. Used to restrict width of nodes. Default is wrap text after 24 characters. |
width |
a numeric value. an optional parameter for specifying the width of the resulting graphic in pixels. |
height |
a numeric value. an optional parameter for specifying the height of the resulting graphic in pixels. |
fillColor |
a valid R color to be used as the default node fill color during |
fillColorObs |
a valid R color to be used as the fill color for observed nodes during |
Value
Returns an object of class grViz
and htmlwidget
that is also rendered in the RStudio viewer for interactive buidling of graphical models.
Examples
# Render a simple graph
dag_create() %>%
dag_node("Demand","X") %>%
dag_node("Price","Y", child = "X") %>%
dag_render()
# Hide the mathematical details of a graph
dag_create() %>%
dag_node("Demand","X") %>%
dag_node("Price","Y", child = "X") %>%
dag_render(shortLabel = TRUE)