eforce: Build force network

Description Usage Arguments See Also Examples

View source: R/force.R

Description

Build force network

Plot force directed graph.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
eforce(p, name = NULL, large = FALSE, center = list("50%", "50%"),
  roam = FALSE, size = "100%", minRadius = 10, maxRadius = 20,
  linkSymbol = "none", linkSymbolSize = list(10, 15), scaling = 1,
  gravity = 1, draggable = TRUE, useWorker = TRUE, steps = 1, z = 2,
  zlevel = 0, ...)

eforce_(p, name = NULL, large = FALSE, center = list("50%", "50%"),
  roam = FALSE, size = "100%", minRadius = 10, maxRadius = 20,
  linkSymbol = "none", linkSymbolSize = list(10, 15), scaling = 1,
  gravity = 1, draggable = TRUE, useWorker = TRUE, steps = 1, z = 2,
  zlevel = 0, ...)

Arguments

p

an echart objects.

name

name of network.

large

set to TRUE to optimise for large graphs.

center

center of network.

roam

set to TRUE to enable zoom and drag.

size

size of layout.

minRadius, maxRadius

minimum and maximum radius of nodes.

linkSymbol

can be set to arrow.

linkSymbolSize

size of symbol.

scaling

scaling factor.

gravity

centripetal force coefficient.

draggable

set to TRUE to allow dragging nodes.

useWorker

specifies whether to put layout calculation into web worker when the browser supports web worker.

steps

the number of iterations of each frame layout calculation.

z, zlevel

first and second grade cascading control, the higher z the closer to the top.

...

any other options to pass to serie.

See Also

enodes eforce

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
let <- LETTERS[1:20]

edges <- data.frame(source = sample(let, 20), target = sample(let, 20),
  weight = runif(20, 5, 20))

nodes <- data.frame(name = let, value = runif(20, 5, 25), group = rep(LETTERS[1:4], 5))

echart() %>%
  eforce(itemStyle = list(normal = list(label = list(show = TRUE)))) %>% # show labels
  enodes(nodes, name, value = value, category = group) %>%
  elinks(edges, source, target)

JohnCoene/echarts documentation built on May 4, 2018, 8:04 a.m.