re-frame

tatut 2025-09-11T05:14:14.523819Z

is there a tool to get a visual graph of the signal graph? like graphviz dot

jba 2025-09-24T09:00:37.906219Z

Maybe https://github.com/ertugrulcetin/re-frame-flow?

tatut 2025-09-24T09:30:55.312559Z

afaict from the documentation that works for fx dispatching, but not drawing subscription dependency trees

Kimo 2025-09-24T09:41:00.579679Z

Looks like re-frame-flow overrides the value of some re-frame.core fns, like reg-event-fx, so that they close over re-frame-flow's state. Then it draws a graph from that state, using https://www.npmjs.com/package/@dagrejs/dagre and https://www.npmjs.com/package/react-flow-renderer. Looks nice, works pretty cleanly.

Kimo 2025-09-24T09:44:03.808449Z

You could probably change it so that it overrides re-frame.core/subscribe in a similar way, somehow.

Kimo 2025-09-24T09:51:02.205429Z

I've been thinking about building a graph viewer for https://day8.github.io/re-frame/Flows/. I wonder if react-flow-renderer is a good tool to use here, or if I should consider something more clojure-native. Maybe use https://github.com/scicloj/clay, or extend https://github.com/clojure/core.async.flow-monitor.

Kimo 2025-09-24T10:02:05.216859Z

Even more tools... https://github.com/simongray/clojure-graph-resources

steveb8n 2025-09-24T10:10:15.881609Z

I have done this for core.async flow. It implements datafy so it was easy to load into loom and then graphviz is free. If you add datafy to reframe flow, then it would unlock this and all the loom goodies

steveb8n 2025-09-11T12:20:17.004669Z

I would use a tool like this if it existed

tatut 2025-09-11T12:52:36.732039Z

yeah, I didn't see re-frisk having this exact functionality

tatut 2025-09-11T12:58:03.153969Z

I can of course follow the keys to definitions in emacs , but a visual graph would be nice

tatut 2025-09-11T12:58:18.127739Z

to see that if I change this, then this whole subtree potentially recomputes

lassemaatta 2025-09-11T05:22:37.063539Z

I actually (tried) to write a static analyzer for re-frame subs many many years ago, back when I was learning re-frame. It produced dot, but had many caveats as it's just a static analysis of the source code so it was easy to confuse. I hesitate to provide a link as I'm not very proud of the code 🙂 These days you could probably leverage clj-kondo analysis for something like that. I know that re-frisk can visualize the sub graph, but not sure if you can export it

tatut 2025-09-11T05:28:05.877559Z

runtime is fine

tatut 2025-09-11T05:28:28.751419Z

I'll check re-frisk