How viable is it to use membrane to draw something like a DAG?
I think I got nerd sniped
You can check out my force atlas implementation that is part of my fermor graph library. It's a bit different from other force layout algos, though. It goes through a few modes in sequence, but it gets excellent results for graphs of up to a few thousand nodes. Graphs with < 100 nodes are laid out pretty much instantly. It's still on a branch because I've got some improvements still in store when I get time, but it works fine as-is. https://github.com/pangloss/fermor/blob/force-atlas/src/fermor/force_atlas.clj
@smith.adriane this is so cool!
works surprisingly well given how little code and naive it is.
@darrickw’s implementation is probably much better. I'll have to try it out!
dude that's amazing
I've been doing it for a project I'm working full time on, with webgl backend, feel free to dm altho obviously phronmo understands membrane better
I had a small number of nodes with a lot of detail and wrote a wrapper around webcola but then realized that whilst I had a DAG, I could jam it into a grid layout and then "jiggle it" and that for me was easier/better than adding a million constraints to a constraint based layout,
nothing too special, but the code is here, https://github.com/phronmophobic/graph.force-layout
@darrickw, I'm trying out your fermor example and had a few questions
1. Is there an idiomatic way to get a sequence of edges from a graph?
2. What are edge labels? It looks like they're required when using add-edge(s)
😮 the UI slowness problem I had in the past is back
@smith.adriane Awesome! I'm happy to help.
I just cloned the repo and ran the example
Let me move this to a new thread
It should be pretty straightforward. Right now, the draw functions for ellipses/circles aren't implemented since they rarely show up in UIs, but it would be easy to add if you need it. There's also not currently any builtins for arrows, but that would also be pretty easy to include. If there's anything else that might be missing, I can probably add it pretty quickly.
a layout engine 🙂
specifically, I want to visualize an interaction net https://raw.githubusercontent.com/moonad/Assets/master/images/inet-simulation.gif
So layouts need to change pretty often, with an understanding that nodes have specific ports
Do you have something specific in mind when you say layout engine?
I've thought about best way to layout graphs. Either implementing c bindings to graphviz or implementing some of the layouts in pure clojure
I want to visualize graph reduction, so nodes and edges will get dynamically destroyed and created, and the graph will have to be drawn pretty readably each time
A layout engine in clojure shouldn't be hard https://github.com/brunomnsilva/JavaFXSmartGraph
Yea. I don't think it should be too bad. I was going to mention force directed as getting pretty good results and not needing a lot of code.
There's also a bunch of js graph layout libs that shouldn't be that hard to translate.