% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cograph.R
\name{cograph}
\alias{cograph}
\title{Create a Network Visualization}
\usage{
cograph(
  input,
  layout = NULL,
  directed = NULL,
  nodes = NULL,
  seed = 42,
  simplify = FALSE,
  ...
)
}
\arguments{
\item{input}{Network input. Can be:
\itemize{
\item A square numeric matrix (adjacency/weight matrix)
\item A data frame with edge list (from, to, optional weight columns)
\item An igraph object
\item A statnet network object
\item A qgraph object
\item A tna object
}}

\item{layout}{Layout algorithm name such as "circle", "oval", "spring",
"groups", "grid", "random", "star", "bipartite", "gephi", or "custom";
a coordinate matrix/data frame; a CographLayout; or an igraph layout
function/name. Default NULL (no layout computed). Set to a layout to
compute immediately, or use sn_layout() later.}

\item{directed}{Logical. Force directed interpretation. NULL for auto-detect.}

\item{nodes}{Node metadata. Can be NULL or a data frame with node attributes.
If data frame has a \code{label} or \code{labels} column, those are used for display.}

\item{seed}{Random seed for deterministic layouts. Default 42. Set NULL for random.}

\item{simplify}{Logical or character. If FALSE (default), every transition
from tna sequence data is a separate edge. If TRUE or a string
("sum", "mean", "max", "min"), duplicate edges are aggregated.}

\item{...}{Additional arguments passed to the layout function.}
}
\value{
A cograph_network object that can be further customized and rendered.
}
\description{
The main entry point for cograph. Accepts adjacency matrices, edge lists,
igraph, statnet network, qgraph, or tna objects and creates a visualization-ready
network object.
}
\examples{
# From adjacency matrix (layout computed lazily on first plot)
adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
cograph(adj) |> splot()

# From edge list
edges <- data.frame(from = c(1, 1, 2), to = c(2, 3, 3))
cograph(edges) |> splot(layout = "circle")

# Pipe-friendly customization
cograph(adj) |>
  sn_nodes(fill = "steelblue") |>
  sn_edges(color = "gray50") |>
  splot(layout = "circle")
}
\seealso{
\code{\link{splot}} for base R graphics rendering,
\code{\link{soplot}} for grid graphics rendering,
\code{\link{sn_nodes}} for node customization,
\code{\link{sn_edges}} for edge customization,
\code{\link{sn_layout}} for changing layouts,
\code{\link{sn_theme}} for visual themes,
\code{\link{sn_palette}} for color palettes,
\code{\link{from_qgraph}} and \code{\link{from_tna}} for converting external objects
}
