From 1a367d70be36906a6f43f7bc2b060ed8d1059eb9 Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Wed, 20 Apr 2022 10:28:59 +0200 Subject: feat(uti): Add copyable text also to anomalies Change-Id: I4d850985bafc00594c61e5cf1c2ece2be6a90b1f Signed-off-by: Tibor Frank --- resources/tools/dash/app/pal/trending/graphs.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'resources/tools') diff --git a/resources/tools/dash/app/pal/trending/graphs.py b/resources/tools/dash/app/pal/trending/graphs.py index 4273d9d2f8..6e0bcb55eb 100644 --- a/resources/tools/dash/app/pal/trending/graphs.py +++ b/resources/tools/dash/app/pal/trending/graphs.py @@ -285,21 +285,31 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame, anomaly_x = list() anomaly_y = list() anomaly_color = list() + hover = list() for idx, anomaly in enumerate(anomalies): if anomaly in (u"regression", u"progression"): anomaly_x.append(x_axis[idx]) anomaly_y.append(trend_avg[idx]) anomaly_color.append(_ANOMALY_COLOR[anomaly]) + hover_itm = ( + f"date: {x_axis[idx].strftime('%d-%m-%Y %H:%M:%S')}
" + f"trend [pps]: {trend_avg[idx]}
" + f"classification: {anomaly}" + ) + if ttype == "pdr-lat": + hover_itm = hover_itm.replace("[pps]", "[us]") + hover.append(hover_itm) anomaly_color.extend([0.0, 0.5, 1.0]) traces.append( go.Scatter( x=anomaly_x, y=anomaly_y, mode=u"markers", - hoverinfo=u"none", + text=hover, + hoverinfo=u"text+name", showlegend=False, legendgroup=name, - name=f"{name}-anomalies", + name=name, marker={ u"size": 15, u"symbol": u"circle-open", -- cgit 1.2.3-korg