enodes: Add nodes

Description Usage Arguments Details See Also Examples

View source: R/force.R

Description

Add nodes for eforce.

Add nodes for eforce.

Usage

1
2
3
4
5
6
enodes(p, nodes, name, label, value, category, symbolSize, depth,
  ignore = FALSE, symbol = "circle", fixX = FALSE, fixY = FALSE)

enodes_(p, nodes, name, label = NULL, value = NULL, category = NULL,
  symbolSize = NULL, depth = NULL, ignore = FALSE, symbol = "circle",
  fixX = FALSE, fixY = FALSE)

Arguments

p

an echart object.

nodes

nodes data.frame.

name

name column.

label

nodes label column.

value

nodes value (size).

category

nodes group column.

symbolSize

nodes symbol size column.

depth

depth of nodes.

ignore

whether to ignore nodes.

symbol

nodes symbol, see details for valid values.

fixX, fixY

whether to fix x and y axis position.

Details

Valid values for symbol:

See Also

enodes eforce

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)

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 22, 2021, 6:18 p.m.