Title: | Graphviz Pipeline Plot Based on Grids (grPipe: Graphviz Pipeline) |
---|---|
Description: | Create a grid-based graphviz using the following functions: 1 - Creating the data.frame where the nodes are; 2 - Adding and editing nodes; 3 - Plotting these nodes. |
Authors: | Daniel Gaspar Gonçalves [aut, cre] |
Maintainer: | Daniel Gaspar Gonçalves <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.2.0 |
Built: | 2024-10-31 18:36:30 UTC |
Source: | https://github.com/d-gaspar/grpipe |
if nrow or ncol parameters are equal zero, then the output will be an empty data.frame.
grPipe.create(nrow = 0, ncol = 0)
grPipe.create(nrow = 0, ncol = 0)
nrow |
integer |
ncol |
integer |
Returns a data.frame with 3 columns (id, id_next and text) where:
if nrow==0 or ncol==0, then return an empty data.frame;
if nrow>0 and ncol>0, then return a data.frame with one row:
id = paste0(LETTERS[nrow], ncol)
id_next = NA
text = NA
attr = NA
image = NA
Daniel Gaspar Gonçalves
nodes = grPipe.create() nodes = grPipe.create(nrow = 2, ncol = 5)
nodes = grPipe.create() nodes = grPipe.create(nrow = 2, ncol = 5)
add a new node if it doesn't exist or update an existing one.
grPipe.node( nodes, id, id_next, text, attr = "style=filled, shape=box, fillcolor='#d3d3d3', color='#d3d3d3', margin='0.2,0'", image = NA )
grPipe.node( nodes, id, id_next, text, attr = "style=filled, shape=box, fillcolor='#d3d3d3', color='#d3d3d3', margin='0.2,0'", image = NA )
nodes |
data.frame |
id |
character |
id_next |
character |
text |
character |
attr |
character |
image |
character |
Returns a data.frame with 5 columns (id, id_next, text, attr and image) where:
If id and id_next already exist in the data.frame nodes, then return the data.frame nodes with the value text updated;
Otherwise, add a row in the data.frame nodes with the values passed (id, id_next and text) and then return the data.frame nodes.
Daniel Gaspar Gonçalves
nodes = grPipe.create(2,5) nodes = grPipe.node(nodes, "A1", "A2", "input") nodes = grPipe.node(nodes, "A2", "B2", "step 1") nodes = grPipe.node(nodes, "B2", "B3", "step 2") nodes = grPipe.node(nodes, "B3", "B4", "step 3") nodes = grPipe.node(nodes, "B4", "A4", "step 4") nodes = grPipe.node(nodes, "A4", "A5", "step 5") nodes = grPipe.node(nodes, "A5", NA, "output")
nodes = grPipe.create(2,5) nodes = grPipe.node(nodes, "A1", "A2", "input") nodes = grPipe.node(nodes, "A2", "B2", "step 1") nodes = grPipe.node(nodes, "B2", "B3", "step 2") nodes = grPipe.node(nodes, "B3", "B4", "step 3") nodes = grPipe.node(nodes, "B4", "A4", "step 4") nodes = grPipe.node(nodes, "A4", "A5", "step 5") nodes = grPipe.node(nodes, "A5", NA, "output")
save grPipe nodes in pngfile path.
grPipe.plot( nodes, pngfile, title = "", plot = TRUE, showGrid = FALSE, colSpace = 0.5, rowSpace = 0.5 )
grPipe.plot( nodes, pngfile, title = "", plot = TRUE, showGrid = FALSE, colSpace = 0.5, rowSpace = 0.5 )
nodes |
data.frame |
pngfile |
character |
title |
character |
plot |
logical |
showGrid |
logical |
colSpace |
numeric |
rowSpace |
numeric |
No return value.
Daniel Gaspar Gonçalves
nodes = grPipe.create(2,5) nodes = grPipe.node(nodes, "A1", "A2", "input") nodes = grPipe.node(nodes, "A2", "B2", "step 1") nodes = grPipe.node(nodes, "B2", "B3", "step 2") nodes = grPipe.node(nodes, "B3", "B4", "step 3") nodes = grPipe.node(nodes, "B4", "A4", "step 4") nodes = grPipe.node(nodes, "A4", "A5", "step 5") nodes = grPipe.node(nodes, "A5", NA, "output") grPipe.plot(nodes, tempfile(), showGrid = TRUE) grPipe.plot(nodes, tempfile(), showGrid = FALSE)
nodes = grPipe.create(2,5) nodes = grPipe.node(nodes, "A1", "A2", "input") nodes = grPipe.node(nodes, "A2", "B2", "step 1") nodes = grPipe.node(nodes, "B2", "B3", "step 2") nodes = grPipe.node(nodes, "B3", "B4", "step 3") nodes = grPipe.node(nodes, "B4", "A4", "step 4") nodes = grPipe.node(nodes, "A4", "A5", "step 5") nodes = grPipe.node(nodes, "A5", NA, "output") grPipe.plot(nodes, tempfile(), showGrid = TRUE) grPipe.plot(nodes, tempfile(), showGrid = FALSE)