fix: Fix overlap issue when creating multiple tables#22
Conversation
|
@HassanBahati is attempting to deploy a commit to the Md Azizul Hakim's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@HassanBahati Thanks, and Great job! This is indeed an issue, and your PR looks good, just some things to confirm before I approve this PR
Again, thank you for your contribution. I really appreciate it |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@HassanBahati Hi, any updates from your side? I’m working on #11 and will need this feature. If I don’t hear back from you, I’ll close the PR and use your logic as a base for my fix. Thanks! |
HassanBahati
left a comment
There was a problem hiding this comment.
Hi @AHS12 , sorry been caught up late. Will resolve on here by tomorrow. Thanks!
HassanBahati
left a comment
There was a problem hiding this comment.
@AHS12 checkout the latest changes on here when you get a chance.
|
@HassanBahati Great job and thank you so much for paitently addressing my comments, I am merging your pr |
Description
When creating multiple tables in the diagram editor, new tables would overlap with existing ones because they were all positioned at the same fixed coordinates relative to the viewport center.

Brief summary of changes and motivation.
Implemented a smart positioning algorithm that automatically finds non-overlapping positions for new tables:
findNonOverlappingPositionthat checks if the default position overlaps with existing nodes and uses a spiral positioning algorithm to find alternative non-overlapping positions. Falls back to placing tables far from existing nodes if needed.Type of Change
Testing
Test Environment:
Checklist
Additional Notes
Any extra context or screenshots.