Hi folks. I have only recently appreciated how clever Observable is, so I may be missing some basics.
I am working with graph data models that are very nicely visualizable using graphviz/dot. However it would be so much richer if the nodes in the dot diagram could be made to interact with the rest of the notebook. For example, to show more details, state or offer interaction opportunities contextualized to one of the possibly very many nodes in a graph.
I searched the forum and couldn’t see any discussion of this. The closest was Hyperlink in Graphviz node doesn't work which is concerned with URLs being clickable.
What I have tried to do is tweak a notebook I found, such that if you click a node it will call a nominated callback. It isn’t working, but realistically I’m not going to have time to figure this out for a while so I thought I’d share the half-baked idea in case it’s interesting for others here.
My rough experiments are here: Can GraphViz dot be made more interactive? fork: with click/selection handling? / Dan Brickley / Observable
Note that I forked from a notebook which depends on the hpcc-js-wasm re-packaging of graphviz, rather than the Observable built-in. The notebook I forked from already toggles the styling of nodes, so I think it establishes the principle that such things can be exposed fully to scripting, … it’s just a matter of working out the details (and thinking about mobile/desktop/accessibility UX-level concerns).