% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_xlsx.R
\name{xlsx_drawing}
\alias{xlsx_drawing}
\title{Drawing manager for xlsx sheets}
\description{
R6 class that manages a drawing file for an xlsx
sheet. Used internally by \code{\link[=sheet_add_drawing]{sheet_add_drawing()}} methods.
}
\keyword{internal}
\section{Super class}{
\code{officer::openxml_document} -> \code{xlsx_drawing}
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-xlsx_drawing-new}{\code{xlsx_drawing$new()}}
\item \href{#method-xlsx_drawing-add_chart_anchor}{\code{xlsx_drawing$add_chart_anchor()}}
\item \href{#method-xlsx_drawing-add_chart_rel}{\code{xlsx_drawing$add_chart_rel()}}
\item \href{#method-xlsx_drawing-add_image_rel}{\code{xlsx_drawing$add_image_rel()}}
\item \href{#method-xlsx_drawing-add_image_anchor}{\code{xlsx_drawing$add_image_anchor()}}
\item \href{#method-xlsx_drawing-clone}{\code{xlsx_drawing$clone()}}
}
}
\if{html}{\out{
<details><summary>Inherited methods</summary>
<ul>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="dir_name"><a href='../../officer/html/openxml_document.html#method-openxml_document-dir_name'><code>officer::openxml_document$dir_name()</code></a></span></li>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="feed"><a href='../../officer/html/openxml_document.html#method-openxml_document-feed'><code>officer::openxml_document$feed()</code></a></span></li>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="file_name"><a href='../../officer/html/openxml_document.html#method-openxml_document-file_name'><code>officer::openxml_document$file_name()</code></a></span></li>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="get"><a href='../../officer/html/openxml_document.html#method-openxml_document-get'><code>officer::openxml_document$get()</code></a></span></li>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="name"><a href='../../officer/html/openxml_document.html#method-openxml_document-name'><code>officer::openxml_document$name()</code></a></span></li>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="rel_df"><a href='../../officer/html/openxml_document.html#method-openxml_document-rel_df'><code>officer::openxml_document$rel_df()</code></a></span></li>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="relationship"><a href='../../officer/html/openxml_document.html#method-openxml_document-relationship'><code>officer::openxml_document$relationship()</code></a></span></li>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="remove"><a href='../../officer/html/openxml_document.html#method-openxml_document-remove'><code>officer::openxml_document$remove()</code></a></span></li>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="replace_xml"><a href='../../officer/html/openxml_document.html#method-openxml_document-replace_xml'><code>officer::openxml_document$replace_xml()</code></a></span></li>
<li><span class="pkg-link" data-pkg="officer" data-topic="openxml_document" data-id="save"><a href='../../officer/html/openxml_document.html#method-openxml_document-save'><code>officer::openxml_document$save()</code></a></span></li>
</ul>
</details>
}}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-xlsx_drawing-new"></a>}}
\if{latex}{\out{\hypertarget{method-xlsx_drawing-new}{}}}
\subsection{Method \code{new()}}{
Create or reuse a drawing for a sheet.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{xlsx_drawing$new(package_dir, sheet_obj, content_type)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{package_dir}}{path to the unpacked xlsx directory}

\item{\code{sheet_obj}}{a sheet R6 object}

\item{\code{content_type}}{a content_type R6 object}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-xlsx_drawing-add_chart_anchor"></a>}}
\if{latex}{\out{\hypertarget{method-xlsx_drawing-add_chart_anchor}{}}}
\subsection{Method \code{add_chart_anchor()}}{
Add a chart anchor to the drawing (absolute
placement in inches from the top-left corner of the sheet).
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{xlsx_drawing$add_chart_anchor(
  chart_rid,
  left = 1,
  top = 1,
  width = 6,
  height = 4
)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{chart_rid}}{relationship id of the chart}

\item{\code{left, top}}{top-left anchor in inches}

\item{\code{width, height}}{size in inches}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-xlsx_drawing-add_chart_rel"></a>}}
\if{latex}{\out{\hypertarget{method-xlsx_drawing-add_chart_rel}{}}}
\subsection{Method \code{add_chart_rel()}}{
Add a relationship from the drawing to a chart file.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{xlsx_drawing$add_chart_rel(chart_basename)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{chart_basename}}{filename of the chart XML}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-xlsx_drawing-add_image_rel"></a>}}
\if{latex}{\out{\hypertarget{method-xlsx_drawing-add_image_rel}{}}}
\subsection{Method \code{add_image_rel()}}{
Add a relationship from the drawing to a media image.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{xlsx_drawing$add_image_rel(image_basename)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{image_basename}}{filename (without directory) of the image
sitting in \verb{xl/media/}.}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-xlsx_drawing-add_image_anchor"></a>}}
\if{latex}{\out{\hypertarget{method-xlsx_drawing-add_image_anchor}{}}}
\subsection{Method \code{add_image_anchor()}}{
Add an image anchor to the drawing (absolute placement
in inches from the top-left corner of the sheet).
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{xlsx_drawing$add_image_anchor(
  image_rid,
  left = 1,
  top = 1,
  width = 2,
  height = 2,
  alt = ""
)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{image_rid}}{relationship id of the image}

\item{\code{left, top}}{top-left anchor in inches}

\item{\code{width, height}}{size in inches}

\item{\code{alt}}{alternative text}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-xlsx_drawing-clone"></a>}}
\if{latex}{\out{\hypertarget{method-xlsx_drawing-clone}{}}}
\subsection{Method \code{clone()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{xlsx_drawing$clone(deep = FALSE)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}
