- return None
-
- style={
- "vertical-align": "top",
- "display": "inline-block",
- "width": "80%",
- "padding": "5px"
- }
-
- fig = go.Figure()
- dates = self.data.iloc[[0], 1:].values.flatten().tolist()[::-1]
- x_data = [
- datetime(
- int(date[0:4]), int(date[4:6]), int(date[6:8]),
- int(date[9:11]), int(date[12:])
- ) for date in dates
- ]
- x_data_range = [
- date for date in x_data if date >= start and date <= end
- ]
- vpp = self.data.iloc[[1], 1:].values.flatten().tolist()[::-1]
- csit = list(self.data.columns[1:])[::-1]
- labels = list(self.data["Build Number:"][3:])
- for i in range(3, len(self.data)):
- name = _is_selected(labels[i-3], sel)
- if not name:
- continue
- y_data = [
- float(v) / 1e6 for v in \
- self.data.iloc[[i], 1:].values.flatten().tolist()[::-1]
- ]
- hover_txt = list()
- for x_idx, x_itm in enumerate(x_data):
- hover_txt.append(
- f"date: {x_itm}<br>"
- f"average [Mpps]: {y_data[x_idx]}<br>"
- f"vpp-ref: {vpp[x_idx]}<br>"
- f"csit-ref: {csit[x_idx]}"
- )
- fig.add_trace(
- go.Scatter(
- x=x_data_range,
- y= y_data,
- name=name,
- mode="markers+lines",
- text=hover_txt,
- hoverinfo=u"text+name"
- )
- )
- layout = self._graph_layout.get("plot-trending", dict())
- fig.update_layout(layout)
-
- return fig, style
+ output.set_values({
+ # "graph-tput-figure": self.NO_GRAPH,
+ # "graph-lat-figure": self.NO_GRAPH,
+ # "div-tput-style": self.STYLE_HIDEN,
+ # "div-latency-style": self.STYLE_HIDEN,
+ # "div-lat-metadata-style": self.STYLE_HIDEN,
+ # "div-download-style": self.STYLE_HIDEN,
+ "selected-tests-data": store_sel,
+ "cl-selected-options": _list_tests()
+ })
+
+ return output.value()
+
+ # @app.callback(
+ # Output("tput-metadata", "children"),
+ # Input("graph-tput", "clickData")
+ # )
+ # def _show_tput_metadata(hover_data):
+ # """
+ # """
+ # if not hover_data:
+ # raise PreventUpdate
+
+ # return hover_data["points"][0]["text"].replace("<br>", "\n")
+
+ # @app.callback(
+ # Output("graph-latency-hdrh", "figure"),
+ # Output("graph-latency-hdrh", "style"),
+ # Output("lat-metadata", "children"),
+ # Input("graph-latency", "clickData")
+ # )
+ # def _show_latency_hdhr(hover_data):
+ # """
+ # """
+ # if not hover_data:
+ # raise PreventUpdate
+
+ # graph = no_update
+ # hdrh_data = hover_data["points"][0].get("customdata", None)
+ # if hdrh_data:
+ # graph = graph_hdrh_latency(hdrh_data, self.layout)
+
+ # return (
+ # graph,
+ # self.STYLE_INLINE,
+ # hover_data["points"][0]["text"].replace("<br>", "\n")
+ # )
+
+ # @app.callback(
+ # Output("download-data", "data"),
+ # State("selected-tests", "data"),
+ # Input("btn-download-data", "n_clicks"),
+ # prevent_initial_call=True
+ # )
+ # def _download_data(store_sel, n_clicks):
+ # """
+ # """
+
+ # if not n_clicks:
+ # raise PreventUpdate
+
+ # df = pd.DataFrame()
+ # for itm in store_sel:
+ # sel_data = select_trending_data(self.data, itm)
+ # if sel_data is None:
+ # continue
+ # df = pd.concat([df, sel_data], ignore_index=True)
+
+ # return dcc.send_data_frame(df.to_csv, "trending_data.csv")