-
Notifications
You must be signed in to change notification settings - Fork 86
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
getSelectedRowNames, getSelectedColnames, selectRows, selectCols? #7
Comments
Hi Paul, That's great, I'm glad progress is being made. If I understand you correctly you want to be able to get the current rows/columns and set the current rows/columns. The Clustergrammer.js API (API docs) supports setting the current rows/columns and you can get the current rows/col from the You can get the current row/column names using
You can set the current rows/columns using
You can leave the You can try running these commands in the developer console of the github.io page: http://maayanlab.github.io/clustergrammer/ Let us know if that is what you are looking for. Best, |
Thanks, Nick. I gave this a try, and it works as you say.
However, I hope to:
— scenario 1
a) select a row or cluster of rows interactively in clustergrammer
b) in javascript, retrieve the names of just those selected rows
— scenario 2
a) in javascript, select rows by name, programmatically
I hope to do both of these operations this with columns as well.
Possible?
Thanks!
- Paul
… On Aug 3, 2017, at 1:11 PM, Nicolas Fernandez ***@***.***> wrote:
Hi Paul,
That's great, I'm glad progress is being made. If I understand you correctly you want to be able to get the current rows/columns and set the current rows/columns.
The Clustergrammer.js API (API docs) supports setting the current rows/columns and you can get the current rows/col from the cgm object (I'll build an API for getting rows/columns later).
You can get the current row/column names using
// get current row names
cgm.params.network_data.row_nodes_names
// get current column names
cgm.params.network_data.col_nodes_names
You can set the current rows/columns using
cgm.filter_viz_using_names({'row':['LRRK2','NRK'], 'col':['H2106', 'H23']})
You can leave the row and/or col attributes empty to reset the rows/columns.
You can try running these commands in the developer console of the github.io page: http://maayanlab.github.io/clustergrammer/
Let us know if that is what you are looking for.
Best,
Nick
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi Paul, Scenario 1 Scenario 2 Let me know if that helps. Best, |
Hi Nick,
This all works great. Thank you!
- Paul
… On Aug 4, 2017, at 9:47 AM, Nicolas Fernandez ***@***.***> wrote:
Hi Paul,
Scenario 1
You can interactively select a row or cluster of rows in two ways. You can crop, where you draw out a region of interest that filters out only that area (then you can use the previous command to get the row/col names in JavaScript). You can also use the interactive dendrogram to crop into clusters of different sizes and to get the row/col names of the selected cluster.
Scenario 2
Would the cgm.filter_viz_using_names endpoint work for this? You can use it to programmatically filter the visualization for rows/columns of interest.
Let me know if that helps.
Best,
Nick
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Great, I'll close the issue then. |
@cornhundred, I want to report which subset of rows the user has clicked on when they crop the matrix. To do so, I've used /* This is the function I pass as 'matrix_update_callback' */
handleMatrixUpdate(matrix_filter) {
/* when I set a breakpoint here, 'matrix_filter' is null,
so this callback isn't passed any info */
const new_rows = this.cgm.params.network_data.row_nodes_names; /* But this doesn't give
me what I want, `new_rows` is outdated, it's what was visible before the current matrix update */
} |
After looking at the code that calls the callback, it looks like in order to get the behavior I am looking for, one of these two must be the case:
Either one would require a fork and rebuild of Clustergrammer. However, I'm hoping there's some other way to do this that I'm not aware of. |
Hi Nick,
We are making pretty good progress on the RClustergrammer package. It's a pleasure working with what you have created.
Here are a few requests, all regarding selections: either retrieving the currently selected rows or column names for use in R, or making Clustergrammer selections from R - the programmatic equivalent, say, of clicking on a subcluster, after which the other rows (or columns) are grayed out.
All we need in either case is the equivalent functions in your javascript API. Maybe they already exist?
To sketch out some pseudo-code:
cg = Clustergrammer(args);
var nodeNames = cg.getSelectedRowNames()
var colNames = cg.getSelectedColumnNames()
cg.selectRows(["A", "B", "C"])
cg.selectColumns(["X", "Y", "Z"])
Possible?
The text was updated successfully, but these errors were encountered: