% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot-forest.R
\name{plot_bootstrap_forest}
\alias{plot_bootstrap_forest}
\alias{plot_bootstrap_forest.net_bootstrap}
\alias{plot_bootstrap_forest.tna_bootstrap}
\alias{plot_bootstrap_forest.boot_glasso}
\alias{plot_bootstrap_forest.net_bootstrap_group}
\title{Forest Plot for Bootstrap Network Results}
\usage{
plot_bootstrap_forest(x, ...)

\method{plot_bootstrap_forest}{net_bootstrap}(
  x,
  alpha = NULL,
  layout = c("linear", "circular", "grouped"),
  interval = c("ci", "cr", "both"),
  show_nonsig = TRUE,
  sort_by = c("estimate", "significance", "name"),
  n_top = NULL,
  node_colors = NULL,
  sig_color = "#2C6E8A",
  cr_color = "#D4829A",
  nonsig_color = "#CCCCCC",
  ring_color = "#C8C8C8",
  median_color = "#AAAAAA",
  label_size = NULL,
  label_color = NULL,
  point_size = NULL,
  r_inner = NULL,
  r_outer = NULL,
  gap_rad = NULL,
  label_offset = NULL,
  src_label_size = NULL,
  margins = c(0.1, 0.1, 0.1, 0.1),
  scale = 1,
  title = NULL,
  subtitle = NULL,
  ...
)

\method{plot_bootstrap_forest}{tna_bootstrap}(
  x,
  alpha = NULL,
  layout = c("linear", "circular", "grouped"),
  interval = c("ci", "cr", "both"),
  show_nonsig = TRUE,
  sort_by = c("estimate", "significance", "name"),
  n_top = NULL,
  node_colors = NULL,
  sig_color = "#2C6E8A",
  cr_color = "#D4829A",
  nonsig_color = "#CCCCCC",
  ring_color = "#C8C8C8",
  median_color = "#AAAAAA",
  label_size = NULL,
  label_color = NULL,
  point_size = NULL,
  r_inner = NULL,
  r_outer = NULL,
  gap_rad = NULL,
  label_offset = NULL,
  src_label_size = NULL,
  margins = c(0.1, 0.1, 0.1, 0.1),
  scale = 1,
  title = NULL,
  subtitle = NULL,
  ...
)

\method{plot_bootstrap_forest}{boot_glasso}(
  x,
  alpha = NULL,
  layout = c("linear", "circular", "grouped"),
  interval = c("ci", "cr", "both"),
  show_nonsig = TRUE,
  sort_by = c("estimate", "significance", "name"),
  n_top = NULL,
  node_colors = NULL,
  sig_color = "#2C6E8A",
  cr_color = "#D4829A",
  nonsig_color = "#CCCCCC",
  ring_color = "#C8C8C8",
  median_color = "#AAAAAA",
  label_size = NULL,
  label_color = NULL,
  point_size = NULL,
  r_inner = NULL,
  r_outer = NULL,
  gap_rad = NULL,
  label_offset = NULL,
  src_label_size = NULL,
  margins = c(0.1, 0.1, 0.1, 0.1),
  scale = 1,
  title = NULL,
  subtitle = NULL,
  ...
)

\method{plot_bootstrap_forest}{net_bootstrap_group}(
  x,
  layout = c("linear", "circular"),
  interval = c("ci", "cr", "both"),
  show_nonsig = TRUE,
  n_top = NULL,
  all_edges = FALSE,
  pos_color = NULL,
  title = NULL,
  subtitle = NULL,
  label_size = 2.8,
  ...
)
}
\arguments{
\item{x}{A \code{tna_bootstrap} (from \code{tna::bootstrap}),
\code{net_bootstrap}, \code{net_bootstrap_group}, or
\code{boot_glasso} object.}

\item{...}{Currently unused.}

\item{alpha}{Significance threshold. Default: inherits from the object
(\code{$ci_level} or \code{$alpha}), falling back to \code{0.05}.}

\item{layout}{\code{"linear"} (default) draws the classic tall forest plot;
\code{"circular"} arranges each edge as a spoke around a circle, with the
inner ring at the data minimum and the outer ring at the data maximum;
\code{"grouped"} arranges edges in sectors by source node where supported.}

\item{interval}{Which interval to display: \code{"ci"} (bootstrap confidence
interval, default), \code{"cr"} (consistency range, stability inference
only), or \code{"both"} (CI as outer bar, CR as inner bar).}

\item{show_nonsig}{Logical: include non-significant edges (greyed out)?
Default \code{TRUE}.}

\item{sort_by}{How to order edges on the y-axis (linear layout) or
clockwise from top (radial layout):
\code{"estimate"} (default, ascending), \code{"significance"} (most
significant at top), or \code{"name"} (alphabetical).}

\item{n_top}{Integer: restrict to the \code{n_top} edges with the largest
absolute estimate. Applied after significance filtering. Default \code{NULL}.}

\item{node_colors}{Optional node-colour vector for grouped radial layouts.}

\item{sig_color}{Colour for significant CI bars and points. Default \code{"#2C6E8A"} (teal-blue).}

\item{cr_color}{Colour for the consistency range bar (\code{interval = "cr"} or \code{"both"}).
Default \code{"#D4829A"}.}

\item{nonsig_color}{Colour for non-significant edges. Default \code{"#CCCCCC"}.}

\item{ring_color}{Colour for the reference rings (radial layout only). Default \code{"#C8C8C8"}.}

\item{median_color}{Colour for the dashed median ring (radial layout only). Default \code{"#AAAAAA"}.}

\item{label_size}{Text size for edge labels (radial and grouped layouts).
Default \code{NULL} for automatic sizing in the main methods, or
\code{2.8} for \code{net_bootstrap_group}.}

\item{label_color}{Fixed colour for edge labels (radial layout only). \code{NULL} (default)
inherits the edge colour (teal for significant, grey for non-significant).}

\item{point_size}{Size of the estimate square. Default \code{3} (linear) or \code{2} (radial).}

\item{r_inner}{Inner ring radius (grouped layout). Default \code{NULL} (auto).}

\item{r_outer}{Outer ring radius (grouped layout). Default \code{NULL} (auto).}

\item{gap_rad}{Gap in radians between sectors (grouped layout). Default \code{NULL} (auto).}

\item{label_offset}{Distance between outer ring and labels (grouped layout). Default \code{NULL} (auto).}

\item{src_label_size}{Text size for source node labels in the center (grouped layout).
Default \code{NULL} (auto, \code{label_size * 0.80}).}

\item{margins}{Margins as \code{c(bottom, left, top, right)} fractions (grouped layout).
Default \code{c(0.1, 0.1, 0.1, 0.1)}.}

\item{scale}{Scaling factor applied to all text and point sizes (grouped layout).
Default \code{1}. Use values > 1 for high-DPI output, < 1 for small devices.}

\item{title}{Plot title. Default \code{NULL}.}

\item{subtitle}{Plot subtitle. Default \code{NULL}.}

\item{all_edges}{For \code{net_bootstrap_group}, show the union of group
edges instead of only edges common to all groups. Default \code{FALSE}.}

\item{pos_color}{Currently unused by the \code{net_bootstrap_group} method.}
}
\value{
A \code{ggplot} object.
}
\description{
A ggplot2-based forest plot for \code{net_bootstrap},
\code{net_bootstrap_group}, \code{tna_bootstrap}, and \code{boot_glasso}
objects. Each row is one network edge; horizontal bars span the confidence
interval and a filled square marks the point estimate. A dashed reference
line runs through zero.

Produces a ggplot2 forest plot where each row is one network edge, the
square marks the bootstrap mean estimate, and the horizontal bar spans the
selected interval. A dashed reference line runs through zero. Significant
edges are highlighted in colour; non-significant ones appear in grey (only
shown when \code{show_nonsig = TRUE}).
}
\details{
For \code{net_bootstrap} objects from stability inference, both a bootstrap
confidence interval (\code{ci_lower}/\code{ci_upper}) and a consistency
range (\code{cr_lower}/\code{cr_upper}) are available. Use
\code{interval = "both"} to overlay both on the same plot.
}
\examples{
\dontshow{if (requireNamespace("tna", quietly = TRUE)) withAutoprint(\{ # examplesIf}
# Bootstrap a TNA built from sequence data (required by tna::bootstrap)
d    <- tna::prepare_data(
  tna::group_regulation_long,
  actor = "Actor", time = "Time", action = "Action"
)
Mod  <- tna::tna(d)
boot <- tna::bootstrap(Mod, iter = 50)
plot_bootstrap_forest(boot, n_top = 8)
\dontshow{\}) # examplesIf}
}
