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

Add clickAction to sankeyNetwork #228

Open
Atrebas opened this issue Jan 23, 2018 · 1 comment
Open

Add clickAction to sankeyNetwork #228

Atrebas opened this issue Jan 23, 2018 · 1 comment

Comments

@Atrebas
Copy link

Atrebas commented Jan 23, 2018

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):

## 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.

@Atrebas
Copy link
Author

Atrebas commented Jan 23, 2018

Just saw there is already PR #139 for this, but there are some conflicts.

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

No branches or pull requests

2 participants