% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mlna.R
\name{plot_mlna}
\alias{plot_mlna}
\alias{mlna}
\title{Multilevel Network Visualization}
\usage{
plot_mlna(
  model,
  layer_list = NULL,
  community = NULL,
  layout = "horizontal",
  layer_spacing = 4,
  layer_width = 8,
  layer_depth = 4,
  skew_angle = 25,
  node_spacing = 0.7,
  colors = NULL,
  shapes = NULL,
  edge_colors = NULL,
  within_edges = TRUE,
  between_edges = TRUE,
  between_style = 2,
  show_border = TRUE,
  legend = TRUE,
  legend_position = "topright",
  curvature = 0.15,
  node_size = 3,
  minimum = 0,
  scale = 1,
  show_labels = TRUE,
  nodes = NULL,
  label_abbrev = NULL,
  ...
)

mlna(
  model,
  layer_list = NULL,
  community = NULL,
  layout = "horizontal",
  layer_spacing = 4,
  layer_width = 8,
  layer_depth = 4,
  skew_angle = 25,
  node_spacing = 0.7,
  colors = NULL,
  shapes = NULL,
  edge_colors = NULL,
  within_edges = TRUE,
  between_edges = TRUE,
  between_style = 2,
  show_border = TRUE,
  legend = TRUE,
  legend_position = "topright",
  curvature = 0.15,
  node_size = 3,
  minimum = 0,
  scale = 1,
  show_labels = TRUE,
  nodes = NULL,
  label_abbrev = NULL,
  ...
)
}
\arguments{
\item{model}{A tna object, weight matrix, or cograph_network.}

\item{layer_list}{Layers can be specified as:
\itemize{
\item A list of character vectors (node names per layer)
\item A string column name from nodes data (e.g., "layer")
\item NULL to auto-detect from columns named: layer, layers, groups, etc.
\item NULL with \code{community} specified for algorithmic detection
}}

\item{community}{Community detection method to use for auto-layering.
If specified, overrides \code{layer_list}. See \code{\link{detect_communities}}
for available methods: "louvain", "walktrap", "fast_greedy", "label_prop",
"infomap", "leiden".}

\item{layout}{Node layout within layers: "horizontal" (default) spreads nodes
horizontally, "circle" arranges nodes in an ellipse, "spring" uses
force-directed placement based on within-layer connections.}

\item{layer_spacing}{Vertical distance between layer centers. Default 2.5.}

\item{layer_width}{Horizontal width of each layer shell. Default 5.}

\item{layer_depth}{Depth of each layer (for 3D effect). Default 2.5.}

\item{skew_angle}{Angle of perspective skew in degrees. Default 25.}

\item{node_spacing}{Node placement ratio within layer (0-1). Default 0.7.
Higher values spread nodes closer to the layer edges.}

\item{colors}{Vector of colors for each layer. Default auto-generated.}

\item{shapes}{Vector of shapes for each layer. Default cycles through
"circle", "square", "diamond", "triangle".}

\item{edge_colors}{Vector of edge colors by source layer. If NULL (default),
uses darker versions of layer colors.}

\item{within_edges}{Logical. Show edges within layers (solid lines). Default TRUE.}

\item{between_edges}{Logical. Show edges between adjacent layers (dashed lines).
Default TRUE.}

\item{between_style}{Line style for between-layer edges. Default 2 (dashed).
Use 1 for solid, 3 for dotted.}

\item{show_border}{Logical. Draw parallelogram shells around layers. Default TRUE.}

\item{legend}{Logical. Whether to show legend. Default TRUE.}

\item{legend_position}{Position for legend. Default "topright".}

\item{curvature}{Edge curvature for within-layer edges. Default 0.15.}

\item{node_size}{Size of nodes. Default 2.5.}

\item{minimum}{Minimum edge weight threshold. Edges below this are hidden.
Default 0.}

\item{scale}{Scaling factor for spacing parameters. Use scale > 1 for
high-resolution output (e.g., scale = 4 for 300 dpi). This multiplies
layer_spacing, layer_width, and layer_depth to maintain proper proportions
at higher resolutions. Default 1.}

\item{show_labels}{Logical. Show node labels. Default TRUE.}

\item{nodes}{Node metadata. Can be:
\itemize{
\item NULL (default): Use existing nodes data from cograph_network
\item Data frame: Must have \code{label} column for matching; if \code{labels}
column exists, uses it for display text
}
Display priority: \code{labels} column > \code{label} column (identifiers).}

\item{label_abbrev}{Label abbreviation: NULL (none), integer (max chars),
or "auto" (adaptive based on node count).}

\item{...}{Additional parameters (currently unused).}
}
\value{
Invisibly returns NULL.

See \code{\link{plot_mlna}}.
}
\description{
Visualizes multilevel/multiplex networks where multiple layers are stacked
in a 3D perspective view. Each layer contains nodes connected by solid edges
(within-layer), while dashed lines connect nodes between adjacent layers
(inter-layer edges). Each layer is enclosed in a parallelogram shell giving
a pseudo-3D appearance.
}
\examples{
\dontrun{
# Create multilevel network
set.seed(42)
nodes <- paste0("N", 1:15)
m <- matrix(runif(225, 0, 0.3), 15, 15)
diag(m) <- 0
colnames(m) <- rownames(m) <- nodes

# Define 3 layers
layers <- list(
  Macro = paste0("N", 1:5),
  Meso = paste0("N", 6:10),
  Micro = paste0("N", 11:15)
)

# Basic usage
plot_mlna(m, layers)

# Customized
plot_mlna(m, layers,
     layer_spacing = 2.5,
     layer_width = 5,
     between_style = 2,  # dashed
     minimum = 0.1)

# Circle layout within layers
plot_mlna(m, layers, layout = "circle")
}
\dontrun{
nodes <- paste0("N", 1:9)
m <- matrix(runif(81, 0, 0.3), 9, 9)
diag(m) <- 0
colnames(m) <- rownames(m) <- nodes
layers <- list(L1 = nodes[1:3], L2 = nodes[4:6], L3 = nodes[7:9])
mlna(m, layers)
}
}
