anvaka / VivaGraphJS

Graph drawing library for JavaScript
Other
3.76k stars 425 forks source link

attempting to use ngraph.remove-overlaps fails because of outdated dependencies #203

Open rodneyrehm opened 7 years ago

rodneyrehm commented 7 years ago

First of all: thank you for all of ngraph!

I'm currently looking into rendering a network graph and the youtube and amazon (source not found) examples have come the closest to what I want to have visually. The main problem with most of the other examples I've played with was overlapping nodes.

When loading ngraph.remove-overlaps (which sadly is CommonJS only) and applying it VivaGraphJS via removeOverlaps(layout, {active: true}) I get Uncaught TypeError: layout.on is not a function, presumably because the current VivaGraph 0.8.3 is using old versions (v0.0.21 vs v0.1.2). Is VivaGraph intentionally using outdated dependencies?

anvaka commented 7 years ago

Thanks for pointing this out. I updated the force layout to the latest version, so it should be compatible with ngraph.remove-overlaps.

I have to warn though, that overlap removal is a CPU intensive process. It would probably be better to not use { active: true }. Instead, call it just once, when your layout is almost stable.