aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/dash/app/pal/trending/layout.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2022-03-31 08:43:15 +0200
committerTibor Frank <tifrank@cisco.com>2022-04-01 06:02:37 +0000
commite972e67afac3ab3eb785668d01d3bdf1833eade9 (patch)
treed66073d93f65968091f142c3c92d7ea3cc9508cb /resources/tools/dash/app/pal/trending/layout.py
parentfbe38103754d5d572267d78ee5a25e2ecb8c6118 (diff)
UTI: PoC - Make detailed hover information copyable
Change-Id: Ib313d6289412b921caa528c3984a640c3e4862eb Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/dash/app/pal/trending/layout.py')
-rw-r--r--resources/tools/dash/app/pal/trending/layout.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/resources/tools/dash/app/pal/trending/layout.py b/resources/tools/dash/app/pal/trending/layout.py
index 6369a027cf..6be71ace15 100644
--- a/resources/tools/dash/app/pal/trending/layout.py
+++ b/resources/tools/dash/app/pal/trending/layout.py
@@ -15,6 +15,7 @@
"""
+import json
import pandas as pd
from dash import dcc
@@ -173,6 +174,18 @@ class Layout:
)
],
type="circle"
+ ),
+ html.Div(
+ children=[
+ dcc.Markdown("""
+ **Metadata**
+
+ Click on data points in the graph.
+ """),
+ html.Pre(
+ id="hover-metadata"
+ )
+ ]
)
],
style={
@@ -569,3 +582,12 @@ class Layout:
}
return (no_update, store_sel, _list_tests(),
no_update, no_update, no_update, style)
+
+ @app.callback(
+ Output("hover-metadata", "children"),
+ Input("graph", "clickData")
+ )
+ def _show_metadata(hover_data):
+ if not hover_data:
+ raise PreventUpdate
+ return json.dumps(hover_data, indent=2)