Open source · MIT

A muscle map you can tap.

Front and rear, male and female, as clean SVG. Every muscle has a stable ID and an anatomical side, so a tap becomes data your app can use.

Try it

Tap a muscle, use Tab and Enter, or search by name. Matching regions across front and rear highlight together.

Body
View
Select
Male muscle map — front and rear Interactive schematic muscle map. Left and right refer to the person, not the screen. Each named region has a stable muscle ID. Bind the provided controller or native component for tap handling. Right Sternocleidomastoid, front view Left Sternocleidomastoid, front view Right Sternocleidomastoid, front view Left Sternocleidomastoid, front view Left Trapezius, front view Right Trapezius, front view Left Anterior deltoid, front view Right Anterior deltoid, front view Right Lateral deltoid, front view Left Lateral deltoid, front view Right Pectoralis major (chest), front view Left Pectoralis major (chest), front view Right Biceps brachii, front view Left Biceps brachii, front view Right Serratus anterior, front view Left Serratus anterior, front view Right Brachialis, front view Left Brachialis, front view Right Rectus abdominis (abs), front view Left Rectus abdominis (abs), front view Right Serratus anterior, front view Left Serratus anterior, front view Right Serratus anterior, front view Left Serratus anterior, front view Right Rectus abdominis (abs), front view Left Rectus abdominis (abs), front view Right Serratus anterior, front view Left Serratus anterior, front view Left Forearm flexors, front view Right Forearm flexors, front view Right Rectus abdominis (abs), front view Left Rectus abdominis (abs), front view Right External oblique, front view Left External oblique, front view Right Rectus abdominis (abs), front view Left Rectus abdominis (abs), front view Right Tensor fasciae latae, front view Left Tensor fasciae latae, front view Right Iliopsoas (hip flexors), front view Left Iliopsoas (hip flexors), front view Right Sartorius, front view Left Sartorius, front view Right Rectus femoris, front view Left Rectus femoris, front view Right Vastus lateralis, front view Left Vastus lateralis, front view Right Hip adductors (inner thigh), front view Left Hip adductors (inner thigh), front view Right Vastus medialis, front view Left Vastus medialis, front view Right Patella / front knee, front view Left Patella / front knee, front view Right Patellar tendon / upper shin region, front view Left Patellar tendon / upper shin region, front view Right Tibialis anterior, front view Left Tibialis anterior, front view Right Gastrocnemius, front view Left Gastrocnemius, front view Left Fibularis (peroneal) group, front view Right Fibularis (peroneal) group, front view Right Soleus, front view Left Soleus, front view Left Trapezius, rear view Right Trapezius, rear view Left Trapezius, rear view Right Trapezius, rear view Left Trapezius, rear view Right Trapezius, rear view Left Lateral deltoid, rear view Right Lateral deltoid, rear view Left Posterior deltoid, rear view Right Posterior deltoid, rear view Left Posterior rotator cuff, rear view Right Posterior rotator cuff, rear view Left Triceps brachii, rear view Right Triceps brachii, rear view Left Triceps brachii, rear view Left Latissimus dorsi (lats), rear view Right Latissimus dorsi (lats), rear view Right Triceps brachii, rear view Left Triceps brachii, rear view Right Triceps brachii, rear view Left Erector spinae / lower back, rear view Right Erector spinae / lower back, rear view Left Forearm extensors, rear view Right Forearm extensors, rear view Left External oblique, rear view Right External oblique, rear view Left Gluteus medius, rear view Right Gluteus medius, rear view Left Gluteus maximus, rear view Right Gluteus maximus, rear view Left Iliotibial band region, rear view Right Iliotibial band region, rear view Left Hip adductors (inner thigh), rear view Right Hip adductors (inner thigh), rear view Right Biceps femoris, rear view Left Biceps femoris, rear view Left Medial hamstrings, rear view Right Medial hamstrings, rear view Left Back of knee (popliteal region), rear view Right Back of knee (popliteal region), rear view Left Gastrocnemius, rear view Right Gastrocnemius, rear view Left Gastrocnemius, rear view Right Gastrocnemius, rear view Right Soleus, rear view Left Soleus, rear view Left Soleus, rear view Left Achilles tendon region, rear view Right Soleus, rear view Right Achilles tendon region, rear view

