% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hd-object.R
\name{+.hd}
\alias{+.hd}
\title{Add Layers to an hd Object}
\usage{
\method{+}{hd}(e1, e2)
}
\arguments{
\item{e1}{An \code{hd} object (left-hand side).}

\item{e2}{An \code{hd_geom} or \code{hd_opts} object (right-hand side).}
}
\value{
The updated \code{hd} object (invisibly, so the chain prints once).
}
\description{
Implements the \code{+} operator for \code{\link[=hd]{hd()}} objects, mirroring how \code{ggplot2}
builds plots incrementally.  Recognised right-hand sides:
}
\details{
\describe{
\item{\code{hd_geom} object}{Sets the geometry (from any \verb{hd_geom_*()} call).
Adding a second geom replaces the first where highdir renders one geometry
per figure.}
\item{\code{hd_opts} object}{Sets presentation options.  Adding a second
\code{hd_opts} replaces the first.}
}

Unknown right-hand sides produce an informative error rather than silently
being ignored.
}
\examples{
df <- data.frame(age = c("18-24", "25-34"), pct = c(42, 55))

# Chain layers
p <- hd(df, x = "age", y = "pct") +
  hd_geom_column() +
  hd_opts(title = "Demo")

# Reuse a partial object with different opts
base <- hd(df, x = "age", y = "pct") + hd_geom_column()
base + hd_opts(title = "English title")
base + hd_opts(title = "Norsk tittel")

}
