knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

library(icongram)

icongram

R build status

r scales::comma(nrow(igrams)) icons for shiny development thanks to icongram.

knitr::include_graphics("man/figures/demo.png")

Installation

You can install the development version of icongram from GitHub with:

# install.packages("devtools")
devtools::install_github("r4fun/icongram")

Example

Return an icon by calling igram:

igram(
  icon = "r", 
  lib = "simple",
  size = 128, 
  color = "default" # alternatively, a hexcode
)

Icon information is stored in igrams:

igrams

A small shiny example:

library(shiny)
library(icongram)

ui <- fluidPage(
  fluidRow(
    column(
      width = 12,
      align = "center",
      h1("icongram for shiny"),
      igram("r"),
      br(),
      tags$code('icongram::igram("r")')
    )
  )
)

server <- function(input, output, session) {

}

shinyApp(ui, server)

To view the raw HTML, use raw = TRUE:

igram("r", raw = TRUE)
print(igram("r", raw = TRUE))


r4fun/icongram documentation built on Aug. 25, 2020, 5:18 a.m.