% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nmf.sem.R
\name{nmfkc.DOT}
\alias{nmfkc.DOT}
\title{Generate Graphviz DOT Scripts for NMF or NMF-with-Covariates Models}
\usage{
nmfkc.DOT(
  result,
  type = c("YX", "YA", "YXA"),
  threshold = 0.01,
  sig.level = 0.1,
  rankdir = "LR",
  fill = TRUE,
  weight_scale = 5,
  weight_scale_ax = weight_scale,
  weight_scale_xy = weight_scale,
  weight_scale_ay = weight_scale,
  Y.label = NULL,
  X.label = NULL,
  A.label = NULL,
  Y.title = "Observation (Y)",
  X.title = "Basis (X)",
  A.title = "Covariates (A)",
  hide.isolated = TRUE
)
}
\arguments{
\item{result}{The return value from \code{nmfkc}, containing matrices
\code{X}, \code{B}, and optionally \code{C}.}

\item{type}{Character string specifying the visualization style:
one of \code{"YX"}, \code{"YA"}, \code{"YXA"}.}

\item{threshold}{Minimum coefficient magnitude to display an edge.}

\item{sig.level}{Significance level for filtering C edges when inference
results are available (i.e., \code{x} is of class \code{"nmfkc.inference"}).
Only edges with p-value below \code{sig.level} are shown, decorated with
significance stars (\code{*}, \code{**}, \code{***}). Set to \code{NULL}
to disable filtering and show all edges above \code{threshold}. Default is 0.1.}

\item{rankdir}{Graphviz rank direction (e.g., \code{"LR"}, \code{"TB"}).}

\item{fill}{Logical; whether nodes should be drawn with filled shapes.}

\item{weight_scale}{Base scaling factor for edge widths.}

\item{weight_scale_ax}{Scaling factor for edges \eqn{A \rightarrow X} (type \code{"YXA"}).}

\item{weight_scale_xy}{Scaling factor for edges \eqn{X \rightarrow Y}.}

\item{weight_scale_ay}{Scaling factor for edges \eqn{A \rightarrow Y} (type \code{"YA"}).}

\item{Y.label}{Optional character vector for labels of Y nodes.}

\item{X.label}{Optional character vector for labels of X (latent factor) nodes.}

\item{A.label}{Optional character vector for labels of A (covariate) nodes.}

\item{Y.title}{Cluster title for Y nodes.}

\item{X.title}{Cluster title for X nodes.}

\item{A.title}{Cluster title for A nodes.}

\item{hide.isolated}{Logical. If \code{TRUE} (default), Y and A nodes that have no
edges at or above \code{threshold} are excluded from the graph.}
}
\value{
A character string representing a Graphviz DOT script.
}
\description{
Produces a Graphviz DOT script visualizing the structure of an NMF model
(\eqn{Y \approx X C A}) or its simplified forms.

Supported visualization types:
\itemize{
\item \code{"YX"} — Standard NMF view: latent factors \eqn{X} map to observations \eqn{Y}.
\item \code{"YA"} — Direct regression view: covariates \eqn{A} map directly to \eqn{Y}
using the combined coefficient matrix \eqn{X C}.
\item \code{"YXA"} — Full tri-factorization: \eqn{A \rightarrow C \rightarrow X \rightarrow Y}.
}

Edge widths are scaled by coefficient magnitude, and nodes with no edges
above the threshold are omitted from the visualization.
}
\examples{
Y <- matrix(cars$dist, nrow = 1)
A <- rbind(1, cars$speed)
result <- nmfkc(Y, A, rank = 1)
dot <- nmfkc.DOT(result)
cat(dot)

}
\seealso{
\code{\link{nmfkc}}, \code{\link{nmfae.DOT}}, \code{\link{nmf.sem.DOT}},
\code{\link{nmfkc.ar.DOT}}, \code{\link{plot.nmfkc.DOT}}
}
