Title: | Create nomnoml diagrams in R based on data frames with nodes and edges |
---|---|
Description: | Create nomnoml diagrams in R based on data frames with nodes and edges. |
Authors: | Giorgio Comai [aut, cre, cph] |
Maintainer: | Giorgio Comai <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9001 |
Built: | 2024-10-24 04:13:35 UTC |
Source: | https://github.com/giocomai/nomnomlgraph |
nomnoml
based on edges and nodesAvailable association
types to be used in the edges
data frame:
nn_graph( nodes, edges, output = "diagram", direction = "down", lineWidth = 1, fill = "#FEFEFF", zoom = 4, arrowSize = 1, bendSize = 0.3, gutter = 5, edgeMargin = 0, edgesStyle = "hard", fillArrows = "false", font = "sans", fontSize = 12, leading = 1.25, padding = 8, spacing = 40, stroke = "#33322E", title = "filename", png = NULL, width = NULL, height = NULL, svg = FALSE )
nn_graph( nodes, edges, output = "diagram", direction = "down", lineWidth = 1, fill = "#FEFEFF", zoom = 4, arrowSize = 1, bendSize = 0.3, gutter = 5, edgeMargin = 0, edgesStyle = "hard", fillArrows = "false", font = "sans", fontSize = 12, leading = 1.25, padding = 8, spacing = 40, stroke = "#33322E", title = "filename", png = NULL, width = NULL, height = NULL, svg = FALSE )
nodes |
A data frame with two columns: |
edges |
A data frame with three columns: |
output |
Defaults to "diagram". Valid values are either "diagram" or "code". |
direction |
Defaults to "down". Valid values are either "down" or "right". |
fill |
Defaults to "#FEFEFF". Values commonly used by |
edgesStyle |
Defaults to "hard". Valid values are either "hard" or
"rounded". Value is passed to |
png |
Optional file name to export diagram as 'png'. |
width |
Optional width in pixels for the exported 'png'. |
height |
Optional height in pixels for the exported 'png'. |
svg |
Use 'svg' output instead of 'png'? Notice that rendering in 'svg' is not at a par with 'png' and renders incorrectly at times. |
association -> association <-> association –> dependency <–> dependency -:> generalization <:- generalization –:> implementation <:– implementation +- composition +-> composition o- aggregation o-> aggregation – note -/- hidden
An object with class nomnoml
and htmlwidget
. By default, it the
diagram is printed.
nodes <- tibble::tribble( ~id, ~text, 1, "Starting point", 2, "Other starting point", 3, "This is where things merge", 4, "This is where things go" ) edges <- tibble::tribble( ~from, ~to, ~association, 1, 3, "-", 2, 3, "-", 3, 4, "->" ) nn_graph( nodes = nodes, edges = edges, fill = "#fdf6e3", edgesStyle = "rounded", # font = "Roboto Condensed", fillArrows = "false", svg = TRUE )
nodes <- tibble::tribble( ~id, ~text, 1, "Starting point", 2, "Other starting point", 3, "This is where things merge", 4, "This is where things go" ) edges <- tibble::tribble( ~from, ~to, ~association, 1, 3, "-", 2, 3, "-", 3, 4, "->" ) nn_graph( nodes = nodes, edges = edges, fill = "#fdf6e3", edgesStyle = "rounded", # font = "Roboto Condensed", fillArrows = "false", svg = TRUE )