File size: 1,900 Bytes
8d3a7b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from shiny import ui

ui = ui.nav_panel(
    "Correlation Explorer",

    # === Global CSS Styling ===
    ui.tags.style("""
        .chat-label {
            font-weight: bold;
            margin-top: 1em;
        }
        .response-box {
            background-color: #f9f9f9;
            border: 1px solid #ccc;
            padding: 1em;
            border-radius: 8px;
            margin-top: 1em;
            max-height: 400px;
            overflow-y: auto;
            white-space: normal;
        }
        .markdown p {
            margin: 0.5em 0;
        }
    """),

    # === Header ===
    ui.h2("Correlation Insights from Candidate Data"),

    # === Box 1: Correlation Controls ===
    ui.card(
        ui.input_select("job_id", "Select Job ID", choices=[]),
        ui.input_select("col1", "Column 1", choices=[]),
        ui.input_select("col2", "Column 2", choices=[]),
        ui.input_action_button("calc_corr", "Calculate Correlation"),
        style="margin-bottom: 2em;"
    ),

    # === Box 2: Gemini Correlation Output ===
    ui.card(
        ui.h4("Gemini Correlation Insight"),
        ui.output_ui("correlation_output"),
        style="margin-bottom: 2em;"
    ),

    # === Box 3: Follow-up Chat and LLM Response ===
    ui.card(
        ui.h4("Ask a Follow-up Question"),
        ui.input_text("chat_input", "Your question:", placeholder="e.g. Does this apply to junior candidates?"),
        ui.input_action_button("chat_send", "Send"),
        ui.output_text("chat_status_ui"),
        ui.div(
            ui.h4("Gemini Response"),
            ui.output_ui("chat_response"),
            class_="response-box"
        ),
        style="margin-bottom: 2em;"
    ),

    # === Box 4: Candidate Table Preview ===
    ui.card(
        ui.h4("Candidate Data Preview"),
        ui.output_table("candidate_table", width="100%"),
        style="margin-bottom: 2em;"
    )
)