Reactivity
On this page

Reactivity

3.1 Reactive Calc

Exercise

Extract the account filtering logic into a reactive calculation.





Exercise

Extract the account filtering logic into a reactive calculation.

Loading...




Exercise

Extract the account filtering logic into a reactive calculation.

Loading...




The source code for this exercise is here.

3.2 Stacking Reactives

Exercise

We have a second sidebar input which allows the user to filter the dataset by the number of characters in the text field. Add a second reactive calculation to the app which filters the account_data() reactive.

For reference input.chars() returns a tuple with the lower and upper range of a value, and you can filter the data frame with: df[df["text"].str.len().between(*input.chars())].

Exercise

We have a second sidebar input which allows the user to filter the dataset by the number of characters in the text field. Add a second reactive calculation to the app which filters the account_data() reactive.

For reference input.chars() returns a tuple with the lower and upper range of a value, and you can filter the data frame with: df[df["text"].str.len().between(*input.chars())].

Exercise

We have a second sidebar input which allows the user to filter the dataset by the number of characters in the text field. Add a second reactive calculation to the app which filters the account_data() reactive.

For reference input.chars() returns a tuple with the lower and upper range of a value, and you can filter the data frame with: df[df["text"].str.len().between(*input.chars())].

The source code for this exercise is here.