Project Status: Active – The project has reached a stable, usable state and is being actively developed. Signed by Signed commit % R-CMD-check Linux build Status Coverage Status Minimal R Version License

ggpos

Print {ggplot2} or {grid} Objects to ESC/POS Compatible Network Devices

Description

ESC/POS devices, such as receipt printers, have the ability to print their own form of raster bitmap graphics. Tools are provided to turn {ggplot2} or {grid} objects into such raster bitmaps and print them to ESC/POS compatible devices.

What’s Inside The Tin

The following functions are implemented:

  • ggpos: Print a ggplot (or other grid object) to an ESC/POS compatible network device with sensible defaults

NOTE

I’ve only tested this on a single, networked EPSON TM-T88V printer.

Installation

remotes::install_github("hrbrmstr/ggpos")

NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.

Usage

library(ggpos)

# current version
packageVersion("ggpos")
## [1] '0.1.0'

ggplot(mtcars) +
  geom_point(
    aes(wt, mpg)
  ) +
  labs(
    title = "Test of {ggpos}"
  ) +
  theme_ipsum_es(grid="XY") +
  theme(
    panel.grid.major.x = element_line(color = "black"),
    panel.grid.major.y = element_line(color = "black")
  ) -> gg

ggpos(gg, host_pos = HOSTNAME_OR_IP_ADDRESS_OF_YOUR_PRINTER)

ggpos Metrics

Lang # Files (%) LoC (%) Blank lines (%) # Lines (%)
C++ 2 0.10 114 0.25 53 0.25 36 0.06
R 4 0.20 56 0.12 19 0.09 30 0.05
YAML 2 0.10 35 0.08 10 0.05 2 0.00
Rmd 1 0.05 21 0.05 21 0.10 34 0.06
C 1 0.05 0 0.00 2 0.01 177 0.32
SUM 10 0.50 226 0.50 105 0.50 279 0.50

clock Package Metrics for ggpos

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

GitHub

View Github