From 91d0c6b0936187e40d1e0a0822c1c3e03ee6c525 Mon Sep 17 00:00:00 2001 From: Debbie Matthews Date: Fri, 19 Jul 2024 09:02:11 -0700 Subject: [PATCH 1/4] Unstacked bar chart example --- python/api-examples-source/charts.bar_chart_unstacked.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 python/api-examples-source/charts.bar_chart_unstacked.py 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) From 86fb5b39c226de1148bea7691483f68f19e51215 Mon Sep 17 00:00:00 2001 From: Debbie Matthews Date: Fri, 19 Jul 2024 11:26:44 -0700 Subject: [PATCH 2/4] area chart stacking example --- python/api-examples-source/charts.area_chart_steamgraph.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 python/api-examples-source/charts.area_chart_steamgraph.py 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") From b78e0bdc21e242e4bf03186acebbdd3fc0400efe Mon Sep 17 00:00:00 2001 From: Debbie Matthews Date: Fri, 19 Jul 2024 11:37:18 -0700 Subject: [PATCH 3/4] st.feedback examples --- python/api-examples-source/widgets.feedback_stars.py | 6 ++++++ python/api-examples-source/widgets.feedback_thumbs.py | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 python/api-examples-source/widgets.feedback_stars.py create mode 100644 python/api-examples-source/widgets.feedback_thumbs.py 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]}") From 9ee1f1423493ce8c1b271c5e09084fb2ca964b39 Mon Sep 17 00:00:00 2001 From: Debbie Matthews Date: Mon, 22 Jul 2024 17:21:55 -0700 Subject: [PATCH 4/4] Change apps to nightly --- python/api-examples-source/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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