Skip to content

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

Open

Description

@RiboRings

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!

Activity

  1. kevinrue commented on May 1, 2024

    @kevinrue
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions