File size: 4,467 Bytes
54f0e5a
56d4acc
54f0e5a
 
 
 
 
 
 
 
 
da063d1
54f0e5a
 
 
 
 
 
 
 
 
aa9569d
 
 
 
 
54f0e5a
 
 
 
 
 
cbd517c
 
 
 
 
54f0e5a
 
 
 
 
 
 
 
 
56d4acc
54f0e5a
 
 
1a497e8
54f0e5a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a2697b
30168ed
0a2697b
 
 
 
 
 
54f0e5a
 
 
 
 
d32e3b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54f0e5a
 
2a298cc
54f0e5a
 
 
 
 
 
 
f665103
54f0e5a
2a298cc
54f0e5a
06f3314
cbd517c
 
 
 
 
 
 
 
 
54f0e5a
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import gradio as gr
from src.styles import custom_css, polygon_svg

from src.structures.all_structure import (
    ALL_ACCS,
    STYLED
)
from src.structures.pes_structure import (PES_ACCS,
    ORDER_LIST,
    DATA_TYPES,
    COLUMN_HEADERS,
    STYLED_PES_ACCS,
    filter_data,
    filter_columns,
)
from src.abouts import *
from src.structures.lek_structure import (
    LEK_ACCS,
    ORDER_LIST_LEK,
    COLUMN_HEADERS_LEK,
    DATA_TYPES_LEK,
    filter_columns_lek,
    LEK_ACCS_EN,
    ORDER_LIST_LEK_EN,
    COLUMN_HEADERS_LEK_EN,
    DATA_TYPES_LEK_EN,
)
from src.structures.ldek_structure import (
    LDEK_ACCS,
    ORDER_LIST_LDEK,
    COLUMN_HEADERS_LDEK,
    DATA_TYPES_LDEK,
    filter_columns_ldek,
    LDEK_EN_ACCS,
    ORDER_LIST_LDEK_EN,
    COLUMN_HEADERS_LDEK_EN,
    DATA_TYPES_LDEK_EN
)

global data_component
global data_component_ldek

main = gr.Blocks(css=custom_css)
with main:
    with gr.Row():
        with gr.Column():
            gr.HTML(polygon_svg)
        with gr.Column():
            gr.HTML(HEADER_TITLE)
    with gr.Tabs(elem_classes="tab-buttons") as tabs:
        with gr.TabItem("πŸ₯‡ Polish Medical Exams"):
            gr.Markdown(LEADERBOARD_DESC)
            data_component = gr.components.Dataframe(
                value=STYLED,
                type="pandas",
                datatype=["markdown"],
                interactive=False,
                visible=True,
                show_label=True,
                column_widths=[400,150,150,150,150]
            )

        with gr.TabItem("πŸ₯ PES"):
            gr.Markdown(PES_DESC)
            # Checkbox to toggle column visibility
            columns_selector = gr.CheckboxGroup(
                choices=ORDER_LIST,
                label="Select columns to display",
                value=ORDER_LIST,
            )
            # Dataframe component to display the leaderboard data
            data_component = gr.components.Dataframe(
                value=STYLED_PES_ACCS,
                headers=COLUMN_HEADERS,
                type="pandas",
                datatype=DATA_TYPES,
                interactive=False,
                visible=True,
                # column_widths=[400] + [250] * (len(COLUMN_HEADERS) - 1)
            )
            def update_dataframe(selected_columns):
                return filter_columns(selected_columns)
            columns_selector.change(update_dataframe, inputs=columns_selector, outputs=data_component)

        with gr.TabItem("🩺 LEK"):
            gr.Markdown(LEK_DESC)
            data_component_ldek = gr.components.Dataframe(
                value=LEK_ACCS,
                headers=COLUMN_HEADERS_LEK,
                type="pandas",
                datatype=DATA_TYPES_LEK,
                interactive=False,
                visible=True,
                column_widths=[400] + [180] +[155] * 22
            )
            gr.Markdown(LEK_DESC_EN)
            data_component_ldek = gr.components.Dataframe(
                value=LEK_ACCS_EN,
                headers=COLUMN_HEADERS_LEK_EN,
                type="pandas",
                datatype=DATA_TYPES_LEK_EN,
                interactive=False,
                visible=True,
                column_widths=[400] + [180] +[155] * 22
            )

        with gr.TabItem("🦷 LDEK"):
            gr.Markdown(LDEK_DESC)

            data_component_ldek = gr.components.Dataframe(
                value=LDEK_ACCS,
                headers=COLUMN_HEADERS_LDEK,
                type="pandas",
                datatype=DATA_TYPES_LDEK,
                interactive=False,
                visible=True,
                column_widths=[400] + [180] + [155] * 22
            )


            gr.Markdown(LDEK_DESC_EN)
            data_component_ldek = gr.components.Dataframe(
                value=LDEK_EN_ACCS,
                headers=COLUMN_HEADERS_LDEK_EN,
                type="pandas",
                datatype=DATA_TYPES_LDEK_EN,
                interactive=False,
                visible=True,
                column_widths=[400] + [180] + [155] * 22
            )


    with gr.Column():
            with gr.Accordion("πŸ“™ Citation", open=False):
                citation_button = gr.Textbox(
                    label=CITATION_LABEL,
                    value=CITATION_CONTENT,
                    lines=20,
                    elem_id="citation-button",
                    show_copy_button=True,
                )

if __name__ == "__main__":
    main.launch()