GaetanoParente commited on
Commit
1ad9db6
·
1 Parent(s): b9c5837

rivista grafica modulo forecasting

Browse files
Files changed (2) hide show
  1. app.py +24 -13
  2. style.css +1 -1
app.py CHANGED
@@ -38,7 +38,7 @@ if not os.path.exists(demo_csv_path):
38
  f.write(csv_content)
39
 
40
  def forecast_logic(file):
41
- if file is None: raise gr.Error("Carica un file CSV")
42
  if isinstance(file, list): file = file[0]
43
 
44
  img, text = forecast.predict_workload(file)
@@ -184,21 +184,32 @@ with gr.Blocks(title="NGT AI Platform", theme=theme, css_paths="style.css") as d
184
 
185
  with gr.Row(elem_classes="responsive-row"):
186
  with gr.Column(scale=1):
187
- with gr.Group():
188
- gr.Markdown("### 1. Configurazione")
189
- with gr.Row():
190
- gr.Dropdown(["Customer Care"], label="Business Unit", value="Customer Care")
191
- gr.Dropdown(["Ass. Tecnica"], label="Reparto", value="Ass. Tecnica")
192
  gr.Dropdown(["Inbound Calls"], label="Attività", value="Inbound Calls")
193
-
194
- gr.Markdown("### 2. Dati Storici")
195
- forecast_file = gr.File(label="Seleziona Export (.csv)", file_types=[".csv"], height=100, interactive=False)
196
- forecast_btn = gr.Button("🔮 Genera Grafico Interattivo", variant="primary")
197
 
198
- with gr.Column(scale=3):
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  gr.Markdown("### 📊 Dashboard Interattiva")
200
- forecast_plot = gr.Plot(label="Analisi Volumi")
201
- forecast_stats = gr.Textbox(label="KPI Backtesting", lines=4)
 
 
 
202
 
203
  forecast_btn.click(
204
  forecast_logic,
 
38
  f.write(csv_content)
39
 
40
  def forecast_logic(file):
41
+ if file is None: raise gr.Error("Seleziona un file CSV")
42
  if isinstance(file, list): file = file[0]
43
 
44
  img, text = forecast.predict_workload(file)
 
184
 
185
  with gr.Row(elem_classes="responsive-row"):
186
  with gr.Column(scale=1):
187
+ gr.Markdown("### 1. Configurazione")
188
+ with gr.Row():
189
+ gr.Dropdown(["Customer Care"], label="Business Unit", value="Customer Care")
190
+ gr.Dropdown(["Ass. Tecnica"], label="Reparto", value="Ass. Tecnica")
 
191
  gr.Dropdown(["Inbound Calls"], label="Attività", value="Inbound Calls")
 
 
 
 
192
 
193
+ with gr.Column(scale=1):
194
+ gr.Markdown("### 2. Dati Storici")
195
+ with gr.Row():
196
+ forecast_file = gr.File(
197
+ label="Seleziona Export (.csv)",
198
+ file_types=[".csv"],
199
+ height=100,
200
+ interactive=False
201
+ )
202
+ with gr.Row(elem_classes="responsive-row"):
203
+ forecast_btn = gr.Button("🔮 Genera\nGrafico", variant="primary", scale=1)
204
+
205
+ with gr.Row(elem_classes="responsive-row"):
206
+ with gr.Column():
207
  gr.Markdown("### 📊 Dashboard Interattiva")
208
+ # show_label=False rende il grafico più pulito senza il titolino grigio sopra
209
+ forecast_plot = gr.Plot(show_label=False)
210
+
211
+ with gr.Row(elem_classes="responsive-row"):
212
+ forecast_stats = gr.Textbox(label="KPI Backtesting & Performance", lines=3)
213
 
214
  forecast_btn.click(
215
  forecast_logic,
style.css CHANGED
@@ -9,7 +9,7 @@
9
  }
10
 
11
  .h4-margin{
12
- margin-left: 4px 6px 6px 4px;
13
  }
14
 
15
  .logo-container img { margin-bottom: 4px !important; object-fit: contain; }
 
9
  }
10
 
11
  .h4-margin{
12
+ margin: 4px 6px 6px 4px;
13
  }
14
 
15
  .logo-container img { margin-bottom: 4px !important; object-fit: contain; }