Skip to content

fix line alignment - #121

Merged
elear merged 1 commit into
mainfrom
fix-line-alignment
Jul 19, 2026
Merged

fix line alignment#121
elear merged 1 commit into
mainfrom
fix-line-alignment

Conversation

@elear

@elear elear commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

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 endpoints

Summary

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=750 with only ~52 units between clouds. That triggered two bugs:

  1. Label offset (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.
  2. Beyond the rows that fit vertically, labels were simply stacked on top of the next icon down — there was no wrap logic.

Fix

mudmaker-visualizer.js:

  • drawNode(): label offset reduced from radius + 24radius + 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.
  • Enlarged the drawing surface to make room for a comfortable 6-endpoint single column:
    • SVG viewBox 0 0 900 6200 0 900 720 (in mudmaker.html).
    • Enterprise border height 444544 (bottom moves from y=522 to y=622).
    • Legend anchor y=555 → y=655.
    • Empty-state hint text y=614 → y=714.
    • "Internet" zone label moved from mid-height (y=304) to the top-right corner (y=108) so it labels the zone instead of colliding with an endpoint row.

Files changed

  • mudmaker-visualizer.js
  • mudmaker.html

@elear
elear merged commit 8a89ab7 into main Jul 19, 2026
6 checks passed
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.

1 participant