-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Dataframe index configuration example * Column border example * Metric border example * Bump to nightly
- Loading branch information
1 parent
d1b7050
commit c34c2a7
Showing
4 changed files
with
36 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,18 @@ | ||
import streamlit as st | ||
import pandas as pd | ||
from datetime import date | ||
|
||
df = pd.DataFrame( | ||
{ | ||
"Date": [date(2024, 1, 1), date(2024, 2, 1), date(2024, 3, 1)], | ||
"Total": [13429, 23564, 23452], | ||
} | ||
) | ||
df.set_index("Date", inplace=True) | ||
|
||
config = { | ||
"_index": st.column_config.DateColumn("Month", format="MMM YYYY"), | ||
"Total": st.column_config.NumberColumn("Total ($)"), | ||
} | ||
|
||
st.dataframe(df, column_config=config) |
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, border=True) | ||
|
||
left.markdown("Lorem ipsum " * 10) | ||
middle.markdown("Lorem ipsum " * 5) | ||
right.markdown("Lorem ipsum ") |
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 | ||
|
||
a, b = st.columns(2) | ||
c, d = st.columns(2) | ||
|
||
a.metric("Temperature", "30°F", "-9°F", border=True) | ||
b.metric("Wind", "4 mph", "2 mph", border=True) | ||
|
||
c.metric("Humidity", "77%", "5%", border=True) | ||
d.metric("Pressure", "30.34 inHg", "-2 inHg", border=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 |
---|---|---|
|
@@ -11,4 +11,4 @@ pydeck | |
Faker | ||
openai | ||
vega_datasets | ||
streamlit>=1.40.0 | ||
streamlit-nightly |