rich-iannone / DiagrammeR

Compare f53b20c ... +1 ... 5644261

Coverage Reach
utils.R print.R generate_dot.R add_node.R x11_hex.R import_graph.R add_n_nodes_ws.R trav_both_edge.R add_full_graph.R render_graph.R create_graph.R get_paths.R add_grid_3d.R add_edge.R add_grid_2d.R add_pa_graph.R export_graph.R trav_in_until.R trav_out_until.R add_edges_from_table.R add_prism.R add_balanced_tree.R add_gnp_graph.R add_gnm_graph.R add_growing_graph.R add_cycle.R delete_edge.R trav_both.R add_star.R add_path.R add_smallworld_graph.R select_nodes_in_neighborhood.R trav_in.R trav_out.R add_islands_graph.R visnetwork.R get_node_info.R select_edges.R trav_out_edge.R trav_in_edge.R colorize_node_attrs.R trav_out_node.R colorize_edge_attrs.R trav_in_node.R add_node_clones_ws.R combine_graphs.R add_nodes_from_table.R is_edge_present.R get_similar_nbrs.R layout_nodes_w_string.R add_reverse_edges_ws.R select_nodes.R add_n_node_clones.R from_igraph.R select_edges_by_node_id.R select_nodes_by_degree.R set_node_attr_to_display.R add_edges_w_string.R select_edges_by_edge_id.R display_metagraph.R set_edge_attr_to_display.R rescale_node_attrs.R rescale_edge_attrs.R attr_themes.R select_nodes_by_id.R add_nodes_from_df_cols.R recode_node_attrs.R recode_edge_attrs.R set_node_attr_w_fcn.R get_attr_dfs.R filter_graph_series.R add_edge_clone.R set_edge_attrs.R trav_reverse_edge.R set_node_position.R select_last_edges_created.R select_last_nodes_created.R add_n_nodes.R invert_selection.R fully_connect_nodes_ws.R set_df_as_edge_attr.R set_df_as_node_attr.R mutate_edge_attrs_ws.R create_node_df.R mutate_node_attrs_ws.R transform_to_subgraph_ws.R delete_node.R grViz.R set_node_attrs.R delete_global_graph_attrs.R add_graph_action.R create_edge_df.R delete_edges_ws.R join_node_attrs.R rename_node_attrs.R rename_edge_attrs.R delete_nodes_ws.R nudge_node_positions_ws.R spectools.R delete_graph_actions.R delete_loop_edges_ws.R get_jaccard_similarity.R trigger_graph_actions.R add_forward_edges_ws.R fully_disconnect_nodes_ws.R get_last_edges_created.R get_last_nodes_created.R copy_node_attrs.R copy_edge_attrs.R get_dice_similarity.R transform_to_complement_graph.R get_edges.R set_cache.R join_edge_attrs.R edge_aes.R rev_edge_dir_ws.R reorder_graph_actions.R drop_node_attrs.R set_edge_attrs_ws.R add_global_graph_attrs.R get_edge_attrs.R base64.R mutate_edge_attrs.R add_edge_df.R from_adj_matrix.R is_edge_mutual.R add_node_df.R is_edge_multiple.R node_aes.R set_node_attrs_ws.R do_dfs.R drop_edge_attrs.R do_bfs.R delete_cache.R mutate_node_attrs.R get_radiality.R set_graph_time.R is_edge_loop.R get_agg_degree_out.R clear_selection.R get_agg_degree_total.R get_agg_degree_in.R get_graph_series_info.R rev_edge_dir.R get_selection.R get_degree_distribution.R count_unconnected_nodes.R export_csv.R get_authority_centrality.R get_eigen_centrality.R get_node_attrs.R get_degree_histogram.R get_edge_attrs_ws.R get_closeness.R get_coreness.R get_node_attrs_ws.R get_degree_out.R get_constraint.R get_degree_in.R get_degree_total.R deselect_edges.R get_all_connected_nodes.R deselect_nodes.R get_s_connected_cmpts.R get_w_connected_cmpts.R get_graph_info.R get_leverage_centrality.R set_graph_name.R get_eccentricity.R DiagrammeR.R get_edge_count_w_multiedge.R mermaid.R set_graph_directed.R set_graph_undirected.R get_alpha_centrality.R get_predecessors.R get_successors.R get_closeness_vitality.R get_common_nbrs.R get_betweenness.R is_node_present.R get_multiedge_count.R get_pagerank.R get_global_graph_attr_info.R get_non_nbrs.R get_nbrs.R create_graph_series.R combine_edfs.R render_graph_from_graph_series.R is_graph_weighted.R count_automorphisms.R get_bridging.R combine_ndfs.R add_graph_to_graph_series.R get_cmty_louvain.R get_min_eccentricity.R get_cmty_fast_greedy.R get_cmty_edge_btwns.R to_igraph.R get_cmty_l_eigenvec.R get_edge_ids.R get_min_cut_between.R get_node_ids.R count_loop_edges.R open_graph.R save_graph.R get_cmty_walktrap.R is_property_graph.R get_articulation_points.R get_edge_df_ws.R get_node_df_ws.R get_periphery.R get_cache.R get_graph_from_graph_series.R is_graph_connected.R get_reciprocity.R count_mutual_node_pairs.R is_graph_dag.R get_max_eccentricity.R get_girth.R count_unconnected_node_pairs.R remove_graph_from_graph_series.R count_asymmetric_node_pairs.R get_mean_distance.R get_adhesion.R count_s_connected_cmpts.R count_w_connected_cmpts.R get_edge_info.R count_edges.R is_graph_empty.R count_nodes.R transform_to_min_spanning_tree.R node_data.R get_graph_actions.R edge_data.R get_graph_log.R is_graph_simple.R get_graph_time.R is_graph_directed.R get_graph_name.R get_edge_df.R get_node_df.R is_graph_undirected.R count_graphs_in_graph_series.R

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -19,103 +19,104 @@
Loading
19 19
#'   Markdown documents, and within Shiny output bindings.
20 20
#'
21 21
#' @examples
22 -
#' \dontrun{
22 +
#' \donttest{
23 23
#' # Create a simple graph running left to right (note
24 24
#' # that the whitespace is not important)
25 -
#' DiagrammeR("
26 -
#'   graph LR
27 -
#'     A-->B
28 -
#'     A-->C
29 -
#'     C-->E
30 -
#'     B-->D
31 -
#'     C-->D
32 -
#'     D-->F
33 -
#'     E-->F
34 -
#' ")
25 +
#' # DiagrammeR("
26 +
#' #   graph LR
27 +
#' #     A-->B
28 +
#' #     A-->C
29 +
#' #     C-->E
30 +
#' #     B-->D
31 +
#' #     C-->D
32 +
#' #     D-->F
33 +
#' #     E-->F
34 +
#' # ")
35 +
#'
35 36
#' # Create the equivalent graph but have it running
36 37
#' # from top to bottom
37 -
#' DiagrammeR("
38 -
#'    graph TB
39 -
#'    A-->B
40 -
#'    A-->C
41 -
#'    C-->E
42 -
#'    B-->D
43 -
#'    C-->D
44 -
#'    D-->F
45 -
#'    E-->F
46 -
#' ")
38 +
#' # DiagrammeR("
39 +
#' #    graph TB
40 +
#' #    A-->B
41 +
#' #    A-->C
42 +
#' #    C-->E
43 +
#' #    B-->D
44 +
#' #    C-->D
45 +
#' #    D-->F
46 +
#' #    E-->F
47 +
#' # ")
47 48
#'
48 49
#' # Create a graph with different node shapes and
49 50
#' # provide fill styles for each node
50 -
#' DiagrammeR("graph LR;A(Rounded)-->B[Squared];B-->C{A Decision};
51 -
#'  C-->D[Square One];C-->E[Square Two];
52 -
#'  style A fill:#E5E25F;  style B fill:#87AB51; style C fill:#3C8937;
53 -
#'  style D fill:#23772C;  style E fill:#B6E6E6;"
54 -
#' )
51 +
#' # DiagrammeR("graph LR;A(Rounded)-->B[Squared];B-->C{A Decision};
52 +
#' #  C-->D[Square One];C-->E[Square Two];
53 +
#' #  style A fill:#E5E25F;  style B fill:#87AB51; style C fill:#3C8937;
54 +
#' #  style D fill:#23772C;  style E fill:#B6E6E6;"
55 +
#' # )
55 56
#'
56 57
#' # Load in the 'mtcars' dataset
57 -
#' data(mtcars)
58 -
#' connections <- sapply(
59 -
#'  1:ncol(mtcars)
60 -
#'   ,function(i) {
61 -
#'      paste0(
62 -
#'         i
63 -
#'       ,"(",colnames(mtcars)[i],")---"
64 -
#'       ,i,"-stats("
65 -
#'       ,paste0(
66 -
#'         names(summary(mtcars[,i]))
67 -
#'         ,": "
68 -
#'         ,unname(summary(mtcars[,i]))
69 -
#'         ,collapse="<br/>"
70 -
#'       )
71 -
#'       ,")"
72 -
#'    )
73 -
#'  }
74 -
#' )
58 +
#' # data(mtcars)
59 +
#' # connections <- sapply(
60 +
#' #  1:ncol(mtcars)
61 +
#' #   ,function(i) {
62 +
#' #      paste0(
63 +
#' #         i
64 +
#' #       ,"(",colnames(mtcars)[i],")---"
65 +
#' #       ,i,"-stats("
66 +
#' #       ,paste0(
67 +
#' #         names(summary(mtcars[,i]))
68 +
#' #         ,": "
69 +
#' #         ,unname(summary(mtcars[,i]))
70 +
#' #         ,collapse="<br/>"
71 +
#' #       )
72 +
#' #       ,")"
73 +
#' #    )
74 +
#' #  }
75 +
#' # )
75 76
#'
76 77
#' # Create a diagram using the 'connections' object
77 -
#' DiagrammeR(
78 -
#'    paste0(
79 -
#'      "graph TD;", "\n",
80 -
#'      paste(connections, collapse = "\n"),"\n",
81 -
#'      "classDef column fill:#0001CC, stroke:#0D3FF3, stroke-width:1px;" ,"\n",
82 -
#'      "class ", paste0(1:length(connections), collapse = ","), " column;"
83 -
#'    )
84 -
#'  )
78 +
#' # DiagrammeR(
79 +
#' #    paste0(
80 +
#' #      "graph TD;", "\n",
81 +
#' #      paste(connections, collapse = "\n"),"\n",
82 +
#' #      "classDef column fill:#0001CC, stroke:#0D3FF3, stroke-width:1px;" ,"\n",
83 +
#' #      "class ", paste0(1:length(connections), collapse = ","), " column;"
84 +
#' #    )
85 +
#' #  )
85 86
#'
86 87
#' # Also with `DiagrammeR()`, you can use tags
87 88
#' # from `htmltools` (just make sure to use
88 89
#' # `class = "mermaid"`)
89 90
#' library(htmltools)
90 -
#' diagramSpec = "
91 -
#' graph LR;
92 -
#'   id1(Start)-->id2(Stop);
93 -
#'   style id1 fill:#f9f,stroke:#333,stroke-width:4px;
94 -
#'   style id2 fill:#ccf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5;
95 -
#' "
96 -
#' html_print(tagList(
97 -
#'   tags$h1("R + mermaid.js = Something Special")
98 -
#'   ,tags$pre(diagramSpec)
99 -
#'   ,tags$div(class="mermaid",diagramSpec)
100 -
#'   ,DiagrammeR()
101 -
#' ))
91 +
#' # diagramSpec = "
92 +
#' # graph LR;
93 +
#' #   id1(Start)-->id2(Stop);
94 +
#' #   style id1 fill:#f9f,stroke:#333,stroke-width:4px;
95 +
#' #   style id2 fill:#ccf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5;
96 +
#' # "
97 +
#' # html_print(tagList(
98 +
#' #   tags$h1("R + mermaid.js = Something Special")
99 +
#' #   ,tags$pre(diagramSpec)
100 +
#' #   ,tags$div(class="mermaid", diagramSpec)
101 +
#' #   ,DiagrammeR()
102 +
#' # ))
102 103
#'
103 104
#' # Create a sequence diagram
104 -
#' DiagrammeR("
105 -
#' sequenceDiagram;
106 -
#'    customer->>ticket seller: ask for a ticket;
107 -
#'    ticket seller->>database: seats;
108 -
#'    alt tickets available
109 -
#'      database->>ticket seller: ok;
110 -
#'      ticket seller->>customer: confirm;
111 -
#'      customer->>ticket seller: ok;
112 -
#'      ticket seller->>database: book a seat;
113 -
#'      ticket seller->>printer: print a ticket;
114 -
#'    else sold out
115 -
#'      database->>ticket seller: none left;
116 -
#'      ticket seller->>customer: sorry;
117 -
#'    end
118 -
#' ")
105 +
#' # DiagrammeR("
106 +
#' # sequenceDiagram;
107 +
#' #    customer->>ticket seller: ask for a ticket;
108 +
#' #    ticket seller->>database: seats;
109 +
#' #    alt tickets available
110 +
#' #      database->>ticket seller: ok;
111 +
#' #      ticket seller->>customer: confirm;
112 +
#' #      customer->>ticket seller: ok;
113 +
#' #      ticket seller->>database: book a seat;
114 +
#' #      ticket seller->>printer: print a ticket;
115 +
#' #    else sold out
116 +
#' #      database->>ticket seller: none left;
117 +
#' #      ticket seller->>customer: sorry;
118 +
#' #    end
119 +
#' # ")
119 120
#' }
120 121
#'
121 122
#' @import htmlwidgets
@@ -157,5 +158,6 @@
Loading
157 158
    x = x,
