feat(bodymap): body map data, endpoint and component - #16
Merged
Merged
Conversation
tools/bodymap/molemapper_zones.py transcribes MoleMapper's 61 zone identifiers and names and its 32 hit polygons with their per-view origins, under the BSD notice already reproduced in THIRD_PARTY_NOTICES.md; the side field comes from the name because the identifier digit only encodes the screen side. tools/bodymap/build.py draws a flat, gender-neutral silhouette from tapered capsules, clips the polygons to it, hands uncovered slivers to the neighbour with the longest shared edge and asserts an exact tiling. The result is zones.json, committed in two identical copies for the backend and the frontend (CI compares them), plus labelled previews in docs/design/bodymap. Design notes in docs/design/BODY_MAP.md. Signed-off-by: Jose David <josedalmena@gmail.com>
nevus.bodymap loads and validates zones.json from package data and exposes the zone codes for later validation of lesion locations; GET /api/bodymap returns the map for API clients and reports. Tests cover the invariants of the asset (56 zones, 28 per view, sides from the patient's point of view, geometry inside the view box, identical frontend copy) and the endpoint. Signed-off-by: Jose David <josedalmena@gmail.com>
The BodyMap component renders the shared silhouette and its zones as focusable buttons named in the account language, reports the tapped zone and the tapped point normalised to the view box (the keyboard places at the zone anchor), and draws markers at normalised positions. A front/back toggle and the map sit on the person page; lesions arrive in the next step. Zone names in English and Spanish; four component tests. Signed-off-by: Jose David <josedalmena@gmail.com>
jalmena
force-pushed
the
feature/body-map
branch
from
September 24, 2026 10:22
235393f to
b83ed08
Compare
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.
What
The body map, first half: the shared asset, its endpoint and the component. Lesions and observations follow in the next PR.
tools/bodymap/molemapper_zones.pyunder the BSD notice inTHIRD_PARTY_NOTICES.md(rows now point at the files). Thesidefield is taken from the name, because the identifier digit encodes the screen side, not the patient's.tools/bodymap/build.py; both views share it. Polygons are clipped to it, slivers go to the neighbour with the longest shared edge, and the builder asserts an exact tiling with no overlaps. Previews with zone codes indocs/design/bodymap/, notes indocs/design/BODY_MAP.md.zones.json(56 zones, versionnevus-body-map/1, normalised coordinates), committed in two identical copies for backend and frontend; CI compares them.nevus.bodymaploader andGET /api/bodymap.BodyMap(zones as named, focusable buttons; tap yields the zone and the point; markers at normalised positions),ViewToggle, zone names in EN/ES, wired into the person page.just bodymap; ruff and pre-commit now covertools/.Verification