Add BodyMap: a front and back body map for React - #1
Merged
Merged
Conversation
One component, two uses: pick a region (selected + onSelect), or show what was recorded per region (counts, as neutral shades and badges), or both. 13 regions on each view, drawn once per side and mirrored. - Left and right are the person's: left_upper_arm is on the viewer's right on the front and on the viewer's left on the back. A test checks every region from its geometry. - Accessible: picking makes each region a named button (Enter, Space) that says its count; a read-only map lists counts for screen readers. - Calm: counts are never coloured good or bad. Colours are --rbm-* CSS variables; every word is a prop; regions can be replaced. - Stateless, SSR-safe, "use client", React 18+, no dependencies. Replaces the two different body drawings in the MoleCare web app. Same checks, CI, release and demo site as react-photo-compare. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first version of
@molecare/react-body-map. It replaces the MoleCare web app's two different body drawings (BodyPartSelectorandBodyMapWidget) with one reusable package.One component, two uses
selected+onSelect.counts, as neutral shades plus a number badge.What makes it different
left_upper_armis drawn on the viewer's right on the front view and on the viewer's left on the back view. A test checks every region from its geometry, so a swapped side can't slip through.--rbm-*CSS variables.regionsreplaces the drawing entirely, andmirrorPathmeans a limb only needs drawing once."use client", React 18+, no dependencies.Regions: 13 per view, 26 in total: head, neck, chest/upper back, abdomen/lower back, pelvis/buttocks, and upper arm, forearm and hand, thigh, and lower leg and foot on each side.
Also included, the same as react-photo-compare:
Checked
Not done yet: the repo is private, and the Pages site goes live once it's set up after merge. Switching the web app to this package is a separate PR once it's on npm.
🤖 Generated with Claude Code