Add it to your app

Copy the files you need from the muscle-map/ folder, or load the controller from a CDN. No build step, no package to install.

1. Get the files

Download the repo, or copy muscle-map/ into your project. It holds the SVGs, the controller and the JSON data.

git clone https://github.com/PerspicaciousGuy/Open-Muscle-Map.git

2. Or use the CDN

Web only. The SVGs still need to be fetched from your own server.

<script src="https://cdn.jsdelivr.net/gh/PerspicaciousGuy/Open-Muscle-Map@v1.1.0/muscle-map/muscle-map.js"></script>
<!-- Pinned to a release tag. @main always serves the latest commit and can change under you. -->

Using an AI coding agent? Jump to For AI agents.

Inline the SVG, then bind the controller. Use inline markup: an <img> shows the picture but exposes no paths to tap. Tested in a headless browser.

<div id="body-map"></div>
<script src="./muscle-map/muscle-map.js"></script>
<script>
(async () => {
  // Serve the files over HTTP; fetch() does not work from file://
  const res = await fetch('./muscle-map/male-muscle-map.svg');
  if (!res.ok) throw new Error('Could not load the muscle map');
  document.querySelector('#body-map').innerHTML = await res.text();

  const map = MuscleMap.createMuscleMap(document.querySelector('#body-map svg'), {
    multiple: true,                 // tap toggles; keep several selected
    bilateral: false,               // true: left and right select together
    onSelect: region => console.log(region.muscleId, region.side, region.view),
    onChange: selected => console.log(selected)
  });

  map.setSelected(['right:lateral_deltoid']);
  // map.setView('front'); map.clear(); map.destroy();
})();
</script>

For AI agents

A direct brief for Claude Code, Codex, Cursor and other coding agents: the rules they must not get wrong, the files to copy per platform, how to implement, and the checks that prove it works. Paste this into your agent, or give it the URL.

Read https://perspicaciousguy.github.io/Open-Muscle-Map/AGENTS.md and follow it to add the Open-Muscle-Map muscle map to this project. Run the verification steps and report what you could not test.
Read the full AGENTS.md
# Integrating Open-Muscle-Map (instructions for AI coding agents)

You are adding a tappable muscle map to someone's app. Follow this file literally. Everything you need is in `muscle-map/`. Do not redraw, flip, re-color paths in the SVG, or invent muscle names.

## 1. Facts you must not get wrong

- **Join key:** `muscleId` (for example `lateral_deltoid`). It is identical on male and female, front and rear. Map it to the app's own data. The full list is `muscle-map/muscles.json`; 32 are selectable (`selectable: true`), 5 are joints, fascia or tendons and are not.
- **Selection key:** `side:muscleId` (`right:lateral_deltoid`). In bilateral mode it is `both:muscleId`.
- **Sides are the person's, not the screen's.** Anatomical right is screen-left in the front view and screen-right in the rear view. The `side` field already accounts for this. Never mirror an SVG or swap sides.
- **One muscle is many panels.** Several drawn tiles share one `muscleId` (abs, triceps, glutes). Count muscles by `muscleId`, never by tile.
- **Inline the SVG.** An `<img>` or native image loses the per-region paths. Web and WebView use the controller; React Native uses `MuscleMap.tsx`; do not parse the SVG by hand.
- **The map is schematic.** Do not present it as medically exact. Forearm flexors and extensors, hip adductors, medial hamstrings, fibularis, posterior rotator cuff and erector spinae are groups on purpose.

## 2. Pick the path

| Target | Use | Copy these files |
|---|---|---|
| Web, any framework | `muscle-map.js` controller + inline SVG | `muscle-map.js`, `male-muscle-map.svg`, `female-muscle-map.svg` |
| React (web) | same controller inside an effect, `destroy()` on unmount | same as web |
| React Native / Expo | native component, no WebView | `MuscleMap.tsx`, `muscle-map.d.ts`, `male-map-data.json`, `female-map-data.json`; install `react-native-svg` |
| SwiftUI / WKWebView | WebView page + `muscleMap` message handler | `male-webview.html`, `female-webview.html` |
| Android WebView | WebView page + JS interface shim | `male-webview.html`, `female-webview.html` |

Code for each path is in `site/code/` (and on the live site under Guides). Start from it; adapt names and wiring to the host app.

