% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/classes.R, R/api.R
\name{Interact}
\alias{Interact}
\alias{interact}
\title{Add interactivity to a plot}
\usage{
Interact(tooltip = NULL, zoom = logical(0), brush = logical(0))

interact(tooltip = TRUE, zoom = TRUE, brush = TRUE)
}
\arguments{
\item{tooltip}{\code{TRUE} (default) shows the mapped x/y values on hover;
\code{FALSE} disables the tooltip; a character vector of column names (e.g.
\code{tooltip = c("model", "hwy")}) shows those columns from the layer data
instead.}

\item{zoom}{Enable scroll-to-zoom and double-click-to-reset.}

\item{brush}{Enable brush-to-zoom: drag a rectangle on the plot to zoom
to it (double-click still resets).}
}
\value{
An \link{Interact} spec to add to a plot with \code{+}.
}
\description{
Plots are static-first: \code{render(p)} and printing produce a static SVG
image. Adding \code{interact()} with \code{+} opts the plot into the interactive
HTML/canvas target — \code{render(p)} then produces the interactive page
instead (an explicit \code{render(p, target = )} always wins).
}
\examples{
p <- ggnext(cars, aes(speed, dist)) + geom_point()
render(p)                 # static SVG
pi <- p + interact()      # same plot, interactive by default
html <- render(pi)        # HTML/canvas with tooltip + zoom + brush
}
