% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot-bootstrap.R
\name{plot.tna_bootstrap}
\alias{plot.tna_bootstrap}
\alias{splot.tna_bootstrap}
\title{Plot Bootstrap Results}
\usage{
\method{plot}{tna_bootstrap}(x, ...)

splot.tna_bootstrap(
  x,
  display = c("styled", "significant", "full", "ci"),
  edge_style_sig = 1,
  edge_style_nonsig = 2,
  color_nonsig = "#888888",
  show_ci = FALSE,
  show_stars = TRUE,
  width_by = NULL,
  inherit_style = TRUE,
  ...
)
}
\arguments{
\item{x}{A tna_bootstrap object (from tna::bootstrap).}

\item{...}{Additional arguments passed to splot().}

\item{display}{Display mode:
\itemize{
\item "styled" (default): All edges with styling to distinguish significant/non-significant
\item "significant": Only significant edges
\item "full": All edges without significance styling
\item "ci": Show CI bands on edges
}}

\item{edge_style_sig}{Line style for significant edges (1=solid). Default 1.}

\item{edge_style_nonsig}{Line style for non-significant edges (2=dashed). Default 2.}

\item{color_nonsig}{Accepted for compatibility; styled mode currently uses a
fixed pink color for non-significant edges.}

\item{show_ci}{Logical: include CI bounds in edge labels? Default FALSE.
Use \code{display = "ci"} for CI underlays on edges.}

\item{show_stars}{Logical: show significance stars (*, **, ***) on edges? Default TRUE.}

\item{width_by}{Optional: "cr_lower" to scale edge width by lower consistency range bound.}

\item{inherit_style}{Logical: inherit colors/layout from original TNA model? Default TRUE.}
}
\value{
Invisibly returns the plot.
}
\description{
Visualizes bootstrap analysis results with styling to distinguish
significant from non-significant edges. Works with tna_bootstrap objects
from the tna package.
}
\details{
The function expects a tna_bootstrap object containing:
\itemize{
\item \code{weights} or \code{weights_orig}: Original weight matrix
\item \code{weights_sig}: Significant weights only (optional)
\item \code{p_values}: P-value matrix
\item \code{ci_lower}, \code{ci_upper}: Confidence interval bounds
\item \code{level}: Significance level (default 0.05)
\item \code{model}: Original TNA model for styling inheritance
}

Edge styling in "styled" mode:
\itemize{
\item Significant edges: solid dark blue, bold labels with stars, rendered on top
\item Non-significant edges: dashed pink, plain labels, rendered behind
}
}
\examples{
# Mock a tna_bootstrap object with synthetic data
w <- matrix(c(0, .3, .1, .2, 0, .4, .3, .1, 0), 3, 3)
rownames(w) <- colnames(w) <- c("A", "B", "C")
p <- matrix(c(1, .01, .5, .03, 1, .001, .2, .8, 1), 3, 3)
boot <- list(weights = w, p_values = p,
             ci_lower = w - 0.05, ci_upper = w + 0.05, level = 0.05,
             model = list(weights = w, labels = c("A", "B", "C")))
class(boot) <- c("tna_bootstrap", "list")
splot(boot)
splot(boot, display = "significant")

}
