Skip to content
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

Refactor show graph, allow for explicit calling of formats, add interactive widget for Jupyter #176

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

timkpaine
Copy link
Member

@timkpaine timkpaine commented Mar 29, 2024

As per title.

Allows for explicit calling of:

  • show_graph_pil
  • show_graph_graphviz

Adds:

  • show_graph_widget: uses ipydagred3 which was written explicitly for use with csp

Modifies:

  • show_graph to check if in Jupyter, and if so, either use the new widget display or return the Digraph for inline viewing

tmp

A small unrelated change is included: Replacing base Exception in symphony.py and profiler.py with RuntimeError and ModuleNotFoundError, respectively.

@timkpaine timkpaine added the type: enhancement Issues and PRs related to improvements to existing features label Mar 29, 2024
@timkpaine
Copy link
Member Author

timkpaine commented Mar 29, 2024

It takes longer to create the graph widget, but once created, it renders much faster.

Using the 16 bit nand computer as an example "large" graph, Preview has issues showing the png, whereas the widget displays it fluidly. Note that the blurring and tearing is NOT gif recording artifacts, but due to Preview. During the mouse shaking, Preview is frozen (the spinning pinwheel is displayed but doesn't show on the recording).

tmp

@timkpaine timkpaine force-pushed the tkp/graphvisua branch 2 times, most recently from 723d2bc to c1d7eae Compare May 8, 2024 14:58
@timkpaine timkpaine force-pushed the tkp/graphvisua branch 2 times, most recently from b4b4cb0 to ae89775 Compare May 11, 2024 18:09
@timkpaine
Copy link
Member Author

Note that I'm planning on moving this to daggre so that we can use the interactive visualization outside of Jupyter.

csp/showgraph.py Outdated
image.show()


def show_graph_graphviz(graph_func, *args, graph_filename=None, interactive=False, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interactive is unused

@timkpaine timkpaine marked this pull request as draft March 1, 2025 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Issues and PRs related to improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants