aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/dash/app/pal/trending/graphs.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2022-05-02 10:39:24 +0200
committerTibor Frank <tifrank@cisco.com>2022-05-03 09:51:18 +0000
commitcd417be7f836eb9346fad4f87bd4f75dc1d9a429 (patch)
treeeca75a80eabdfcb97c9eb0f2791197a7c13c987a /resources/tools/dash/app/pal/trending/graphs.py
parent54b40c5fbfa6102d3e71502ebcb9ca56cb5ef80c (diff)
feat(uti): Add structured menu for stats
Change-Id: I907606b1b994e991975f887611750d23fd7f1634 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/dash/app/pal/trending/graphs.py')
-rw-r--r--resources/tools/dash/app/pal/trending/graphs.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/resources/tools/dash/app/pal/trending/graphs.py b/resources/tools/dash/app/pal/trending/graphs.py
index 16cb5a2cb3..1d9fd1ccfa 100644
--- a/resources/tools/dash/app/pal/trending/graphs.py
+++ b/resources/tools/dash/app/pal/trending/graphs.py
@@ -201,11 +201,12 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame,
df = df.dropna(subset=[_VALUE[ttype], ])
if df.empty:
return list()
-
- x_axis = [d for d in df["start_time"] if d >= start and d <= end]
- if not x_axis:
+ df = df.loc[((df["start_time"] >= start) & (df["start_time"] <= end))]
+ if df.empty:
return list()
+ x_axis = df["start_time"].tolist()
+
anomalies, trend_avg, trend_stdev = _classify_anomalies(
{k: v for k, v in zip(x_axis, df[_VALUE[ttype]])}
)
@@ -327,9 +328,6 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame,
u"len": 0.8,
u"title": u"Circles Marking Data Classification",
u"titleside": u"right",
- # u"titlefont": {
- # u"size": 14
- # },
u"tickmode": u"array",
u"tickvals": [0.167, 0.500, 0.833],
u"ticktext": _TICK_TEXT_LAT \