% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/middleware.R
\name{.get_prebuild_aes_label}
\alias{.get_prebuild_aes_label}
\title{Retrieve the pre-build label for an aesthetic}
\usage{
.get_prebuild_aes_label(plot, aes_name)
}
\arguments{
\item{plot}{A ggplot object.}

\item{aes_name}{A single character string giving the aesthetic whose
pre-build label should be retrieved.}
}
\value{
A character string representing the best available pre-build label
for the requested aesthetic.
}
\description{
Internal helper that attempts to determine the eventual user-facing label
associated with a mapped aesthetic before the plot has been formally built.
}
\details{
The helper first checks for explicit labels supplied through
\code{ggplot2::labs()} or related mechanisms. If no explicit label is found,
it falls back to the mapped expression itself using
\code{rlang::as_label()}.

Both plot-level and layer-level mappings are searched.

ggplotplus uses this helper during pre-build guide processing to identify
aesthetics that are likely to collapse into a shared legend, such as when
both \code{fill} and \code{shape} are mapped to the same variable.
}
\keyword{internal}
