Update
Browse files
app.py
CHANGED
@@ -5,43 +5,46 @@ from datasets import load_dataset
|
|
5 |
|
6 |
st.title("Code Arena")
|
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 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
with
|
47 |
-
|
|
|
|
|
|
|
|
5 |
|
6 |
st.title("Code Arena")
|
7 |
|
8 |
+
if st.query_params["problem"]:
|
9 |
+
problem_id = st.query_params["problem"]
|
10 |
+
st.write("Problem Description")
|
11 |
+
|
12 |
+
else:
|
13 |
+
with st.spinner("Loading data...", show_time=True):
|
14 |
+
ds = load_dataset("Elfsong/leetcode_data", split='train')
|
15 |
+
|
16 |
+
tab_problem, tab_submission, tab_model = st.tabs(["Problems", "Submissions", "Models"])
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
with tab_problem:
|
21 |
+
df = pd.DataFrame(
|
22 |
+
{
|
23 |
+
"name": ["Problem 1", "Problem 2", "Problem 3"],
|
24 |
+
"url": ["https://roadmap.streamlit.app", "https://extras.streamlit.app", "https://issues.streamlit.app"],
|
25 |
+
"stars": [random.randint(0, 1000) for _ in range(3)],
|
26 |
+
"views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],
|
27 |
+
}
|
28 |
+
)
|
29 |
+
st.dataframe(
|
30 |
+
df,
|
31 |
+
column_config={
|
32 |
+
"name": "Problem",
|
33 |
+
"stars": st.column_config.NumberColumn(
|
34 |
+
"Github Stars",
|
35 |
+
help="Number of stars on GitHub",
|
36 |
+
format="%d ⭐",
|
37 |
+
),
|
38 |
+
"url": st.column_config.LinkColumn("App URL"),
|
39 |
+
"views_history": st.column_config.LineChartColumn(
|
40 |
+
"Views (past 30 days)", y_min=0, y_max=5000
|
41 |
+
),
|
42 |
+
},
|
43 |
+
hide_index=True,
|
44 |
+
)
|
45 |
+
|
46 |
+
with tab_submission:
|
47 |
+
st.header("Submissions")
|
48 |
+
|
49 |
+
with tab_model:
|
50 |
+
st.header("Models")
|