Skip to content

Commit b2877f0

Browse files
Prerelease 1.26.0 (#780)
* Update generate.py Update generate.py to parse StatusContainer. * Update st.markdown example app * Add interactive markdown example * Add st.toggle embedded app source * Add embedded app source for chart color parameter * Switch to nightly for prerelease * Spacing/formatting in app source * Embedded app source formatting * Use type parameter in st.button example * Typesetting consistency * Revert st.button example app Moved change to release branch * Update title, header, subheader example apps * Add app source for st.status examples
1 parent 0f9b4cc commit b2877f0

19 files changed

+204
-8
lines changed

python/api-examples-source/charts.area_chart.py

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

66
@st.cache_data
77
def load_data():
8-
df = pd.DataFrame(np.random.randn(20, 3), columns=["a", "b", "c"])
8+
df = pd.DataFrame(
9+
np.random.randn(20, 3),
10+
columns = ['a', 'b', 'c'])
911
return df
1012

1113

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import numpy as np
2+
import pandas as pd
3+
import streamlit as st
4+
5+
6+
@st.cache_data
7+
def load_data():
8+
df = pd.DataFrame({
9+
'col1' : np.random.randn(20),
10+
'col2' : np.random.randn(20),
11+
'col3' : np.random.choice(['A','B','C'], 20)
12+
})
13+
return df
14+
15+
16+
chart_data = load_data()
17+
18+
st.area_chart(
19+
chart_data,
20+
x = 'col1',
21+
y = 'col2',
22+
color = 'col3'
23+
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import numpy as np
2+
import pandas as pd
3+
import streamlit as st
4+
5+
6+
@st.cache_data
7+
def load_data():
8+
df = pd.DataFrame(
9+
np.random.randn(20, 3),
10+
columns = ['col1', 'col2', 'col3'])
11+
return df
12+
13+
14+
chart_data = load_data()
15+
16+
st.area_chart(
17+
chart_data,
18+
x = 'col1',
19+
y = ['col2', 'col3'],
20+
color = ['#FF0000', '#0000FF'] # Optional
21+
)

python/api-examples-source/charts.bar_chart.py

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

66
@st.cache_data
77
def load_data():
8-
df = pd.DataFrame(np.random.randn(50, 3), columns=["a", "b", "c"])
8+
df = pd.DataFrame(
9+
np.random.randn(50, 3),
10+
columns = ["a", "b", "c"])
911
return df
1012

1113

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import numpy as np
2+
import pandas as pd
3+
import streamlit as st
4+
5+
6+
@st.cache_data
7+
def load_data():
8+
df = pd.DataFrame({
9+
'col1' : list(range(20))*3,
10+
'col2' : np.random.randn(60),
11+
'col3' : ['A']*20 + ['B']*20 + ['C']*20
12+
})
13+
return df
14+
15+
16+
chart_data = load_data()
17+
18+
st.bar_chart(
19+
chart_data,
20+
x = 'col1',
21+
y = 'col2',
22+
color = 'col3'
23+
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import numpy as np
2+
import pandas as pd
3+
import streamlit as st
4+
5+
6+
@st.cache_data
7+
def load_data():
8+
df = pd.DataFrame({
9+
'col1' : list(range(20)),
10+
'col2' : np.random.randn(20),
11+
'col3' : np.random.randn(20)
12+
})
13+
return df
14+
15+
16+
chart_data = load_data()
17+
18+
st.bar_chart(
19+
chart_data,
20+
x = 'col1',
21+
y = ['col2', 'col3'],
22+
color = ['#FF0000', '#0000FF'] # Optional
23+
)

python/api-examples-source/charts.line_chart.py

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

66
@st.cache_data
77
def load_data():
8-
df = pd.DataFrame(np.random.randn(20, 3), columns=["a", "b", "c"])
8+
df = pd.DataFrame(
9+
np.random.randn(20, 3),
10+
columns = ['a', 'b', 'c'])
911
return df
1012

1113

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import numpy as np
2+
import pandas as pd
3+
import streamlit as st
4+
5+
6+
@st.cache_data
7+
def load_data():
8+
df = pd.DataFrame({
9+
'col1' : np.random.randn(20),
10+
'col2' : np.random.randn(20),
11+
'col3' : np.random.choice(['A','B','C'], 20)
12+
})
13+
return df
14+
15+
16+
chart_data = load_data()
17+
18+
st.line_chart(
19+
chart_data,
20+
x = 'col1',
21+
y = 'col2',
22+
color = 'col3'
23+
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import numpy as np
2+
import pandas as pd
3+
import streamlit as st
4+
5+
6+
@st.cache_data
7+
def load_data():
8+
df = pd.DataFrame(
9+
np.random.randn(20, 3),
10+
columns = ['col1', 'col2', 'col3'])
11+
return df
12+
13+
14+
chart_data = load_data()
15+
16+
st.line_chart(
17+
chart_data,
18+
x = 'col1',
19+
y = ['col2', 'col3'],
20+
color = ['#FF0000', '#0000FF'] # Optional
21+
)

python/api-examples-source/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ altair==4.2.0
1010
pydeck==0.8.0
1111
Faker==19.1.0
1212
openai==0.27.8
13-
streamlit==1.25.0
13+
streamlit-nightly

0 commit comments

Comments
 (0)