Spaces:
Sleeping
Sleeping
Delete charts.py
Browse files- pages/charts.py +0 -33
pages/charts.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import altair as alt
|
| 3 |
-
from vega_datasets import data
|
| 4 |
-
|
| 5 |
-
source = data.cars()
|
| 6 |
-
input = st.chat_input(
|
| 7 |
-
placeholder="Type a message",
|
| 8 |
-
key="input",
|
| 9 |
-
)
|
| 10 |
-
chart = alt.Chart(source).mark_circle().encode(
|
| 11 |
-
x='Horsepower',
|
| 12 |
-
y='Miles_per_Gallon',
|
| 13 |
-
color='Origin',
|
| 14 |
-
).interactive()
|
| 15 |
-
|
| 16 |
-
tab1, tab2 = st.tabs(["Streamlit theme (default)", "Altair native theme"])
|
| 17 |
-
|
| 18 |
-
with tab1:
|
| 19 |
-
# Use the Streamlit theme.
|
| 20 |
-
# This is the default. So you can also omit the theme argument.
|
| 21 |
-
st.altair_chart(chart, theme="streamlit", use_container_width=True)
|
| 22 |
-
with tab2:
|
| 23 |
-
# Use the native Altair theme.
|
| 24 |
-
st.altair_chart(chart, theme=None, use_container_width=True)
|
| 25 |
-
|
| 26 |
-
message = st.chat_message("assistant")
|
| 27 |
-
message.write("Hello human")
|
| 28 |
-
message.altair_chart(chart, theme=None, use_container_width=True)
|
| 29 |
-
|
| 30 |
-
if input == "show me sales":
|
| 31 |
-
message = st.chat_message("assistant")
|
| 32 |
-
message.write("Here are the sales")
|
| 33 |
-
message.altair_chart(chart, theme="streamlit", use_container_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|