Spaces:
Sleeping
Sleeping
update readme
Browse files- README.md +1 -1
- test_altair.py +0 -25
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 🖼️
|
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
6 |
sdk: streamlit
|
7 |
-
sdk_version: 1.
|
8 |
python_version: 3.9.13
|
9 |
app_file: app.py
|
10 |
pinned: false
|
|
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
6 |
sdk: streamlit
|
7 |
+
sdk_version: 1.19.0
|
8 |
python_version: 3.9.13
|
9 |
app_file: app.py
|
10 |
pinned: false
|
test_altair.py
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import altair as alt
|
3 |
-
import pandas as pd
|
4 |
-
|
5 |
-
# Generate random data for the chart
|
6 |
-
data = pd.DataFrame({
|
7 |
-
'Category': ['A', 'B', 'C', 'D', 'E'],
|
8 |
-
'Value': [0.2, 0.5, 0.8, 1.2, 1.5]
|
9 |
-
})
|
10 |
-
|
11 |
-
# Define the color scale for the bars
|
12 |
-
color_scale = alt.Scale(
|
13 |
-
domain=[0, 1], # Values between 0 and 1 will be blue
|
14 |
-
range=['steelblue', 'lightgray']
|
15 |
-
)
|
16 |
-
|
17 |
-
# Create the bar chart using Altair
|
18 |
-
chart = alt.Chart(data).mark_bar().encode(
|
19 |
-
x='Category',
|
20 |
-
y='Value',
|
21 |
-
color=alt.Color('Value', scale=color_scale)
|
22 |
-
)
|
23 |
-
|
24 |
-
# Render the chart using Streamlit
|
25 |
-
st.altair_chart(chart, use_container_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|