File size: 1,558 Bytes
8c89a6d
6a914f4
3788f63
bcc3eb3
3788f63
293121e
 
08dccaf
35b35ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f81fc9a
35b35ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
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
41
42
43
44
45
46
47
48
49
50
51
import random 
import pandas as pd
import streamlit as st
from datasets import load_dataset

st.title("Code Arena")

if "problem" in st.query_params:
    problem_id = st.query_params["problem"]
    st.write("Problem Description")

else:
    with st.spinner("Loading data...", show_time=True):
        ds = load_dataset("Elfsong/leetcode_data", split='train')

    tab_problem, tab_submission, tab_model = st.tabs(["Problems", "Submissions", "Models"])



    with tab_problem:
        df = pd.DataFrame(
            {
                "name": ["Problem 1", "Problem 2", "Problem 3"],
                "url": ["/?problem=1", "https://extras.streamlit.app", "https://issues.streamlit.app"],
                "stars": [random.randint(0, 1000) for _ in range(3)],
                "views_history": [[random.randint(0, 5000) for _ in range(30)] for _ in range(3)],
            }
        )
        st.dataframe(
            df,
            column_config={
                "name": "Problem",
                "stars": st.column_config.NumberColumn(
                    "Github Stars",
                    help="Number of stars on GitHub",
                    format="%d ⭐",
                ),
                "url": st.column_config.LinkColumn("App URL"),
                "views_history": st.column_config.LineChartColumn(
                    "Views (past 30 days)", y_min=0, y_max=5000
                ),
            },
            hide_index=True,
        )

    with tab_submission:
        st.header("Submissions")

    with tab_model:
        st.header("Models")