# NOT RUN {
# 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"
))
# }
Run the code above in your browser using DataLab