Skip to contents

Creates an animated 3D visualization showing how spurious extrema are smoothed during the gradient flow complex construction process.

Usage

visualize.smoothing.steps(
  gflow_result,
  plot_res,
  step_by_step = TRUE,
  animation_delay = 0.5,
  out.dir = NULL,
  filename.prefix = "smoothing_step"
)

Arguments

gflow_result

Result from create.gflow.cx(..., detailed.recording = TRUE). Must contain $smoothing_history (list of steps).

plot_res

A list containing at least $layout: an \(n\times 2\) numeric matrix of 2D coordinates for vertices. If $graph (igraph) or adjacency data are present, edges will also be rendered when available.

step_by_step

Logical; if TRUE, waits for user input between steps (interactive only). In non-interactive/headless sessions this is ignored and snapshot mode is used.

animation_delay

Numeric; delay in seconds between frames (used when not waiting).

out.dir

Optional output directory for snapshot PNGs (default: tempdir()).

filename.prefix

Character; prefix for snapshot filenames (default: "smoothing_step").

Value

NULL invisibly.

Details

The function opens a single rgl window and reuses it for all frames. In headless/CI environments, an off-screen rgl device is used automatically and images are written to out.dir.

Examples

if (FALSE) { # \dontrun{
if (requireNamespace("rgl", quietly = TRUE)) {
  # result <- create.gflow.cx(..., detailed.recording = TRUE)
  # plot_res <- list(layout = <n x 2 matrix>, graph = <igraph optional>)
  # visualize.smoothing.steps(result, plot_res)
}
} # }