For Shiny app development, I need to know how to visualize the reactive flow and how Shiny optimizes updates. Specifically, what package does 'Mastering Shiny' recommend for reactive graph visualization, and how does Shiny ensure it only re-executes necessary components when user inputs change?
Navigate to 'mastering-shiny.org'. Go to Chapter 14, 'The reactive graph'. Locate the recommended package for visualizing the reactive graph in section 14.1 'Introduction'. Navigate to section 14.4 'An input changes'. Read section 14.4 to understand how Shiny handles updates efficiently. State the recommended package and explain how Shiny ensures minimal work during updates.
Identify 'reactlog' as the recommended package for visualizing the reactive graph. Explain that Shiny ensures minimal work through an 'invalidation phase' where it marks affected components as 'dirty' and only re-executes those parts of the reactive graph that are truly dependent on the changed input, thereby avoiding unnecessary computations.