Chapter 14. The Reactive Graph
Introduction
To understand reactive computation, you must first understand the reactive graph. In this chapter, we’ll dive into the details of the graph, paying more attention to the precise order in which things happen. In particular, you’ll learn about the importance of invalidation, the process that is key to ensuring that Shiny does the minimum amount of work. You’ll also learn about the reactlog package, which can automatically draw the reactive graph for real apps.
If it’s been a while since you looked at Chapter 3, I highly recommend that you refamiliarize yourself with it before continuing. It lays the groundwork for the concepts that we’ll explore in more detail here.
A Step-by-Step Tour of Reactive Execution
To explain the process of reactive execution, we’ll use the graphic shown in Figure 14-1. It contains three reactive inputs, three reactive expressions, and three outputs.1 Recall that reactive inputs and expressions are collectively called reactive producers; reactive expressions and outputs are reactive consumers.
The connections between the components are directional, with the arrows indicating the direction of reactivity. The direction might surprise you, as it’s easy to think of a consumer taking ...
Get Mastering Shiny now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.