Skip to content

Commit c8a3422

Browse files
committed
change background colour of extension panel
1 parent ef02bfc commit c8a3422

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

vignettes/img/iSEEhex_color.png

109 KB
Loading

vignettes/workshop_isee_extension.Rmd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ iSEE(sce, initial = list(
576576

577577
How can we even tell which is which?!
578578

579+
### Overwriting S4 methods
580+
579581
The generic `.fullName()` declares the label shown in the interface, at the top of each panel.
580582

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

598600
<br/>
599601

602+
Similarly, the generic `.panelColor()` declares the background colour of the panel header (as well as the colour of brushes for compatible panels).
603+
604+
Let us create a method for the new class, that gives it a different colour.
605+
606+
```{r}
607+
setMethod(".panelColor", "ReducedDimensionHexPlot", function(x) "#991717")
608+
```
609+
610+
Let's launch the app to see the effect
611+
612+
```{r, message=FALSE, warning=FALSE, eval=FALSE}
613+
iSEE(sce, initial = list(
614+
ReducedDimensionHexPlot(PanelWidth = 6L),
615+
ReducedDimensionPlot(PanelWidth = 6L)
616+
))
617+
```
618+
619+
![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)
620+
621+
<br/>
622+
600623
## Session info
601624

602625
```{r}

0 commit comments

Comments
 (0)