membrane

Ben Sless 2022-07-11T16:53:49.816039Z

How viable is it to use membrane to draw something like a DAG?

phronmophobic 2022-07-12T20:40:01.119959Z

I think I got nerd sniped

😅 1
Darrick Wiebe 2022-07-13T01:41:07.042449Z

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

Ben Sless 2022-07-13T02:53:00.168889Z

@smith.adriane this is so cool!

phronmophobic 2022-07-13T06:45:17.772239Z

works surprisingly well given how little code and naive it is.

phronmophobic 2022-07-13T06:46:18.398399Z

@darrickw’s implementation is probably much better. I'll have to try it out!

Ben Sless 2022-07-13T06:52:32.198189Z

dude that's amazing

zimablue 2022-08-02T20:07:53.316799Z

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

👍 1
zimablue 2022-08-02T20:10:11.651029Z

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,

🎉 1
phronmophobic 2022-07-13T17:36:03.703669Z

nothing too special, but the code is here, https://github.com/phronmophobic/graph.force-layout

phronmophobic 2022-07-13T19:04:37.539049Z

@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)

Ben Sless 2022-07-13T19:09:27.095419Z

😮 the UI slowness problem I had in the past is back

Darrick Wiebe 2022-07-13T19:09:27.955049Z

@smith.adriane Awesome! I'm happy to help.

Ben Sless 2022-07-13T19:09:41.295939Z

I just cloned the repo and ran the example

Darrick Wiebe 2022-07-13T19:10:10.525829Z

Let me move this to a new thread

👍 1
phronmophobic 2022-07-11T17:17:03.690969Z

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.

Ben Sless 2022-07-11T17:23:00.110529Z

a layout engine 🙂

Ben Sless 2022-07-11T17:23:19.333589Z

specifically, I want to visualize an interaction net https://raw.githubusercontent.com/moonad/Assets/master/images/inet-simulation.gif

Ben Sless 2022-07-11T17:25:27.818219Z

So layouts need to change pretty often, with an understanding that nodes have specific ports

phronmophobic 2022-07-11T17:25:48.047199Z

Do you have something specific in mind when you say layout engine?

phronmophobic 2022-07-11T17:26:36.605559Z

I've thought about best way to layout graphs. Either implementing c bindings to graphviz or implementing some of the layouts in pure clojure

Ben Sless 2022-07-11T17:27:17.407409Z

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

Ben Sless 2022-07-11T17:28:04.618939Z

A layout engine in clojure shouldn't be hard https://github.com/brunomnsilva/JavaFXSmartGraph

phronmophobic 2022-07-11T17:29:07.028279Z

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.

phronmophobic 2022-07-11T17:29:55.958219Z

There's also a bunch of js graph layout libs that shouldn't be that hard to translate.