Skip to content

Visualize deptrac layers as part of the Symfony Profiler#4

Merged
makomweb merged 23 commits intomasterfrom
martin/profiler-arch-visualization
Apr 8, 2026
Merged

Visualize deptrac layers as part of the Symfony Profiler#4
makomweb merged 23 commits intomasterfrom
martin/profiler-arch-visualization

Conversation

@makomweb
Copy link
Copy Markdown
Owner

@makomweb makomweb commented Apr 8, 2026

Takes deptrac.yaml and shows the architectural layers in the Symfony Profiler panel.

grafik

makomweb and others added 22 commits April 8, 2026 14:48
…ency arrows

- Fix Core positioned as innermost layer (was showing as outermost)
- Simplify to 4 layers: Core, Supporting, Generic, Tests
- Draw dependency arrows with different angles to avoid overlap
- Use quadratic bezier curves for arrows pointing outward
- Add visible labels and proper color coding
- Add legend with layer colors and arrow explanation
- Arrows now point from source layer to dependency layers with dashed style
- Better spacing and clearer visual hierarchy

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix layer ordering: Core innermost → Supporting → Generic → Tests outermost
- Reverse radius calculation so Core has smallest radius (innermost)
- Darken Core color to #8B1A1A (was #FF6B6B, too light)
- Update all colors with darker, more distinct palette:
  - Core: Dark Red #8B1A1A
  - Supporting: Dark Teal #1B8A7E
  - Generic: Dark Blue #0066CC
  - Tests: Orange #FF6B35
- Fix legend colors to match actual layer colors
- Fix arrow drawing logic to use corrected radius values

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…r blending

- Replace overlapping circle approach with SVG path-based annulus (ring) shapes
- Use fill-rule: evenodd to properly cut out inner circle from outer circle
- Remove opacity property that was causing color mixing from overlap
- Use innerRadius and outerRadius for proper ring geometry
- Update arrow drawing to use outerRadius for correct positioning
- Colors now display pure without blending artifacts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change arrows to start at middle of source layer and end at middle of target layer
- Use straight lines instead of curved bezier paths
- Change from dashed to solid lines (#333 dark gray)
- Remove arrowhead from start, keep only at end (triangular)
- Remove opacity and simplify arrow styling
- Spread arrows around circle using even angle distribution
- Each dependency now has clear, simple arrow pointing inward to its dependency

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 22.5 degree offset to all arrow angles to avoid 12 o'clock position
- Prevents arrows from overlapping with layer labels at top of diagram
- Arrows spread evenly around circle but skip the label zone
- Labels remain clear and unobstructed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change layer order from: Core, Supporting, Generic, Tests
- New order: Core, Generic, Supporting, Tests
- Alphabetical ordering (Core < Generic < Supporting < Tests)
- All arrows now point inward from outer layers to inner dependencies:
  - Supporting → Core, Generic (both inner)
  - Tests → Core, Generic, Supporting (all inner)
  - Core, Generic have no dependencies (innermost)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change layer order from: Core, Generic, Supporting, Tests
- New order: Core, Supporting, Generic, Tests
- Visually represents Generic as external infrastructure layer
- Supporting layer is now clearly the adapter/bridge layer
- Generic (frameworks/external) is now outer layer before Tests
- Better semantic representation of onion architecture:
  - Core: business logic (innermost)
  - Supporting: adapters bridging Core ↔ Generic
  - Generic: external frameworks (infrastructure, outer)
  - Tests: test layer (outermost)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change layer order to: Core → Supporting → Tests → Generic
- Remove Generic from Tests' allowed dependencies in deptrac.yaml
- Tests now only depend on Core and Supporting (application layers)
- Generic (external frameworks) is now outermost (infrastructure)
- Better separation: test code vs external frameworks
- Tests are application-layer tests, not meta-tests of frameworks

Architecture now represents:
  - Core: business logic (innermost, no deps)
  - Supporting: adapters/infrastructure code (depends on Core + Generic)
  - Tests: application tests (depends on Core + Supporting)
  - Generic: external frameworks (outermost, no deps)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ement

- Remove max-width, margin: auto from container div
- Remove wrapper margin: 20px 0
- Remove border, border-radius, background gradient from SVG
- Add viewBox for responsive scaling
- Add white background rectangle inside SVG for clean appearance
- SVG is now block-level with no extra spacing
- Canvas fills container without margins or padding

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…traction

- Rename class from ArchitectureVisualization to DeptracVisualization
- Refactor into private methods (_createSvg, _getColorPalette, etc.)
- Remove unnecessary complexity and improve code organization
- Move from backend/public/js to backend/assets/js/deptrac-visualization/
- Create package.json and README.md for future npm extraction
- Update template to reference new location and renamed class
- Add backward compatibility alias for old class name
- No external dependencies, pure SVG rendering
- Ready for extraction as standalone 'deptrac-visualization' npm package

Changes:
  - architecture-visualization.js → deptrac-visualization/index.js
  - 283 lines → 223 lines (cleaner, more maintainable)
  - Better separation of concerns with private methods
  - Package metadata ready for npm publication

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Keep copy in backend/assets for future npm extraction
- Copy to backend/public/js for immediate web access
- Allows script path /js/deptrac-visualization/index.js to work
- Maintains backward compatibility with current setup

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Core: #8B1A1A (dark red) → #C9A2A2 (muted mauve)
- Supporting: #1B8A7E (dark teal) → #7DB5AA (soft sage)
- Generic: #0066CC (bright blue) → #6BA3D4 (soft slate blue)
- Tests: #FF6B35 (bright orange) → #E8A968 (muted peach)
- Adjusted strokes to match desaturated palette
- Colors now have reduced saturation for lighter, gentler appearance

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add type checks for mixed types from Yaml::parseFile()
- Check is_array() before accessing deptrac key
- Check is_array() before accessing name key
- Check is_string() for layer key in ruleset loop
- Properly type-hint dependencies array construction
- Use var annotation in getDetails() to satisfy PHPStan's strict types
- All PHPStan level 8 errors resolved

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Restore correct color palette from assets version
- Core: #C9A2A2 (was #ff00dd)
- Supporting: #7DB5AA (was #ff00ddb3)
- Generic: #6BA3D4 (was #ff00dd31)
- Tests: #E8A968 (was #ff00dd6e)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.15%. Comparing base (10d476a) to head (ad9648f).
⚠️ Report is 24 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master       #4      +/-   ##
============================================
+ Coverage     37.80%   40.15%   +2.34%     
- Complexity      365      386      +21     
============================================
  Files            89       90       +1     
  Lines          1021     1061      +40     
============================================
+ Hits            386      426      +40     
  Misses          635      635              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@makomweb makomweb merged commit 1cf5220 into master Apr 8, 2026
2 checks passed
@makomweb makomweb deleted the martin/profiler-arch-visualization branch April 8, 2026 13:14
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