## 3. Implement

1. Read the host app's conventions first (framework, state, styling, how assets are bundled). Match them.
2. Copy only the files for your path into the app's own folder. Keep `muscle-map/` files unmodified so they can be updated later.
3. Wire the callback: on select you receive `{ muscleId, muscleName, side, view, selected, selectionKey, ... }`. Translate `muscleId` into the app's own concept (exercise filter, heatmap key). Put that mapping in one table in the app, with an explicit entry for every selectable `muscleId` you support and a visible fallback for the rest.
4. Selected color: set the CSS variable `--muscle-active` (web) or `activeColor` (React Native). Hover and focus: `--muscle-hover`, `--muscle-focus`. Do not edit the SVG fills.
5. Heatmap: `controller.setColors({ muscleId: 0..1 | 'css colour' })` (web, WebView) or the `colors` prop (React Native, any colour string). Unknown `muscleId`s and non-finite numbers throw. Selection colour wins over heat. `clearColors()` removes them.
6. Single vs several selections: `multiple`. Left and right together: `bilateral`.

## 4. Verify (do all of it, report what you could not run)

Run these from the repo root of this project before touching the host app:

```bash
node scripts/verify-data.mjs      # SVG, JSON data, regions.json and muscles.json agree (no dependencies)
node scripts/build-site.mjs       # builds _site/ (the demo, guides and ID table)
```

Browser checks (needs `npm install --no-save playwright && npx playwright install chromium`):

```bash
node scripts/verify-browser.mjs   # selection modes, keyboard, guide snippet, phone layout, no console errors
node scripts/verify-react.mjs     # React guide built with Vite and tapped (needs network for npm install)
```

Then verify the integration in the host app:

- **Web / React:** `muscle-map.js` is a classic script with no ES exports: import it for its side effect and use `window.MuscleMap` (a default import fails under the Vite dev server). Open the page over HTTP (`fetch()` fails from `file://`). Tap a muscle: the `onSelect` payload has the expected `muscleId` and `side`. Tap a front-view and a rear-view panel of the same muscle: both highlight. Press Tab to a region, then Enter: it selects. Press Escape: it clears. Check the browser console is clean.
- **React Native:** `npx tsc --noEmit` passes (enable `resolveJsonModule`). Run on a simulator, tap, and log `region.muscleId`.
- **SwiftUI:** the snippet must compile for an iOS target (CI runs `xcrun --sdk iphonesimulator swiftc -typecheck`). Run in the simulator: the `muscleMap` handler receives `type == "musclemap:select"`. Confirm `male-webview.html` is in the app bundle's resources, or nothing loads.
- **Android:** the page must be loaded from assets; confirm `evaluateJavascript` that defines `window.ReactNativeWebView` runs after page load, then tap and check the Kotlin callback.

## 5. What has and has not been tested (do not claim more)

| Path | Status |
|---|---|
| Data consistency, controller, JavaScript guide, demo site | Tested in headless Chromium by `scripts/verify-*.mjs` (CI: `.github/workflows/verify.yml`) |
| `MuscleMap.tsx` and the React Native guide | Type-checked in CI; not run on a device |
| React guide | Built with Vite and run under both the production build and the dev server in headless Chromium by `scripts/verify-react.mjs` (CI: `verify.yml`); not run in other bundlers or frameworks |
| SwiftUI guide | Compiled by `.github/workflows/verify-swift.yml` once it has run; not run in a simulator |
| Android guide | Compiled against the Android SDK by `verify.yml` once it has run; not run on a device |

If you run a path that is listed as not run, say so in your report with the result, and fix `site/code/` if the snippet was wrong.

## 6. Common mistakes

- Expecting a white backdrop: the artwork is transparent. Give it a neutral surface, or set `[data-background] { fill: ... }` / React Native `backgroundColor`.
- Loading the SVG as `<img>`: nothing is tappable.
- Creating the controller twice on the same SVG: call `destroy()` before rebinding (React effects in strict mode do this).
- Counting `data-region-id` elements as muscles: there are 102 selectable panels but 32 muscles.
- Treating `selectable: false` entries (knee, back of knee, iliotibial band, Achilles) as muscles.
- Hard-coding hex colors in the SVG instead of the CSS variables.
- Using `@main` in a CDN URL in production: pin a tag or commit.

