Closed r-archer37 closed 6 years ago
Here is a smaller reproducible example:
library(googleVis)
dat <- data.frame(From=c(rep("A",3), rep("B", 3)),
To=c(rep(c("X", "Y", "Z"),2)),
Weight=c(5,7,6,2,9,4))
plot(gvisSankey(dat, from="From", to="To", weight="Weight",
options = list(
sankey="{link: {color: {fill: '#d799ae', fillOpacity: 0.8}}}")
))
I can't see that googleVis is causing this issue, afaik we are following the Google documentation here. Currently, Google is working on the rollout of a new version of the Google API. Perhaps, this is causing the behaviour. The Google Forum has more info: https://groups.google.com/forum/#!forum/google-visualization-api
Thanks for the pointer! Looking backward from there, it seems there was a change to this in 2015: https://groups.google.com/d/msg/google-visualization-api/eP8bMUyChxw/0BsCDszSUykJ
It should be sankey.link.defaultOpacity
Here's a working revision of your example:
library(googleVis)
dat <- data.frame(From=c(rep("A",3), rep("B", 3)),
To=c(rep(c("X", "Y", "Z"),2)),
Weight=c(5,7,6,2,9,4))
plot(gvisSankey(dat, from="From", to="To", weight="Weight",
options = list(
sankey="{link: {color: {fill: '#d799ae'}, defaultOpacity: 0.2}}")
))
Thanks for the follow up.
I'm making Sankey charts and with some link colors, I think the chart would look a lot better with links having lower transparency values. However, no matter what value I pass the outcome seems to be no different.
Example code: