badaoui HF Staff commited on
Commit
b61b6d7
·
1 Parent(s): b25971c

use plotly

Browse files
Files changed (4) hide show
  1. app.py +5 -50
  2. requirements.txt +1 -0
  3. styles.css +30 -84
  4. time_series_gradio.py +221 -69
app.py CHANGED
@@ -367,76 +367,31 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
367
 
368
 
369
  # Time-series summary displays (multiple Gradio plots)
370
- time_series_failure_rates = gr.LinePlot(
371
  label="",
372
- x="date",
373
- y="failure_rate",
374
- color="platform",
375
- color_map={"AMD": "#FF6B6B", "NVIDIA": "#76B900"},
376
- title="Overall Failure Rates Over Time",
377
- tooltip=["failure_rate", "date", "change"],
378
- height=300,
379
- x_label_angle=45,
380
- y_title="Failure Rate (%)",
381
  elem_classes=["plot-container"]
382
  )
383
 
384
- time_series_amd_tests = gr.LinePlot(
385
  label="",
386
- x="date",
387
- y="count",
388
- color="test_type",
389
- color_map={"Passed": "#4CAF50", "Failed": "#E53E3E", "Skipped": "#FFA500"},
390
- title="AMD Test Results Over Time",
391
- tooltip=["count", "date", "change"],
392
- height=300,
393
- x_label_angle=45,
394
- y_title="Number of Tests",
395
  elem_classes=["plot-container"]
396
  )
397
 
398
- time_series_nvidia_tests = gr.LinePlot(
399
  label="",
400
- x="date",
401
- y="count",
402
- color="test_type",
403
- color_map={"Passed": "#4CAF50", "Failed": "#E53E3E", "Skipped": "#FFA500"},
404
- title="NVIDIA Test Results Over Time",
405
- tooltip=["count", "date", "change"],
406
- height=300,
407
- x_label_angle=45,
408
- y_title="Number of Tests",
409
  elem_classes=["plot-container"]
410
  )
411
 
412
  # Time-series model view (hidden by default)
413
  with gr.Column(visible=False, elem_classes=["time-series-detail-view"]) as time_series_detail_view:
414
  # Time-series plots for specific model (with spacing)
415
- time_series_amd_model_plot = gr.LinePlot(
416
  label="",
417
- x="date",
418
- y="count",
419
- color="test_type",
420
- color_map={"Passed": "#4CAF50", "Failed": "#E53E3E", "Skipped": "#FFA500"},
421
- title="AMD Results Over Time",
422
- tooltip=["count", "date", "change"],
423
- height=300,
424
- x_label_angle=45,
425
- y_title="Number of Tests",
426
  elem_classes=["plot-container"]
427
  )
428
 
429
- time_series_nvidia_model_plot = gr.LinePlot(
430
  label="",
431
- x="date",
432
- y="count",
433
- color="test_type",
434
- color_map={"Passed": "#4CAF50", "Failed": "#E53E3E", "Skipped": "#FFA500"},
435
- title="NVIDIA Results Over Time",
436
- tooltip=["count", "date", "change"],
437
- height=300,
438
- x_label_angle=45,
439
- y_title="Number of Tests",
440
  elem_classes=["plot-container"]
441
  )
442
 
 
367
 
368
 
369
  # Time-series summary displays (multiple Gradio plots)
370
+ time_series_failure_rates = gr.Plot(
371
  label="",
 
 
 
 
 
 
 
 
 
372
  elem_classes=["plot-container"]
373
  )
374
 
375
+ time_series_amd_tests = gr.Plot(
376
  label="",
 
 
 
 
 
 
 
 
 
377
  elem_classes=["plot-container"]
378
  )
379
 
380
+ time_series_nvidia_tests = gr.Plot(
381
  label="",
 
 
 
 
 
 
 
 
 
382
  elem_classes=["plot-container"]
383
  )
384
 
385
  # Time-series model view (hidden by default)
386
  with gr.Column(visible=False, elem_classes=["time-series-detail-view"]) as time_series_detail_view:
387
  # Time-series plots for specific model (with spacing)
