https://github.com/coatless-rpkg/shinytangle
Bringing Tangle Slider Inputs to Shiny
https://github.com/coatless-rpkg/shinytangle
Last synced: 20 days ago
JSON representation
Bringing Tangle Slider Inputs to Shiny
- Host: GitHub
- URL: https://github.com/coatless-rpkg/shinytangle
- Owner: coatless-rpkg
- Created: 2024-12-26T08:12:06.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-12-26T10:09:58.000Z (5 months ago)
- Last Synced: 2024-12-26T11:19:28.493Z (5 months ago)
- Homepage: http://r-pkg.thecoatlessprofessor.com/shinytangle/
- Size: 1000 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# shinytangle
[](https://github.com/coatless-rpkg/shinytangle/actions/workflows/R-CMD-check.yaml)
shinytangle provides inline interactive widgets for Shiny applications,
allowing you to embed interactive numeric inputs and outputs directly
within text. This makes it easy to create dynamic, interactive
narratives and explanations where users can adjust values and see
results update in real-time.## Installation
You can install the development version of shinytangle from GitHub:
``` r
# install.packages("remotes")
remotes::install_github("coatless-rpkg/shinytangle")
```## Usage
Here’s an example of how to use shinytangle:
``` r
library(shiny)
library(shinytangle)ui <- fluidPage(
titlePanel("shinytangle: Demo Inline"),
p(
"When you have",
inlineNumericInput("amount", 5, min = 0, max = 10),
"items, the total cost is",
inlineOutput("cost")
)
)server <- function(input, output) {
output$cost <- renderInline({
input$amount * 9.99
})
}shinyApp(ui, server)
```
After installing the package, you can explore more examples of
`shinytangle` by running:``` r
# Display a triangle and adjust its size with a,b,c sliders
shiny::runExample("triangle-demo", package = "shinytangle")# Multi-text statement example
shiny::runExample("text-statement-demo", package = "shinytangle")# Try out the README example
shiny::runExample("readme-inline-demo", package = "shinytangle")# See a list of all examples:
system.file("examples-shiny", package="shinytangle")
```