@musclemap/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +34 -0
- package/dist/color-scales.d.ts +3 -0
- package/dist/color-scales.d.ts.map +1 -0
- package/dist/color-scales.js +51 -0
- package/dist/color-scales.js.map +1 -0
- package/dist/heat-colors.d.ts +20 -0
- package/dist/heat-colors.d.ts.map +1 -0
- package/dist/heat-colors.js +107 -0
- package/dist/heat-colors.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/muscle-meta.d.ts +36 -0
- package/dist/muscle-meta.d.ts.map +1 -0
- package/dist/muscle-meta.js +53 -0
- package/dist/muscle-meta.js.map +1 -0
- package/dist/types.d.ts +16 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jsplice / MuscleMap contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Scope of this license:
|
|
26
|
+
|
|
27
|
+
- The MIT license above covers EVERYTHING in this repository — all source code,
|
|
28
|
+
the SVG muscle path data in `packages/assets` (original traced vector work),
|
|
29
|
+
and the body photographs in `apps/playground/public/` (`bg-male-*.png`,
|
|
30
|
+
`bg-female-*.png`).
|
|
31
|
+
- The body photographs were generated with OpenAI image tooling (from the
|
|
32
|
+
maintainer's own prompts) and manually edited. They are released under MIT as
|
|
33
|
+
well — free to use, copy, modify, and redistribute. See ASSET_PROVENANCE.md
|
|
34
|
+
for details.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-scales.d.ts","sourceRoot":"","sources":["../src/color-scales.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgDhD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,gBAAyB,GAAG,MAAM,CAOtF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const NEUTRAL = "#334155";
|
|
2
|
+
/**
|
|
3
|
+
* Stepped color scales per model, ordered high → low. The first stop whose
|
|
4
|
+
* `min` the (clamped) score reaches wins; the trailing `min: 0` stop is the
|
|
5
|
+
* model's base color. Data-driven so each model stays a flat table.
|
|
6
|
+
*/
|
|
7
|
+
const SCALE_STOPS = {
|
|
8
|
+
LOAD: [
|
|
9
|
+
{ min: 86, color: "#ef4444" },
|
|
10
|
+
{ min: 71, color: "#f97316" },
|
|
11
|
+
{ min: 51, color: "#facc15" },
|
|
12
|
+
{ min: 31, color: "#22c55e" },
|
|
13
|
+
{ min: 11, color: "#0ea5e9" },
|
|
14
|
+
{ min: 0, color: NEUTRAL },
|
|
15
|
+
],
|
|
16
|
+
FREQUENCY: [
|
|
17
|
+
{ min: 86, color: "#ef4444" },
|
|
18
|
+
{ min: 61, color: "#f97316" },
|
|
19
|
+
{ min: 31, color: "#22c55e" },
|
|
20
|
+
{ min: 1, color: "#0ea5e9" },
|
|
21
|
+
{ min: 0, color: NEUTRAL },
|
|
22
|
+
],
|
|
23
|
+
BALANCE: [
|
|
24
|
+
{ min: 81, color: "#ef4444" },
|
|
25
|
+
{ min: 61, color: "#f97316" },
|
|
26
|
+
{ min: 46, color: "#22c55e" },
|
|
27
|
+
{ min: 31, color: "#38bdf8" },
|
|
28
|
+
{ min: 0, color: "#8b5cf6" },
|
|
29
|
+
],
|
|
30
|
+
RECOVERY_RISK: [
|
|
31
|
+
{ min: 76, color: "#ef4444" },
|
|
32
|
+
{ min: 51, color: "#f97316" },
|
|
33
|
+
{ min: 26, color: "#facc15" },
|
|
34
|
+
{ min: 0, color: "#22c55e" },
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
function clampScore(score) {
|
|
38
|
+
if (!Number.isFinite(score))
|
|
39
|
+
return 0;
|
|
40
|
+
return Math.max(0, Math.min(100, score));
|
|
41
|
+
}
|
|
42
|
+
export function getMuscleColor(score, model = "LOAD") {
|
|
43
|
+
const value = clampScore(score);
|
|
44
|
+
const stops = SCALE_STOPS[model] ?? [];
|
|
45
|
+
for (const stop of stops) {
|
|
46
|
+
if (value >= stop.min)
|
|
47
|
+
return stop.color;
|
|
48
|
+
}
|
|
49
|
+
return NEUTRAL;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=color-scales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-scales.js","sourceRoot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EAAE;QAC7B,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;QAC7B,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;QAC7B,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE;KAC7B;CACF,CAAC;AAEF,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACtC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,QAA0B,MAAM;IAC5E,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACvC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,KAAK,IAAI,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC;IAC3C,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MuscleColorModel } from "./types";
|
|
2
|
+
export type ColorStop = {
|
|
3
|
+
/** Position on the 0..1 scale. */
|
|
4
|
+
offset: number;
|
|
5
|
+
/** Hex color, e.g. "#22c55e". */
|
|
6
|
+
color: string;
|
|
7
|
+
};
|
|
8
|
+
/** Returns the gradient stops for a color model, useful for legends/defs. */
|
|
9
|
+
export declare function getColorScaleStops(model?: MuscleColorModel): ColorStop[];
|
|
10
|
+
/**
|
|
11
|
+
* Smoothly interpolated heatmap color for a 0..100 score.
|
|
12
|
+
*
|
|
13
|
+
* Unlike {@link getMuscleColor} (which returns discrete category buckets used
|
|
14
|
+
* for badges and labels), this produces the continuous fill color shown on the
|
|
15
|
+
* body, matching the premium heatmap look.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getMuscleHeatColor(score: number, model?: MuscleColorModel): string;
|
|
18
|
+
/** CSS `linear-gradient(...)` string for a model, for legend bars in any framework. */
|
|
19
|
+
export declare function getColorScaleCss(model?: MuscleColorModel, angle?: string): string;
|
|
20
|
+
//# sourceMappingURL=heat-colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heat-colors.d.ts","sourceRoot":"","sources":["../src/heat-colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG;IACtB,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA2EF,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,gBAAyB,GAAG,SAAS,EAAE,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,gBAAyB,GAAG,MAAM,CAmB1F;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,gBAAyB,EAAE,KAAK,SAAU,GAAG,MAAM,CAK1F"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
function clamp01(value) {
|
|
2
|
+
if (!Number.isFinite(value))
|
|
3
|
+
return 0;
|
|
4
|
+
return Math.max(0, Math.min(1, value));
|
|
5
|
+
}
|
|
6
|
+
function clampScore(score) {
|
|
7
|
+
if (!Number.isFinite(score))
|
|
8
|
+
return 0;
|
|
9
|
+
return Math.max(0, Math.min(100, score));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Continuous color ramps, one per color model. These drive the smooth heatmap
|
|
13
|
+
* fills and the legend gradients so both always stay in sync.
|
|
14
|
+
*
|
|
15
|
+
* - LOAD / FREQUENCY: turbo-style blue -> cyan -> green -> yellow -> orange -> red.
|
|
16
|
+
* - BALANCE: under-represented (violet/blue) -> balanced (green) -> over (red).
|
|
17
|
+
* - RECOVERY_RISK: ready (green) -> risky (red).
|
|
18
|
+
*/
|
|
19
|
+
const SCALES = {
|
|
20
|
+
LOAD: [
|
|
21
|
+
{ offset: 0.0, color: "#1e293b" },
|
|
22
|
+
{ offset: 0.12, color: "#0ea5e9" },
|
|
23
|
+
{ offset: 0.34, color: "#22d3ee" },
|
|
24
|
+
{ offset: 0.52, color: "#22c55e" },
|
|
25
|
+
{ offset: 0.68, color: "#facc15" },
|
|
26
|
+
{ offset: 0.84, color: "#f97316" },
|
|
27
|
+
{ offset: 1.0, color: "#ef4444" },
|
|
28
|
+
],
|
|
29
|
+
FREQUENCY: [
|
|
30
|
+
{ offset: 0.0, color: "#1e293b" },
|
|
31
|
+
{ offset: 0.18, color: "#0ea5e9" },
|
|
32
|
+
{ offset: 0.45, color: "#22c55e" },
|
|
33
|
+
{ offset: 0.72, color: "#f97316" },
|
|
34
|
+
{ offset: 1.0, color: "#ef4444" },
|
|
35
|
+
],
|
|
36
|
+
BALANCE: [
|
|
37
|
+
{ offset: 0.0, color: "#8b5cf6" },
|
|
38
|
+
{ offset: 0.32, color: "#38bdf8" },
|
|
39
|
+
{ offset: 0.52, color: "#22c55e" },
|
|
40
|
+
{ offset: 0.74, color: "#f97316" },
|
|
41
|
+
{ offset: 1.0, color: "#ef4444" },
|
|
42
|
+
],
|
|
43
|
+
RECOVERY_RISK: [
|
|
44
|
+
{ offset: 0.0, color: "#22c55e" },
|
|
45
|
+
{ offset: 0.4, color: "#facc15" },
|
|
46
|
+
{ offset: 0.7, color: "#f97316" },
|
|
47
|
+
{ offset: 1.0, color: "#ef4444" },
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
function hexToRgb(hex) {
|
|
51
|
+
const value = hex.replace("#", "");
|
|
52
|
+
const r = parseInt(value.slice(0, 2), 16);
|
|
53
|
+
const g = parseInt(value.slice(2, 4), 16);
|
|
54
|
+
const b = parseInt(value.slice(4, 6), 16);
|
|
55
|
+
return [r, g, b];
|
|
56
|
+
}
|
|
57
|
+
function toHex(channel) {
|
|
58
|
+
return Math.round(clamp01(channel / 255) * 255)
|
|
59
|
+
.toString(16)
|
|
60
|
+
.padStart(2, "0");
|
|
61
|
+
}
|
|
62
|
+
function mix(a, b, t) {
|
|
63
|
+
const [ar, ag, ab] = hexToRgb(a);
|
|
64
|
+
const [br, bg, bb] = hexToRgb(b);
|
|
65
|
+
const r = ar + (br - ar) * t;
|
|
66
|
+
const g = ag + (bg - ag) * t;
|
|
67
|
+
const bl = ab + (bb - ab) * t;
|
|
68
|
+
return `#${toHex(r)}${toHex(g)}${toHex(bl)}`;
|
|
69
|
+
}
|
|
70
|
+
/** Returns the gradient stops for a color model, useful for legends/defs. */
|
|
71
|
+
export function getColorScaleStops(model = "LOAD") {
|
|
72
|
+
return SCALES[model] ?? SCALES.LOAD;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Smoothly interpolated heatmap color for a 0..100 score.
|
|
76
|
+
*
|
|
77
|
+
* Unlike {@link getMuscleColor} (which returns discrete category buckets used
|
|
78
|
+
* for badges and labels), this produces the continuous fill color shown on the
|
|
79
|
+
* body, matching the premium heatmap look.
|
|
80
|
+
*/
|
|
81
|
+
export function getMuscleHeatColor(score, model = "LOAD") {
|
|
82
|
+
const t = clampScore(score) / 100;
|
|
83
|
+
const stops = getColorScaleStops(model);
|
|
84
|
+
if (t <= stops[0].offset)
|
|
85
|
+
return stops[0].color;
|
|
86
|
+
const last = stops[stops.length - 1];
|
|
87
|
+
if (t >= last.offset)
|
|
88
|
+
return last.color;
|
|
89
|
+
for (let i = 0; i < stops.length - 1; i++) {
|
|
90
|
+
const current = stops[i];
|
|
91
|
+
const next = stops[i + 1];
|
|
92
|
+
if (t >= current.offset && t <= next.offset) {
|
|
93
|
+
const span = next.offset - current.offset || 1;
|
|
94
|
+
const local = (t - current.offset) / span;
|
|
95
|
+
return mix(current.color, next.color, local);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return last.color;
|
|
99
|
+
}
|
|
100
|
+
/** CSS `linear-gradient(...)` string for a model, for legend bars in any framework. */
|
|
101
|
+
export function getColorScaleCss(model = "LOAD", angle = "90deg") {
|
|
102
|
+
const stops = getColorScaleStops(model)
|
|
103
|
+
.map((stop) => `${stop.color} ${Math.round(stop.offset * 100)}%`)
|
|
104
|
+
.join(", ");
|
|
105
|
+
return `linear-gradient(${angle}, ${stops})`;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=heat-colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heat-colors.js","sourceRoot":"","sources":["../src/heat-colors.ts"],"names":[],"mappings":"AASA,SAAS,OAAO,CAAC,KAAa;IAC5B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACtC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACtC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,GAA0C;IACpD,IAAI,EAAE;QACJ,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE;QACjC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;QAClC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;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K,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC;AACpB,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,gBAAgB,CAAC,QAA0B,MAAM,EAAE,KAAK,GAAG,OAAO;IAChF,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC;SACpC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC;SAChE,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,mBAAmB,KAAK,KAAK,KAAK,GAAG,CAAC;AAC/C,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { MuscleGroup, MuscleMapRegion, MuscleMapView } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Which body view(s) a muscle group is visible in.
|
|
4
|
+
* Some groups (side delts, forearms, calves) are visible from both sides.
|
|
5
|
+
*/
|
|
6
|
+
export type MuscleVisibility = "FRONT" | "BACK" | "BOTH";
|
|
7
|
+
export type RegionTag = Exclude<MuscleMapRegion, "FULL_BODY">;
|
|
8
|
+
export type MuscleGroupMeta = {
|
|
9
|
+
group: MuscleGroup;
|
|
10
|
+
/**
|
|
11
|
+
* Region buckets this group belongs to. A group can belong to several — e.g.
|
|
12
|
+
* the abs are part of both `UPPER_BODY` and `CORE` — so `UPPER_BODY` views
|
|
13
|
+
* include the core while a `CORE` view can still isolate it.
|
|
14
|
+
*/
|
|
15
|
+
regions: RegionTag[];
|
|
16
|
+
/** Where the muscle is anatomically rendered. */
|
|
17
|
+
visibility: MuscleVisibility;
|
|
18
|
+
/** Whether the group is drawn as a left/right pair or a single centered path. */
|
|
19
|
+
bilateral: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Single source of truth for how every muscle group maps to regions and views.
|
|
23
|
+
* Headless data only — no UI, no copy. Host apps own localized labels.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MUSCLE_GROUP_META: Record<MuscleGroup, MuscleGroupMeta>;
|
|
26
|
+
export declare const ALL_MUSCLE_GROUPS: MuscleGroup[];
|
|
27
|
+
/**
|
|
28
|
+
* Returns the muscle groups that should be rendered for a given view and region.
|
|
29
|
+
*
|
|
30
|
+
* - `view` decides which anatomical side is shown (FRONT / BACK / BOTH).
|
|
31
|
+
* - `region` narrows the set to upper body, lower body, or core.
|
|
32
|
+
*
|
|
33
|
+
* The result is stable-ordered following {@link ALL_MUSCLE_GROUPS}.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getVisibleMuscleGroups(view: MuscleMapView, region?: MuscleMapRegion): MuscleGroup[];
|
|
36
|
+
//# sourceMappingURL=muscle-meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"muscle-meta.d.ts","sourceRoot":"","sources":["../src/muscle-meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3E;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,iDAAiD;IACjD,UAAU,EAAE,gBAAgB,CAAC;IAC7B,iFAAiF;IACjF,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,WAAW,EAAE,eAAe,CAsBlE,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAAW,EAAoD,CAAC;AAYhG;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,aAAa,EACnB,MAAM,GAAE,eAA6B,GACpC,WAAW,EAAE,CAKf"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for how every muscle group maps to regions and views.
|
|
3
|
+
* Headless data only — no UI, no copy. Host apps own localized labels.
|
|
4
|
+
*/
|
|
5
|
+
export const MUSCLE_GROUP_META = {
|
|
6
|
+
CHEST: { group: "CHEST", regions: ["UPPER_BODY"], visibility: "FRONT", bilateral: true },
|
|
7
|
+
BACK_UPPER: { group: "BACK_UPPER", regions: ["UPPER_BODY"], visibility: "BACK", bilateral: true },
|
|
8
|
+
BACK_LOWER: { group: "BACK_LOWER", regions: ["UPPER_BODY", "CORE"], visibility: "BACK", bilateral: true },
|
|
9
|
+
TRAPEZIUS: { group: "TRAPEZIUS", regions: ["UPPER_BODY"], visibility: "BOTH", bilateral: true },
|
|
10
|
+
RHOMBOIDS: { group: "RHOMBOIDS", regions: ["UPPER_BODY"], visibility: "BACK", bilateral: true },
|
|
11
|
+
LATS: { group: "LATS", regions: ["UPPER_BODY"], visibility: "BACK", bilateral: true },
|
|
12
|
+
SHOULDERS_FRONT: { group: "SHOULDERS_FRONT", regions: ["UPPER_BODY"], visibility: "FRONT", bilateral: true },
|
|
13
|
+
SHOULDERS_SIDE: { group: "SHOULDERS_SIDE", regions: ["UPPER_BODY"], visibility: "BOTH", bilateral: true },
|
|
14
|
+
SHOULDERS_REAR: { group: "SHOULDERS_REAR", regions: ["UPPER_BODY"], visibility: "BACK", bilateral: true },
|
|
15
|
+
BICEPS: { group: "BICEPS", regions: ["UPPER_BODY"], visibility: "FRONT", bilateral: true },
|
|
16
|
+
TRICEPS: { group: "TRICEPS", regions: ["UPPER_BODY"], visibility: "BACK", bilateral: true },
|
|
17
|
+
FOREARMS: { group: "FOREARMS", regions: ["UPPER_BODY"], visibility: "BOTH", bilateral: true },
|
|
18
|
+
CORE: { group: "CORE", regions: ["UPPER_BODY", "CORE"], visibility: "FRONT", bilateral: false },
|
|
19
|
+
OBLIQUES: { group: "OBLIQUES", regions: ["UPPER_BODY", "CORE"], visibility: "BOTH", bilateral: true },
|
|
20
|
+
GLUTES: { group: "GLUTES", regions: ["LOWER_BODY"], visibility: "BACK", bilateral: true },
|
|
21
|
+
QUADS: { group: "QUADS", regions: ["LOWER_BODY"], visibility: "FRONT", bilateral: true },
|
|
22
|
+
HAMSTRINGS: { group: "HAMSTRINGS", regions: ["LOWER_BODY"], visibility: "BACK", bilateral: true },
|
|
23
|
+
CALVES: { group: "CALVES", regions: ["LOWER_BODY"], visibility: "BOTH", bilateral: true },
|
|
24
|
+
HIP_FLEXORS: { group: "HIP_FLEXORS", regions: ["LOWER_BODY"], visibility: "FRONT", bilateral: true },
|
|
25
|
+
ADDUCTORS: { group: "ADDUCTORS", regions: ["LOWER_BODY"], visibility: "BOTH", bilateral: true },
|
|
26
|
+
ABDUCTORS: { group: "ABDUCTORS", regions: ["LOWER_BODY"], visibility: "BOTH", bilateral: true },
|
|
27
|
+
};
|
|
28
|
+
export const ALL_MUSCLE_GROUPS = Object.keys(MUSCLE_GROUP_META);
|
|
29
|
+
function matchesView(visibility, view) {
|
|
30
|
+
if (view === "BOTH")
|
|
31
|
+
return true;
|
|
32
|
+
if (visibility === "BOTH")
|
|
33
|
+
return true;
|
|
34
|
+
return visibility === view;
|
|
35
|
+
}
|
|
36
|
+
function matchesRegion(regions, filter) {
|
|
37
|
+
return filter === "FULL_BODY" || regions.includes(filter);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Returns the muscle groups that should be rendered for a given view and region.
|
|
41
|
+
*
|
|
42
|
+
* - `view` decides which anatomical side is shown (FRONT / BACK / BOTH).
|
|
43
|
+
* - `region` narrows the set to upper body, lower body, or core.
|
|
44
|
+
*
|
|
45
|
+
* The result is stable-ordered following {@link ALL_MUSCLE_GROUPS}.
|
|
46
|
+
*/
|
|
47
|
+
export function getVisibleMuscleGroups(view, region = "FULL_BODY") {
|
|
48
|
+
return ALL_MUSCLE_GROUPS.filter((group) => {
|
|
49
|
+
const meta = MUSCLE_GROUP_META[group];
|
|
50
|
+
return matchesView(meta.visibility, view) && matchesRegion(meta.regions, region);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=muscle-meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"muscle-meta.js","sourceRoot":"","sources":["../src/muscle-meta.ts"],"names":[],"mappings":"AAwBA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAyC;IACrE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE;IACxF,UAAU,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE;IACjG,UAAU,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE;IACzG,SAA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GAAkB,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAkB,CAAC;AAEhG,SAAS,WAAW,CAAC,UAA4B,EAAE,IAAmB;IACpE,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACjC,IAAI,UAAU,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,UAAU,KAAK,IAAI,CAAC;AAC7B,CAAC;AAED,SAAS,aAAa,CAAC,OAAoB,EAAE,MAAuB;IAClE,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAmB,EACnB,SAA0B,WAAW;IAErC,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QACxC,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACtC,OAAO,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type MuscleGroup = "CHEST" | "BACK_UPPER" | "BACK_LOWER" | "TRAPEZIUS" | "RHOMBOIDS" | "LATS" | "SHOULDERS_FRONT" | "SHOULDERS_SIDE" | "SHOULDERS_REAR" | "BICEPS" | "TRICEPS" | "FOREARMS" | "CORE" | "OBLIQUES" | "GLUTES" | "QUADS" | "HAMSTRINGS" | "CALVES" | "HIP_FLEXORS" | "ADDUCTORS" | "ABDUCTORS";
|
|
2
|
+
export type MuscleMapSex = "MALE" | "FEMALE";
|
|
3
|
+
export type MuscleMapView = "FRONT" | "BACK" | "BOTH";
|
|
4
|
+
export type MuscleMapRegion = "FULL_BODY" | "UPPER_BODY" | "LOWER_BODY" | "CORE";
|
|
5
|
+
export type MuscleMapMode = "OVERALL" | "STRENGTH" | "CARDIO" | "MOBILITY";
|
|
6
|
+
export type MuscleColorModel = "LOAD" | "FREQUENCY" | "BALANCE" | "RECOVERY_RISK";
|
|
7
|
+
export type MuscleTrend = "UP" | "DOWN" | "STABLE";
|
|
8
|
+
export type MuscleMapValue = {
|
|
9
|
+
score: number;
|
|
10
|
+
volumeKg?: number;
|
|
11
|
+
sets?: number;
|
|
12
|
+
sessions?: number;
|
|
13
|
+
trend?: MuscleTrend;
|
|
14
|
+
};
|
|
15
|
+
export type MuscleMapValues = Partial<Record<MuscleGroup, MuscleMapValue>>;
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,WAAW,GACX,MAAM,GACN,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,QAAQ,GACR,SAAS,GACT,UAAU,GACV,MAAM,GACN,UAAU,GACV,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,aAAa,GACb,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AACtD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,MAAM,CAAC;AACjF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC3E,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC;AAClF,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEnD,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@musclemap/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Headless core for MuscleMap — muscle-group types, color scales and region/visibility rules. UI-free.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"musclemap",
|
|
24
|
+
"muscle",
|
|
25
|
+
"anatomy",
|
|
26
|
+
"heatmap",
|
|
27
|
+
"fitness",
|
|
28
|
+
"headless"
|
|
29
|
+
],
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/Jsplice/MuscleMap.git",
|
|
33
|
+
"directory": "packages/core"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.json",
|
|
37
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"test": "vitest run --root ../.. packages/core"
|
|
39
|
+
}
|
|
40
|
+
}
|