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

feat: add d3-force to push away overlapped pods #245

Merged
merged 1 commit into from
Apr 29, 2023

Conversation

lihebi
Copy link
Collaborator

@lihebi lihebi commented Apr 29, 2023

It uses d3-force and its forceCollide function. It can be triggered with the "auto force" command in the command palette (cmd+k or ctrl+k).

TODOs:

  • forceCollide assumes the pods are circle, but we have rectangle. So collision detection is not ideal.
  • there should be a few more forces, but the effect was not ideal
    • a "center" force to keep pods close
    • edge force to keep connected pods close

Screenshot:

before:

Screenshot from 2023-04-28 17-28-40

After:

Screenshot from 2023-04-28 17-28-50

@lihebi lihebi linked an issue Apr 29, 2023 that may be closed by this pull request
@lihebi lihebi merged commit ead016a into codepod-io:main Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto-shovel pods/scopes that will overlap due to width/height expansion
1 participant