Skip to content

Conversation

@WardCunningham
Copy link
Member

@WardCunningham WardCunningham commented Dec 1, 2025

Nick and I tried moving one line around and it seems to behave much better in my Solo generated test case.

This is a work in progress.

@WardCunningham WardCunningham requested a review from dobbs December 1, 2025 19:06
@WardCunningham
Copy link
Member Author

This observation was from our joint investigation last Saturday.

I have found two ways to refresh this page, one that always works and one that rarely works.
http://ward.dojo.fed.wiki/view/patterns-on-wiki-1996
° Reloading the browser tab always works.
° Jiggling the page to induce a redraw rarely works.
My pet theory now is that we're hanging on to viz that is exhausting something that eventually gets restored to make it work occasionally. Perhaps emit needs to reconstruct something that is currently being preserved through multiple calls to emit/bind.

@dobbs
Copy link
Member

dobbs commented Dec 2, 2025

I looked back at some old commits:
4873d39 I removed the <graphviz-viewer> custom element and switched from HPCC's graphviz back to viz.js.
9fd97ab I switched to a dynamic import() to fix the tests and also created initializeDraw().
#29 (comment) I specifically compared with Observable.

That prompted me to discover that Bostock found and fixed a related problem in 2018!
observablehq/graphviz#3

As such, I think we might use a similar approach here. Wrap the call to viz.renderSVGElement(dot) in a try...catch that re-initializes the viz object.

@dobbs
Copy link
Member

dobbs commented Dec 7, 2025

On closer inspection the current Observable Framework is using this code to render graphviz with a static import and a global const:
https://github.com/observablehq/framework/blob/5745573b5ccaff92e837d692e9c559993f684d28/src/client/stdlib/dot.js

It no longer has a try...catch wrapped around the renderSVGElement() call. I wonder if upgrading would be sufficient.

@dobbs
Copy link
Member

dobbs commented Dec 8, 2025

I still do not understand the mechanism of failure. However Thompson's test case seems to work with this update to a newer Graphviz.
http://wiki.dbbs.co/view/welcome-visitors/thompson.genius.ustawi.wiki/deep-truth-pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants