---
title: "The r2resize R package multiple new functionalities"
output:
  html_document:
    theme: default
    toc: false
    toc_depth: 3
    toc_float: true
---

### Visit docs: https://github.com/oobianom/r2resize

# Install and Use

```{r,eval=FALSE}
install.packages(r2resize)
library(r2resize)
```

# Theme setting

```{r,echo=TRUE}
r2resize::add.resizer(
  theme.color = "black",
  position = "top",
  font.size = "12px",
  font.color = "black",
  tables = TRUE,
  images = TRUE,
  line.color = "orange",
  line.height = 5,
  line.width = 200,
  default.image.width = "40%"
)

```
# Great new features since Version 1.3

## empahsisCard function: container with moving border 

```{r}

r2resize::emphasisCard(shiny::div(
    shiny::tags$h2("Question"),
     shiny::tags$h4("Let's begin with a simply curiousity. Do you consider yourself successful?")
  ), bg.color = "#f1f1f1")

```


Sample text as a separator - Porttitor rhoncus dolor purus non enim praesent elementum facilisis. Risus pretium quam vulputate dignissim suspendisse in. Rhoncus mattis rhoncus urna neque viverra justo nec ultrices. Sed viverra ipsum nunc aliquet bibendum enim.


## Images Examples


### Single image

Elit pellentesque habitant morbi tristique senectus et netus et malesuada. Amet massa vitae tortor condimentum lacinia quis vel eros. 

```{r pressure1, echo=FALSE}

plot(mtcars)
plot(pressure)

```


## Table Examples

### Use with dataTable 

Libero id faucibus nisl tincidunt. Ultrices tincidunt arcu non sodales neque sodales ut etiam. Ut placerat orci nulla pellentesque dignissim enim sit amet. Tempus quam pellentesque nec nam. 

```{r}

library(DT)
datatable(iris)

```



## Regular Markdown Table 1 and 2

Egestas purus viverra accumsan in. Eu ultrices vitae auctor eu augue ut lectus. Leo integer malesuada nunc vel risus commodo.

| Column 1 | Column 2 | Column 3 | Column 4 | Column 5 |
|----------|----------|----------|----------|----------|
| 1        | 23       | 1        | 45       | 6 - 12   |
| 3        | 4        | 5        | NA       | 4 - 5.5  |
| 7        | 7        | 5        | 0        | 5 - 34   |



## splitCard function: Resizable split screen container

```{r}
r2resize::splitCard(
  "Sample text",
  "Sample text 2"
)


r2resize::splitCard(
  "Sample r2symbols 1",
  "Sample nextGen 1",
  bg.right.color = "white",
  bg.left.color = "lightgray",
  position = "vertical"
)

r2resize::splitCard(
  "Sample shinyStorePlus",
  "Sample nextGen 1",
  bg.right.color = "white",
  bg.left.color = "lightgray",
  border.color = "black",
  text.left.color = "black",
  text.right.color = "black",
  position = "vertical"
)



```


Sample text - Porttitor rhoncus dolor purus non enim praesent elementum facilisis. Risus pretium quam vulputate dignissim suspendisse in. Rhoncus mattis rhoncus urna neque viverra justo nec ultrices. Sed viverra ipsum nunc aliquet bibendum enim. 


## sizeableCard function: Container with sizing toolbar

```{r}

r2resize::sizeableCard(shiny::h2("Sizeable text"), "
Lobortis mattis aliquam faucibus purus in massa tempor. Quis enim lobortis scelerisque fermentum dui faucibus in ornare quam. At lectus urna duis convallis. Arcu non odio euismod lacinia at quis risus. Tincidunt ornare massa eget egestas purus viverra accumsan in. Cras adipiscing enim eu turpis egestas pretium aenean.")


r2resize::sizeableCard(shiny::h1("Second seziable text"),"
Lobortis mattis aliquam faucibus purus in massa tempor. Quis enim lobortis scelerisque fermentum dui faucibus in ornare quam. At lectus urna duis convallis. Arcu non odio euismod lacinia at quis risus. Tincidunt ornare massa eget egestas purus viverra accumsan in. Cras adipiscing enim eu turpis egestas pretium aenean.", bg.color = "lightgray", border.color="black")

```


Sample text as a separator - Porttitor rhoncus dolor purus non enim praesent elementum facilisis. Risus pretium quam vulputate dignissim suspendisse in. Rhoncus mattis rhoncus urna neque viverra justo nec ultrices. Sed viverra ipsum nunc aliquet bibendum enim. 


## windowCard function: Window like container with resizable and expandable functions 


```{r}

r2resize::windowCard( shiny::div(
    shiny::tags$h2("Answer"),
    shiny::tags$h4("I’m interviewing with a few companies for a range of positions, but they all come down to delivering an excellent customer experience. I wanted to keep an open mind about how to best achieve that goal, but so far it seems that this role will really allow me to focus all of my energy on customer experience and retention, which I find very appealing.")
  ),
                     title = "Draggable, Resizable, Exapandable",
                        width = "500px",
                        bg.color = "white",
                        border.color = "brown",
                        header.text.color = "white",
                        body.text.color = "black")

```

Sample text as a separator - Porttitor rhoncus dolor purus non enim praesent elementum facilisis. Risus pretium quam vulputate dignissim suspendisse in. Rhoncus mattis rhoncus urna neque viverra justo nec ultrices. Sed viverra ipsum nunc aliquet bibendum enim. 

