-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
95 lines (68 loc) · 1.46 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(icongram)
```
# icongram
<!-- badges: start -->
[![R build status](https://github.com/r4fun/icongram/workflows/R-CMD-check/badge.svg)](https://github.com/r4fun/icongram/actions)
<!-- badges: end -->
`r scales::comma(nrow(igrams))` icons for shiny development thanks to [icongram](https://icongr.am).
```{r, echo=FALSE}
knitr::include_graphics("man/figures/demo.png")
```
## Installation
You can install the development version of icongram from GitHub with:
``` r
# install.packages("devtools")
devtools::install_github("r4fun/icongram")
```
## Example
Return an icon by calling `igram`:
```r
igram(
icon = "r",
lib = "simple",
size = 128,
color = "default" # alternatively, a hexcode
)
```
Icon information is stored in `igrams`:
```{r}
igrams
```
A small shiny example:
```r
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`:
```r
igram("r", raw = TRUE)
```
```{r, echo=FALSE}
print(igram("r", raw = TRUE))
```