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

Slow performance in stack function #1233

Closed
tjohnson314 opened this issue Sep 8, 2021 · 3 comments · Fixed by #1281
Closed

Slow performance in stack function #1233

tjohnson314 opened this issue Sep 8, 2021 · 3 comments · Fixed by #1281
Labels

Comments

@tjohnson314
Copy link

I tried turning on stacking for a timeline with a few hundred events. But the timeline no longer renders smoothly while I zoom in.

I checked the code, and the stack function is pretty inefficient. Each time it adds a new item, it checks for collisions with every other item. If it finds a collision, it tries shifting the new item to the next row, and checks for collisions with every item again. If the number of rows required is large, that's an O(n^3) algorithm.

There's a greedy algorithm for this that's O(n log n) instead - see the notes on interval partitioning here: https://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/04GreedyAlgorithms-2x2.pdf.

If you'd like, I can try fixing this myself and sending a pull request.

@smee
Copy link
Contributor

smee commented Sep 23, 2021

That would be great! Maybe you can get some insights from the previous efforts in this forks PR: yotamberk/timeline-plus#26

@avbdr
Copy link

avbdr commented Nov 2, 2021

Gentlemen, I am interested in resolving this issue and Im up on paying for this improvement. Is anybody available to make a bugfix for this?

Sometimes I have very large charts (40-50 separate lines with about 1000 elements in each ) with thousands of items to display and page gets completely unresponsive.
image

@vis-bot
Copy link
Collaborator

vis-bot commented Nov 6, 2021

🎉 This issue has been resolved in version 7.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants