-
Notifications
You must be signed in to change notification settings - Fork 93
[fix] Prevent Overlapping of Clusters in netjsongraph.js #171 #349
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
base: master
Are you sure you want to change the base?
Conversation
- 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.
This reverts commit f314caa.
This reverts commit c02b4ad.
This reverts commit 659b2d6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has slipped my attention, the notification for this was buried among many other notifications. That's why it's good to let us know about your work in the dev chat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the PR description you mention a test file called cluster_overlap_test.html
, which I see you have removed. What type of problem where you having with this? I think such a test file to compare the behavior of this branch with master and verify whether the situation really improves is quite useful.
Thanks for the review @nemesifier! The cluster_overlap_test.html file was initially created to visualize the issue, but I removed it since I thought it wasn't necessary after fixing the overlap problem. However, I see your point—it could be useful for verifying improvements. I can reintroduce it and ensure it effectively compares the branch behavior with master. Let me know if you'd like any specific tests included! |
This reverts commit 61fe412.
Hi @nemesifier , I've made the requested changes: ✅ Moved netjson-cluster-overlap.html to /public/example_templates for consistency. Let me know if you need any further modifications or if you'd like me to proceed with replacing the current clustering example with this one. Thanks for your feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @nemesifier I’ve fixed the issue. The error occurred because the requested file was not being served correctly. I’ve updated Let me know if you still encounter any issues! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if I am doing something wrong but this isn't working for me, here's what I see:
netjsongraphjs-clustering-pr.webm
@niteshsinha17 do you see a different situation or do you get the same result I get?
![]() It looks like the @nemesifier, are you running |
@nemesifier I am getting this result. Seems something is wrong. I will look into PR in detail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done a very basic review for now. The graph is not rendering properly.
Check this comment, here @nemesifier
has mentioned about an example that needs to be added. #239 (review)
Hey @niteshsinha17 , let me know if any other changes are needed 😁 |
@cestercian It's really good you are putting efforts. But I am interested in knowing your observations and reasoning behind your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would group all the clustering docs into a single section coming just before "Example Usage". The rest looks good to me but I'm trying to spare some time to do a complete round of testing before merging.
This reverts commit 12b3437.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While testing openwisp/openwisp-monitoring#668 on demo I see that there's overlapping clusters:
demo.webm
Will DM you to show you this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
denmark.webm
This reverts commit a53f590.
prevented cluster overlap by repling clusters
cluster.june.2.movLogic Changes for Cluster SeparationEnhanced Cluster Logic:
|
Refined clustering logic and removed previous changes
Updated test cases for the new clustering logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great progress @cestercian! 👍
Problem found during testing: the green cluster overlapped the non clustered point.
clustering-04-june-2025.webm
When calculating whether we should move the cluster, can you take into account also non clustered points to avoid this? I guess if there were 2 yellow points we would have got a cluster and it would have worked normally, but we won't always have clusters, some times as in this case we will have only 1 point of a specific color and we don't want to hide it below the clusters.
updated clustering logic to form cluster even on single nodes
Hey @nemesifier , I've updated the clustering logic to form clusters even for single nodes and added test cases to cover this change. |
Checklist
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:
KDBush
to optimize clustering performance.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