Skip to content

Commit 361c8e4

Browse files
authored
Merge pull request #15 from sstevens2/patch-3
Added example of a widget we might use
2 parents c6fedd4 + 50a5811 commit 361c8e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

_episodes/06-refactoring-for-flexibility.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ keypoints:
1717

1818
We now have a working Streamlit app. However, it is only displaying one plot, and we can't currently change what that plot is showing.
1919
And we know that there is a lot more information to visualize in our dataset!
20-
So we are going to add in even more interactivity with some widgets.
21-
However, before we can add in widgets, we need to refactor our code. Widgets are an interface for users to set a variable to some value. Our code needs to be refactored to use variables instead of "hard-coded" values.
20+
So we are going to add in even more interactivity with some widgets.
21+
Widgets are an interface for users to set a variable to some value.
22+
For example, we we may want users to choose from a drop down menu widget to control which continent is displayed.
23+
However, before we can add in widgets, we need to refactor our code to allow for more user flexiblity in what is displayed. Our code needs to be refactored to use variables instead of "hard-coded" values.
2224

2325
For now, we will set these variables (`continent` and `metric` in the code below) to be strings. That means that after refactoring, the app will not actually look any different. However, it will make adding the widgets in much easier - because we will assign those `continent` and `metric` variables to the widget output.
2426

0 commit comments

Comments
 (0)