% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotly_exposure.R
\name{plotly_exposure}
\alias{plotly_exposure}
\title{Interactive Exposure Plot.}
\usage{
plotly_exposure(
  exposure_obj,
  showGrid = TRUE,
  main = "Exposure Plot",
  xlab = "Time",
  ylab = "Event Rate",
  fitCol = "black",
  gridCol = "lightgray",
  signif = 3,
  cols = NULL
)
}
\arguments{
\item{exposure_obj}{An object of class 'exposure', or a list of such objects.
Each object is created using the `exposure()` function from the `ReliaGrowR`
package.}

\item{showGrid}{Show grid (TRUE) or hide grid (FALSE). Default is TRUE.}

\item{main}{Main title. Default is "Exposure Plot".}

\item{xlab}{X-axis label. Default is "Time".}

\item{ylab}{Y-axis label. Default is "Event Rate".}

\item{fitCol}{Color of the event rate step function. Default is "black". Used
only for a single exposure object; ignored when `cols` is provided or multiple
objects are supplied.}

\item{gridCol}{Color of the grid. Default is "lightgray".}

\item{signif}{Significant digits of results. Default is 3. Must be a positive integer.}

\item{cols}{Optional character vector of colors, one per exposure object. When
provided, each object's step function is drawn in the corresponding color.
Recycled if shorter than the number of objects.}
}
\value{
A `plotly` object representing the interactive exposure plot.
}
\description{
The function creates an interactive exposure plot for one or more `exposure`
objects. When a list of objects is provided the estimates are overlaid on the
same plot, each rendered in a distinct color.
The plot shows the cumulative event rate over time as a step function.
}
\examples{
\dontrun{
library(ReliaGrowR)
ids <- c("A", "A", "A", "B", "B", "C", "C", "C", "C")
times <- c(50, 150, 350, 100, 300, 80, 200, 320, 450)
fit <- exposure(id = ids, time = times)
plotly_exposure(fit)

# Overlay two exposure objects
fit2 <- exposure(id = c("X", "X", "Y"), time = c(60, 220, 180))
plotly_exposure(list(fit, fit2), cols = c("steelblue", "tomato"))
}
}
