christophergandrud / christophergandrud/networkD3

Some colors ignored in sankeyNetwork(colourScale = ...)

Open
#242 5 comments 0 reactions 0 assignees View on GitHub
bug sankeyNetwork
Dominant language
R
Stars
659
Forks
259
PR merge metrics
No merged PRs in 30d

Description

The following graph should have a green node, but it appears blue. Tested with both the CRAN release and 9c0a9c9ff32c53212d2d43e0ae3cc664137315e6.

```r
nodes <- data.frame(
id = letters[1:3],
label = c("blue", "green", "black"),
status = c("imported", "up to date", "outdated"),
stringsAsFactors = FALSE
)
edges <- data.frame(
src = c(0, 0, 1),
target = c(2, 1, 2),
value = 1
)
color <- "d3.scaleOrdinal() .domain(['imported', 'up to date', 'outdated']) .range(['#1874CD', '#228B22', '#000000'])"
networkD3::sankeyNetwork(
Links = edges,
Nodes = nodes,
NodeID = "label",
Source = "src",
Target = "target",
NodeGroup = "status",
Value = "value",
colourScale = color,
fontSize = 16
)
```

![color](https://user-images.githubusercontent.com/1580860/42670186-56f692ec-8627-11e8-85dc-34e3a108dd82.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.