API

One function, MuscleMap.createMuscleMap(svg, options), returns a controller. Create it once per inline SVG.

multiple

Tap toggles a muscle and keeps the others. Default is one selection.

bilateral

Left and right select together. Keys become both:muscle_id.

onSelect(region)

Fires per tap with muscleId, side, view, selected and the full region metadata.

onChange(selected)

The logical selection, one entry per muscle, not per drawn tile.

setSelected(keys)

Select from code, for example ['right:lateral_deltoid'].

setView('both' | 'front' | 'rear')

Switch the visible side.

setColors(values)

Heatmap. { lateral_deltoid: 0.8, biceps_brachii: '#2dd4bf' }: a number from 0 to 1 is blended from blue to red (override with { low, high }), a string is used as a CSS colour. Selected muscles keep the selection colour. clearColors() removes them.

clear() destroy()

Clear the selection, or remove the listeners before rebinding.

--muscle-active

CSS variable for the selected fill. --muscle-hover and --muscle-focus cover the other states.

Anatomical right is screen-left in the front view and screen-right in the rear view. The side metadata already accounts for this, so do not flip the SVGs horizontally. TypeScript types are in muscle-map.d.ts.

Muscle IDs

Use muscleId to connect a tap to your own data, for example an exercise catalog. The IDs are the same on both bodies and both views.

NameIDGroupTypeSelectable
SternocleidomastoidsternocleidomastoidneckmuscleYes
Trapeziustrapeziusupper_backmuscleYes
Anterior deltoidanterior_deltoidshouldersmuscleYes
Lateral deltoidlateral_deltoidshouldersmuscleYes
Posterior deltoidposterior_deltoidshouldersmuscleYes
Pectoralis major (chest)pectoralis_majorchestmuscleYes
Biceps brachiibiceps_brachiiupper_armsmuscleYes
Brachialisbrachialisupper_armsmuscleYes
Serratus anteriorserratus_anteriorcoremuscleYes
Rectus abdominis (abs)rectus_abdominiscoremuscleYes
External obliqueexternal_obliquecoremuscleYes
Forearm flexorsforearm_flexorsforearmsmuscle groupYes
Tensor fasciae lataetensor_fasciae_lataehipsmuscleYes
Iliopsoas (hip flexors)iliopsoashipsmuscleYes
Hip adductors (inner thigh)hip_adductorsadductorsmuscle groupYes
SartoriussartoriushipsmuscleYes
Rectus femorisrectus_femorisquadricepsmuscleYes
Vastus lateralisvastus_lateralisquadricepsmuscleYes
Vastus medialisvastus_medialisquadricepsmuscleYes
Patella / front kneepatella_regionjointsjointNo
Tibialis anteriortibialis_anteriorshinsmuscleYes
GastrocnemiusgastrocnemiuscalvesmuscleYes
Fibularis (peroneal) groupfibularis_groupshinsmuscle groupYes
SoleussoleuscalvesmuscleYes
Posterior rotator cuffposterior_rotator_cuffupper_backmuscle groupYes
Triceps brachiitriceps_brachiiupper_armsmuscleYes
Latissimus dorsi (lats)latissimus_dorsiupper_backmuscleYes
Erector spinae / lower backerector_spinaelower_backmuscle groupYes
Forearm extensorsforearm_extensorsforearmsmuscle groupYes
Gluteus mediusgluteus_mediusglutesmuscleYes
Gluteus maximusgluteus_maximusglutesmuscleYes
Iliotibial band regioniliotibial_tractconnective_tissuefasciaNo
Biceps femorisbiceps_femorishamstringsmuscleYes
Medial hamstringsmedial_hamstringshamstringsmuscle groupYes
Back of knee (popliteal region)popliteal_regionjointsjointNo
Achilles tendon regionachilles_tendonconnective_tissuetendonNo
Patellar tendon / upper shin regionpatellar_tendon_regionconnective_tissuetendonNo

Boundaries are simplified for a fitness diagram, not a dissection atlas. Forearm flexors and extensors, hip adductors, medial hamstrings, fibularis muscles and the lumbar erectors are groups because the artwork cannot separate the individual muscles. Knee, tendon and fascia panels are drawn but not selectable. See the verification notes for what is source-backed and what is not.