fix line alignment - #121
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ran terminal command: git status --short && echo === && git --no-pager diff --stat HEAD
Ran terminal command: git --no-pager diff HEAD -- mudmaker.html assets/js/mudmaker-visualizer.js | head -120
Ran terminal command: git log --oneline -20 && echo === && git --no-pager log HEAD..origin/HEAD --oneline 2>/dev/null; git --no-pager log origin/HEAD..HEAD --oneline 2>/dev/null; git branch --show-current
Here's the PR text, scoped to the changes on
fix-line-alignment:Title
visualizer: fix cloud/label collisions when there are many internet endpointsSummary
When a device has 5+ internet endpoints (e.g. the Philips Hue Bridge from the IoT Sentinel captures, which has 6), the visualizer collapsed them into a single vertical column at
x=750with only ~52 units between clouds. That triggered two bugs:radius + 24) landed the label past the visual midpoint between consecutive clouds — so cloud N's label was drawn 26 units above cloud N+1's icon (only 4 units of clearance) and just 12 units below cloud N's own icon. Visually the topmost cloud looked unlabeled because its label was drawn on top of the cloud below it.Fix
mudmaker-visualizer.js:
drawNode(): label offset reduced fromradius + 24→radius + 6(and subtitle from+43→+25). Labels now sit visually attached to their own node, not adrift between two nodes.endpointPositions()for internet endpoints: computes a per-row minimum gap of 82 units (enough that a cloud's label rectangle never overlaps the next cloud's icon), spreads a single column across the available vertical range, and wraps to a vertically-interleaved second column (column = index % totalColumns) only when the count exceeds what fits — the interleave guarantees labels in adjacent columns never share a horizontal band.0 0 900 620→0 0 900 720(in mudmaker.html).444→544(bottom moves from y=522 to y=622).Files changed