Shiny Concepts Without Runtime
Output Status
Mark Display Readiness
Shiny outputs are display targets that can be ready or waiting for data.
Program
Play the script to choose a modeled output and see whether it is ready.
output_status.R
Replay: real traced execution (multi-file project)
output_index <- 1
outputs <- c("text", "table", "chart")
ready <- c(TRUE, TRUE, FALSE)[output_index]
state <- ifelse(ready, "ready", "waiting")
output <- outputs[output_index]
label <- paste(output, state, sep = ":")
cat(label, "\n", sep = "")
output_index <- 2
outputs <- c("text", "table", "chart")
ready <- c(TRUE, TRUE, FALSE)[output_index]
state <- ifelse(ready, "ready", "waiting")
output <- outputs[output_index]
label <- paste(output, state, sep = ":")
cat(label, "\n", sep = "")
output_index <- 3
outputs <- c("text", "table", "chart")
ready <- c(TRUE, TRUE, FALSE)[output_index]
state <- ifelse(ready, "ready", "waiting")
output <- outputs[output_index]
label <- paste(output, state, sep = ":")
cat(label, "\n", sep = "")
output_index ← 1
1output_index <- 12outputs <- c("text", "table", "chart")values this step1output_indexoutputs ← text, table, chart
1output_index <- 12outputs <- c("text", "table", "chart")3ready <- c(TRUE, TRUE, FALSE)[output_index]values this steptext, table, chartoutputsready ← TRUE
2outputs <- c("text", "table", "chart")3ready <- c(TRUE, TRUE, FALSE)[output_index]4state <- ifelse(ready, "ready", "waiting")values this stepTRUEready1output_indexstate ← ready
3ready <- c(TRUE, TRUE, FALSE)[output_index]4state <- ifelse(ready, "ready", "waiting")5output <- outputs[output_index]values this stepreadystateTRUEreadyoutput ← text
4state <- ifelse(ready, "ready", "waiting")5output <- outputs[output_index]6label <- paste(output, state, sep = ":")values this steptextoutput1output_indexlabel ← text:ready
5output <- outputs[output_index]6label <- paste(output, state, sep = ":")7cat(label, "\n", sep = "")values this steptext:readylabeltextoutputreadystatecat(label, " ", sep = "")
6label <- paste(output, state, sep = ":")7cat(label, "\n", sep = "")outputtext:readyvalues this steptext:readylabel
output_index ← 2
1output_index <- 22outputs <- c("text", "table", "chart")values this step2output_indexoutputs ← text, table, chart
1output_index <- 22outputs <- c("text", "table", "chart")3ready <- c(TRUE, TRUE, FALSE)[output_index]values this steptext, table, chartoutputsready ← TRUE
2outputs <- c("text", "table", "chart")3ready <- c(TRUE, TRUE, FALSE)[output_index]4state <- ifelse(ready, "ready", "waiting")values this stepTRUEready2output_indexstate ← ready
3ready <- c(TRUE, TRUE, FALSE)[output_index]4state <- ifelse(ready, "ready", "waiting")5output <- outputs[output_index]values this stepreadystateTRUEreadyoutput ← table
4state <- ifelse(ready, "ready", "waiting")5output <- outputs[output_index]6label <- paste(output, state, sep = ":")values this steptableoutput2output_indexlabel ← table:ready
5output <- outputs[output_index]6label <- paste(output, state, sep = ":")7cat(label, "\n", sep = "")values this steptable:readylabeltableoutputreadystatecat(label, " ", sep = "")
6label <- paste(output, state, sep = ":")7cat(label, "\n", sep = "")outputtable:readyvalues this steptable:readylabel
output_index ← 3
1output_index <- 32outputs <- c("text", "table", "chart")values this step3output_indexoutputs ← text, table, chart
1output_index <- 32outputs <- c("text", "table", "chart")3ready <- c(TRUE, TRUE, FALSE)[output_index]values this steptext, table, chartoutputsready ← FALSE
2outputs <- c("text", "table", "chart")3ready <- c(TRUE, TRUE, FALSE)[output_index]4state <- ifelse(ready, "ready", "waiting")values this stepFALSEready3output_indexstate ← waiting
3ready <- c(TRUE, TRUE, FALSE)[output_index]4state <- ifelse(ready, "ready", "waiting")5output <- outputs[output_index]values this stepwaitingstateFALSEreadyoutput ← chart
4state <- ifelse(ready, "ready", "waiting")5output <- outputs[output_index]6label <- paste(output, state, sep = ":")values this stepchartoutput3output_indexlabel ← chart:waiting
5output <- outputs[output_index]6label <- paste(output, state, sep = ":")7cat(label, "\n", sep = "")values this stepchart:waitinglabelchartoutputwaitingstatecat(label, " ", sep = "")
6label <- paste(output, state, sep = ":")7cat(label, "\n", sep = "")outputchart:waitingvalues this stepchart:waitinglabel
output target
An output name identifies where a value would be displayed.
readiness
A boolean flag can model whether the output has enough data to display.
display state
Combining the output name and state gives a compact UI status.