388
+ time_series_amd_model_plot = gr.Plot(
389
  label="",
 
 
 
 
 
 
 
 
 
390
  elem_classes=["plot-container"]
391
  )
392
 
393
+ time_series_nvidia_model_plot = gr.Plot(
394
  label="",
 
 
 
 
 
 
 
 
 
395
  elem_classes=["plot-container"]
396
  )
397
 
requirements.txt CHANGED
@@ -1,2 +1,3 @@
1
  matplotlib>=3.8
2
  gradio_toggle
 
 
1
  matplotlib>=3.8
2
  gradio_toggle
3
+ plotly>=5.0
styles.css CHANGED
@@ -960,102 +960,48 @@ h1, h2, h3, p, .markdown {
960
  padding: 30px 20px !important;
961
  }
962
 
963
- /* Historical view plot styling - increase all text sizes */
964
- .historical-view .plot-container svg text,
965
- .time-series-detail-view .plot-container svg text {
966
- font-size: 18px !important;
967
- }
968
-
969
- /* Historical view title styling */
970
- .historical-view .plot-container svg text[class*="title"],
971
- .time-series-detail-view .plot-container svg text[class*="title"],
972
- .historical-view .plot-container svg g[class*="title"] text,
973
- .time-series-detail-view .plot-container svg g[class*="title"] text {
974
- font-size: 22px !important;
975
- font-weight: 600 !important;
976
  }
977
 
978
- /* Historical view axis titles (x-axis and y-axis labels) */
979
- .historical-view .plot-container svg g[class*="xtitle"] text,
980
- .historical-view .plot-container svg g[class*="ytitle"] text,
981
- .time-series-detail-view .plot-container svg g[class*="xtitle"] text,
982
- .time-series-detail-view .plot-container svg g[class*="ytitle"] text,
983
- .historical-view .plot-container svg .xtitle text,
984
- .historical-view .plot-container svg .ytitle text,
985
- .time-series-detail-view .plot-container svg .xtitle text,
986
- .time-series-detail-view .plot-container svg .ytitle text {
987
- font-size: 18px !important;
988
- font-weight: 500 !important;
989
  }
990
 
991
- /* Historical view axis tick labels */
992
- .historical-view .plot-container svg g[class*="axis"] text,
993
- .time-series-detail-view .plot-container svg g[class*="axis"] text,
994
- .historical-view .plot-container svg .xaxis text,
995
- .historical-view .plot-container svg .yaxis text,
996
- .time-series-detail-view .plot-container svg .xaxis text,
997
- .time-series-detail-view .plot-container svg .yaxis text {
998
  font-size: 16px !important;
 
999
  }
1000
 
1001
- /* Historical view legend styling - make it much larger */
1002
- .historical-view .plot-container svg g[class*="legend"] text,
1003
- .time-series-detail-view .plot-container svg g[class*="legend"] text,
1004
- .historical-view .plot-container svg .legend text,
1005
- .time-series-detail-view .plot-container svg .legend text,
1006
- .historical-view .plot-container svg g.legend text,
1007
- .time-series-detail-view .plot-container svg g.legend text,
1008
- .historical-view .plot-container svg text.legend,
1009
- .time-series-detail-view .plot-container svg text.legend {
1010
- font-size: 18px !important;
1011
- font-weight: 500 !important;
1012
- }
1013
-
1014
- /* Target all plotly/gradio plot text elements */
1015
- .historical-view .plot-container .js-plotly-plot text,
1016
- .time-series-detail-view .plot-container .js-plotly-plot text {
1017
  font-size: 16px !important;
 
1018
  }
1019
 
