CSIT-1133: Cosmetic improvements in trending plots 17/13117/3
authorTibor Frank <tifrank@cisco.com>
Tue, 19 Jun 2018 08:46:42 +0000 (10:46 +0200)
committerTibor Frank <tifrank@cisco.com>
Tue, 19 Jun 2018 12:03:59 +0000 (14:03 +0200)
 - Remove "outlier" from the colorbar
 - Remove anomalies from the legend

Change-Id: Idd3255d912c48c80347a773a6b19307e90a53926
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_CPTA.py
resources/tools/presentation/new/generator_CPTA.py

index c996aca..40fed8b 100644 (file)
@@ -163,8 +163,9 @@ def _generate_trending_traces(in_data, job_name, build_info, moving_win_size=10,
         line={
             "width": 1
         },
+        showlegend=True,
         legendgroup=name,
-        name="{name}-thput".format(name=name),
+        name="{name}".format(name=name),
         marker={
             "size": 5,
             "color": color,
@@ -180,7 +181,7 @@ def _generate_trending_traces(in_data, job_name, build_info, moving_win_size=10,
         y=anomalies.values,
         mode='markers',
         hoverinfo="none",
-        showlegend=True,
+        showlegend=False,
         legendgroup=name,
         name="{name}-anomalies".format(name=name),
         marker={
@@ -231,6 +232,7 @@ def _generate_trending_traces(in_data, job_name, build_info, moving_win_size=10,
                 "width": 1,
                 "color": color,
             },
+            showlegend=False,
             legendgroup=name,
             name='{name}-trend'.format(name=name)
         )
index 4dc5e6f..d4ac06d 100644 (file)
@@ -136,9 +136,8 @@ def _generate_trending_traces(in_data, job_name, build_info,
     anomalies_colors = list()
     anomalies_avgs = list()
     anomaly_color = {
-        "outlier": 0.0,
-        "regression": 0.33,
-        "normal": 0.66,
+        "regression": 0.0,
+        "normal": 0.5,
         "progression": 1.0
     }
     if anomaly_classification:
@@ -150,7 +149,7 @@ def _generate_trending_traces(in_data, job_name, build_info,
                 anomalies_colors.append(
                     anomaly_color[anomaly_classification[idx]])
                 anomalies_avgs.append(avgs[idx])
-        anomalies_colors.extend([0.0, 0.33, 0.66, 1.0])
+        anomalies_colors.extend([0.0, 0.5, 1.0])
 
     # Create traces
 
@@ -161,8 +160,9 @@ def _generate_trending_traces(in_data, job_name, build_info,
         line={
             "width": 1
         },
+        showlegend=True,
         legendgroup=name,
-        name="{name}-thput".format(name=name),
+        name="{name}".format(name=name),
         marker={
             "size": 5,
             "color": color,
@@ -183,6 +183,7 @@ def _generate_trending_traces(in_data, job_name, build_info,
                 "width": 1,
                 "color": color,
             },
+            showlegend=False,
             legendgroup=name,
             name='{name}-trend'.format(name=name)
         )
@@ -193,20 +194,18 @@ def _generate_trending_traces(in_data, job_name, build_info,
         y=anomalies_avgs,
         mode='markers',
         hoverinfo="none",
-        showlegend=True,
+        showlegend=False,
         legendgroup=name,
         name="{name}-anomalies".format(name=name),
         marker={
             "size": 15,
             "symbol": "circle-open",
             "color": anomalies_colors,
-            "colorscale": [[0.00, "grey"],
-                           [0.25, "grey"],
-                           [0.25, "red"],
-                           [0.50, "red"],
-                           [0.50, "white"],
-                           [0.75, "white"],
-                           [0.75, "green"],
+            "colorscale": [[0.00, "red"],
+                           [0.33, "red"],
+                           [0.33, "white"],
+                           [0.66, "white"],
+                           [0.66, "green"],
                            [1.00, "green"]],
             "showscale": True,
             "line": {
@@ -221,8 +220,8 @@ def _generate_trending_traces(in_data, job_name, build_info,
                     "size": 14
                 },
                 "tickmode": 'array',
-                "tickvals": [0.125, 0.375, 0.625, 0.875],
-                "ticktext": ["Outlier", "Regression", "Normal", "Progression"],
+                "tickvals": [0.167, 0.500, 0.833],
+                "ticktext": ["Regression", "Normal", "Progression"],
                 "ticks": "",
                 "ticklen": 0,
                 "tickangle": -90,

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.