aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2019-05-07 13:46:40 +0200
committerTibor Frank <tifrank@cisco.com>2019-05-07 11:48:18 +0000
commit1f40a4f1dabe5c82dc3dbd2b67ae52b2fce63d83 (patch)
tree8025f14c5b9d4adb490a77881c95fa057e757bc2
parentd98e61872b752201b6f3f4bdbf513f8b4a7181d1 (diff)
Report: NFV Graphs
Change-Id: I0f395d4bd2ec090e55f6650ea9042a77e82ead4d Signed-off-by: Tibor Frank <tifrank@cisco.com> (cherry picked from commit 08f078f5722d7c171ee83e92fdf8642fa441e8bd)
-rw-r--r--resources/tools/presentation/generator_plots.py83
1 files changed, 42 insertions, 41 deletions
diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py
index 56b9a89a91..cc9a774576 100644
--- a/resources/tools/presentation/generator_plots.py
+++ b/resources/tools/presentation/generator_plots.py
@@ -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)