Report: NFV Graphs 06/19406/1
authorTibor Frank <tifrank@cisco.com>
Tue, 7 May 2019 11:46:40 +0000 (13:46 +0200)
committerTibor Frank <tifrank@cisco.com>
Tue, 7 May 2019 11:46:40 +0000 (13:46 +0200)
Change-Id: I0f395d4bd2ec090e55f6650ea9042a77e82ead4d
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_plots.py

index 56b9a89..cc9a774 100644 (file)
@@ -1513,49 +1513,50 @@ def plot_service_density_heatmap_compare(plot, input_data):
     for c in range(len(txt_chains)):
         hover_line = list()
         for n in range(len(txt_nodes)):
-            if data_r[c][n] is not None:
-                data_point = dict(
-                    x=n+1,
-                    y=c+1,
-                    xref="x",
-                    yref="y",
-                    xanchor="center",
-                    yanchor="middle",
-                    text=str(data_r[c][n]) if data_r[c][n] is not None else "",
-                    font=dict(
-                        size=14,
-                    ),
-                    align="center",
-                    showarrow=False
-                )
-                annotations_r.append(deepcopy(data_point))
-                data_point["text"] = str(data_c[c][n]) \
-                    if data_c[c][n] is not None else ""
-                annotations_c.append(deepcopy(data_point))
-                data_point["text"] = str(diff[c][n]) \
-                    if diff[c][n] is not None else ""
-                annotations_diff.append(deepcopy(data_point))
-
-                hover_line.append(text.format(
-                    name=vals[txt_chains[c]][txt_nodes[n]]["name"],
+            point = dict(
+                x=n + 1,
+                y=c + 1,
+                xref="x",
+                yref="y",
+                xanchor="center",
+                yanchor="middle",
+                text="",
+                font=dict(
+                    size=14,
+                ),
+                align="center",
+                showarrow=False
+            )
+
+            point["text"] = "" if data_r[c][n] is None else str(data_r[c][n])
+            annotations_r.append(deepcopy(point))
+
+            point["text"] = "" if data_c[c][n] is None else str(data_c[c][n])
+            annotations_c.append(deepcopy(point))
+
+            point["text"] = "" if diff[c][n] is None else str(diff[c][n])
+            annotations_diff.append(deepcopy(point))
+
+            hover_line.append(text.format(
+                name=vals[txt_chains[c]][txt_nodes[n]]["name"],
+                title_r=plot["reference"]["name"],
+                text_r=text_r.format(
+                    val_r=data_r[c][n],
+                    stdev_r=vals[txt_chains[c]][txt_nodes[n]]["stdev_r"],
+                    nr_r=vals[txt_chains[c]][txt_nodes[n]]["nr_r"]
+                ) if data_r[c][n] is not None else "Test Failed",
+                title_c=plot["compare"]["name"],
+                text_c=text_c.format(
+                    val_c=data_c[c][n],
+                    stdev_c=vals[txt_chains[c]][txt_nodes[n]]["stdev_c"],
+                    nr_c=vals[txt_chains[c]][txt_nodes[n]]["nr_c"]
+                ) if data_c[c][n] is not None else "Test Failed",
+                text_diff=text_diff.format(
                     title_r=plot["reference"]["name"],
-                    text_r=text_r.format(
-                        val_r=data_r[c][n],
-                        stdev_r=vals[txt_chains[c]][txt_nodes[n]]["stdev_r"],
-                        nr_r=vals[txt_chains[c]][txt_nodes[n]]["nr_r"]
-                    ) if data_r[c][n] is not None else "Test Failed",
                     title_c=plot["compare"]["name"],
-                    text_c=text_c.format(
-                        val_c=data_c[c][n],
-                        stdev_c = vals[txt_chains[c]][txt_nodes[n]]["stdev_c"],
-                        nr_c=vals[txt_chains[c]][txt_nodes[n]]["nr_c"]
-                    ) if data_c[c][n] is not None else "Test Failed",
-                    text_diff=text_diff.format(
-                        title_r=plot["reference"]["name"],
-                        title_c=plot["compare"]["name"],
-                        diff=diff[c][n]
-                    ) if diff[c][n] is not None else ""
-                ))
+                    diff=diff[c][n]
+                ) if diff[c][n] is not None else ""
+            ))
 
         hovertext.append(hover_line)
 

©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.