% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{calculate_plot_dimensions}
\alias{calculate_plot_dimensions}
\title{Calculate plot dimensions with aspect ratio consideration}
\usage{
calculate_plot_dimensions(
  base_height = 4.5,
  aspect.ratio = 1,
  n_x = NULL,
  n_y = NULL,
  x_scale_factor = 0.5,
  y_scale_factor = 0.5,
  legend.position = "right",
  legend.direction = "vertical",
  legend_n = 1,
  legend_nchar = 5,
  flip = FALSE,
  min_width = 3,
  min_height = 3,
  max_width = 12,
  max_height = 12
)
}
\arguments{
\item{base_height}{Base height for the plot (before legend adjustments). Default is 4.5.}

\item{aspect.ratio}{Aspect ratio (height/width). If NULL, width is calculated independently.}

\item{n_x}{Number of categories on x-axis (for width scaling)}

\item{n_y}{Number of categories on y-axis (for height scaling)}

\item{x_scale_factor}{Scaling factor per x-axis category. Default is 0.5.}

\item{y_scale_factor}{Scaling factor per y-axis category. Default is 0.5.}

\item{legend.position}{Position of legend ("none", "right", "left", "top", "bottom")}

\item{legend.direction}{Direction of legend ("vertical" or "horizontal")}

\item{flip}{Whether the plot is flipped (inverts aspect ratio)}

\item{min_width}{Minimum width in inches. Default is 3.}

\item{min_height}{Minimum height in inches. Default is 3.}

\item{max_width}{Maximum width in inches. Default is 12.}

\item{max_height}{Maximum height in inches. Default is 12.}
}
\value{
A list with height and width components
}
\description{
This function calculates plot height and width taking into account:
\itemize{
\item Content-based scaling (number of items on axes)
\item Aspect ratio constraints
\item Legend position and direction
\item Minimum and maximum dimension bounds
}
}
\keyword{internal}