158 159
    width = width,
159 160
    height = height,
160 -
    package = "DiagrammeR")
161 +
    package = "DiagrammeR"
162 +
  )
161 163
}

@@ -19,15 +19,17 @@
Loading
19 19
#'
20 20
#' # Save the graph to disk; use
21 21
#' # the file name `gnp_graph.dgr`
22 -
#' save_graph(
23 -
#'   x = gnp_graph,
24 -
#'   file = "gnp_graph")
22 +
#' # save_graph(
23 +
#' #   x = gnp_graph,
24 +
#' #   file = "gnp_graph"
25 +
#' # )
25 26
#'
26 27
#' # To read the graph file from
27 28
#' # disk, use `open_graph()`
28 -
#' gnp_graph_2 <-
29 -
#'   open_graph(
30 -
#'     file = "gnp_graph.dgr")
29 +
#' # gnp_graph_2 <-
30 +
#' #   open_graph(
31 +
#' #     file = "gnp_graph.dgr"
32 +
#' # )
31 33
#'
32 34
#' @export
33 35
save_graph <- function(x,

@@ -4,7 +4,7 @@
Loading
4 4
#'
5 5
#' @inheritParams render_graph
6 6
#' @examples
7 -
#' \dontrun{
7 +
#'
8 8
#' # Create a node data frame (ndf)
9 9
#' ndf <-
10 10
#'   create_node_df(
@@ -14,7 +14,8 @@
Loading
14 14
#'                   "pink", "aqua", "yellow"),
15 15
#'     shape = "dot",
16 16
#'     size = c(20, 80, 40, 10, 30, 50),
17 -
#'     type = c("1", "1", "1", "2", "2", "2"))
17 +
#'     type = c("1", "1", "1", "2", "2", "2")
18 +
#'   )
18 19
#'
19 20
#' # Create an edge data frame (edf)
20 21
#' edf <-
@@ -23,16 +24,17 @@
Loading
23 24
#'     to = c(4, 3, 1, 3, 1, 4),
24 25
#'     color = c("green", "green", "grey",
25 26
#'               "grey", "blue", "blue"),
26 -
#'     rel = "leading_to")
27 +
#'     rel = "leading_to"
28 +
#'   )
27 29
#'
28 30
#' # Create a graph object
29 31
#' graph <-
30 32
#'   create_graph(
31 33
#'     nodes_df = ndf,
32 -
#'     edges_df = edf)
34 +
#'     edges_df = edf
35 +
#'   )
33 36
#'
34 -
#' visnetwork(graph)
35 -
#' }
37 +
#' # visnetwork(graph)
36 38
#'
37 39
#' @import visNetwork
38 40
#' @export

@@ -16,7 +16,7 @@
Loading
16 16
#' @param height An optional parameter for specifying the height of the
17 17
#'   resulting graphic in pixels.
18 18
#' @examples
19 -
#' \dontrun{
19 +
#' \donttest{
20 20
#' # Render a graph that's a
21 21
#' # balanced tree
22 22
#' create_graph() %>%

@@ -36,7 +36,8 @@
Loading
36 36
#' graph <-
37 37
#'   create_graph() %>%
38 38
#'   add_full_graph(
39 -
#'     n = 3, keep_loops = TRUE)
39 +
#'     n = 3, keep_loops = TRUE
40 +
#'   )
40 41
#'
41 42
#' # Get node information
42 43
#' # from this graph
@@ -58,7 +59,8 @@
Loading
58 59
#'     n = 3,
59 60
#'     type = "connected",
60 61
#'     label = c("1st", "2nd", "3rd"),
61 -
#'     rel = "connected_to")
62 +
#'     rel = "connected_to"
63 +
#'   )
62 64
#'
63 65
#' # Show the graph's node
64 66
#' # data frame (ndf)
@@ -82,9 +84,10 @@
Loading
82 84
#'   sample(9, FALSE) %>%
83 85
#'   round(2) %>%
84 86
#'   matrix(
85 -
#'     nc = 3,
86 -
#'     nr = 3,
87 -
#'     dimnames = list(c("a", "b", "c")))
87 +
#'     ncol = 3,
88 +
#'     nrow = 3,
89 +
#'     dimnames = list(c("a", "b", "c"))
90 +
#'   )
88 91
#'
89 92
#' # Create the fully-connected
90 93
#' # graph (without loops however)
@@ -118,7 +121,8 @@
Loading
118 121
#'     label = TRUE,
119 122
#'     rel = "related_to",
120 123
#'     edge_wt_matrix = edge_wt_matrix,
121 -
#'     keep_loops = FALSE) %>%
124 +
#'     keep_loops = FALSE
125 +
#'   ) %>%
122 126
#'   get_edge_df()
123 127
#'
124 128
#' @export

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R 81.55%
Project Totals (244 files) 81.55%
Loading