Spaces:
Sleeping
Sleeping
add test chart
Browse files
app.py
CHANGED
|
@@ -1,4 +1,37 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import numpy as np
|
| 3 |
+
import pandas as pd
|
| 4 |
+
import altair as alt
|
| 5 |
|
| 6 |
+
|
| 7 |
+
gene_id_1 = st.text_input(
|
| 8 |
+
label = "Gene 1",
|
| 9 |
+
value = "CNAG0000001",
|
| 10 |
+
max_chars = 20,
|
| 11 |
+
help = "CNAG Gene ID e.g. CNAG0000001")
|
| 12 |
+
|
| 13 |
+
gene_id_2 = st.text_input(
|
| 14 |
+
label = "Gene 2",
|
| 15 |
+
value = "CNAG0000002",
|
| 16 |
+
max_chars = 20,
|
| 17 |
+
help = "CNAG Gene ID e.g. CNAG0000002")
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
chart_data = pd.DataFrame(
|
| 21 |
+
np.random.randn(20, 3),
|
| 22 |
+
columns=["a", "b", "c"])
|
| 23 |
+
|
| 24 |
+
chart = (
|
| 25 |
+
alt.Chart(chart_data)
|
| 26 |
+
.mark_circle()
|
| 27 |
+
.encode(
|
| 28 |
+
x="a",
|
| 29 |
+
y="b",
|
| 30 |
+
size="c",
|
| 31 |
+
color="c",
|
| 32 |
+
tooltip=["a", "b", "c"])
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
st.altair_chart(
|
| 36 |
+
chart,
|
| 37 |
+
use_container_width=True)
|