tgdwyer / WebCola

Javascript constraint-based graph layout
http://marvl.infotech.monash.edu/webcola/
MIT License
2.01k stars 257 forks source link

Using cola algorithm without d3 dependency to compute the co-ordinates #261

Open damodharanj opened 6 years ago

damodharanj commented 6 years ago

I have a situation where I would like to use tree constrained layout for computing the 2d co-ordinates for my graphs. But I don't want to use d3. Is it possible with the current architecture of webcola?

jaminellis commented 5 years ago

I am currently using it with VueJS, without d3, so this is definitely possible.

lksnmnn commented 5 years ago

Could you elaborate how you are using it exactly? I am currently trying to combine VueJs and WebCola.

I like the idea that Vue takes care of data flow / state and the DOM while I use WebCola for layouting (instead of d3-force).

Edit: after a long stretch of unsuccessful attempts, browser crashes and weird behaviour I got it to work quite well. I guess there is still room for improvement especially towards reactivity of the graph and vue's livecycle methods.

I can't share the project right now as it is my bachelor thesis, but I will link it as soon as I am done.

kmannislands commented 5 years ago

For future readers, I found this a little challenging to figure out from just the provided examples until I had a look at the headless tests and then it became much more clear.

Wrote some react bindings that I suppose could become OSS if there is any interest.

pinyin commented 4 years ago

@lksnmnn @kmannislands May I ask if your codes are open sourced by now? I'm also trying to use this project without d3.

lksnmnn commented 4 years ago

I couldn't get it to work the way I wanted after all, so I switched completely to D3's force simulation to create the layouts for my application. I still use Vue for templating and DOM generation.

WebCoLa still has some nice features my layout is lacking atm (mostly grouping related constraints) and is probably faster when setup correctly. Maybe I will circle back to it in the future.