csp icon indicating copy to clipboard operation
csp copied to clipboard

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

Open timkpaine opened this issue 1 year ago • 2 comments

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 avatar Mar 29 '24 22:03 timkpaine

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 avatar Mar 29 '24 23:03 timkpaine

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

timkpaine avatar May 11 '24 18:05 timkpaine