Day 3 · 11:15
A dashboard is not a gallery of every KPI you have. It is a one-screen argument with filters. Shiny (and Posit Connect, Streamlit, Power BI) are delivery vehicles. The grammar you learned yesterday still decides whether the screen tells the truth.
You will leave able to
- State the one-screen rule and the three filters a pulse dashboard is allowed.
- Sketch a Shiny UI for supplier OTIF.
- Know when a knitted PDF is better than a live app.
On the desk
The ancestor of this session was a live-coded word cloud. Useful as theatre; rare as a management system. You will design a supply-chain pulse: OTIF, lead time, defect ppm, one screen, three filters (supplier, lane, last n weeks).
The one-screen rule
- One question (*Are we leaking reliability, and where?*).
- One scatter or violinbox that answers it.
- A small table of the ten worst lanes.
- Filters that a director can drive with a thumb on a phone.
- A timestamp of the extract, in the footer, always.
A Shiny skeleton
library(shiny)library(tidyverse) otif <- read_csv("supplier-otif.csv") ui <- fluidPage( titlePanel("Supplier pulse"), sidebarLayout( sidebarPanel( selectInput("supplier", "Supplier", choices = c("All", sort(unique(otif$supplier)))), sliderInput("weeks", "Last n weeks", 4, 24, 12) ), mainPanel(plotOutput("scatter"), tableOutput("worst")) )) server <- function(input, output) { dat <- reactive({ otif %>% filter(week >= max(week) - input$weeks + 1) %>% { if (input$supplier == "All") . else filter(., supplier == input$supplier) } }) output$scatter <- renderPlot({ dat() %>% ggplot(aes(lead_days, otif_pct, colour = supplier)) + geom_point(size = 3) + labs(x = "Lead time (days)", y = "OTIF %") }) output$worst <- renderTable({ dat() %>% group_by(lane, supplier) %>% summarise(otif = mean(otif_pct), .groups = "drop") %>% arrange(otif) %>% slice_head(n = 8) })} shinyApp(ui, server)You will not productionise this in seventy-five minutes. You will leave knowing the shape: inputs on the left, a reactive dataset, a plot, a table of exceptions. That shape ports to Power BI and to a well-made Excel with Power Query — the difference is whether the pipeline is visible.
Exercise 3.2
Name the three filters
For *your* function (marketing, HR, risk, retail), write the one question and the three filters of a pulse dashboard you would actually open on a Monday. If you need more than three filters, you do not have a pulse — you have a data dump.