BINF_tut


Project maintained by sarbal Hosted on GitHub Pages — Theme by mattgraham

Week 10: So shiny!

Objectives

Let’s make something interactive! Shiny is an R/python package that makes it easy to build interactive web applications (apps) straight from R/Python. This lesson will get you started building Shiny apps right away. You will learn how to:

Setting up

You will be creating a shiny app, so there is no need for a notebook this week.

What’s Shiny, precious, eh?

Start off by installing the shiny package:

pip install shiny

Then create a package from the terminal.

shiny create  

Reactive == Interactive

Run!

shiny run --reload --launch-browser app_dir/app.py

Widgets (input)

function widget
actionButton Action Button
checkboxGroupInput A group of check boxes
checkboxInput A single check box
dateInput A calendar to aid date selection
dateRangeInput A pair of calendars for selecting a date range
fileInput A file upload control wizard
helpText Help text that can be added to an input form
numericInput A field to enter numbers
radioButtons A set of radio buttons
selectInput A box with choices to select from
sliderInput A slider bar
submitButton A submit button
textInput A field to enter text

Output functions

Output function Creates
dataTableOutput DataTable
htmlOutput raw HTML
imageOutput image
plotOutput plot
ableOutput table
textOutput text
uiOutput raw HTML
verbatimTextOutput text

Render functions

render function Creates
renderDataTable DataTable
renderImage images (saved as a link to a source file)
renderPlot plots
renderPrint any printed output
renderTable data frame, matrix, other table like structures
renderText character strings
renderUI a Shiny tag object or HTML

Resources and other

https://shiny.posit.co/py/docs/overview.html

Back to the homepage