1020
- .historical-view .plot-container .js-plotly-plot .legendtext,
1021
- .time-series-detail-view .plot-container .js-plotly-plot .legendtext {
1022
- font-size: 18px !important;
1023
- }
1024
-
1025
- /* Target Altair/Vega-Lite charts used by Gradio */
1026
- .historical-view .vega-embed text,
1027
- .time-series-detail-view .vega-embed text,
1028
- .historical-view .mark-text text,
1029
- .time-series-detail-view .mark-text text {
1030
- font-size: 18px !important;
1031
- }
1032
-
1033
- /* Vega-Lite legend text */
1034
- .historical-view .vega-embed .role-legend-label,
1035
- .time-series-detail-view .vega-embed .role-legend-label,
1036
- .historical-view .vega-embed g[aria-label*="legend"] text,
1037
- .time-series-detail-view .vega-embed g[aria-label*="legend"] text {
1038
- font-size: 18px !important;
1039
- font-weight: 500 !important;
1040
- }
1041
-
1042
- /* Vega-Lite axis titles */
1043
- .historical-view .vega-embed .role-axis-title,
1044
- .time-series-detail-view .vega-embed .role-axis-title {
1045
- font-size: 18px !important;
1046
- font-weight: 500 !important;
1047
- }
1048
-
1049
- /* Vega-Lite axis labels */
1050
- .historical-view .vega-embed .role-axis-label,
1051
- .time-series-detail-view .vega-embed .role-axis-label {
1052
- font-size: 16px !important;
1053
  }
1054
 
1055
- /* Vega-Lite chart title */
1056
- .historical-view .vega-embed .role-title,
1057
- .time-series-detail-view .vega-embed .role-title {
1058
- font-size: 22px !important;
 
1059
  font-weight: 600 !important;
1060
  }
1061
 
 
960
  padding: 30px 20px !important;
961
  }
962
 
963
+ /* Plotly chart styling for historical view */
964
+ .historical-view .plot-container,
965
+ .time-series-detail-view .plot-container {
966
+ background-color: #000000 !important;
 
 
 
 
 
 
 
 
 
967
  }
968
 
969
+ /* Plotly specific text styling */
970
+ .historical-view .js-plotly-plot .plotly,
971
+ .time-series-detail-view .js-plotly-plot .plotly {
972
+ background-color: #000000 !important;
 
 
 
 
 
 
 
973
  }
974
 
975
+ /* Plotly legend text */
976
+ .historical-view .js-plotly-plot .legend text,
977
+ .time-series-detail-view .js-plotly-plot .legend text {
 
 
 
 
978
  font-size: 16px !important;
979
+ fill: #CCCCCC !important;
980
  }
981
 
982
+ /* Plotly axis titles */
983
+ .historical-view .js-plotly-plot .g-xtitle text,
984
+ .historical-view .js-plotly-plot .g-ytitle text,
985
+ .time-series-detail-view .js-plotly-plot .g-xtitle text,
986
+ .time-series-detail-view .js-plotly-plot .g-ytitle text {
 
 
 
 
 
 
 
 
 
 
 
987
  font-size: 16px !important;
988
+ fill: #CCCCCC !important;
989
  }
990
 
991
+ /* Plotly axis tick labels */
992
+ .historical-view .js-plotly-plot .xtick text,
993
+ .historical-view .js-plotly-plot .ytick text,
994
+ .time-series-detail-view .js-plotly-plot .xtick text,
995
+ .time-series-detail-view .js-plotly-plot .ytick text {
996
+ font-size: 14px !important;
997
+ fill: #CCCCCC !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
998
  }
999
 
1000
+ /* Plotly title */
1001
+ .historical-view .js-plotly-plot .g-gtitle text,
1002
+ .time-series-detail-view .js-plotly-plot .g-gtitle text {
1003
+ font-size: 20px !important;
1004
+ fill: #FFFFFF !important;
1005
  font-weight: 600 !important;
1006
  }
1007
 
time_series_gradio.py CHANGED
@@ -3,6 +3,8 @@ import numpy as np
3
  from datetime import datetime
4
  from data import extract_model_data
5
  import gradio as gr
 
 
6
 
