Skip to content

Commit 6466515

Browse files
committed
Re-org examples into examples-shiny directory to work with shiny::runExample().
Modify README.Rmd to include an animated GIF and run commands.
1 parent 2e100d1 commit 6466515

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed

README.Rmd

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,23 @@ server <- function(input, output) {
6161
shinyApp(ui, server)
6262
```
6363

64+
![](https://github.com/user-attachments/assets/c96aa063-e38c-4f80-ab88-c0a1fe090525)
65+
66+
After installing the package, you can explore more examples of `shinytangle` by running:
67+
68+
```r
69+
# Display a triangle and adjust its size with a,b,c sliders
70+
shiny::runExample("triangle-demo", package = "shinytangle")
71+
72+
# Multi-text statement example
73+
shiny::runExample("text-statement-demo", package = "shinytangle")
74+
75+
# Try out the README example
76+
shiny::runExample("readme-inline-demo", package = "shinytangle")
77+
78+
# See a list of all examples:
79+
system.file("examples-shiny", package="shinytangle")
80+
```
81+
82+
83+

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,22 @@ server <- function(input, output) {
4949

5050
shinyApp(ui, server)
5151
```
52+
53+
![](https://github.com/user-attachments/assets/c96aa063-e38c-4f80-ab88-c0a1fe090525)
54+
55+
After installing the package, you can explore more examples of
56+
`shinytangle` by running:
57+
58+
``` r
59+
# Display a triangle and adjust its size with a,b,c sliders
60+
shiny::runExample("triangle-demo", package = "shinytangle")
61+
62+
# Multi-text statement example
63+
shiny::runExample("text-statement-demo", package = "shinytangle")
64+
65+
# Try out the README example
66+
shiny::runExample("readme-inline-demo", package = "shinytangle")
67+
68+
# See a list of all examples:
69+
system.file("examples-shiny", package="shinytangle")
70+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
library(shiny)
2+
library(shinytangle)
3+
4+
ui <- fluidPage(
5+
titlePanel("shinytangle: Demo Inline"),
6+
p(
7+
"When you have",
8+
inlineNumericInput("amount", 5, min = 0, max = 10),
9+
"items, the total cost is",
10+
inlineOutput("cost")
11+
)
12+
)
13+
14+
server <- function(input, output) {
15+
output$cost <- renderInline({
16+
input$amount * 9.99
17+
})
18+
}
19+
20+
shinyApp(ui, server)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)