Skip to content

Commit 9812331

Browse files
authored
Merge pull request #29 from BristolMyersSquibb/fix/maelle-review-issues
Address review feedback from maelle
2 parents 4d3e765 + f2b9864 commit 9812331

13 files changed

Lines changed: 106 additions & 80 deletions

.vitepress/config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ module.exports = {
1717
{ text: 'Examples', link: '/examples/' },
1818
{ text: 'Playground', link: 'https://blockr.cloud/app/empty' }
1919
],
20+
editLink: {
21+
pattern: 'https://github.com/BristolMyersSquibb/blockr-site/edit/main/:path',
22+
text: 'Edit this page on GitHub'
23+
},
2024
sidebar: {
2125
'/learn/': [{
2226
text: 'Learn',
2327
items: [
28+
{ text: 'Installation', link: '/learn/00-installation' },
2429
{ text: 'Build your first app', link: '/learn/01-build-your-first-app' },
2530
{ text: 'Build a dashboard', link: '/learn/02-build-a-dashboard' },
2631
{ text: 'Create a custom block', link: '/learn/03-create-a-block' }

.vitepress/theme/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
display: flex !important;
44
align-items: center;
55
gap: 8px;
6-
color: #999;
6+
color: #666;
77
font-size: 0.85em;
88
}
99

docs/blocks/01-wrangling.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Use the column selector to pick the columns you want. You can select multiple co
1414

1515
The block includes a "distinct" option. When enabled, duplicate rows are removed from the result, keeping only unique combinations of the selected columns.
1616

17-
![](01-select-block.png)
17+
![Select block interface showing column picker](01-select-block.png)
1818

1919
---
2020

@@ -28,7 +28,7 @@ Add multiple conditions using the "+ Add Condition" button. Each condition can b
2828

2929
For more elaborate filter conditions using comparisons or calculations, use the filter expression block instead.
3030

31-
![](01-filter-block.png)
31+
![Filter block interface with value dropdowns](01-filter-block.png)
3232

3333
---
3434

@@ -38,7 +38,7 @@ The filter expression block keeps only rows that meet specific conditions using
3838

3939
Supported operators include `>`, `<`, `==`, `!=`, `>=`, `<=` for comparisons, and `%in%` for checking membership in a set of values. Combine multiple conditions using `&` (AND) to require all conditions to be true, or `|` (OR) to require at least one condition to be true. The expression editor provides syntax highlighting and validates your expressions. Examples: `mpg > 20`, `cyl == 4 | cyl == 6`, `hp > 100 & wt < 3`.
4040

41-
![](01-filter-expr-block.png)
41+
![Filter expression block with R expression editor](01-filter-expr-block.png)
4242

4343
---
4444

@@ -50,7 +50,7 @@ When sorting by multiple columns, the order matters. The first column is the pri
5050

5151
Add columns using the "+" button and remove them using the "×" button. Toggle between ascending and descending order for each column independently.
5252

53-
![](01-arrange-block.png)
53+
![Arrange block with sort column and direction controls](01-arrange-block.png)
5454

5555
---
5656

@@ -62,7 +62,7 @@ For head and tail types, specify the number of rows using n (count) or prop (pro
6262

6363
The custom type accepts a rows expression like "1:5" or "c(1, 3, 5, 10)". All slice types support grouping via the by parameter, which performs the slice operation within each group separately.
6464

65-
![](01-slice-block.png)
65+
![Slice block interface with type selector](01-slice-block.png)
6666

6767
---
6868

@@ -74,7 +74,7 @@ Use mathematical operators (`+`, `-`, `*`, `/`, `^`) and functions (`sqrt()`, `l
7474

7575
Expression order matters: later expressions can reference columns created by earlier expressions in the same mutate block. The by parameter allows grouping, making column references operate within each group. Add expressions with the "+ Add Expression" button and remove them with the "×" button.
7676

77-
![](01-mutate-expr-block.png)
77+
![Mutate expression block with column name and expression fields](01-mutate-expr-block.png)
7878

7979
---
8080

@@ -86,7 +86,7 @@ Select the existing column from a dropdown to ensure valid column names. Type th
8686

8787
The block validates that you don't rename the same column twice and ensures column names don't conflict with existing names.
8888

89-
![](01-rename-block.png)
89+
![Rename block showing new name to old name mapping](01-rename-block.png)
9090

9191
---
9292

@@ -100,7 +100,7 @@ Use the "Columns to group by" selector to group data before summarizing. When gr
100100

101101
For more complex aggregations using custom R expressions, use the summarize expression block instead.
102102

103-
![](01-summarize-block.png)
103+
![Summarize block with function dropdown and column selector](01-summarize-block.png)
104104

105105
---
106106

@@ -112,7 +112,7 @@ Enter expressions like `mean(mpg)`, `sum(hp)`, `dplyr::n()`, or more complex cal
112112

113113
Use the "Columns to group by" selector to group data before summarizing. The "Show advanced options" section provides additional settings like the unpack option for handling functions that return data frames.
114114

115-
![](01-summarize-expr-block.png)
115+
![Summarize expression block with R expression editor](01-summarize-expr-block.png)
116116

117117
---
118118

@@ -124,7 +124,7 @@ Join types: left_join keeps all rows from the left dataset and matching rows fro
124124

125125
The "Custom Column Mappings" interface supports both same-name joins (when columns have identical names) and different-name joins (when the matching columns have different names in each dataset). Add multiple join keys to match on multiple columns simultaneously. Enable "Use natural join" to automatically join on all common columns.
126126

127-
![](01-join-block.png)
127+
![Join block with join type selector and column mappings](01-join-block.png)
128128

129129
---
130130

@@ -136,7 +136,7 @@ Columns are matched by name. If datasets have different columns, the result incl
136136

137137
The "Show advanced options" section provides the id_name option which adds an identifier column that tracks which source dataset each row came from. This is useful when combining data from multiple sources and you need to maintain provenance.
138138

139-
![](01-bind-rows-block.png)
139+
![Bind rows block interface](01-bind-rows-block.png)
140140

141141
---
142142

@@ -148,7 +148,7 @@ All input datasets must have exactly the same number of rows. The rows are combi
148148

149149
If datasets have columns with the same name, they are automatically renamed with numeric suffixes (e.g., "Sepal.Length...1", "Sepal.Length...6") to avoid conflicts.
150150

151-
![](01-bind-cols-block.png)
151+
![Bind columns block interface](01-bind-cols-block.png)
152152

153153
---
154154

@@ -166,7 +166,7 @@ Select which columns to pivot. These columns are transformed into two new column
166166

167167
The "Show advanced options" section provides names_prefix (removes common prefixes from column names) and values_drop_na (removes rows where the value is NA). This is useful for reshaping time series data, survey responses, or preparing data for visualization.
168168

169-
![](01-pivot-longer-block.png)
169+
![Pivot longer block with column selector and naming options](01-pivot-longer-block.png)
170170

171171
---
172172

@@ -178,7 +178,7 @@ Select which column contains values for new column names (names_from) and which
178178

179179
The "Show advanced options" section provides names_prefix (adds a prefix to new column names) and values_fill (provides a value for missing combinations). This is useful for creating crosstabs, pivot tables, or comparing values across categories.
180180

181-
![](01-pivot-wider-block.png)
181+
![Pivot wider block with names_from and values_from selectors](01-pivot-wider-block.png)
182182

183183
---
184184

@@ -190,7 +190,7 @@ Select the column to separate and specify the names for the new columns (comma-s
190190

191191
The "Show advanced options" section provides remove (whether to remove the input column), convert (whether to convert new columns to appropriate types), and extra/fill options for handling rows with too many or too few pieces.
192192

193-
![](01-separate-block.png)
193+
![Separate block with column selector and separator input](01-separate-block.png)
194194

195195
---
196196

@@ -202,7 +202,7 @@ Select the columns to unite and specify the name for the new combined column. En
202202

203203
The "Show advanced options" section provides the remove option (whether to remove the input columns after uniting) and na.rm (whether to remove NA values before uniting).
204204

205-
![](01-unite-block.png)
205+
![Unite block with column selector and separator input](01-unite-block.png)
206206

207207
---
208208

docs/blocks/02-visualisation.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Map columns to the x and y axes to show how variables relate to each other. Add
1212

1313
Scatter plots support additional aesthetics including shape (for categorical distinctions) and alpha (transparency). Use alpha values between 0 and 1 to reduce overplotting in dense regions. The block automatically handles scale creation and legend generation for all mapped aesthetics.
1414

15-
![](02-block-ggplot-scatter.png)
15+
![Scatter plot example](02-block-ggplot-scatter.png)
1616

1717
---
1818

@@ -24,7 +24,7 @@ Select a categorical variable for the x axis to create bars for each category. T
2424

2525
Bar charts work well for comparing discrete groups, showing distributions of categorical variables, or displaying summary statistics. The block handles count aggregation automatically when no y variable is specified.
2626

27-
![](02-block-ggplot-bar.png)
27+
![Bar chart example](02-block-ggplot-bar.png)
2828

2929
---
3030

@@ -36,7 +36,7 @@ Map a sequential variable (like time or age) to the x axis and a continuous vari
3636

3737
Line charts support additional aesthetics including linetype for distinguishing groups with different line styles (solid, dashed, dotted) and size for varying line thickness. This visualization is ideal for temporal data, growth curves, and tracking changes over ordered sequences.
3838

39-
![](02-block-ggplot-line.png)
39+
![Line chart example](02-block-ggplot-line.png)
4040

4141
---
4242

@@ -48,7 +48,7 @@ Select a categorical variable for x and a continuous variable for y. The box sho
4848

4949
Box plots provide a compact summary of distribution shape, central tendency, and variability. They're particularly effective when comparing multiple groups side-by-side, as the aligned boxes make differences in median, spread, and skewness immediately visible.
5050

51-
![](02-block-ggplot-boxplot.png)
51+
![Box plot example](02-block-ggplot-boxplot.png)
5252

5353
---
5454

@@ -60,7 +60,7 @@ Like box plots, violin plots require a categorical x variable and continuous y v
6060

6161
Violin plots are superior to box plots when you need to see whether distributions are unimodal or multimodal, identify subtle differences in distribution shape, or understand the full data density rather than just quartiles. They're especially valuable with larger datasets where distribution details matter.
6262

63-
![](02-block-ggplot-violin.png)
63+
![Violin plot example](02-block-ggplot-violin.png)
6464

6565
---
6666

@@ -72,7 +72,7 @@ Map a continuous variable to x to create a density curve. The fill aesthetic cre
7272

7373
Density plots work well for comparing distributions when you want smooth, continuous representations rather than binned histograms. They're particularly effective with the alpha aesthetic set to 0.5-0.7, which makes overlapping distributions easy to distinguish. Use them to compare distribution shapes, identify modes, or assess whether groups follow similar patterns.
7474

75-
![](02-block-ggplot-density.png)
75+
![Density plot example](02-block-ggplot-density.png)
7676

7777
---
7878

@@ -84,7 +84,7 @@ Like line charts, area charts map sequential data to x and continuous values to
8484

8585
Area charts work best when the filled space has meaning, such as cumulative quantities, market shares, or resource allocation over time. The alpha aesthetic (0.6-0.8) is particularly important when comparing overlapping areas, as it allows all curves to remain visible while still emphasizing volume.
8686

87-
![](02-block-ggplot-area.png)
87+
![Area chart example](02-block-ggplot-area.png)
8888

8989
---
9090

@@ -96,7 +96,7 @@ Select a continuous variable for x. The block automatically creates bins and cou
9696

9797
Histograms are fundamental for exploratory data analysis: assessing whether data follows a normal distribution, identifying skewness or multimodality, detecting outliers, and understanding data range. Experiment with bin counts to find the right level of detail for your data's density and range.
9898

99-
![](02-block-ggplot-histogram.png)
99+
![Histogram example](02-block-ggplot-histogram.png)
100100

101101
---
102102

@@ -108,7 +108,7 @@ Map a categorical variable to x and a numeric value to y. Each category becomes
108108

109109
While controversial among data visualization experts who prefer bar charts for precise comparisons, pie charts remain intuitive for showing simple proportions, especially when one category dominates or when emphasizing that parts constitute a whole. Keep categories limited and consider using a donut chart variant for a modern aesthetic.
110110

111-
![](02-block-ggplot-pie.png)
111+
![Pie chart example](02-block-ggplot-pie.png)
112112

113113
---
114114

@@ -120,7 +120,7 @@ Configure exactly like pie charts, but set donut_hole to a value between 0.3 and
120120

121121
The empty center draws attention and can be used strategically to display total values, titles, or key metrics. The ring shape also makes it slightly easier to compare arc lengths than full pie slices, as the curves are more linear. Use donut charts when aesthetics matter or when you want to emphasize the ring pattern over the center point.
122122

123-
![](02-block-ggplot-donut.png)
123+
![Donut chart example](02-block-ggplot-donut.png)
124124

125125
---
126126

@@ -132,7 +132,7 @@ Select a facet variable to create a separate panel for each unique value. The nc
132132

133133
Facet wrap works well with 3-15 groups where you want to see each group's pattern separately while maintaining visual comparison. It automatically handles scales: by default all facets share the same x and y scales for easy comparison, though you can set scales to "free" for independent axes. Use this for comparing patterns across time periods, regions, or categories.
134134

135-
![](02-block-facet.png)
135+
![Facet wrap layout example](02-block-facet.png)
136136

137137
---
138138

@@ -144,7 +144,7 @@ Select variables for facet_rows and facet_cols to create a rows × columns layou
144144

145145
Facet grid is powerful for experimental designs with multiple factors, comparing subgroups across time periods, or any situation where data is naturally organized by two categorical variables. The grid structure reveals interaction effects and makes systematic comparisons straightforward. Keep factor levels reasonable (typically 2-5 levels per dimension) to maintain readability.
146146

147-
![](02-block-facet-grid.png)
147+
![Facet grid layout example](02-block-facet-grid.png)
148148

149149
---
150150

@@ -156,7 +156,7 @@ Select from over 20 built-in themes including classic ggplot2 themes (theme_mini
156156

157157
Themes control non-data elements: backgrounds, grid lines, axis styling, legend appearance, and text formatting. Apply a theme block after visualization blocks to style the entire plot consistently. Common choices include theme_minimal for clean presentations, theme_classic for publication-ready plots, and theme_dark for emphasis or presentations on dark backgrounds.
158158

159-
![](02-block-theme.png)
159+
![Theme block with theme selector](02-block-theme.png)
160160

161161
---
162162

@@ -168,7 +168,7 @@ Select a layout style (horizontal, vertical, or grid) and specify the number of
168168

169169
Grid composition is essential for complex figures that tell a complete story through multiple related views. Each input can be a complete visualization pipeline, allowing you to combine different chart types, subsets, or transformations. This is particularly powerful for academic papers, reports, or dashboards where you need to present multiple coordinated views.
170170

171-
![](02-block-grid.png)
171+
![Grid block composing multiple plots](02-block-grid.png)
172172

173173
---
174174

docs/blocks/03-io.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ When you select multiple files, the block provides combination strategies:
3737

3838
This makes it easy to load and combine related datasets in one step.
3939

40-
![](03-read-block.png)
40+
![Read block interface with file source and format options](03-read-block.png)
4141

4242
---
4343

@@ -96,7 +96,7 @@ The write block accepts multiple dataframe inputs, similar to how you might comb
9696

9797
Format-specific options (like CSV delimiter or quote character) can be configured through the `args` parameter.
9898

99-
![](03-write-block.png)
99+
![Write block interface with format and output mode options](03-write-block.png)
100100

101101
---
102102

docs/concepts/01-reactivity.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ blockr did not invent reactivity! blockr is built on the [Shiny](https://shiny.p
1717
If you have already completed the [Build a dashboard](../../learn/02-build-a-dashboard) tutorial, you have already seen reactivity in action.
1818
In that tutorial you learnt how to build a simple dashboard which uses a filter to update a plot on penguins:
1919

20-
![](01-img-01.png)
20+
![Penguins dashboard with filter updating the plot](01-img-01.png)
2121

2222
Let's zoom into the workflow to better understand what is going on.
2323
Here, we can see that as one block updates, all downstream blocks update:
2424

25-
![](01-img-02.png)
25+
![Diagram showing a change in one block updating the downstream block](01-img-02.png)
2626

2727
In this example, this results in only a single block updating.
2828

@@ -31,20 +31,20 @@ In other words, it comes after it in the workflow.
3131
If data flows from A → B → C, then B and C are both downstream of A.
3232
This means that for complicated workflows, a change higher up the workflow can result in many blocks being updated:
3333

34-
![](01-img-03.png)
34+
![Complex workflow where a change propagates to many downstream blocks](01-img-03.png)
3535

3636
Note that upstream blocks never get updated.
3737
In our simple example, this means that our data block does **not** get updated, because it is upstream of our filter block:
3838

39-
![](01-img-04.png)
39+
![Upstream data block is not affected by changes in the filter block](01-img-04.png)
4040

4141
## Errors
4242

4343
Sometimes updating a block can causes errors downstream.
4444

4545
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:
4646

47-
![](01-img-05.png)
47+
![Error in downstream blocks after changing the dataset](01-img-05.png)
4848

4949
This happens because the downstream filter and plot blocks user variables from the penguins dataset.
5050
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.

docs/dev/create-block.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
<VideoEmbed id="-PdixmAscQI" title="Creating blocks in blockr" />
44

5-
Write custom blocks in pure R to extend blockr with your own logic. A block is a specialized Shiny module that returns an **expression** (the R code it generates) and a **state** (its current input values).
5+
Write custom blocks in pure R to extend blockr with your own logic. A block is a specialized Shiny module that returns an **expression** (the R code it generates) and a **state** (its current input values). A workflow is a Shiny app composed of connected blocks.
6+
7+
Blocks should live in an R package so they can be registered, shared, and tested. The examples below show the package-based approach.
68

79
## Block anatomy
810

examples/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Curated demo workflows running on [blockr.cloud](https://blockr.cloud). Open any
9393
<img src="/examples/ai-ctrl.png" alt="AI Control + Pipeline Discovery" />
9494
<div class="example-body">
9595
<p class="example-title">AI Control + Pipeline Discovery</p>
96-
<p>AI-powered data filtering and automatic pipeline construction from natural language.</p>
96+
<p>AI-powered data filtering and pipeline construction. Click the sparkles button (✨) in a block to describe what you want in plain English.</p>
9797
<span class="example-link">Open in Playground →</span>
9898
</div>
9999
</a>

learn/00-installation.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Installation
2+
3+
Most users access blockr through [blockr.cloud](https://blockr.cloud) and don't need to install anything. If you want to run blockr locally, follow the steps below.
4+
5+
## Prerequisites
6+
7+
You need [R](https://www.r-project.org/) (version 4.1 or later) installed on your system.
8+
9+
## Install blockr
10+
11+
```r
12+
install.packages("blockr")
13+
```
14+
15+
## Run blockr
16+
17+
```r
18+
blockr::run_app()
19+
```
20+
21+
This opens an empty blockr canvas in your browser. From here you can add blocks, connect them, and build workflows just like on blockr.cloud.
22+
23+
## Next steps
24+
25+
- [Build your first app](01-build-your-first-app): a step-by-step tutorial to get started

0 commit comments

Comments
 (0)