You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to make a custom panel responsive to selection #39
Recently I was trying to make the panels of iSEEtree reactive to selections transmitted by other panels, like the RowDataTable. I was struggling because even after adding a .multiSelectionResponsive and .multiSelectionRestricted methods to the custom panel, they would not change upon selecting rows in RowDataTable. An example of this was reported in this iSEEtree issue.
Solution
After a while, I discovered that it would worked if I added the following selection to the .generateOutput method (taken from here):
all_cmds[["select"]] <- .processMultiSelections(x, all_memory, all_contents, panel_env)
if (is.null(panel_env[["row_selected"]])){
panel_env[["se"]] <- se
} else {
panel_env[["se"]] <- se[unlist(panel_env[["row_selected"]]), ]
}
Also, I wanted this specific panel (RowTreePlot) to be reactive only to row selection (and not column selection), so I added the following methods:
Activity
kevinrue commentedon May 1, 2024
Regarding your first code block
Any particular reason for the syntax
is.null(panel_env[["row_selected"]])?I couldn't recognise the coding pattern, so I went to check in iSEE/iSEE and found this:
https://github.com/iSEE/iSEE/blob/51cd280a4486e7a6173e0856bc8833e9c75f7a98/R/family_RowDotPlot.R#L450
Is your
row_selectedexpected to beNULLor can you simply check for its existence?RiboRings commentedon May 1, 2024
Thank you! I wasn't aware of this cleaner solution. It will be added to the next version.