% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stream-viz.R
\name{stream_viz}
\alias{stream_viz}
\title{Create a streaming widget}
\usage{
stream_viz(
  outputId,
  session = shiny::getDefaultReactiveDomain(),
  stream_id = NULL,
  width = NULL,
  height = NULL,
  refresh_rate = 33,
  show_controls = TRUE,
  streaming = FALSE,
  token = NULL
)
}
\arguments{
\item{outputId}{Character scalar.  The output ID matching the
corresponding \code{\link{streamVizOutput}} call.  Used to compute
\code{stream_id} automatically when \code{stream_id} is \code{NULL}.}

\item{session}{Shiny session object.  Defaults to the active reactive
domain.  Together with \code{outputId} determines the token-qualified
stream file identifier.}

\item{stream_id}{Character scalar or \code{NULL}.  When \code{NULL}
(default) the stream identifier is computed as
\code{stream_file_id(outputId, session, token = token)}.  Provide an
explicit value to override for non-Shiny or advanced use.}

\item{width, height}{Widget dimensions (passed to \code{\link[htmlwidgets]{createWidget}}).}

\item{refresh_rate}{Numeric scalar (milliseconds). Polling interval used
when the viewer is in \emph{active streaming} mode (play button pressed).
Lower values give smoother animation but increase CPU/network load.
Default \code{33} (approximately 30 Hz).}

\item{show_controls}{Logical. Whether to display the hover toolbar
(play/pause, zoom, reset, export).  Default \code{TRUE}.}

\item{streaming}{Logical.  Whether to start active streaming immediately
when the widget is rendered.  Default \code{FALSE}; set to \code{TRUE}
to begin polling for new data automatically.  Can also be toggled later
via \code{\link{updateStreamViz}}.}

\item{token}{Character scalar or \code{NULL}.  When \code{NULL} (default)
the session's own token is used.  Override with a parent session token
when running inside a standalone viewer (pop-out window) so that the
child session fetches the parent's binary stream file.}
}
\value{
An \pkg{htmlwidgets} object.
}
\description{
Creates a multi-channel signal viewer widget that fetches its data from
the binary stream file produced by \code{\link{stream_to_js}}.
}
\details{
The \code{outputId} together with \code{session} is used to auto-compute
the token-qualified stream file identifier via
\code{\link{stream_file_id}}.  You can override this by passing an
explicit \code{stream_id}.

Use \code{\link{updateStreamViz}} for in-place updates without recreating
the widget.
}
\seealso{
\code{\link{streamVizOutput}}, \code{\link{renderStreamViz}},
  \code{\link{updateStreamViz}}, \code{\link{stream_file_id}}
}
