% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paintr-embellish.R
\name{embellish_helpers}
\alias{embellish_helpers}
\alias{embellish_identity}
\alias{embellish_symbol_to_string}
\title{Built-in helpers for a placeholder's plain-R evaluation slot}
\usage{
embellish_identity()

embellish_symbol_to_string()
}
\value{
Each factory returns a function of signature \verb{function(x, ...)}.
\code{\link[=embellish_identity]{embellish_identity()}}'s function returns its first argument \code{x}
unchanged. \code{\link[=embellish_symbol_to_string]{embellish_symbol_to_string()}}'s function returns a character
vector of column names captured from the unevaluated \code{x}.
}
\description{
A placeholder-embellished ggplot expression must stay valid plain R that
renders the original plot with no app running. Each placeholder carries a
callable (the \verb{embellish_eval =} argument of the
\verb{ptr_define_placeholder_*()} constructors) that supplies its plain-R
meaning when the naked expression is evaluated outside \code{ptr_app()}. These
two factories are the built-in callables for that slot:
}
\details{
\itemize{
\item \code{\link[=embellish_identity]{embellish_identity()}} returns the identity \code{function(x, ...) x} — the
slot's default behaviour. The placeholder call becomes a no-op wrapper:
it returns its argument unchanged.
\item \code{\link[=embellish_symbol_to_string]{embellish_symbol_to_string()}} returns a function that captures its
argument \emph{unevaluated} and turns column references into a character
vector of names. This is the pattern a column-selecting consumer needs
so the naked expression works inside a tidyselect verb: tidyselect
evaluates an unknown wrapper call in non-masked scope, where bare column
symbols throw "object not found"; returning the names as strings
sidesteps that because tidyselect accepts selection by name.
}

These helpers are \emph{author-controlled} plain-R semantics, never derived —
only the author knows the intended live-R meaning of a placeholder.
}
\examples{
f <- embellish_identity()
f(5L)

g <- embellish_symbol_to_string()
g(c(mpg, hp))
g(mpg)
}
