Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the use of scale_* function in colourScale argument #28

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Yunuuuu
Copy link

@Yunuuuu Yunuuuu commented Sep 27, 2022

These commits provide a interface to use scale_d3_* function in sankeyNetwork, and imports all ggsci discrete palette.

URL <- paste0(
  "https://cdn.rawgit.com/christophergandrud/networkD3/",
  "master/JSONdata/energy.json"
)
Energy <- jsonlite::fromJSON(URL)

# Plot
sankeyD3::sankeyNetwork(
  Links = Energy$links, Nodes = Energy$nodes, Source = "source",
  Target = "target", Value = "value", NodeID = "name",
  units = "TWh", fontSize = 12, nodeWidth = 30,
  colourScale = sankeyD3::scale_d3_igv()
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant