Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed-up layout computation. #47

Merged
merged 1 commit into from Dec 12, 2017

Conversation

Projects
None yet
2 participants
@thocevar
Copy link
Contributor

commented Dec 11, 2017

Problem:
Computation of node positions with the Fruchterman-Reingold force-directed layout method presented a bottleneck in the Network Explorer widget.

Solution:

  • Use a sample/subset of nodes to estimate repulsive forces acting on each node. Experiments showed similar resulting layouts (with a significantly lower runtime).
  • Introduce callback_rate parameter to detach the number of callbacks from the number of iterations of the layout algorithm.

Result:
Continuous drawing of calculated node positions is a new bottleneck. It can be mitigated with the use of callback_rate.

@@ -173,7 +173,7 @@ def on_tab_changed(index):

self.relayout_button = gui.button(box, self, 'Re-layout',
callback=self.relayout, autoDefault=False)
self.view.positionsChanged.connect(lambda _: self.progressbar.advance())
self.view.positionsChanged.connect(lambda positions, progress: self.progressbar.set(progress))

This comment has been minimized.

Copy link
@kernc

kernc Dec 11, 2017

Member

Got:

AttributeError: 'ProgressBar' object has no attribute 'set'

@thocevar thocevar force-pushed the thocevar:explorer branch from bae55ad to 3aad398 Dec 12, 2017

@kernc kernc force-pushed the thocevar:explorer branch from 3aad398 to bbf2e57 Dec 12, 2017

@kernc kernc force-pushed the thocevar:explorer branch from bbf2e57 to 12837a3 Dec 12, 2017

@kernc

This comment has been minimized.

Copy link
Member

commented Dec 12, 2017

I don't notice much difference but understand it should be there. It works.

I made the adaptation of callback_rate=.25 as replotting even iterations results in smoother animation.

@kernc kernc merged commit 01821c8 into biolab:master Dec 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.