Thank you for considering contributing! This guide will get you set up quickly.
git clone https://github.com/abdofallah/MuscleMapJS.git
cd MuscleMapJS
npm install
npm run dev # starts Vite dev server at http://localhost:5173/demo/index.html
npm run typecheck # run TypeScript type checksrc/
index.ts ← Public API exports
types.ts ← All TypeScript interfaces and type unions
core/
body-renderer.ts ← Canvas2D rendering engine + hit-testing
body-path-data.ts ← Path data provider + ViewBox configs
muscles.ts ← Muscle hierarchy, sub-groups, display names
data/
male-front-paths.ts
male-back-paths.ts
female-front-paths.ts
female-back-paths.ts
heatmap/
color-scale.ts ← HeatmapColorScale class + 6 presets
color-interpolation.ts
styles/
body-view-style.ts ← 4 style presets
utils/
color.ts ← parseColor, interpolateColor, toCSSColor
widget/
muscle-map-widget.ts ← Main public widget (primary entry point)
heatmap-legend.ts ← Standalone legend component
i18n/
locales.ts ← 11 locale translations
- TypeScript strict mode — no
anyunless absolutely necessary - Prefer private class fields for internal state
- Use
readonlyfor constants - Document public methods with JSDoc comments
- Check the existing SwiftUI SDK to maintain parity
- Add the relevant TypeScript types to
src/types.ts - Implement in the appropriate module
- Export from
src/index.ts - Add a usage example in
demo/index.html
- Open
src/i18n/locales.ts - Add your locale code to the
Localetype union - Add translations for all 36 muscles and the 7 UI strings
- Open a PR
Please include:
- Browser and version
- Steps to reproduce
- Expected vs actual behavior
- A minimal code example
By contributing, you agree that your contributions will be licensed under the MIT License.