CitationGecko / gecko-react

Rewrite of Citation Gecko as a React app
153 stars 29 forks source link

[Suggestion] Improve/redo layouting by leveraging cola.js (WebCoLa) and/or networkVizJS? #13

Closed no-identd closed 5 years ago

no-identd commented 5 years ago

@AndrewJakubowicz has this very nice library available here:

https://github.com/AndrewJakubowicz/networkVizJS

I figure using this rather than d3 for the graph layouting might work a lot better but sadly lack time & skill to contribute such a major feature change; hence the suggestion.

Also, in lieu of (or as a first step towards?) redoing everything with networkVizJS, the library on which networkVizJS builds, @tgdwyer's cola.js, can function as a drop-in replacement of d3's graph force layouting:

https://ialab.it.monash.edu/webcola/

(One might also consider js.cytoscape.org, albeit that at least ostensibly seems like overkill, perhaps.)

barney-walker commented 5 years ago

It looks fairly straightforward to swap d3 for cola.js but on the cola.js site it says that compared to d3 "it may be less scalable to very large graphs."

As we're already limited on the scalability front (see #6) I'm inclined to stick with d3 for now but maybe I'll have an play around and see how much of a difference it makes.

no-identd commented 5 years ago

I can't say for sure about whether cola.js alone when used as a drop in replacement would scale worse, but: The majority of lag right now seems to come from the force simulation taking non-polynomial time to converge to stable positional vertice placement, which seems evident from the massive amounts of jittering. (In fact, that observation prompted me to offer the suggestion of using networkVizJS in the first place.)

I strongly suspect that at least networkVizJS should make that problem go away, but I can't say for sure if pure cola.js alone would make some, or any, difference (positive or negative) in that regard.

(Sorry for the very late response, btw.)