Skip to content

Brutally truncate enormous object dumps, for tooltip purposes #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions graphtik/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def make_data_value_tooltip(plot_args: PlotArgs):
tooltip = f"({type(val).__name__}, shape: {val.shape}) {val}"
else:
tooltip = f"({type(val).__name__}) {val}"
return quote_html_tooltips(tooltip)
return quote_html_tooltips(tooltip[:4095])


def make_overwrite_tooltip(plot_args: PlotArgs):
Expand All @@ -481,7 +481,7 @@ def make_overwrite_tooltip(plot_args: PlotArgs):
val = plot_args.solution.overwrites[node]
val_str = "\n ".join(f"{i}. {v}" for i, v in reversed(list(enumerate(val))))
tooltip = f"(x{len(val)} overwrites) {val_str}"
return quote_html_tooltips(tooltip)
return quote_html_tooltips(tooltip[:4095])


def make_op_prune_comment(plot_args: PlotArgs):
Expand Down