% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot-communities.R
\name{overlay_communities}
\alias{overlay_communities}
\title{Overlay Community Blobs on a Network Plot}
\usage{
overlay_communities(
  x,
  communities,
  blob_colors = NULL,
  blob_alpha = 0.25,
  blob_linewidth = 0.7,
  blob_line_alpha = 0.8,
  ...
)
}
\arguments{
\item{x}{A network object passed to \code{\link{splot}}: \code{tna},
matrix, \code{igraph}, or \code{cograph_network}.}

\item{communities}{Community assignments in any format:
a method name (e.g., \code{"walktrap"}, \code{"louvain"}),
a numeric or factor membership vector (e.g., \code{c(1, 1, 2, 2, 3)}),
a named list of character vectors,
a \code{cograph_communities} object, or
a \code{tna_communities} object.}

\item{blob_colors}{Character vector of fill colors for blobs.
Recycled if shorter than the number of communities.}

\item{blob_alpha}{Numeric. Fill transparency (0-1).}

\item{blob_linewidth}{Numeric. Border line width.}

\item{blob_line_alpha}{Numeric. Border line transparency (0-1).}

\item{...}{Additional arguments passed to \code{\link{splot}}.}
}
\value{
The \code{splot} result (invisibly).
}
\description{
Render a network with \code{\link{splot}} and overlay smooth blob
shapes highlighting node communities.
}
\examples{
set.seed(1)
mat <- matrix(runif(25), 5, 5,
              dimnames = list(LETTERS[1:5], LETTERS[1:5]))
diag(mat) <- 0
overlay_communities(mat, list(g1 = c("A","B"), g2 = c("C","D","E")))

\dontshow{if (requireNamespace("tna", quietly = TRUE)) withAutoprint(\{ # examplesIf}
model <- tna::tna(tna::group_regulation)
comm <- cograph::communities(model$weights, method = "infomap")
overlay_communities(model, comm)
\dontshow{\}) # examplesIf}
}
