read-static

0th

Percentile

Read

Read nodes and edges into your graph, with or without a delay.

Usage
sg_read_nodes(sg, data, ..., delay)

sg_read_edges(sg, data, ..., delay)

sg_read_exec(sg, refresh = TRUE)

Arguments
sg

An object of class sigmajsas intatiated by sigmajs.

data

Data.frame (or list) of nodes or edges.

...

Any column name, see details.

delay

Column name containing delay in milliseconds.

refresh

Whether to refresh the force layout.

Functions

  • sg_read_nodes read nodes.

  • sg_read_edges read edges.

  • sg_read_exec send read nodes and edges to JavaScript front end.

Aliases
  • read-static
  • sg_read_nodes
  • sg_read_edges
  • sg_read_exec
Examples
# NOT RUN {
nodes <- sg_make_nodes(50)
 nodes$batch <- c(
	 rep(1000, 25),
	 rep(3000, 25)
	)

edges <- data.frame(
 id = 1:80,
	 source = c(
	  sample(1:25, 40, replace = TRUE),
		sample(1:50, 40, replace = TRUE)
	 ),
	 target = c(
	  sample(1:25, 40, replace = TRUE),
		sample(1:50, 40, replace = TRUE)
	 ),
	 batch = c(
	  rep(1000, 40),
		rep(3000, 40)
	 )
) %>% 
 dplyr::mutate_all(as.character)

sigmajs() %>% 
  sg_force_start() %>% 
  sg_read_nodes(nodes, id, label, color, size, delay = batch) %>% 
  sg_read_edges(edges, id, source, target, delay = batch) %>% 
	 sg_force_stop(4000) %>% 
  sg_read_exec() %>% 
	 sg_button("read_exec", "Add nodes & edges")

# }
Documentation reproduced from package sigmajs, version 0.1.3, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.