% 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{
Inherited methods

- `officer::openxml_document$dir_name()`
- `officer::openxml_document$feed()`
- `officer::openxml_document$file_name()`
- `officer::openxml_document$get()`
- `officer::openxml_document$name()`
- `officer::openxml_document$rel_df()`
- `officer::openxml_document$relationship()`
- `officer::openxml_document$remove()`
- `officer::openxml_document$replace_xml()`
- `officer::openxml_document$save()`

}} \if{html}{\out{

}} \if{html}{\out{}} \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{
}}\preformatted{xlsx_drawing$new(package_dir, sheet_obj, content_type)}\if{html}{\out{
}} } \subsection{Arguments}{ \if{html}{\out{
}} \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{
}} } } \if{html}{\out{

}} \if{html}{\out{}} \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{
}}\preformatted{xlsx_drawing$add_chart_anchor( chart_rid, left = 1, top = 1, width = 6, height = 4 )}\if{html}{\out{
}} } \subsection{Arguments}{ \if{html}{\out{
}} \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{
}} } } \if{html}{\out{

}} \if{html}{\out{}} \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{
}}\preformatted{xlsx_drawing$add_chart_rel(chart_basename)}\if{html}{\out{
}} } \subsection{Arguments}{ \if{html}{\out{
}} \describe{ \item{\code{chart_basename}}{filename of the chart XML} } \if{html}{\out{
}} } } \if{html}{\out{

}} \if{html}{\out{}} \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{
}}\preformatted{xlsx_drawing$add_image_rel(image_basename)}\if{html}{\out{
}} } \subsection{Arguments}{ \if{html}{\out{
}} \describe{ \item{\code{image_basename}}{filename (without directory) of the image sitting in \verb{xl/media/}.} } \if{html}{\out{
}} } } \if{html}{\out{

}} \if{html}{\out{}} \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{
}}\preformatted{xlsx_drawing$add_image_anchor( image_rid, left = 1, top = 1, width = 2, height = 2, alt = "" )}\if{html}{\out{
}} } \subsection{Arguments}{ \if{html}{\out{
}} \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{
}} } } \if{html}{\out{

}} \if{html}{\out{}} \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{
}}\preformatted{xlsx_drawing$clone(deep = FALSE)}\if{html}{\out{
}} } \subsection{Arguments}{ \if{html}{\out{
}} \describe{ \item{\code{deep}}{Whether to make a deep clone.} } \if{html}{\out{
}} } } }