Skip to content

Commit 8192e71

Browse files
committed
Add reactivity fundamental
1 parent 6fe86f3 commit 8192e71

26 files changed

Lines changed: 166 additions & 23 deletions

_quarto.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ website:
4141
- text: "How-To"
4242
href: howto/01-export-code.qmd
4343
- text: "Fundamentals"
44-
href: fundamentals/index.qmd
44+
href: fundamentals/01-reactivity.qmd
4545
- text: "Blocks"
4646
href: blocks/01-wrangling.qmd
4747
- text: "Demo"
@@ -62,7 +62,7 @@ website:
6262
- howto/02-save-and-restore.qmd
6363
- title: "Fundamentals"
6464
contents:
65-
- fundamentals/index.qmd
65+
- fundamentals/01-reactivity.qmd
6666
- title: "Blocks"
6767
contents:
6868
- blocks/01-wrangling.qmd

docs/blocks/01-wrangling.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<span class="menu-text">How-To</span></a>
102102
</li>
103103
<li class="nav-item">
104-
<a class="nav-link" href="../fundamentals/index.html">
104+
<a class="nav-link" href="../fundamentals/01-reactivity.html">
105105
<span class="menu-text">Fundamentals</span></a>
106106
</li>
107107
<li class="nav-item">

docs/blocks/02-visualisation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<span class="menu-text">How-To</span></a>
103103
</li>
104104
<li class="nav-item">
105-
<a class="nav-link" href="../fundamentals/index.html">
105+
<a class="nav-link" href="../fundamentals/01-reactivity.html">
106106
<span class="menu-text">Fundamentals</span></a>
107107
</li>
108108
<li class="nav-item">

docs/blocks/03-io.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<span class="menu-text">How-To</span></a>
102102
</li>
103103
<li class="nav-item">
104-
<a class="nav-link" href="../fundamentals/index.html">
104+
<a class="nav-link" href="../fundamentals/01-reactivity.html">
105105
<span class="menu-text">Fundamentals</span></a>
106106
</li>
107107
<li class="nav-item">

docs/fundamentals/01-img-01.png

741 KB
Loading

docs/fundamentals/01-img-02.png

335 KB
Loading

docs/fundamentals/01-img-03.png

318 KB
Loading

docs/fundamentals/01-img-04.png

337 KB
Loading

docs/fundamentals/01-img-05.png

379 KB
Loading
Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
88

99

10-
<title>index – blockr</title>
10+
<title>reactivity – blockr</title>
1111
<style>
1212
code{white-space: pre-wrap;}
1313
span.smallcaps{font-variant: small-caps;}
@@ -100,7 +100,7 @@
100100
<span class="menu-text">How-To</span></a>
101101
</li>
102102
<li class="nav-item">
103-
<a class="nav-link active" href="../fundamentals/index.html" aria-current="page">
103+
<a class="nav-link active" href="../fundamentals/01-reactivity.html" aria-current="page">
104104
<span class="menu-text">Fundamentals</span></a>
105105
</li>
106106
<li class="nav-item">
@@ -137,7 +137,7 @@
137137
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
138138
<i class="bi bi-layout-text-sidebar-reverse"></i>
139139
</button>
140-
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="../fundamentals/index.html">index.html</a></li></ol></nav>
140+
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="../fundamentals/01-reactivity.html">Reactivity</a></li></ol></nav>
141141
<a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
142142
</a>
143143
</div>
@@ -151,26 +151,76 @@
151151
<ul class="list-unstyled mt-1">
152152
<li class="sidebar-item">
153153
<div class="sidebar-item-container">
154-
<a href="../fundamentals/index.html" class="sidebar-item-text sidebar-link active">
155-
<span class="menu-text">index.html</span></a>
154+
<a href="../fundamentals/01-reactivity.html" class="sidebar-item-text sidebar-link active">
155+
<span class="menu-text">Reactivity</span></a>
156156
</div>
157157
</li>
158158
</ul>
159159
</div>
160160
</nav>
161161
<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div>
162162
<!-- margin-sidebar -->
163-
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar zindex-bottom">
164-
163+
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
164+
<nav id="TOC" role="doc-toc" class="toc-active">
165+
<h2 id="toc-title">On this page</h2>
166+
167+
<ul>
168+
<li><a href="#reactivity" id="toc-reactivity" class="nav-link active" data-scroll-target="#reactivity">Reactivity</a>
169+
<ul class="collapse">
170+
<li><a href="#overview" id="toc-overview" class="nav-link" data-scroll-target="#overview">Overview</a></li>
171+
<li><a href="#example" id="toc-example" class="nav-link" data-scroll-target="#example">Example</a></li>
172+
<li><a href="#errors" id="toc-errors" class="nav-link" data-scroll-target="#errors">Errors</a></li>
173+
</ul></li>
174+
</ul>
175+
</nav>
165176
</div>
166177
<!-- main -->
167178
<main class="content" id="quarto-document-content"><header id="title-block-header" class="quarto-title-block"></header>
168179

