- style={
- "vertical-align": "top",
- "display": "none",
- "width": "80%",
- "padding": "5px"
- }
- return (no_update, store_sel, _list_tests(),
- no_update, no_update, no_update, style)
+ output.set_values({
+ "graph-tput-figure": self.NO_GRAPH,
+ "graph-lat-figure": self.NO_GRAPH,
+ "selected-tests-data": store_sel,
+ "cl-selected-options": _list_tests()
+ })
+
+ return output.value()
+
+ @app.callback(
+ Output("metadata-tput-lat", "children"),
+ Output("metadata-hdrh-graph", "children"),
+ Output("offcanvas-metadata", "is_open"),
+ Input("graph-tput", "clickData"),
+ Input("graph-latency", "clickData")
+ )
+ def _show_tput_metadata(tput_data, lat_data) -> dbc.Card:
+ """
+ """
+ if not (tput_data or lat_data):
+ raise PreventUpdate
+
+ metadata = no_update
+ graph = list()
+
+ trigger_id = callback_context.triggered[0]["prop_id"].split(".")[0]
+ if trigger_id == "graph-tput":
+ title = "Throughput"
+ txt = tput_data["points"][0]["text"].replace("<br>", "\n")
+ elif trigger_id == "graph-latency":
+ title = "Latency"
+ txt = lat_data["points"][0]["text"].replace("<br>", "\n")
+ hdrh_data = lat_data["points"][0].get("customdata", None)
+ if hdrh_data:
+ graph = [dcc.Graph(
+ id="hdrh-latency-graph",
+ figure=graph_hdrh_latency(hdrh_data, self.layout)
+ ), ]
+
+ metadata = [
+ dbc.Card(
+ children=[
+ dbc.CardHeader(children=[
+ dcc.Clipboard(
+ target_id="tput-lat-metadata",
+ title="Copy",
+ style={"display": "inline-block"}
+ ),
+ title
+ ]),
+ dbc.CardBody(
+ id="tput-lat-metadata",
+ children=[txt]
+ )
+ ]
+ )
+ ]
+
+ return metadata, graph, True