christophergandrud / christophergandrud/networkD3

Add clickAction to sankeyNetwork

Open
#228 1 comment 0 reactions 0 assignees View on GitHub
feature request sankeyNetwork
Dominant language
R
Stars
659
Forks
259
PR merge metrics
No merged PRs in 30d

Description

In forceNetwork, clickAction allows to trigger an action when a node is clicked.
Would it be possible to add this feature to sankeyNetwork?
What I have in mind is to display the elements that belong to a node when it is clicked (e.g. in a table below).

Here is a procedure that seems to be ok (copy/paste from forceNetwork):
```r
## In sankeyNetwork.js
# line 241, above the dragmove function

function click(d) {
return eval(options.clickAction)
}

# line 157, in var node before .call([...])

.on("click", click)

## In sankeyNetwork.R
# line 135, at the end of options

clickAction = clickAction

# line 79, at the end of the sankeyNetwork arguments

clickAction = NULL

# line 44, in the doc
#' @param clickAction character string with a JavaScript expression to evaluate when a node is clicked.
```

Thanks.

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.