support "any" graphic device
- shift temp-file generation from time-based to 'tempfile()', reduces
the (slim) possibility of same-name images being created (e.g.,
parallel production, fast rendering)
- add some graphic helper funcs for generalizing things across all
'spec_*' plotting functions: is_svg, dev_chr, and graphics_dev
- add 'make_inline_plot' to centralize formation of the
'kableExtraInlinePlots' object; prepend 'file:///' to paths when not
is_latex, fixes display of some raster graphics; added "list" as a
secondary class
- add 'listify_args' to enable any single-plot function to be able to
vectorize any of its arguments (so that different plots on different
rows can have different arguments)
- update 'spec_plot' to use these mechanisms
diff --git a/man/graphics_helpers.Rd b/man/graphics_helpers.Rd
new file mode 100644
index 0000000..02210af
--- /dev/null
+++ b/man/graphics_helpers.Rd
@@ -0,0 +1,80 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/graphics_helpers.R
+\name{graphics_helpers}
+\alias{graphics_helpers}
+\alias{graphics_dev}
+\alias{is_svg}
+\alias{dev_chr}
+\title{Helper functions to use various graphics devices}
+\usage{
+graphics_dev(filename, width, height, res, ..., dev)
+
+is_svg(dev)
+
+dev_chr(dev)
+}
+\arguments{
+\item{filename}{Passed through to the graphics device.}
+
+\item{width, height}{Plot dimensions in pixels.}
+
+\item{res}{The resolution of the plot; default is 300.}
+
+\item{...}{extra parameters passing to the graphics-device function.}
+
+\item{dev}{Character (e.g., "svg", "pdf") or function (e.g.,
+\code{grDevices::svg}, \code{grDevices::pdf}).}
+}
+\value{
+'graphics_dev': nothing, a plot device is opened
+
+'is_svg': logical
+
+\code{dev_chr}: character
+}
+\description{
+These helper functions generalize the use of strings (e.g.,
+\code{"svg"}, \code{"pdf"}) or graphic device functions (e.g.,
+\code{grDevices::svg}, \code{grDevices::pdf}) for in-table plots.
+}
+\details{
+\itemize{
+\item \code{graphics_dev} generalizes the use of 'res' and plot dimensions
+across graphic devices. Raster-based devices (e.g., 'png',
+'jpeg', 'tiff', 'bmp') tend to use 'res' and the width/height
+units default to pixels. All other devices (e.g., 'pdf', 'svg')
+tend to use inches as the default units for width/height, and
+error when 'res' is provided.
+
+The current heuristic is the look for the 'res' argument in the
+function's formals; if that is present, then it is assumed that
+the default units are in pixels, so 'width', 'height', and 'res'
+are passed through unmodified. If 'res' is not present, then
+'width' and 'height' are converted from pixels to inches, and
+'res' is not passed to the function
+
+Another purpose of this function is to generalize the different
+graphic functions' use of 'file=' versus 'filename='.
+}
+
+\itemize{
+\item \code{is_svg} determines if the plot device is svg-like, typically one
+of \verb{"svg", }grDevices::svg\verb{, or }svglite::svglite`
+}
+
+\itemize{
+\item \code{dev_chr} determines the filename extension for the applicable
+plot function; when \code{dev} is a string, then it is returned
+unchanged; when \code{dev} is a function, the formals of the function
+are checked for clues (i.e., default value of a \verb{file=} argument)
+}
+}
+\section{Functions}{
+\itemize{
+\item \code{graphics_dev}: Generalize 'res' and 'filename across dev functions
+
+\item \code{is_svg}: Determine if plot device is svg-like
+
+\item \code{dev_chr}: Determine filename extension
+}}
+