aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2022-04-20 10:28:59 +0200
committerTibor Frank <tifrank@cisco.com>2022-04-20 10:55:35 +0200
commit1a367d70be36906a6f43f7bc2b060ed8d1059eb9 (patch)
treece21f0543f7e49a84c695041e9be6c15db5592a5
parentf63e6b83d830734fdb94b8f0384a808f189711f1 (diff)
feat(uti): Add copyable text also to anomalies
Change-Id: I4d850985bafc00594c61e5cf1c2ece2be6a90b1f Signed-off-by: Tibor Frank <tifrank@cisco.com>
-rw-r--r--resources/tools/dash/app/pal/trending/graphs.py14
1 files changed, 12 insertions, 2 deletions
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')}<br>"
+ f"trend [pps]: {trend_avg[idx]}<br>"
+ 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",