From 6461df96e8bd78ed9033cc6148e0e4143ab64130 Mon Sep 17 00:00:00 2001 From: coleramos425 Date: Wed, 30 Aug 2023 16:24:42 -0500 Subject: [PATCH] Adding color code thresholds to standalone GUI to match Grafana Signed-off-by: coleramos425 --- src/omniperf_analyze/utils/gui.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/omniperf_analyze/utils/gui.py b/src/omniperf_analyze/utils/gui.py index 4128bf5ad..c34ea0c3a 100644 --- a/src/omniperf_analyze/utils/gui.py +++ b/src/omniperf_analyze/utils/gui.py @@ -365,7 +365,33 @@ def build_table_chart( if IS_DARK else {}, style_data_conditional=[ - {"if": {"row_index": "odd"}, "backgroundColor": "rgb(60, 60, 60)"} + {"if": {"row_index": "odd"}, "backgroundColor": "rgb(60, 60, 60)"}, + { + "if": {"column_id": "PoP", "filter_query": "{PoP} > 50"}, + "backgroundColor": "#ffa90a", + "color": "white", + }, + { + "if": {"column_id": "PoP", "filter_query": "{PoP} > 80"}, + "backgroundColor": "#ff120a", + "color": "white", + }, + { + "if": { + "column_id": "Avg", + "filter_query": "{Unit} = Pct && {Avg} > 50", + }, + "backgroundColor": "#ffa90a", + "color": "white", + }, + { + "if": { + "column_id": "Avg", + "filter_query": "{Unit} = Pct && {Avg} > 80", + }, + "backgroundColor": "#ff120a", + "color": "white", + }, ] if IS_DARK else [],