Showing 21 of 54 files from the diff.
Other files ignored by Codecov
man/add_static.Rd has changed.
CRAN-RELEASE was deleted.
man/neighbours.Rd has changed.
man/clear-kill.Rd has changed.
man/add_p.Rd has changed.
man/drops_p.Rd has changed.
man/read-batch.Rd has changed.
man/drop_p.Rd has changed.
man/sg_events.Rd has changed.
man/animation.Rd has changed.
man/export.Rd has changed.
man/noverlap.Rd has changed.
man/filter.Rd has changed.
man/sigmajs.Rd has changed.
man/cluster.Rd has changed.
man/force.Rd has changed.
man/read.Rd has changed.
man/get_graph.Rd has changed.
man/graph.Rd has changed.
man/adds_p.Rd has changed.
DESCRIPTION has changed.
cran-comments.md has changed.
man/drag-nodes.Rd has changed.
man/sg_button.Rd has changed.

@@ -17,6 +17,8 @@
Loading
17 17
#' @note Have the parameters from your initial graph match that of the node you add, i.e.: if you pass \code{size} in your initial chart,
18 18
#' make sure you also have it in your proxy.
19 19
#' 
20 +
#' @return The \code{proxy} object.
21 +
#' 
20 22
#' @rdname add_p
21 23
#' @export
22 24
sg_add_node_p <- function(proxy, data, ..., refresh = TRUE) {
@@ -80,6 +82,8 @@
Loading
80 82
#' @note Have the parameters from your initial graph match that of the node you add, i.e.: if you pass \code{size} in your initial chart,
81 83
#' make sure you also have it in your proxy.
82 84
#' 
85 +
#' @return The \code{proxy} object.
86 +
#' 
83 87
#' @rdname adds_p
84 88
#' @export
85 89
sg_add_nodes_p <- function(proxy, data, ..., refresh = TRUE, rate = "once") {
@@ -144,10 +148,7 @@
Loading
144 148
#' @param id Id of edge or node to delete.
145 149
#' @param refresh Whether to refresh the graph after node is dropped, required to take effect, if you are running force the algorithm is killed and restarted.
146 150
#'
147 -
#' @examples
148 -
#' \dontrun{
149 -
#' demo("drop-node", package = "sigmajs")
150 -
#' }
151 +
#' @return The \code{proxy} object.
151 152
#'
152 153
#' @rdname drop_p
153 154
#' @export
@@ -193,11 +194,8 @@
Loading
193 194
#'
194 195
#' @param proxy An object of class \code{sigmajsProxy} as returned by \code{\link{sigmajsProxy}}.
195 196
#' @param refresh Whether to refresh the graph after node is dropped, required to take effect, if you are running force the algorithm is killed and restarted.
196 -
#'
197 -
#' @examples
198 -
#' \dontrun{
199 -
#' demo("clear-graph", package = "sigmajs")
200 -
#' }
197 +
#' 
198 +
#' @return The \code{proxy} object.
201 199
#'
202 200
#' @rdname clear-kill
203 201
#' @export
@@ -247,13 +245,8 @@
Loading
247 245
#' of the delay to effectively add each row one after the other: delay is thus applied at each row (number of seconds to wait
248 246
#' before the row is added *since the previous row*). If \code{FALSE} this is the number of milliseconds to wait before the node or
249 247
#' edge is added to the visualisation; \code{delay} is used as passed to the function.
250 -
#'
251 -
#' @examples
252 -
#' \dontrun{
253 -
#' demo("add-nodes-delay", package = "sigmajs") # add nodes with a delay
254 -
#' demo("add-edges-delay", package = "sigmajs") # add edges with a delay
255 -
#' demo("add-delay", package = "sigmajs") # add nodes and edges with a delay
256 -
#' }
248 +
#' 
249 +
#' @return The \code{proxy} object.
257 250
#'
258 251
#' @note Have the parameters from your initial graph match that of the node you add, i.e.: if you pass \code{size} in your initial chart,
259 252
#' make sure you also have it in your proxy.
@@ -330,6 +323,8 @@
Loading
330 323
#' @param refresh Whether to refresh the graph after node is dropped, required to take effect.
331 324
#' @param rate Refresh rate, either \code{once}, the graph is refreshed after data.frame of nodes is added or at each \code{iteration} (row-wise). Only applies if \code{refresh} is set to \code{TRUE}.
332 325
#'
326 +
#' @return The \code{proxy} object.
327 +
#' 
333 328
#' @note Have the parameters from your initial graph match that of the node you add, i.e.: if you pass \code{size} in your initial chart,
334 329
#' make sure you also have it in your proxy.
335 330
#' 
@@ -398,12 +393,7 @@
Loading
398 393
#' before the row is dropped *since the previous row*). If \code{FALSE} this is the number of milliseconds to wait before the node or
399 394
#' edge is added to the visualisation; \code{delay} is used as passed to the function.
400 395
#'
401 -
#' @examples
402 -
#' \dontrun{
403 -
#' demo("drop-nodes-delay", package = "sigmajs") # add nodes with a delay
404 -
#' demo("drop-edges-delay", package = "sigmajs") # add edges with a delay
405 -
#' demo("drop-delay", package = "sigmajs") # add nodes and edges with a delay
406 -
#' }
396 +
#' @return The \code{proxy} object.
407 397
#'
408 398
#' @note Have the parameters from your initial graph match that of the node you add, i.e.: if you pass \code{size} in your initial chart,
409 399
#' make sure you also have it in your proxy.
@@ -542,6 +532,8 @@
Loading
542 532
#' 
543 533
#' if(interactive()) shinyApp(ui, server)
544 534
#' 
535 +
#' @return The \code{proxy} object.
536 +
#' 
545 537
#' @name read
546 538
#' @export
547 539
sg_read_nodes_p <- function(proxy, data, ...){
@@ -657,6 +649,8 @@
Loading
657 649
#' 
658 650
#' if(interactive()) shinyApp(ui, server)
659 651
#' 
652 +
#' @return The \code{proxy} object.
653 +
#' 
660 654
#' @name read-batch
661 655
#' @export
662 656
sg_read_delay_nodes_p <- function(proxy, data, ..., delay){

@@ -16,6 +16,8 @@
Loading
16 16
#'   sg_edges(edges, id, source, target) %>%
17 17
#'   sg_layout() %>% 
18 18
#'   sg_noverlap()
19 +
#' 
20 +
#' @return The first argument either \code{sg} or \code{proxy}.
19 21
#'
20 22
#' @rdname noverlap
21 23
#' @export

@@ -36,6 +36,8 @@
Loading
36 36
#' }
37 37
#' if(interactive()) shinyApp(ui, server) # run
38 38
#' 
39 +
#' @return The \code{proxy} object.
40 +
#' 
39 41
#' @rdname get_graph
40 42
#' @export
41 43
sg_get_nodes_p <- function(proxy) {

@@ -28,7 +28,9 @@
Loading
28 28
#' @note Keep \code{width} at \code{100\%} for a responsive visualisation.
29 29
#' 
30 30
#' @seealso \code{\link{sg_kill}}.
31 -
#'
31 +
#' 
32 +
#' @return An object of class \code{htmlwidget} which renders the visualisation on print.
33 +
#' 
32 34
#' @export
33 35
sigmajs <- function(type = NULL, width = "100%", kill = FALSE, height = NULL, elementId = NULL) {
34 36
  

@@ -18,8 +18,7 @@
Loading
18 18
#'   \item{\code{sg_filter_undo_p} Undo filters, accepts vector of \code{name}s.}
19 19
#' }
20 20
#' 
21 -
#' @examples 
22 -
#' # demo("filter-nodes", package = "sigmajs")
21 +
#' @return The \code{proxy} object.
23 22
#' 
24 23
#' @rdname filter
25 24
#' @export

@@ -13,6 +13,9 @@
Loading
13 13
#' sigmajs() %>% 
14 14
#'   sg_from_gexf(gexf) 
15 15
#' }
16 +
#' 
17 +
#' @return A modified version of the \code{sg} object.
18 +
#' 
16 19
#' @export
17 20
sg_from_gexf <- function(sg, file, sd = NULL) {
18 21

@@ -26,6 +26,8 @@
Loading
26 26
#'   sg_animate(mapping = list(x = "to_x", y = "to_y", size = "to_size"))
27 27
#' 
28 28
#' @seealso \href{https://github.com/jacomyal/sigma.js/tree/master/plugins/sigma.plugins.animate}{official documentation}
29 +
#' 
30 +
#' @return An object of class \code{htmlwidget} which renders the visualisation on print.
29 31
#'
30 32
#' @rdname animation
31 33
#' @export

@@ -23,7 +23,8 @@
Loading
23 23
#'   sg_export_svg() %>% 
24 24
#'   sg_button("export_svg", "download")
25 25
#' 
26 -
#' # demo("export-graph", package = "sigmajs")
26 +
#' @return An object of class \code{htmlwidget} which renders the visualisation on print.
27 +
#' Functions ending in \code{_p} return the \code{proxy}.
27 28
#' 
28 29
#' @rdname export
29 30
#' @export

@@ -53,6 +53,8 @@
Loading
53 53
#'   
54 54
#' # all source and target are present in node ids
55 55
#' all(c(edges$source, edges$target) %in% nodes$id)
56 +
#' 
57 +
#' @return A modified version of the \code{sg} object.
56 58
#'
57 59
#' @rdname graph
58 60
#' @export
@@ -166,6 +168,8 @@
Loading
166 168
#'   sg_add_edges(edges, delay, id, source, target, cumsum = FALSE) %>%
167 169
#'   sg_force_stop(2300) # stop after all edges added
168 170
#' 
171 +
#' @return A modified version of the \code{sg} object.
172 +
#' 
169 173
#' @rdname add_static
170 174
#' @export
171 175
sg_add_nodes <- function(sg, data, delay, ..., cumsum = TRUE) {
@@ -261,6 +265,8 @@
Loading
261 265
#'   sg_nodes(nodes, id, size, color) %>% 
262 266
#'   sg_drop_nodes(nodes2, id, delay, cumsum = FALSE)
263 267
#' 
268 +
#' @return A modified version of the \code{sg} object.
269 +
#' 
264 270
#' @rdname drop_static 
265 271
#' @export
266 272
sg_drop_nodes <- function(sg, data, ids, delay, cumsum = TRUE) {
@@ -360,6 +366,8 @@
Loading
360 366
#'   sg_read_exec() %>% 
361 367
#' 	 sg_button("read_exec", "Add nodes & edges")
362 368
#' 
369 +
#' @return A modified version of the \code{sg} object.
370 +
#' 
363 371
#' @name read-static
364 372
#' @export
365 373
sg_read_nodes <- function(sg, data, ..., delay){

@@ -13,6 +13,8 @@
Loading
13 13
#' demo("add-camera", package = "sigmajs")
14 14
#' }
15 15
#' 
16 +
#' @return An object of class \code{htmlwidget} which renders the visualisation on print.
17 +
#' 
16 18
#' @noRd
17 19
#' @keywords internal
18 20
sg_camera <- function(sg, elementId = NULL, initialise = FALSE) {

@@ -13,6 +13,8 @@
Loading
13 13
#'   sg_nodes(nodes, id, label) %>% # no need to pass size
14 14
#'   sg_edges(edges, id, source, target) %>% 
15 15
#'   sg_relative_size()
16 +
#' 
17 +
#' @return A modified version of the \code{sg} object.
16 18
#'
17 19
#' @export
18 20
sg_relative_size <- function(sg, initial = 1) {

@@ -39,6 +39,8 @@
Loading
39 39
#'   sg_force() %>% 
40 40
#'   sg_force_stop() # stop force after 5 seconds
41 41
#' 
42 +
#' @return Their first arguments, either \code{sg} or \code{proxy}.
43 +
#' 
42 44
#' @seealso \href{https://github.com/jacomyal/sigma.js/tree/master/plugins/sigma.layout.noverlap}{official documentation}
43 45
#'
44 46
#' @name force

@@ -33,6 +33,8 @@
Loading
33 33
#'   sg_progress(nodes2, delay, text, element = "h3") %>%
34 34
#'   sg_button(c("add_nodes", "progress"), "add") 
35 35
#' 
36 +
#' @return A modified version of the \code{sg} object.
37 +
#' 
36 38
#' @export
37 39
sg_progress <- function(sg, data, delay, text, ..., position = "top", id = NULL,
38 40
                        tag = htmltools::span, cumsum = TRUE){

@@ -17,6 +17,8 @@
Loading
17 17
#'		sg_from_igraph(lesmis_igraph, layout) %>%
18 18
#'		sg_settings(defaultNodeColor = "#000")
19 19
#' }
20 +
#' 
21 +
#' @return A modified version of the \code{sg} object.
20 22
#'
21 23
#' @export
22 24
sg_from_igraph <- function(sg, igraph, layout = NULL, sd = NULL) {

@@ -59,6 +59,8 @@
Loading
59 59
#' 
60 60
#' @note The default class (\code{btn btn-default}) works with Bootstrap 3 (the default framework for Shiny and R markdown).
61 61
#' 
62 +
#' @return An object of class \code{htmlwidget} which renders the visualisation on print.
63 +
#' 
62 64
#' @export
63 65
sg_button <- function(sg, event, ..., position = "top", class = "btn btn-default", tag = htmltools::tags$button, id = NULL){
64 66
  

@@ -7,9 +7,7 @@
Loading
7 7
}
8 8
9 9
.onLoad <- function(libname, pkgname) {
10 -
  options(SIGMAJS_STORAGE = FALSE)
11 10
  shiny::registerInputHandler("sigmajsParseJS", function(data, ...) {
12 11
    jsonlite::fromJSON(jsonlite::toJSON(data, auto_unbox = TRUE))
13 12
  }, force = TRUE)
14 -
  options(SIGMAJS_STORAGE = FALSE)
15 13
}

@@ -32,7 +32,9 @@
Loading
32 32
#'   
33 33
#' clustered <- sg_get_cluster(nodes, edges)
34 34
#' 
35 -
#' @return \code{sg_get_cluster} returns nodes with \code{color} variable.
35 +
#' @return \code{sg_get_cluster} returns nodes with \code{color} variable while 
36 +
#' \code{sg_cluster} returns an object of class \code{htmlwidget} which renders 
37 +
#' the visualisation on print.
36 38
#' 
37 39
#' @rdname cluster
38 40
#' @export

@@ -15,6 +15,8 @@
Loading
15 15
#'   sg_edges(edges, id, source, target) %>% 
16 16
#'   sg_layout() %>% 
17 17
#'   sg_neighbours()
18 +
#' 
19 +
#' @return A modified version of the \code{sg} object.
18 20
#'
19 21
#' @rdname neighbours
20 22
#' @export

@@ -104,6 +104,8 @@
Loading
104 104
#' 
105 105
#' @inheritParams sg_nodes
106 106
#' 
107 +
#' @return A modified version of the \code{sg} object.
108 +
#' 
107 109
#' @rdname clear-kill
108 110
#' @export
109 111
sg_kill <- function(sg){
@@ -138,6 +140,8 @@
Loading
138 140
#'   sg_nodes(nodes, id, size) %>% 
139 141
#'   sg_scale_color(pal = c("red", "blue"))
140 142
#' 
143 +
#' @return A modified version of the \code{sg} object.
144 +
#' 
141 145
#' @name color-scale
142 146
#' @export
143 147
sg_scale_color <- function(sg, pal){

@@ -63,6 +63,8 @@
Loading
63 63
#' 
64 64
#' @seealso \href{https://github.com/jacomyal/sigma.js/wiki/Events-API}{official documentation}.
65 65
#' 
66 +
#' @return An object of class \code{htmlwidget} which renders the visualisation on print.
67 +
#' 
66 68
#' @export 
67 69
sg_events <- function(sg, events){
68 70
  if(missing(events))

@@ -19,6 +19,9 @@
Loading
19 19
#' # proxies
20 20
#' demo("drag-nodes", package = "sigmajs")
21 21
#' }
22 +
#' 
23 +
#' @return \code{sg_drag_nodes} An object of class \code{htmlwidget} which renders the visualisation on print.
24 +
#' While \code{sg_drag_nodes_start_p} and \code{sg_drag_nodes_kill_p}
22 25
#'
23 26
#' @rdname drag-nodes
24 27
#' @export
@@ -29,8 +32,8 @@
Loading
29 32
30 33
  .test_sg(sg)
31 34
32 -
    sg$x$dragNodes <- TRUE
33 -
    sg
35 +
  sg$x$dragNodes <- TRUE
36 +
  sg
34 37
}
35 38
36 39
#' @rdname drag-nodes
@@ -45,7 +48,8 @@
Loading
45 48
	message <- list(id = proxy$id) # create message
46 49
47 50
	proxy$session$sendCustomMessage("sg_drag_nodes_start_p", message)
48 -
    proxy
51 +
  
52 +
  proxy
49 53
}
50 54
51 55
#' @rdname drag-nodes
@@ -60,5 +64,5 @@
Loading
60 64
	message <- list(id = proxy$id) # create message
61 65
62 66
	proxy$session$sendCustomMessage("sg_drag_nodes_kill_p", message)
63 -
    proxy
67 +
  proxy
64 68
}
Files Coverage
R 41.19%
Project Totals (26 files) 41.19%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading