Skip to content

Commit 1b49f31

Browse files
committed
enh(plot) Shape in data-tooltips
1 parent af81d07 commit 1b49f31

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

graphtik/plot.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,12 @@ def make_data_value_tooltip(plot_args: PlotArgs):
415415
node = plot_args.nx_item
416416
assert node in plot_args.solution
417417
val = plot_args.solution[node]
418-
tooltip = "(None)" if val is None else f"({type(val).__name__}) {val}"
418+
if val is None:
419+
tooltip = "(None)"
420+
elif hasattr(val, "shape"):
421+
tooltip = f"({type(val).__name__}, shape: {val.shape}) {val}"
422+
else:
423+
tooltip = f"({type(val).__name__}) {val}"
419424
return quote_html_tooltips(tooltip)
420425

421426

0 commit comments

Comments
 (0)