% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/graph_render.R
\name{cgv_set_graph}
\alias{cgv_set_graph}
\title{Set Graph Data for Rendering}
\usage{
cgv_set_graph(
  viewer,
  nodes,
  edges,
  positions = NULL,
  node_values = NULL,
  node_colors = NULL,
  node_sizes = NULL,
  cmap = 6L
)
}
\arguments{
\item{viewer}{External pointer returned by \code{cgv_viewer}.}

\item{nodes}{Integer vector of node IDs.}

\item{edges}{Two-column integer matrix (from, to), 1-based.}

\item{positions}{Nx3 numeric matrix of 3D coordinates (optional; linear if NULL).}

\item{node_values}{Numeric vector of length N for automatic coloring via colormap
(e.g. BFS depth, group id). Ignored if \code{node_colors} is provided.}

\item{node_colors}{Nx4 integer matrix (RGBA 0-255) for explicit node colors.
Takes priority over \code{node_values}.}

\item{node_sizes}{Numeric vector of length N for point sizes (default 10).}

\item{cmap}{Integer colormap id (default 6 = viridis). Common values:
5 = plasma, 6 = viridis, 7 = inferno, 8 = magma.}
}
\value{
No return value, called for side effects: uploads the node and
  edge buffers to the GPU and caches node positions on the viewer for
  subsequent \code{cgv_fly_to} / picking calls. Returns \code{NULL}
  invisibly.
}
\description{
Provide the full graph (or a subgraph) as adjacency data with optional
node colors, sizes, and colormap.
}
