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

How to show a custom visual param box and at the same time inherit data and selection param boxes #40

Open
RiboRings opened this issue May 1, 2024 · 1 comment

Comments

@RiboRings
Copy link

Problem

At the beginning, all panels in iSEEtree had only a visual param box that I created manually within the .defineInterface method. However, with this approach the parent .defineInterface method gets overwritten and the data and selection param boxes do not show up. Some related discussion is also available in this iSEEtree issue.

Solution
Using the ComplexHeatmapPlot as a template, I realised first I could call the parent method with callNextMethod, and then embed my custom visual box between data and selection boxes created by the parent method. This is done as follows, taken from here:

#' @importFrom methods callNextMethod
setMethod(".defineInterface", "RowTreePlot", function(x, se, select_info) {
  
  out <- callNextMethod()
  list(
    out[1],
    .create_visual_box_for_rowtree(x, se),
    out[-1]
  )
  
})

You also need to define a function that creates the visual box (in this case .create_visual_box_for_rowtree), as done here. And this returns all three standard param boxes in the correct order!

@kevinrue
Copy link
Member

kevinrue commented May 1, 2024

Thanks for pinpointing a great example for this use case which I'll be happy to showcase in a chapter about writing new panels!

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

No branches or pull requests

2 participants