% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-layout.R
\name{geom_treemap}
\alias{geom_treemap}
\title{Treemap}
\usage{
geom_treemap(
  mapping = NULL,
  data = NULL,
  alpha = NULL,
  label = TRUE,
  label_size = NULL
)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Requires \code{size} (the area
value) and \code{label} (the tile name); map \code{color} to shade by category.}

\item{alpha}{Tile opacity.}

\item{label}{Draw tile labels where they fit.}

\item{label_size}{Label size in px.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Area-proportional nested rectangles, laid out with the squarified
algorithm (Bruls, Huizing & van Wijk 2000) so tiles stay close to square
and stay comparable by area.
}
\examples{
d <- data.frame(
  region = c("North", "South", "East", "West", "Central"),
  revenue = c(52, 38, 27, 19, 11)
)
ggnext(d, aes(size = revenue, label = region, color = region)) +
  geom_treemap() +
  theme_void()
}
