graph | R Documentation |
Creates a UML-like graph from your 'Shiny application' developed with modules.
graph(x, fields = NULL, styles = NULL, options = NULL)
x |
a |
fields |
optional. name of the fields to include in the graph. The
possible values can be found at |
styles |
optional. a named list to apply custom styles on the graph nodes. A full list of the available styles can be seen from: nomnoml: Custom classifier styles |
options |
optional. custom options for the whole graph. A full list of the available options can be seen from: nomnoml: Directives |
The graph call uses the nomnoml
tool to draw a UML diagram of the Shiny
application.
a supreme
graph.
nomnoml: The sassy UML diagram renderer
# create a graph:
path <- example_yaml()
sp <- supreme(src_yaml(path))
graph(sp)
# filter fields, only return the certain fields in the graph entities:
graph(sp, fields = c("input", "return"))
# style entites:
graph(sp, styles = list(
"server" = list(fill = "#ff0", "underline", "bold"),
"module_modal_dialog" = list(fill = "lightblue", "dashed", visual = "note")
))
# style entities having a word "tab" in it:
sp_df <- as.data.frame(sp) # turn supreme object to data.frame
tab_modules <- sp_df$name[grep("_tab_", sp_df$name)]
styles <- lapply(seq_along(tab_modules), function(x) list(fill = "orange"))
names(styles) <- tab_modules
graph(sp, styles = styles)
# set graph options:
graph(sp, options = list(
direction = "right",
fontSize = 10,
title = "Model application"
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.