Learn R Programming

flow (version 0.0.2)

build_nomnoml_code: build nomnoml code from data

Description

This functions builds the nomnoml code to render from the data built by flow_data(). It's not very useful for the average user to call it directly but its arguments can be set through flow_view() so their definitions are useful.

Usage

build_nomnoml_code(
  data,
  code,
  direction = c("down", "right"),
  ranker = c("network-simplex", "tight-tree", "longest-path"),
  arrowSize = 1,
  edges = c("hard", "rounded"),
  bendSize = 0.3,
  font = "Courier",
  fontSize = 12,
  lineWidth = 3,
  padding = 16,
  spacing = 40,
  leading = 1.25,
  stroke = "#33322E",
  fill = "#eee8d5",
  title = "filename",
  zoom = 1,
  fillArrows = FALSE,
  acyclicer = "greedy",
  gutter = 5,
  edgeMargin = 0
)

Arguments

data

A data frame built by flow_data()

code

Whether to display the code in code blocks or only the header, to be more compact, if NA, the code will be displayed only if no header is defined by special comments.

direction

Whether to orient the chart from top to bottom or left to right

ranker

ranker, set to "longest-path" to have all exit points alligned at the bottom.

arrowSize

Arrow size

edges

Whether to keep edges "straight", or have them "rounded"

bendSize

Bend size, if edges is "rounded"

font

Font

fontSize

Font size

lineWidth

Line Width

padding

Padding

spacing

Spacing between blocks

leading

distance between two baselines of lines of type

stroke

Stroke

fill

Default filling color

title

Title, no effect was observed

zoom

Zoom, no effect was observed

fillArrows

Whether to fill arrows, no effect was observed

acyclicer

Acyclicer, no effect was observed

gutter

Gutter, no effect was observed

edgeMargin

Edge margin, no effect was observed

Details

All arguments, with the exception of data and code, are nomnoml directives, enumerated at https://openbase.io/js/nomnoml/documentation .

Some of those don't seem to do anything in the context of this package, but given the sparsity of nomnoml documentation, we decided to keep all of them for more flexibility.