Skip to contents

Visualise a stock-and-flow diagram using DiagrammeR. Stocks are represented as boxes. Flows are represented as arrows between stocks and/or double circles, where the latter represent what it outside of the model boundary. Hover over the stocks and flows to see their equations.

Usage

# S3 method for class 'sdbuildR_xmile'
plot(
  x,
  format_label = TRUE,
  wrap_width = 20,
  center_stocks = FALSE,
  font_size = 18,
  font_family = "Georgia",
  stock_col = "#83d3d4",
  flow_col = "#f48153",
  minlen = 2,
  ...
)

Arguments

x

Stock-and-flow model of class sdbuildR_xmile

format_label

If TRUE, apply default formatting to labels if labels are the same as variable names.

wrap_width

Width of text wrapping for labels. Must be an integer. Defaults to 20.

center_stocks

If TRUE, stocks are vertically aligned in the middle of the diagram. Defaults to FALSE.

font_size

Font size. Defaults to 18.

font_family

Font name. Defaults to "Georgia".

stock_col

Colour of stocks. Defaults to "#83d3d4".

flow_col

Colour of flows. Defaults to "#f48153".

minlen

Minimum length of edges; must be an integer. Defaults to 2.

...

Optional arguments

Value

Stock-and-flow diagram plotted with DiagrammeR()

Examples

sfm = xmile("SIR")
plot(sfm)