169180

170181

171182

183+
<section id="reactivity" class="level1">
184+
<h1>Reactivity</h1>
185+
<section id="overview" class="level2">
186+
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
187+
<p>blockr uses a concept called reactivity to ensure that any changes you make to a block in your workflow are automatically reflected in all downstream blocks. This means that when you update one part of your workflow, you don’t need to manually trigger updates elsewhere, everything downstream adjusts automatically. It’s the same idea that powers the interactivity you’re used to seeing in spreadsheets: if cell A1 contains a price and cell B1 calculates tax with =A1 * 0.2, changing A1 instantly updates B1. blockr works the same way, but for entire data transformation steps instead of individual cells.</p>
188+
<div class="callout callout-style-default callout-note callout-titled">
189+
<div class="callout-header d-flex align-content-center">
190+
<div class="callout-icon-container">
191+
<i class="callout-icon"></i>
192+
</div>
193+
<div class="callout-title-container flex-fill">
194+
Note
195+
</div>
196+
</div>
197+
<div class="callout-body-container callout-body">
198+
<p>blockr did not invent reactivity! blockr is built on the <a href="https://shiny.posit.co/">Shiny</a> framework in R, which itself borrowed the ideas of reactivity from <a href="https://www.meteor.com/">Meteor</a></p>
199+
</div>
200+
</div>
201+
</section>
202+
<section id="example" class="level2">
203+
<h2 class="anchored" data-anchor-id="example">Example</h2>
204+
<p>If you have already completed the <a href="../tutorials/02-build-a-dashboard.html">Build a dashboard</a> tutorial, you have already seen reactivity in action. In that tutorial you learnt how to build a simple dashboard which uses a filter to update a plot on penguins:</p>
205+
<p><img src="01-img-01.png" class="img-fluid"></p>
206+
<p>Let’s zoom into the workflow to better understand what is going on. Here, we can see that as one block updates, all downstream blocks update:</p>
207+
<p><img src="01-img-02.png" class="img-fluid"></p>
208+
<p>In this example, this results in only a single block updating.</p>
209+
<p>A downstream block is any block that depends on (directly or indirectly) the output of a given block. In other words, it comes after it in the workflow. If data flows from A → B → C, then B and C are both downstream of A. This means that for complicated workflows, a change higher up the workflow can result in many blocks being updated:</p>
210+
<p><img src="01-img-03.png" class="img-fluid"></p>
211+
<p>Note that upstream blocks never get updated. In our simple example, this means that our data block does <strong>not</strong> get updated, because it is upstream of our filter block:</p>
212+
<p><img src="01-img-04.png" class="img-fluid"></p>
213+
</section>
214+
<section id="errors" class="level2">
215+
<h2 class="anchored" data-anchor-id="errors">Errors</h2>
216+
<p>Sometimes updating a block can causes errors downstream.</p>
217+
<p>For example, again using our simple penguins dashboard, if we update the dataset block to use a dataset other than penguins, it will causes errors downstream:</p>
218+
<p><img src="01-img-05.png" class="img-fluid"></p>
219+
<p>This happens because the downstream filter and plot blocks user variables from the penguins dataset. When this dataset changes, these variables are no longer available and so the downstream blocks error to let us know they are trying to use variables that no longer exist. In this instance to fix these errors, we just need to update the variables used in the downstream blocks to those found in the new dataset.</p>
172220

173221

222+
</section>
223+
</section>
174224

175225
</main> <!-- /main -->
176226
<script id="quarto-html-after-body" type="application/javascript">

0 commit comments

Comments
 (0)