This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this app implements exercise 2 of section 14.4.5 in Mastering Shiny | |
# as you update the inputs, you can check how long the computation takes | |
# by seeing which of y1, y2, y3 changes | |
# example: | |
# change x1 and the time for y1 will be different from when app is initialized | |
# so it takes 1 second for graph to recompute when x1 changes | |
# exercise solution: | |
# when x1 changes: 1 second | |
# when x2 changes: 2 seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(reactable) | |
library(htmltools) | |
# https://thomaswilburn.github.io/viz-book/css-flex.html | |
# was crucual to figuring this out. thanks Thomas! | |
bar_chart <- | |
function(value, | |
color_left = "#78c2ad", | |
color_right = "#f3969a", |