Skip to content

Commit

Permalink
change background colour of extension panel
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrue committed Jul 30, 2024
1 parent ef02bfc commit c8a3422
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Binary file added vignettes/img/iSEEhex_color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions vignettes/workshop_isee_extension.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ iSEE(sce, initial = list(

How can we even tell which is which?!

### Overwriting S4 methods

The generic `.fullName()` declares the label shown in the interface, at the top of each panel.

Let us create a method for the new class, that gives it a different name, highlighting the hexagonal binning in the plot.
Expand All @@ -597,6 +599,27 @@ iSEE(sce, initial = list(

<br/>

Similarly, the generic `.panelColor()` declares the background colour of the panel header (as well as the colour of brushes for compatible panels).

Let us create a method for the new class, that gives it a different colour.

```{r}
setMethod(".panelColor", "ReducedDimensionHexPlot", function(x) "#991717")
```

Let's launch the app to see the effect

```{r, message=FALSE, warning=FALSE, eval=FALSE}
iSEE(sce, initial = list(
ReducedDimensionHexPlot(PanelWidth = 6L),
ReducedDimensionPlot(PanelWidth = 6L)
))
```

![Screenshot of iSEE app including a parent ReducedDimensionPlot and a ReducedDimensionHexPlot extension after changing the background colour of the child panel.](img/iSEEhex_color.png)

<br/>

## Session info

```{r}
Expand Down

0 comments on commit c8a3422

Please sign in to comment.