COMPLECS was developed to help make sense of complex systems. It reads data from a number of worksheets in a spreadsheet and generates a diagram according to those specifications. Originally, COMPLECS was developed to visualise a problem during the needs assessment phase of intervention development.

complecs(
  input,
  title = "COMPLECS overview",
  layout = "neato",
  graph_styling = list(c("outputorder", "nodesfirst", "graph"), c("overlap", "false",
    "graph"), c("fixedsize", "false", "node")),
  directed = TRUE,
  outputFile = NULL,
  outputWidth = NULL,
  outputHeight = NULL,
  returnSvgOnly = FALSE,
  maxLabelLength = 20,
  regExReplacements = list(c("\\\"", "`"), c("\\'", "`"), c("\\\\", "/"))
)

# S3 method for complecs
print(
  x,
  width = x$input$width,
  height = x$input$height,
  title = DiagrammeR::get_graph_name(x$output$graph),
  ...
)

Arguments

input

Either a link to a Google Sheet, or a path to an Excel file.

title

The title of the COMPLECS graph.

layout

The layout to use; has to be one of the DiagrammeR layout types (dot, neato, circo and twopi).

graph_styling

Additional styling to apply; a list with three-element vectors, where the three elements correspond to, respectively, the attr, value, and attr_type arguments for DiagrammeR::add_global_graph_attrs().

outputFile

A character vector where each element is one path (including filename) to write the graph to.

outputWidth, outputHeight

If not NULL, a way to override the width and height when calling complecs to generate a COMPLECS overview.

returnSvgOnly

Whether to only return the SVG in a character vector.

maxLabelLength

The number of characters where to wrap the labels.

regExReplacements

A list of pairs of regular expressions that will be applied to the specifications before generating the ABCD. This can be used to sanitize problematic characters (e.g. ', " and \).

x

The object to print (i.e. a result of a call to complecs).

width, height

If not NULL, a way to override the width and height when calling print to print a COMPLECS overview.

...

Any additional arguments for the print() method are passed to DiagrammeR::render_graph().

Value

A complecs object that includes the graph and the graph in SVG in output$graph and output$graphSvg.

Details

COMPLECS is a recursive acronym for COMPLECS Organises Multiple Players & Linked Environments using Connected Specifications.

Examples

complecs(paste0("https://docs.google.com/spreadsheets/d/", "1WMO15xroy4a0RfpuZ8GhT-NfDoxwS34w9PrWp8rGjjk"));
#> Warning: `as_data_frame()` is deprecated as of tibble 2.0.0. #> Please use `as_tibble()` instead. #> The signature and semantics have changed, see `?as_tibble`. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_warnings()` to see where this warning was generated.
#> Parsed with column specification: #> cols( #> from_entity_id = col_character(), #> to_entity_id = col_character(), #> connection_type_id = col_character() #> )
#> Parsed with column specification: #> cols( #> entity_id = col_character(), #> entity_label = col_character(), #> entity_type_id = col_character() #> )
#> Parsed with column specification: #> cols( #> entity_type_id = col_character(), #> entity_type_label = col_character(), #> color = col_character(), #> shape = col_character(), #> fillcolor = col_character(), #> style = col_character(), #> fontcolor = col_character() #> )
#> Parsed with column specification: #> cols( #> connection_type_id = col_character(), #> connection_type_label = col_character(), #> label = col_character(), #> color = col_character(), #> style = col_character(), #> dir = col_character() #> )