Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
UTI: PoC - Make detailed hover information copyable
[csit.git]
/
resources
/
tools
/
dash
/
app
/
pal
/
trending
/
layout.py
diff --git
a/resources/tools/dash/app/pal/trending/layout.py
b/resources/tools/dash/app/pal/trending/layout.py
index
6369a02
..
6be71ac
100644
(file)
--- 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
import pandas as pd
from dash import dcc
@@
-173,6
+174,18
@@
class Layout:
)
],
type="circle"
)
],
type="circle"
+ ),
+ html.Div(
+ children=[
+ dcc.Markdown("""
+ **Metadata**
+
+ Click on data points in the graph.
+ """),
+ html.Pre(
+ id="hover-metadata"
+ )
+ ]
)
],
style={
)
],
style={
@@
-569,3
+582,12
@@
class Layout:
}
return (no_update, store_sel, _list_tests(),
no_update, no_update, no_update, style)
}
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)