Skip to content

Commit

Permalink
update Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Aug 8, 2024
1 parent e8c674a commit 0a202a5
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 4 deletions.
1 change: 1 addition & 0 deletions R/geom-draw.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ geom_draw <- function(draw = grid::nullGrob(), ...,
#' @usage NULL
#' @aliases GeomDraw
#' @export
#' @keywords internal
GeomDraw <- ggplot2::ggproto(
"GeomDraw", ggplot2::Geom,
## No required_aes
Expand Down
1 change: 1 addition & 0 deletions R/layout-.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ is.layout <- function(x) methods::is(x, "Layout")
#' @param object A [layout_heatmap()] or [layout_stack()] object.
#' @importFrom methods show
#' @export
#' @keywords internal
methods::setMethod("show", "Layout", function(object) {
print(object)
})
Expand Down
2 changes: 1 addition & 1 deletion R/layout-heatmap-.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Heatmap layout
#' Put plots around a Heatmap
#'
#' `ggheatmap` is an alias of `layout_heatmap`.
#'
Expand Down
53 changes: 53 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,57 @@
url: https://yunuuuu.github.io/ggalign/

template:
bootstrap: 5
light-switch: true

reference:
- title: Building plot
- subtitle: Adding elemnt
desc: >
All plots begin with a call to `ggheatmap()` or `ggstack`, supplying default
data and aesthetic mappings, specified by `aes()`. You then add reordering
the layout, or group the layout into panels, and add plots, layers, scales,
coords with `+`. To save a plot to disk, use `ggsave()`.
contents:
- layout-add
- layout-and
- build_patchwork

- subtitle: Active context
desc: >
A Layout object may have multiple plots, you can choose where to add ggplot2
elements with following functions.
contents:
- hmanno
- active
- activate

- title: Plot Layout
desc: A Layout object defines how to place the plots.
contents:
- layout_heatmap
- layout_stack

- title: Plot basics
desc: Add plots to layout
contents:
- ggalign
- ggpanel

- title: Setup Layout
desc: Reordering obervations or Group into panels
contents:
- starts_with("align")

- title: Extending ggplot2
desc: New ggplot2 geoms, stats, scales, and facets
contents:
- geom_draw

- title: helpers
desc: A handful of helpers
contents:
- hclust2
- dendrogram_data
- is.ggheatmap
- is.ggstack
2 changes: 1 addition & 1 deletion man/ggplot2-ggproto.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/layout_heatmap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/show-Layout-method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vignettes/layout-heatmap.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ default `mapping` and `data`. You can add `ggplot2` elements as usual.
ggheatmap(small_mat) + geom_point() + scale_fill_viridis_c()
```

### Position scales
For position scales, `limits` cannot be setted, and the internal will always
reset it as the default. This is required to align the heatmap and annotation.
```{r}
Expand Down Expand Up @@ -195,13 +196,14 @@ ggheatmap(small_mat) +
align_reorder()
```

### Facets and Panel titles
When working with facets, manual configuration of panel using the `facet_*`
function is not possible since the internal will use `facet_grid` to set the
row/column groups controlled by heatmap annotation. However, you can provide
`facet_grid` or `facet_null` (if no panel) to control the other arguments
except `rows` and `cols`. A common usage case is to change the panel strip text.

THe default theme in `ggalign` removed the panel strip text, you can override
The default theme in `ggalign` removed the panel strip text, you can override
the behaviour with `theme(strip.text = element_text())`. This allows us to add
the panel title appropriately in heatmaps or any heatmap annotation with plot.
```{r}
Expand Down

0 comments on commit 0a202a5

Please sign in to comment.