Skip to content

Commit 9d55c80

Browse files
sfc-gh-dmatthewssnehankekrekajarenc
authored
Release 1.27.0 (#817)
* Add documentation for `st.status` (#783) * Create st.status page * Update API cards & docstrings * Update st.status API card summary * Add st.status to chat elements in API index * Add st.toggle documentation (#784) * Add st.toggle documentation Add page, API card, and navigation for st.toggle * Update streamlit.json --------- Co-authored-by: snehankekre <[email protected]> * Feature/enable deploy button (#787) * Add deployment button gif * Move deploy button in app menu docs * Update image borders in app-menu.md * Sync streamlit.json with release branch --------- Co-authored-by: snehankekre <[email protected]> * Release 1.26 (#785) * Add captions and markdown to st.radio example * Update streamlit.json * Remove static images for title, header, subheader * Update markdown.md Add interactive embedded app * Update changelog for 1.26.0 * Update embedded apps to 1.26.0 * Use relative internal links in changelog for performance reasons * Fix Markdown issue in download button point * Move incorrect PR about number input into notable changes * Don't reference PR 7154 in other changes * Change impact label and add PR 7143 to other changes * Update cheatsheet and configuration.md * Update What's new --------- Co-authored-by: snehankekre <[email protected]> * Update streamlit.json (#790) * Update streamlit.json * Update widget.button.py * Update experimental-user.md (#794) use [email protected] instead of [email protected] according to changes in the Streamlit library code base streamlit/streamlit#7219 * Feature/st.scatter chart (#806) * Add st.scatter_chart * Update streamlit.json * Update streamlit.json * Feature/st.link button (#814) * Update button api images * Add st.link_button page and navigation * Update streamlit.json * Update download_button.svg * Update api-cheat-sheet.md * Update streamlit.json * Update changelog.md * Update Cheatsheet * Update What's new cards * Update apps to Streamlit 1.27.0 * Style link button API illustration * Update st.link_button title Co-authored-by: Snehan Kekre <[email protected]> * Feature/st.rerun (#816) * De-experimentalize st.rerun * Add explanation to st.rerun * Update streamlit.json * Style * Update streamlit.json * Markdown typo * Update rerun.md * Confusing wording in st.rerun * Deprecation notice for `st.experimental_rerun` * Add examples and alternatives to st.rerun * Add code prefix to st.rerun example * Make example headers smaller --------- Co-authored-by: snehankekre <[email protected]> --------- Co-authored-by: snehankekre <[email protected]> Co-authored-by: Karen Javadyan <[email protected]>
1 parent 7da0f62 commit 9d55c80

26 files changed

+12916
-114
lines changed

content/library/advanced-features/button-behavior-and-examples.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ st.header(st.session_state['name'])
207207

208208
#### Logic nested in a button with a rerun
209209

210-
Although callbacks are often preferred to avoid extra reruns, our first 'John Doe'/'Jane Doe' example can be modified by adding [`st.experimental_rerun`](/library/api-reference/control-flow/st.experimental_rerun) instead. If you need to acces data in `st.session_state` before the button that modifies it, you can include `st.experimental_rerun` to rerun the script after the change has been committed. This means the script will rerun twice when a button is clicked.
210+
Although callbacks are often preferred to avoid extra reruns, our first 'John Doe'/'Jane Doe' example can be modified by adding [`st.rerun`](/library/api-reference/control-flow/st.rerun) instead. If you need to acces data in `st.session_state` before the button that modifies it, you can include `st.rerun` to rerun the script after the change has been committed. This means the script will rerun twice when a button is clicked.
211211

212212
```python
213213
import streamlit as st
@@ -220,11 +220,11 @@ st.header(st.session_state['name'])
220220

221221
if st.button('Jane'):
222222
st.session_state['name'] = 'Jane Doe'
223-
st.experimental_rerun()
223+
st.rerun()
224224

225225
if st.button('John'):
226226
st.session_state['name'] = 'John Doe'
227-
st.experimental_rerun()
227+
st.rerun()
228228

229229
st.header(st.session_state['name'])
230230
```
@@ -247,7 +247,7 @@ st.text_input('Name', key='name')
247247
if st.button('Clear name'):
248248
st.session_state.name = ''
249249
if st.button('Streamlit!'):
250-
set_name('Streamlit')
250+
st.session_state.name = ('Streamlit')
251251
```
252252

253253
</Important>

content/library/advanced-features/forms.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ The purpose of a form is to override the default behavior of Streamlit which rer
128128

129129
1. The user changes a widget's value on the frontend.
130130
2. The widget's value in `st.session_state` and in the Python backend (server) is updated.
131-
3. The script rerun begins.
131+
3. The script rerun begins.
132132
4. If the widget has a callback, it is executed as a prefix to the page rerun.
133133
5. When the updated widget's function is executed during the rerun, it outputs the new value.
134134

@@ -188,7 +188,7 @@ with st.form('addition'):
188188

189189
<Cloud src="https://doc-forms-process2.streamlit.app/?embed=true" height="400"/>
190190

191-
### Use `st.experimental_rerun`
191+
### Use `st.rerun`
192192

193193
If your process affects content above your form, another alternative is using an extra rerun. This can be less resource-efficient though, and may be less desirable that the above options.
194194

@@ -213,15 +213,15 @@ with st.form('addition'):
213213
# a second rerun when the form is submitted to update the value above.
214214
st.session_state.sum = a + b
215215
if submit:
216-
st.experimental_rerun()
216+
st.rerun()
217217
```
218218

219219
<Cloud src="https://doc-forms-process3.streamlit.app/?embed=true" height="400"/>
220220

221221
## Limitations
222222

223-
* Every form must contain a `st.form_submit_button`.
224-
* `st.button` and `st.download_button` cannot be added to a form.
225-
* `st.form` cannot be embedded inside another `st.form`.
226-
* Callback functions can only be assigned to `st.form_submit_button` within a form; no other widgets in a form can have a callback.
227-
* Interdependent widgets within a form are unlikely to be particularly useful. If you pass `widget1`'s value into `widget2` when they are both inside a form, then `widget2` will only update when the form is submitted.
223+
- Every form must contain a `st.form_submit_button`.
224+
- `st.button` and `st.download_button` cannot be added to a form.
225+
- `st.form` cannot be embedded inside another `st.form`.
226+
- Callback functions can only be assigned to `st.form_submit_button` within a form; no other widgets in a form can have a callback.
227+
- Interdependent widgets within a form are unlikely to be particularly useful. If you pass `widget1`'s value into `widget2` when they are both inside a form, then `widget2` will only update when the form is submitted.

content/library/api-cheat-sheet.md

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ slug: /library/cheatsheet
55

66
# Cheat Sheet
77

8-
This is a summary of the docs, as of [Streamlit v1.26.0](https://pypi.org/project/streamlit/1.26.0/).
8+
This is a summary of the docs, as of [Streamlit v1.27.0](https://pypi.org/project/streamlit/1.27.0/).
99

1010
<Masonry>
1111

@@ -117,6 +117,28 @@ st.video(data)
117117

118118
<CodeTile>
119119

120+
#### Display charts
121+
122+
```python
123+
st.area_chart(df)
124+
st.bar_chart(df)
125+
st.line_chart(df)
126+
st.map(df)
127+
st.scatter_chart(df)
128+
129+
st.altair_chart(chart)
130+
st.bokeh_chart(fig)
131+
st.graphviz_chart(fig)
132+
st.plotly_chart(fig)
133+
st.pydeck_chart(chart)
134+
st.pyplot(fig)
135+
st.vega_lite_chart(df)
136+
```
137+
138+
</CodeTile>
139+
140+
<CodeTile>
141+
120142
#### Add widgets to sidebar
121143

122144
```python
@@ -176,7 +198,7 @@ st.video(data)
176198
# Stop execution immediately:
177199
st.stop()
178200
# Rerun script immediately:
179-
st.experimental_rerun()
201+
st.rerun()
180202

181203
# Group multiple widgets:
182204
>>> with st.form(key='my_form'):
@@ -192,24 +214,25 @@ st.experimental_rerun()
192214
#### Display interactive widgets
193215

194216
```python
195-
st.button('Click me')
196-
st.data_editor('Edit data', data)
197-
st.checkbox('I agree')
198-
st.toggle('Enable')
199-
st.radio('Pick one', ['cats', 'dogs'])
200-
st.selectbox('Pick one', ['cats', 'dogs'])
201-
st.multiselect('Buy', ['milk', 'apples', 'potatoes'])
202-
st.slider('Pick a number', 0, 100)
203-
st.select_slider('Pick a size', ['S', 'M', 'L'])
204-
st.text_input('First name')
205-
st.number_input('Pick a number', 0, 10)
206-
st.text_area('Text to translate')
207-
st.date_input('Your birthday')
208-
st.time_input('Meeting time')
209-
st.file_uploader('Upload a CSV')
210-
st.download_button('Download file', data)
217+
st.button("Click me")
218+
st.download_button("Download file", data)
219+
st.link_button("Go to gallery", url)
220+
st.data_editor("Edit data", data)
221+
st.checkbox("I agree")
222+
st.toggle("Enable")
223+
st.radio("Pick one", ["cats", "dogs"])
224+
st.selectbox("Pick one", ["cats", "dogs"])
225+
st.multiselect("Buy", ["milk", "apples", "potatoes"])
226+
st.slider("Pick a number", 0, 100)
227+
st.select_slider("Pick a size", ["S", "M", "L"])
228+
st.text_input("First name")
229+
st.number_input("Pick a number", 0, 10)
230+
st.text_area("Text to translate")
231+
st.date_input("Your birthday")
232+
st.time_input("Meeting time")
233+
st.file_uploader("Upload a CSV")
211234
st.camera_input("Take a picture")
212-
st.color_picker('Pick a color')
235+
st.color_picker("Pick a color")
213236

214237
# Use widgets' returned values in variables:
215238
>>> for i in range(int(st.number_input('Num:'))):

content/library/api/api-reference.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -428,18 +428,7 @@ style_metric_cards()
428428
## Chart elements
429429

430430
<TileContainer>
431-
<RefCard href="/library/api-reference/charts/st.line_chart">
432-
<Image pure alt="screenshot" src="/images/api/line_chart.jpg" />
433-
434-
#### Simple line charts
435-
436-
Display a line chart.
437-
438-
```python
439-
st.line_chart(my_data_frame)
440-
```
441431

442-
</RefCard>
443432
<RefCard href="/library/api-reference/charts/st.area_chart">
444433
<Image pure alt="screenshot" src="/images/api/area_chart.jpg" />
445434

@@ -463,6 +452,30 @@ Display a bar chart.
463452
st.bar_chart(my_data_frame)
464453
```
465454

455+
</RefCard>
456+
<RefCard href="/library/api-reference/charts/st.line_chart">
457+
<Image pure alt="screenshot" src="/images/api/line_chart.jpg" />
458+
459+
#### Simple line charts
460+
461+
Display a line chart.
462+
463+
```python
464+
st.line_chart(my_data_frame)
465+
```
466+
467+
</RefCard>
468+
<RefCard href="/library/api-reference/charts/st.scatter_chart">
469+
<Image pure alt="screenshot" src="/images/api/scatter_chart.svg" />
470+
471+
#### Simple scatter charts
472+
473+
Display a line chart.
474+
475+
```python
476+
st.scatter_chart(my_data_frame)
477+
```
478+
466479
</RefCard>
467480
<RefCard href="/library/api-reference/charts/st.map">
468481
<Image pure alt="screenshot" src="/images/api/map.jpg" />
@@ -706,7 +719,7 @@ st.altair_chart(chart, use_container_width=True)
706719
<TileContainer>
707720
<RefCard href="/library/api-reference/widgets/st.button">
708721

709-
<Image pure alt="screenshot" src="/images/api/button.jpg" />
722+
<Image pure alt="screenshot" src="/images/api/button.svg" />
710723

711724
#### Button
712725

@@ -732,7 +745,7 @@ edited = st.experimental_data_editor(df, num_rows="dynamic")
732745
</RefCard>
733746
<RefCard href="/library/api-reference/widgets/st.download_button">
734747

735-
<Image pure alt="screenshot" src="/images/api/download_button.jpg" />
748+
<Image pure alt="screenshot" src="/images/api/download_button.svg" />
736749

737750
#### Download button
738751

@@ -742,6 +755,19 @@ Display a download button widget.
742755
st.download_button("Download file", file)
743756
```
744757

758+
</RefCard>
759+
<RefCard href="/library/api-reference/widgets/st.link_button">
760+
761+
<Image pure alt="screenshot" src="/images/api/link_button.svg" />
762+
763+
#### Link button
764+
765+
Display a link button.
766+
767+
```python
768+
st.link_button("Go to gallery", url)
769+
```
770+
745771
</RefCard>
746772
<RefCard href="/library/api-reference/widgets/st.checkbox">
747773

@@ -1699,14 +1725,14 @@ st.stop()
16991725
```
17001726

17011727
</RefCard>
1702-
<RefCard href="/library/api-reference/control-flow/st.experimental_rerun">
1728+
<RefCard href="/library/api-reference/control-flow/st.rerun">
17031729

17041730
#### Rerun script
17051731

17061732
Rerun the script immediately.
17071733

17081734
```python
1709-
st.experimental_rerun()
1735+
st.rerun()
17101736
```
17111737

17121738
</RefCard>

content/library/api/charts/charts.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ finally we also provide a few chart types that are "native" to Streamlit,
1515
like `st.line_chart` and `st.area_chart`.
1616

1717
<TileContainer>
18-
<RefCard href="/library/api-reference/charts/st.line_chart">
19-
<Image pure alt="screenshot" src="/images/api/line_chart.jpg" />
20-
21-
#### Simple line charts
22-
23-
Display a line chart.
24-
25-
```python
26-
st.line_chart(my_data_frame)
27-
```
28-
29-
</RefCard>
3018
<RefCard href="/library/api-reference/charts/st.area_chart">
3119
<Image pure alt="screenshot" src="/images/api/area_chart.jpg" />
3220

@@ -50,6 +38,30 @@ Display a bar chart.
5038
st.bar_chart(my_data_frame)
5139
```
5240

41+
</RefCard>
42+
<RefCard href="/library/api-reference/charts/st.line_chart">
43+
<Image pure alt="screenshot" src="/images/api/line_chart.jpg" />
44+
45+
#### Simple line charts
46+
47+
Display a line chart.
48+
49+
```python
50+
st.line_chart(my_data_frame)
51+
```
52+
53+
</RefCard>
54+
<RefCard href="/library/api-reference/charts/st.scatter_chart">
55+
<Image pure alt="screenshot" src="/images/api/scatter_chart.svg" />
56+
57+
#### Simple scatter charts
58+
59+
Display a line chart.
60+
61+
```python
62+
st.scatter_chart(my_data_frame)
63+
```
64+
5365
</RefCard>
5466
<RefCard href="/library/api-reference/charts/st.map">
5567
<Image pure alt="screenshot" src="/images/api/map.jpg" />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: st.scatter_chart
3+
slug: /library/api-reference/charts/st.scatter_chart
4+
description: st.scatter_chart displays an scatter chart.
5+
---
6+
7+
<Autofunction function="streamlit.scatter_chart" />

content/library/api/control-flow/control-flow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ st.stop()
2222

2323
</RefCard>
2424

25-
<RefCard href="/library/api-reference/control-flow/st.experimental_rerun">
25+
<RefCard href="/library/api-reference/control-flow/st.rerun">
2626

2727
#### Rerun script
2828

2929
Rerun the script immediately.
3030

3131
```python
32-
st.experimental_rerun()
32+
st.rerun()
3333
```
3434

3535
</RefCard>

content/library/api/control-flow/experimental_rerun.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,4 @@ slug: /library/api-reference/control-flow/st.experimental_rerun
44
description: st.experimental_rerun will rerun the script immediately.
55
---
66

7-
<Important>
8-
9-
This is an experimental feature. Experimental features and their APIs may change or be removed at any time. To learn more, click [here](/library/advanced-features/prerelease#experimental-features).
10-
11-
</Important>
12-
13-
<Autofunction function="streamlit.experimental_rerun" />
7+
<Autofunction function="streamlit.experimental_rerun" deprecated={true} deprecatedText="<code>st.experimental_rerun</code> was deprecated in version 1.27.0. Use <a href='/library/api-reference/control-flow/st.rerun'><code>st.rerun</code></a> instead."/>

0 commit comments

Comments
 (0)