Spaces:
Sleeping
Sleeping
QAway-to
commited on
Commit
·
7bb14e7
1
Parent(s):
f3b6ce8
Back to old version v1.2
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ dark_theme = gr.themes.Base(
|
|
| 34 |
with gr.Blocks(theme=dark_theme, css="""
|
| 35 |
/* === Bloomberg / Dark Finance Style === */
|
| 36 |
.gradio-container {
|
| 37 |
-
max-width: 1100px !important;
|
| 38 |
margin: auto !important;
|
| 39 |
font-family: 'Inter', sans-serif;
|
| 40 |
background-color: #0d1117 !important;
|
|
@@ -42,7 +42,7 @@ with gr.Blocks(theme=dark_theme, css="""
|
|
| 42 |
|
| 43 |
/* === LLM Commentary Styling === */
|
| 44 |
#llm_comment_box textarea {
|
| 45 |
-
max-height: 600px !important; /*
|
| 46 |
overflow-y: auto !important;
|
| 47 |
background-color: #161b22 !important;
|
| 48 |
color: #f0f6fc !important;
|
|
@@ -54,9 +54,14 @@ with gr.Blocks(theme=dark_theme, css="""
|
|
| 54 |
padding: 12px !important;
|
| 55 |
}
|
| 56 |
|
| 57 |
-
/* Comparison
|
| 58 |
#comparison_table {
|
| 59 |
margin-top: 8px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
}
|
| 61 |
|
| 62 |
/* Typography & Buttons */
|
|
@@ -97,7 +102,7 @@ h2, h3, .gr-markdown {
|
|
| 97 |
box-shadow: none !important;
|
| 98 |
}
|
| 99 |
|
| 100 |
-
/* === Styled comparison
|
| 101 |
.gr-dataframe table {
|
| 102 |
border-collapse: collapse !important;
|
| 103 |
width: 100% !important;
|
|
@@ -116,6 +121,8 @@ h2, h3, .gr-markdown {
|
|
| 116 |
padding: 8px !important;
|
| 117 |
}
|
| 118 |
""") as demo:
|
|
|
|
|
|
|
| 119 |
gr.Markdown("## Investment Portfolio Analyzer")
|
| 120 |
gr.Markdown(
|
| 121 |
"A professional dashboard for analyzing and comparing investment portfolios using AI insights.",
|
|
@@ -129,7 +136,7 @@ h2, h3, .gr-markdown {
|
|
| 129 |
label="Portfolio ID or Link",
|
| 130 |
placeholder="Enter a portfolio ID (e.g. ea856c1b-...)",
|
| 131 |
lines=1,
|
| 132 |
-
value=
|
| 133 |
)
|
| 134 |
analyze_button = gr.Button("Run Analysis", variant="primary")
|
| 135 |
analyze_output = gr.Textbox(label="Analysis Result", lines=15)
|
|
@@ -144,7 +151,7 @@ h2, h3, .gr-markdown {
|
|
| 144 |
# LLM commentary ABOVE the table
|
| 145 |
comp_output_comment = gr.Textbox(
|
| 146 |
label="AI Commentary",
|
| 147 |
-
lines=14,
|
| 148 |
interactive=False,
|
| 149 |
show_copy_button=True,
|
| 150 |
elem_id="llm_comment_box",
|
|
@@ -154,7 +161,6 @@ h2, h3, .gr-markdown {
|
|
| 154 |
label="Comparative Metrics",
|
| 155 |
wrap=True,
|
| 156 |
elem_id="comparison_table",
|
| 157 |
-
height=700, # keeps proportions consistent
|
| 158 |
)
|
| 159 |
|
| 160 |
from core.comparison_table import show_comparison_table
|
|
@@ -173,12 +179,12 @@ h2, h3, .gr-markdown {
|
|
| 173 |
|
| 174 |
# --- Metrics Table Tab ---
|
| 175 |
with gr.TabItem("Metrics Table"):
|
| 176 |
-
metrics_input = gr.Textbox(label="Portfolio ID", value=
|
| 177 |
metrics_button = gr.Button("Load Metrics", variant="primary")
|
| 178 |
metrics_output = gr.Dataframe(label="Portfolio Metrics", wrap=True)
|
| 179 |
metrics_button.click(fn=show_metrics_table, inputs=metrics_input, outputs=metrics_output)
|
| 180 |
|
| 181 |
-
# --- AlphaBTC Chart Tab
|
| 182 |
with gr.TabItem("AlphaBTC Chart"):
|
| 183 |
chart_input = gr.Textbox(label="Portfolio ID", value="3852a354-e66e-4bc5-97e9-55124e31e687")
|
| 184 |
chart_button = gr.Button("Generate Chart", variant="primary")
|
|
|
|
| 34 |
with gr.Blocks(theme=dark_theme, css="""
|
| 35 |
/* === Bloomberg / Dark Finance Style === */
|
| 36 |
.gradio-container {
|
| 37 |
+
max-width: 1100px !important; /* unified width */
|
| 38 |
margin: auto !important;
|
| 39 |
font-family: 'Inter', sans-serif;
|
| 40 |
background-color: #0d1117 !important;
|
|
|
|
| 42 |
|
| 43 |
/* === LLM Commentary Styling === */
|
| 44 |
#llm_comment_box textarea {
|
| 45 |
+
max-height: 600px !important; /* slightly smaller than table */
|
| 46 |
overflow-y: auto !important;
|
| 47 |
background-color: #161b22 !important;
|
| 48 |
color: #f0f6fc !important;
|
|
|
|
| 54 |
padding: 12px !important;
|
| 55 |
}
|
| 56 |
|
| 57 |
+
/* === Comparison Table === */
|
| 58 |
#comparison_table {
|
| 59 |
margin-top: 8px !important;
|
| 60 |
+
height: 700px !important; /* fixed visible height */
|
| 61 |
+
overflow-y: auto !important; /* adds scroll if needed */
|
| 62 |
+
}
|
| 63 |
+
#comparison_table table {
|
| 64 |
+
width: 100% !important;
|
| 65 |
}
|
| 66 |
|
| 67 |
/* Typography & Buttons */
|
|
|
|
| 102 |
box-shadow: none !important;
|
| 103 |
}
|
| 104 |
|
| 105 |
+
/* === Styled comparison & metrics tables === */
|
| 106 |
.gr-dataframe table {
|
| 107 |
border-collapse: collapse !important;
|
| 108 |
width: 100% !important;
|
|
|
|
| 121 |
padding: 8px !important;
|
| 122 |
}
|
| 123 |
""") as demo:
|
| 124 |
+
|
| 125 |
+
# === Header ===
|
| 126 |
gr.Markdown("## Investment Portfolio Analyzer")
|
| 127 |
gr.Markdown(
|
| 128 |
"A professional dashboard for analyzing and comparing investment portfolios using AI insights.",
|
|
|
|
| 136 |
label="Portfolio ID or Link",
|
| 137 |
placeholder="Enter a portfolio ID (e.g. ea856c1b-...)",
|
| 138 |
lines=1,
|
| 139 |
+
value="b1ef37aa-5b9a-41b4-9394-8823f2de36bb",
|
| 140 |
)
|
| 141 |
analyze_button = gr.Button("Run Analysis", variant="primary")
|
| 142 |
analyze_output = gr.Textbox(label="Analysis Result", lines=15)
|
|
|
|
| 151 |
# LLM commentary ABOVE the table
|
| 152 |
comp_output_comment = gr.Textbox(
|
| 153 |
label="AI Commentary",
|
| 154 |
+
lines=14,
|
| 155 |
interactive=False,
|
| 156 |
show_copy_button=True,
|
| 157 |
elem_id="llm_comment_box",
|
|
|
|
| 161 |
label="Comparative Metrics",
|
| 162 |
wrap=True,
|
| 163 |
elem_id="comparison_table",
|
|
|
|
| 164 |
)
|
| 165 |
|
| 166 |
from core.comparison_table import show_comparison_table
|
|
|
|
| 179 |
|
| 180 |
# --- Metrics Table Tab ---
|
| 181 |
with gr.TabItem("Metrics Table"):
|
| 182 |
+
metrics_input = gr.Textbox(label="Portfolio ID", value="b1ef37aa-5b9a-41b4-9394-8823f2de36bb")
|
| 183 |
metrics_button = gr.Button("Load Metrics", variant="primary")
|
| 184 |
metrics_output = gr.Dataframe(label="Portfolio Metrics", wrap=True)
|
| 185 |
metrics_button.click(fn=show_metrics_table, inputs=metrics_input, outputs=metrics_output)
|
| 186 |
|
| 187 |
+
# --- AlphaBTC Chart Tab ---
|
| 188 |
with gr.TabItem("AlphaBTC Chart"):
|
| 189 |
chart_input = gr.Textbox(label="Portfolio ID", value="3852a354-e66e-4bc5-97e9-55124e31e687")
|
| 190 |
chart_button = gr.Button("Generate Chart", variant="primary")
|