$ show melihcolpan/MuscleMap
MuscleMap is a SwiftUI SDK for rendering interactive human body muscle maps with highlighting, heatmaps, and gesture support. It provides male and female body models in front and back views, supports tap/long-press/drag interactions, pinch-to-zoom, multi-select with undo/redo, pulse animations, and extensive localization (11 languages). Built entirely in SwiftUI with zero external dependencies, it uses SVG path parsing for precise muscle rendering and offers both SwiftUI and UIKit interfaces.
The LLM identified 4 files worth highlighting for reuse:
A robust SVG path parser that handles all SVG path commands (M, L, H, V, C, S, Q, T, A, Z) with proper relative/absolute coordinate management, scientific notation parsing, and whitespace tolerance. Demonstrates non-trivial parsing skill with clean state management and error resilience.
A thread-safe path cache that prevents redundant SVG path parsing by caching paths based on their source string, scale, and offset. Uses NSLock for thread safety and generates smart cache keys incorporating all variables that affect path rendering. Demonstrates effective performance optimization with minimal coupling.
Implements color interpolation for heatmaps with multiple curves (linear, easeIn, easeOut, easeInOut, step, custom) and proper clamping. The easeInOut implementation shows particular mathematical sophistication. Demonstrates strong understanding of color theory and interpolation techniques in a highly reusable, decoupled component.
A clean implementation of undo/redo functionality for muscle selections using the command pattern with a bounded history stack. Properly clears redo stack on new actions and uses @Observable for modern SwiftUI integration. Demonstrates applied software engineering principles in a data-focused context.