-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add another fragment example * Add horizontal bar chart example * Add column vertical alignment examples * Bump to nightly
- Loading branch information
1 parent
557d7c6
commit 1947a3a
Showing
5 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import streamlit as st | ||
from vega_datasets import data | ||
|
||
@st.cache_data | ||
def get_data(): | ||
return data.barley() | ||
|
||
source = get_data() | ||
|
||
st.bar_chart(source, x="variety", y="yield", color="site", horizontal=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import streamlit as st | ||
import time | ||
|
||
|
||
@st.experimental_fragment | ||
def release_the_balloons(): | ||
st.button("Release the balloons", help="Fragment rerun") | ||
st.balloons() | ||
|
||
|
||
with st.spinner("Inflating balloons..."): | ||
time.sleep(5) | ||
release_the_balloons() | ||
st.button("Inflate more balloons", help="Full rerun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import streamlit as st | ||
|
||
left, middle, right = st.columns(3, vertical_alignment="bottom") | ||
|
||
left.text_input("Write something") | ||
middle.button("Click me", use_container_width=True) | ||
right.checkbox("Check me") |
14 changes: 14 additions & 0 deletions
14
python/api-examples-source/layout.columns_vertical_alignment.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import streamlit as st | ||
import numpy as np | ||
|
||
vertical_alignment = st.selectbox( | ||
"Vertical alignment", ["top", "center", "bottom"], index=2 | ||
) | ||
|
||
left, middle, right = st.columns(3, vertical_alignment=vertical_alignment) | ||
left.image("https://static.streamlit.io/examples/cat.jpg") | ||
left.markdown("By [@phonvanna](https://unsplash.com/photos/0g7BJEXq7sU)") | ||
middle.image("https://static.streamlit.io/examples/dog.jpg") | ||
middle.markdown("By [@shotbyrain](https://unsplash.com/photos/rmkIqi_C3cA)") | ||
right.image("https://static.streamlit.io/examples/owl.jpg") | ||
right.markdown("By [@zmachacek](https://unsplash.com/photos/ZN4CzqizIyI)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ altair>=5.0.0 | |
pydeck==0.8.0 | ||
Faker==19.1.0 | ||
openai==1.3.0 | ||
streamlit==1.35.0 | ||
vega_datasets | ||
streamlit-nightly |