aboutsummaryrefslogtreecommitdiffstats
path: root/resources
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 13:46:40 +0200
commit08f078f5722d7c171ee83e92fdf8642fa441e8bd (patch)
treeca245dab690b68cc9ff598186669c0e663a1c9ef /resources
parent06785b385fb4acf5fd5f20ce3ee7a46e0b863c06 (diff)
Report: NFV Graphs
Change-Id: I0f395d4bd2ec090e55f6650ea9042a77e82ead4d Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources')
-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)