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

[Fix] Prevent Overlapping of Clusters in netjsongraph.js (#171) #349

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

cestercian
Copy link
Contributor

@cestercian cestercian commented Mar 12, 2025

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #171

Description of Changes

This PR addresses issue #171 by preventing the overlapping of clusters in the netjsongraph.js visualization.

Changes Implemented:

  • Introduced spatial indexing using KDBush to optimize clustering performance.
  • Implemented grouping of nodes based on proximity and clustering attributes.
  • Modified cluster assignment logic to prevent overlapping.
  • Updated centroid calculations for accurate cluster placement.
  • Ensured better handling of non-clustered nodes.

Testing

A test file (cluster_overlap_test.html) was created to visualize and verify the clustering behavior. The test file simulates overlapping nodes with different statuses and ensures they are properly clustered without overlaps.

Screenshot

image

- Remove redundant font-family declarations on the body and standardize to "sans-serif"
- Update .iconfont declarations to include a serif fallback for better compatibility
- Replace "0px" with "0" for margin properties for consistency
- Improve overall formatting and structure for maintainability
This file is for testing purposes only and helps in identifying and reproducing the problem so that potential solutions can be explored.
@niteshsinha17 niteshsinha17 self-requested a review March 17, 2025 15:06
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.

[change] Prevent overlapping of clusters
1 participant