diff --git a/python/api-examples-source/charts.area_chart_steamgraph.py b/python/api-examples-source/charts.area_chart_steamgraph.py new file mode 100644 index 000000000..5bd16d2a8 --- /dev/null +++ b/python/api-examples-source/charts.area_chart_steamgraph.py @@ -0,0 +1,6 @@ +import streamlit as st +from vega_datasets import data + +source = data.unemployment_across_industries() + +st.area_chart(source, x="date", y="count", color="series", stack="center") diff --git a/python/api-examples-source/charts.bar_chart_unstacked.py b/python/api-examples-source/charts.bar_chart_unstacked.py new file mode 100644 index 000000000..ca982c6d9 --- /dev/null +++ b/python/api-examples-source/charts.bar_chart_unstacked.py @@ -0,0 +1,6 @@ +import streamlit as st +from vega_datasets import data + +source = data.barley() + +st.bar_chart(source, x="year", y="yield", color="site", stack=False) diff --git a/python/api-examples-source/requirements.txt b/python/api-examples-source/requirements.txt index dcdf997d0..72b587ff4 100644 --- a/python/api-examples-source/requirements.txt +++ b/python/api-examples-source/requirements.txt @@ -11,4 +11,4 @@ pydeck==0.8.0 Faker==19.1.0 openai==1.3.0 vega_datasets -streamlit==1.36.0 +streamlit-nightly diff --git a/python/api-examples-source/widgets.feedback_stars.py b/python/api-examples-source/widgets.feedback_stars.py new file mode 100644 index 000000000..0f70f1138 --- /dev/null +++ b/python/api-examples-source/widgets.feedback_stars.py @@ -0,0 +1,6 @@ +import streamlit as st + +sentiment_mapping = ["one", "two", "three", "four", "five"] +selected = st.feedback("stars") +if selected is not None: + st.markdown(f"You selected {sentiment_mapping[selected]} star(s).") diff --git a/python/api-examples-source/widgets.feedback_thumbs.py b/python/api-examples-source/widgets.feedback_thumbs.py new file mode 100644 index 000000000..117ef14ca --- /dev/null +++ b/python/api-examples-source/widgets.feedback_thumbs.py @@ -0,0 +1,6 @@ +import streamlit as st + +sentiment_mapping = [":material/thumb_down:", ":material/thumb_up:"] +selected = st.feedback("thumbs") +if selected is not None: + st.markdown(f"You selected: {sentiment_mapping[selected]}")