How to make Interactive Python Dashboards! (Reactivity in Shiny)
This is a quick-start guide to Shiny for Python, part 2 of a multi-part series.
Data scientists need to quickly build web applications to create and share interactive visualizations, giving others a way to interact with data and analytics. Shiny helps you do this.
In this video, we'll build off of the last tutorial where we learned the basics of building, sharing, and deploying a Shiny app in Python. This video specifically focuses on reactivity in Shiny. You can watch this video as a standalone, but it may be helpful to watch the previous video (https://youtu.be/I2W7i7QyJPI).
We'll cover:
⬡ Creating toggle options for dynamic visualizations
⬡ Understanding Shiny's reactivity model
⬡ Implementing various input selectors
⬡ Building reactive components and visualizations
⬡ Using reactive calculations and effects
⬡ Adding and formatting plots with Plotly
⬡ Documentation walkthrough to learn more about reactivity (reactivity.effect, reactivity.event, reactivity.isolate, reactivity.invalidate_later, etc…)
Video Resources:
Video #1: https://youtu.be/I2W7i7QyJPI?si=nx1dk5ovPc91pvlB
Starter Code (from end of video #1): https://github.com/KeithGalli/shiny-python-projects/tree/video1
Final App: https://keithgalli.shinyapps.io/final-app/
Shiny Resources:
Shiny for Python Homepage: https://shiny.posit.co/py/
Component Gallery: https://shiny.posit.co/py/components/
Express Documentation: https://shiny.posit.co/py/api/express/
Gordon Shotwell’s “How does Shiny Render Things?”: https://youtu.be/jvV4y2xogf8?si=8uGP8ZfboUj1QM4p
Joe Cheng’s “Shiny Programming Practices”: https://youtu.be/B2JzHv4FOTU?si=t4Atii-RSc5ojgom
Stay tuned for part 3, where we'll explore how to make your dashboard look more professional (layouts in Shiny).
Video by @KeithGalli
---
Video Timeline!
0:00 - Intro & Overview
1:01 - Getting Started with Code
2:08 - Adding Shiny Components (Inputs, Outputs, & Display Messages)
3:21 - Creating an Additional Visualization (Sales Over Time by City)
7:55 - What are Reactive.Calcs and How Do We Use Them Properly? (DataFrame Best Practices)
10:27 - Creating an Additional Visualization (Sales Over Time by City) — Continued
14:30 - Filtering City Data with Select Inputs (UI.Input_Selectize)
21:15 - Rendering Shiny Inputs Within Text
22:15 - Quick Formatting Adjustments
22:54 - Understanding the Shiny Reactivity Model (How Does Shiny Render Things?)
24:23 - Adding a Checkbox Input to Change Out Bar Chart Marker Colors
28:00 - Deploying Our Updated App!
29:19 - Advanced Concepts in Shiny Reactivity (Reactive.Effect, Reactive.Event, Reactive.Isolate, Reactive.Invalidate_Later) & Other Resources
All videos in the series:
Part 1 - How to Build, Deploy, & Share a Python Application in 20 minutes! (Using Shiny): https://www.youtube.com/watch?v=I2W7i7QyJPI&t=0s
Part 2 - How to make Interactive Python Dashboards! (Reactivity in Shiny): https://www.youtube.com/watch?v=SLkA-Z8HTAE&t=0s
Part 3 - How to make your Python Dashboard look Professional! (Layouts in Shiny): https://www.youtube.com/watch?v=jemk7DoN4qk&t=0s
Part 4 - How to combine Matplotlib, Plotly, Seaborn, & more in a single Python Dashboard! (Shiny for Python): https://youtu.be/xDgO5hB4-VU?si=kk20yhdpsBqkMYcC
Part 5 - How to Perfect Your Python Dashboard with Advanced Styling! (HTML/CSS - Shiny for Python): https://youtu.be/uYZUS-eFbqw
Shiny for Python
Shiny
shinyapps
RStudio
Data Science
Machine Learning
Python
Stats
Tidyverse
Data Visualization
Data Viz
Ggplot
Technology
Coding
Connect
Server Pro
Shiny
RMarkdown
Package Manager
CRAN
Interoperability
Serious Data Science
Dplyr
Forcats
Ggplot2
Tibble
Readr
Stringr
Tidyr
Purrr
Github
Data Wrangling
Tidy Data
Odbc
Rayshader
Plumber
Blogdown
Gt
Lazy Evaluation
Tidymodels
Statistics
Debugging
Programming Education
Rstats
Open Source
OSS
Reticulate