% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/elements.R
\name{g6_collapse_options}
\alias{g6_collapse_options}
\alias{is_g6_collapse_options}
\title{Configure collapse button for nodes}
\usage{
g6_collapse_options(
  collapsed = FALSE,
  visibility = c("visible", "hover"),
  placement = "right-top",
  r = 6,
  fill = "#fff",
  stroke = "#9cabd4",
  lineWidth = 1,
  iconStroke = "#9cabd4",
  iconLineWidth = 1.4,
  cursor = "pointer",
  zIndex = 999
)

is_g6_collapse_options(x)
}
\arguments{
\item{collapsed}{Logical. Whether the node should be collapsed initially. Default is FALSE.}

\item{visibility}{Character. Visibility mode of the collapse button.
Either \code{"visible"} (always shown when children exist) or \code{"hover"}
(shown only on mouse hover). Default is \code{"visible"}.}

\item{placement}{Character or numeric vector. Position of the collapse button.
Can be one of: "top", "right", "bottom", "left", "right-top", "right-bottom",
"left-top", "left-bottom", or a numeric vector of length 2 for custom coordinates.}

\item{r}{Numeric. Radius of the button. Default is 8.}

\item{fill}{Character. Fill color of the button background. Default is "#fff".}

\item{stroke}{Character. Stroke color of the button border. Default is "#CED4D9".}

\item{lineWidth}{Numeric. Width of the button border. Default is 1.}

\item{iconStroke}{Character. Stroke color of the +/- icon. Default is "#000".}

\item{iconLineWidth}{Numeric. Width of the +/- icon lines. Default is 1.4.}

\item{cursor}{Character. CSS cursor style. Default is "pointer".}

\item{zIndex}{Numeric. Z-index for layering. Default is 999.}

\item{x}{An object to check.}
}
\value{
A list of collapse button configuration options.

Logical indicating if x is of class g6_collapse_options.
}
\description{
Configure collapse button for nodes

Check if object is a g6_collapse_options configuration
}
\examples{
# Default collapse button
g6_collapse_options()

# Custom styled collapse button
g6_collapse_options(
  placement = "right-top",
  fill = "#f0f0f0",
  stroke = "#333",
  r = 10
)

# Collapse button with custom coordinates
g6_collapse_options(placement = c(1, 0.2))
}
