Skip to content

Commit

Permalink
change sankey default display to "internal" (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjyetman authored Dec 16, 2023
1 parent 8cb09fb commit 403f0b7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion R/sankey_network.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @md
#' @export

sankey_network <- function(data, width = NULL, height = NULL, ..., viewer = "browser") {
sankey_network <- function(data, width = NULL, height = NULL, ..., viewer = "internal") {
data <- as_sankey_data(data, ...)

data <- jsonlite::toJSON(data, null = "null", na = "null", auto_unbox = TRUE,
Expand Down
2 changes: 1 addition & 1 deletion inst/sankey_network.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// !preview r2d3 data = jsonlite::toJSON(list(nodes=data.frame(id=c(0,1,2,3,4,5,6),name=c("node0","node1","node2","node3","node4","node5","node6"),group=c("grp1","grp1","grp2","grp2","grp2","grp3","grp3")),links=data.frame(source=c(0,1,1,1,0,2,2,3,5),target=c(2,2,3,5,4,3,4,4,6),value=c(2,2,2,2,2,2,2,4,4)))), dependencies = "inst/lib/d3-sankey/d3-sankey.min.js", d3_version = 6, width = 600, height = 300, options = list(linkStrokeOpacity=0.3,linkMixBlendMode="multiply",linkPath="d3.sankeyLinkHorizontal()",linkColor="source-target",nodeAlign="justify",nodeGroup="group",nodeWidth=15,nodePadding=10,nodeLabelPadding=6,nodeLabelFontFamily="sans-serif",nodeLabelFontSize=10,colors="d3.schemeCategory10"), viewer = "browser"
// !preview r2d3 data = jsonlite::toJSON(list(nodes=data.frame(id=c(0,1,2,3,4,5,6),name=c("node0","node1","node2","node3","node4","node5","node6"),group=c("grp1","grp1","grp2","grp2","grp2","grp3","grp3")),links=data.frame(source=c(0,1,1,1,0,2,2,3,5),target=c(2,2,3,5,4,3,4,4,6),value=c(2,2,2,2,2,2,2,4,4)))), dependencies = "inst/lib/d3-sankey/d3-sankey.min.js", d3_version = 6, width = 600, height = 300, options = list(linkStrokeOpacity=0.3,linkMixBlendMode="multiply",linkPath="d3.sankeyLinkHorizontal()",linkColor="source-target",nodeAlign="justify",nodeGroup="group",nodeWidth=15,nodePadding=10,nodeLabelPadding=6,nodeLabelFontFamily="sans-serif",nodeLabelFontSize=10,colors="d3.schemeCategory10"), viewer = "internal"

r2d3.onRender(function(data, svg, width, height, options) {
let linkStrokeOpacity = options.linkStrokeOpacity;
Expand Down
18 changes: 9 additions & 9 deletions man/as_tree_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/sankey_network.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 403f0b7

Please sign in to comment.