7
  COLORS = {
8
  'passed': '#4CAF50',
@@ -128,11 +130,19 @@ def get_model_time_series_dfs(historical_df: pd.DataFrame, model_name: str) -> d
128
 
129
  def create_time_series_summary_gradio(historical_df: pd.DataFrame) -> dict:
130
  if historical_df.empty or 'date' not in historical_df.columns:
131
- empty_df = pd.DataFrame({'date': [], 'failure_rate': [], 'platform': []})
 
 
 
 
 
 
 
 
132
  return {
133
- 'failure_rates': gr.LinePlot(empty_df, x="date", y="failure_rate", color="platform", title="No historical data available", tooltip=["failure_rate", "date", "change"]),
134
- 'amd_tests': gr.LinePlot(empty_df, x="date", y="failure_rate", color="platform", title="No historical data available", tooltip=["count", "date", "change"]),
135
- 'nvidia_tests': gr.LinePlot(empty_df, x="date", y="failure_rate", color="platform", title="No historical data available", tooltip=["count", "date", "change"])
136
  }
137
 
138
  daily_stats = []
@@ -211,61 +221,159 @@ def create_time_series_summary_gradio(historical_df: pd.DataFrame) -> dict:
211
 
212
  nvidia_df = pd.DataFrame(nvidia_data)
213
 
214
- return {
215
- 'failure_rates': gr.LinePlot(
216
- failure_rate_df,
217
- x="date",
218
- y="failure_rate",
219
- color="platform",
220
- color_map={"AMD": COLORS['amd'], "NVIDIA": COLORS['nvidia']},
221
- title="Overall Failure Rates Over Time",
222
- tooltip=["failure_rate", "date", "change"],
223
- height=400,
224
- x_label_angle=45,
225
- y_title="Failure Rate (%)"
 
 
 
 
 
 
 
 
 
 
 
226
  ),
227
- 'amd_tests': gr.LinePlot(
228
- amd_df,
229
- x="date",
230
- y="count",
231
- color="test_type",
232
- color_map={"Passed": COLORS['passed'], "Failed": COLORS['failed'], "Skipped": COLORS['skipped']},
233
- title="AMD Test Results Over Time",
234
- tooltip=["count", "date", "change"],
235
- height=400,
236
- x_label_angle=45,
237
- y_title="Number of Tests"
238
  ),
239
- 'nvidia_tests': gr.LinePlot(
240
- nvidia_df,
241
- x="date",
242
- y="count",
243
- color="test_type",
244
- color_map={"Passed": COLORS['passed'], "Failed": COLORS['failed'], "Skipped": COLORS['skipped']},
245
- title="NVIDIA Test Results Over Time",
246
- tooltip=["count", "date", "change"],
247
- height=400,
248
- x_label_angle=45,
249
- y_title="Number of Tests"
250
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  }
252
 
253
 
254
  def create_model_time_series_gradio(historical_df: pd.DataFrame, model_name: str) -> dict:
255
  if historical_df.empty or 'date' not in historical_df.columns:
256
- empty_df = pd.DataFrame({'date': [], 'count': [], 'test_type': []})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  return {
258
- 'amd_plot': gr.LinePlot(empty_df, x="date", y="count", color="test_type", title=f"{model_name.upper()} - AMD Results Over Time", tooltip=["count", "date", "change"]),
259
- 'nvidia_plot': gr.LinePlot(empty_df, x="date", y="count", color="test_type", title=f"{model_name.upper()} - NVIDIA Results Over Time", tooltip=["count", "date", "change"])
260
  }
261
 
262
  model_data = historical_df[historical_df.index.str.lower() == model_name.lower()]
263
 
264
  if model_data.empty:
265
- empty_df = pd.DataFrame({'date': [], 'count': [], 'test_type': []})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  return {
267
- 'amd_plot': gr.LinePlot(empty_df, x="date", y="count", color="test_type", title=f"{model_name.upper()} - AMD Results Over Time", tooltip=["count", "date", "change"]),
268
- 'nvidia_plot': gr.LinePlot(empty_df, x="date", y="count", color="test_type", title=f"{model_name.upper()} - NVIDIA Results Over Time", tooltip=["count", "date", "change"])
269
  }
270
 
271
  dates = sorted(model_data['date'].unique())
@@ -328,29 +436,73 @@ def create_model_time_series_gradio(historical_df: pd.DataFrame, model_name: str
328
  amd_df = pd.DataFrame(amd_data)
329
  nvidia_df = pd.DataFrame(nvidia_data)
330
 
331
- return {
332
- 'amd_plot': gr.LinePlot(
333
- amd_df,
334
- x="date",
335
- y="count",
336
- color="test_type",
337
- color_map={"Passed": COLORS['passed'], "Failed": COLORS['failed'], "Skipped": COLORS['skipped']},
338
- title=f"{model_name.upper()} - AMD Results Over Time",
339
- x_label_angle=45,
340
- y_title="Number of Tests",
341
- height=400,
342
- tooltip=["count", "date", "change"]
 
 
 
 
 
 
 
 
 
 
 
343
  ),
344
- 'nvidia_plot': gr.LinePlot(
345
- nvidia_df,
346
- x="date",
347
- y="count",
348
- color="test_type",
349
- color_map={"Passed": COLORS['passed'], "Failed": COLORS['failed'], "Skipped": COLORS['skipped']},
350
- title=f"{model_name.upper()} - NVIDIA Results Over Time",
351
- x_label_angle=45,
352
- y_title="Number of Tests",
353
- height=400,
354
- tooltip=["count", "date", "change"]
355
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  }
 
3
  from datetime import datetime
4
  from data import extract_model_data
5
  import gradio as gr
6
+ import plotly.express as px
7
+ import plotly.graph_objects as go
8
 
9
  COLORS = {
10
  'passed': '#4CAF50',
 
130
 
131
  def create_time_series_summary_gradio(historical_df: pd.DataFrame) -> dict:
132
  if historical_df.empty or 'date' not in historical_df.columns:
133
+ # Create empty Plotly figure
134
+ empty_fig = go.Figure()
135
+ empty_fig.update_layout(
136
+ title="No historical data available",
137
+ height=400,
138
+ font=dict(size=16, color='#CCCCCC'),
139
+ paper_bgcolor='#000000',
140
+ plot_bgcolor='#1a1a1a',
141
+ )
142
  return {
143
+ 'failure_rates': gr.Plot(value=empty_fig),
144
+ 'amd_tests': gr.Plot(value=empty_fig),
145
+ 'nvidia_tests': gr.Plot(value=empty_fig)
146
  }
147
 
148
  daily_stats = []
 
221
 
222
  nvidia_df = pd.DataFrame(nvidia_data)
223
 
224
+ # Create Plotly figure for failure rates
225
+ fig_failure_rates = px.line(
226
+ failure_rate_df,
227
+ x='date',
228
+ y='failure_rate',
229
+ color='platform',
230
+ color_discrete_map={"AMD": COLORS['amd'], "NVIDIA": COLORS['nvidia']},
231
+ title="Overall Failure Rates Over Time",
232
+ labels={'failure_rate': 'Failure Rate (%)', 'date': 'Date', 'platform': 'Platform'}
233
+ )
234
+ fig_failure_rates.update_traces(mode='lines+markers', hovertemplate='%{y:.2f}%<br>%{x}<extra></extra>')
235
+ fig_failure_rates.update_layout(
236
+ height=400,
237
+ font=dict(size=16, color='#CCCCCC'),
238
+ paper_bgcolor='#000000',
239
+ plot_bgcolor='#1a1a1a',
240
+ title_font_size=20,
241
+ legend=dict(font=dict(size=16), bgcolor='rgba(0,0,0,0.5)'),
242
+ xaxis=dict(
243
+ title_font_size=16,
244
+ tickfont_size=14,
245
+ gridcolor='#333333',
246
+ showgrid=True
247
  ),
248
+ yaxis=dict(
249
+ title_font_size=16,
250
+ tickfont_size=14,
251
+ gridcolor='#333333',
252
+ showgrid=True
 
 
 
 
 
 
253
  ),
254
+ hovermode='x unified'
255
+ )
256
+
257
+ # Create Plotly figure for AMD tests
258
+ fig_amd = px.line(
259
+ amd_df,
260
+ x='date',
261
+ y='count',
262
+ color='test_type',
263
+ color_discrete_map={"Passed": COLORS['passed'], "Failed": COLORS['failed'], "Skipped": COLORS['skipped']},
264
+ title="AMD Test Results Over Time",
265
+ labels={'count': 'Number of Tests', 'date': 'Date', 'test_type': 'Test Type'}
266
+ )
267
+ fig_amd.update_traces(mode='lines+markers', hovertemplate='%{y}<br>%{x}<extra></extra>')
268
+ fig_amd.update_layout(
269
+ height=400,
270
+ font=dict(size=16, color='#CCCCCC'),
271
+ paper_bgcolor='#000000',
272
+ plot_bgcolor='#1a1a1a',
273
+ title_font_size=20,
274
+ legend=dict(font=dict(size=16), bgcolor='rgba(0,0,0,0.5)'),
275
+ xaxis=dict(
276
+ title_font_size=16,
277
+ tickfont_size=14,
278
+ gridcolor='#333333',
279
+ showgrid=True
280
+ ),
281
+ yaxis=dict(
282
+ title_font_size=16,
283
+ tickfont_size=14,
284
+ gridcolor='#333333',
285
+ showgrid=True
286
+ ),
287
+ hovermode='x unified'
288
+ )
289
+
290
+ # Create Plotly figure for NVIDIA tests
291
+ fig_nvidia = px.line(
292
+ nvidia_df,
293
+ x='date',
294
+ y='count',
295
+ color='test_type',
296
+ color_discrete_map={"Passed": COLORS['passed'], "Failed": COLORS['failed'], "Skipped": COLORS['skipped']},
297
+ title="NVIDIA Test Results Over Time",
298
+ labels={'count': 'Number of Tests', 'date': 'Date', 'test_type': 'Test Type'}
299
+ )
300
+ fig_nvidia.update_traces(mode='lines+markers', hovertemplate='%{y}<br>%{x}<extra></extra>')
301
+ fig_nvidia.update_layout(
302
+ height=400,
303
+ font=dict(size=16, color='#CCCCCC'),
304
+ paper_bgcolor='#000000',
305
+ plot_bgcolor='#1a1a1a',
306
+ title_font_size=20,
307
+ legend=dict(font=dict(size=16), bgcolor='rgba(0,0,0,0.5)'),
308
+ xaxis=dict(
309
+ title_font_size=16,
310
+ tickfont_size=14,
311
+ gridcolor='#333333',
312
+ showgrid=True
313
+ ),
314
+ yaxis=dict(
315
+ title_font_size=16,
316
+ tickfont_size=14,
317
+ gridcolor='#333333',
318
+ showgrid=True
319
+ ),
320
+ hovermode='x unified'
321
+ )
322
+
323
+ return {
324
+ 'failure_rates': gr.Plot(value=fig_failure_rates),
325
+ 'amd_tests': gr.Plot(value=fig_amd),
326
+ 'nvidia_tests': gr.Plot(value=fig_nvidia)
327
  }
328
 
329
 
330
  def create_model_time_series_gradio(historical_df: pd.DataFrame, model_name: str) -> dict:
331
  if historical_df.empty or 'date' not in historical_df.columns:
332
+ # Create empty Plotly figures
333
+ empty_fig_amd = go.Figure()
334
+ empty_fig_amd.update_layout(
335
+ title=f"{model_name.upper()} - AMD Results Over Time",
336
+ height=400,
337
+ font=dict(size=16, color='#CCCCCC'),
338
+ paper_bgcolor='#000000',
339
+ plot_bgcolor='#1a1a1a',
340
+ )
341
+ empty_fig_nvidia = go.Figure()
342
+ empty_fig_nvidia.update_layout(
343
+ title=f"{model_name.upper()} - NVIDIA Results Over Time",
344
+ height=400,
345
+ font=dict(size=16, color='#CCCCCC'),
346
+ paper_bgcolor='#000000',
347
+ plot_bgcolor='#1a1a1a',
348
+ )
349
  return {
350
+ 'amd_plot': gr.Plot(value=empty_fig_amd),
351
+ 'nvidia_plot': gr.Plot(value=empty_fig_nvidia)
352
  }
353
 
354
  model_data = historical_df[historical_df.index.str.lower() == model_name.lower()]
355
 
356
  if model_data.empty:
357
+ # Create empty Plotly figures
358
+ empty_fig_amd = go.Figure()
359
+ empty_fig_amd.update_layout(
360
+ title=f"{model_name.upper()} - AMD Results Over Time",
361
+ height=400,
362
+ font=dict(size=16, color='#CCCCCC'),
363
+ paper_bgcolor='#000000',
364
+ plot_bgcolor='#1a1a1a',
365
+ )
366
+ empty_fig_nvidia = go.Figure()
367
+ empty_fig_nvidia.update_layout(
368
+ title=f"{model_name.upper()} - NVIDIA Results Over Time",
369
+ height=400,
370
+ font=dict(size=16, color='#CCCCCC'),
371
+ paper_bgcolor='#000000',
372
+ plot_bgcolor='#1a1a1a',
373
+ )
374
  return {
375
+ 'amd_plot': gr.Plot(value=empty_fig_amd),
376
+ 'nvidia_plot': gr.Plot(value=empty_fig_nvidia)
377
  }
378
 
379
  dates = sorted(model_data['date'].unique())
 
436
  amd_df = pd.DataFrame(amd_data)
437
  nvidia_df = pd.DataFrame(nvidia_data)
438
 
439
+ # Create Plotly figure for AMD
440
+ fig_amd = px.line(
441
+ amd_df,
442
+ x='date',
443
+ y='count',
444
+ color='test_type',
445
+ color_discrete_map={"Passed": COLORS['passed'], "Failed": COLORS['failed'], "Skipped": COLORS['skipped']},
446
+ title=f"{model_name.upper()} - AMD Results Over Time",
447
+ labels={'count': 'Number of Tests', 'date': 'Date', 'test_type': 'Test Type'}
448
+ )
449
+ fig_amd.update_traces(mode='lines+markers', hovertemplate='%{y}<br>%{x}<extra></extra>')
450
+ fig_amd.update_layout(
451
+ height=400,
452
+ font=dict(size=16, color='#CCCCCC'),
453
+ paper_bgcolor='#000000',
454
+ plot_bgcolor='#1a1a1a',
455
+ title_font_size=20,
456
+ legend=dict(font=dict(size=16), bgcolor='rgba(0,0,0,0.5)'),
457
+ xaxis=dict(
458
+ title_font_size=16,
459
+ tickfont_size=14,
460
+ gridcolor='#333333',
461
+ showgrid=True
462
  ),
463
+ yaxis=dict(
464
+ title_font_size=16,
465
+ tickfont_size=14,
466
+ gridcolor='#333333',
467
+ showgrid=True
468
+ ),
469
+ hovermode='x unified'
470
+ )
471
+
472
+ # Create Plotly figure for NVIDIA
473
+ fig_nvidia = px.line(
474
+ nvidia_df,
475
+ x='date',
476
+ y='count',
477
+ color='test_type',
478
+ color_discrete_map={"Passed": COLORS['passed'], "Failed": COLORS['failed'], "Skipped": COLORS['skipped']},
479
+ title=f"{model_name.upper()} - NVIDIA Results Over Time",
480
+ labels={'count': 'Number of Tests', 'date': 'Date', 'test_type': 'Test Type'}
481
+ )
482
+ fig_nvidia.update_traces(mode='lines+markers', hovertemplate='%{y}<br>%{x}<extra></extra>')
483
+ fig_nvidia.update_layout(
484
+ height=400,
485
+ font=dict(size=16, color='#CCCCCC'),
486
+ paper_bgcolor='#000000',
487
+ plot_bgcolor='#1a1a1a',
488
+ title_font_size=20,
489
+ legend=dict(font=dict(size=16), bgcolor='rgba(0,0,0,0.5)'),
490
+ xaxis=dict(
491
+ title_font_size=16,
492
+ tickfont_size=14,
493
+ gridcolor='#333333',
494
+ showgrid=True
495
+ ),
496
+ yaxis=dict(
497
+ title_font_size=16,
498
+ tickfont_size=14,
499
+ gridcolor='#333333',
500
+ showgrid=True
501
+ ),
502
+ hovermode='x unified'
503
+ )
504
+
505
+ return {
506
+ 'amd_plot': gr.Plot(value=fig_amd),
507
+ 'nvidia_plot': gr.Plot(value=fig_nvidia)
508
  }