Spaces:
Runtime error
Runtime error
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +38 -35
src/streamlit_app.py
CHANGED
|
@@ -3,38 +3,41 @@ import numpy as np
|
|
| 3 |
import pandas as pd
|
| 4 |
import streamlit as st
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
""
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
import streamlit as st
|
| 5 |
|
| 6 |
+
# We only touch verifiers to prove it imports on 3.11+
|
| 7 |
+
import verifiers as vf
|
| 8 |
+
|
| 9 |
+
st.set_page_config(page_title="Reverse-Text + Spiral Demo", layout="centered")
|
| 10 |
+
st.title("🔄 Reverse-Text & Spiral Demo")
|
| 11 |
+
st.caption(f"verifiers version → {vf.__version__}")
|
| 12 |
+
|
| 13 |
+
# --- Reverse-text toy --------------------------------------------------------
|
| 14 |
+
st.subheader("Reverse a string")
|
| 15 |
+
text_in = st.text_input("Text to reverse")
|
| 16 |
+
if st.button("Do it!"):
|
| 17 |
+
st.code(text_in[::-1])
|
| 18 |
+
|
| 19 |
+
# --- Spiral scatterplot (your original example) -----------------------------
|
| 20 |
+
st.divider()
|
| 21 |
+
st.subheader("Parametric spiral (just for fun)")
|
| 22 |
+
|
| 23 |
+
pts = st.slider("Number of points", 50, 10_000, 1_000)
|
| 24 |
+
turns = st.slider("Turns", 1, 300, 31)
|
| 25 |
+
|
| 26 |
+
idx = np.linspace(0, 1, pts)
|
| 27 |
+
theta, r = 2 * np.pi * turns * idx, idx
|
| 28 |
+
x, y = r * np.cos(theta), r * np.sin(theta)
|
| 29 |
+
|
| 30 |
+
df = pd.DataFrame({"x": x, "y": y, "idx": idx, "rnd": np.random.randn(pts)})
|
| 31 |
+
|
| 32 |
+
st.altair_chart(
|
| 33 |
+
alt.Chart(df, height=650, width=650)
|
| 34 |
+
.mark_point(filled=True)
|
| 35 |
+
.encode(
|
| 36 |
+
x=alt.X("x", axis=None),
|
| 37 |
+
y=alt.Y("y", axis=None),
|
| 38 |
+
color=alt.Color("idx", legend=None, scale=alt.Scale()),
|
| 39 |
+
size=alt.Size("rnd", legend=None,
|
| 40 |
+
scale=alt.Scale(range=[1, 150])),
|
| 41 |
+
),
|
| 42 |
+
use_container_width=True,
|
| 43 |
+
)
|