-
-
- {observation.zones.length === 0 ? (
-
- Cliquez sur les zones du schéma pour les ajouter à cette observation.
-
- ) : (
-
- {observation.zones.map((z, i) => {
- const b = bones.get(z.boneId)
- const isSpine = b?.category === 'spine-zone'
- return (
- -
-
- {describeZone(z, bones)}
- {isSpine && (
-
- )}
-
-
-
- )
- })}
-
- )}
-
-
-
-
- onChange({ ...observation, pathologyIds: ids })}
- />
-
-
-
-
- onChange({ ...observation, freeTextPathologies: items })}
- />
-
-
-
-
- onChange({ ...observation, severity: s })}
- />
-
-
-
-
- )
-}
diff --git a/src/pdf/render/observationPage.ts b/src/pdf/render/observationPage.ts
index 8476d38c..2525cf9b 100644
--- a/src/pdf/render/observationPage.ts
+++ b/src/pdf/render/observationPage.ts
@@ -22,13 +22,9 @@ async function colorizedSvgString(
.forEach((z) => {
const bone = bones.get(z.boneId)
if (!bone) return
- bone.visibleEls.forEach((el) => {
+ bone.els.forEach((el) => {
el.setAttribute('fill', '#b85a3f')
- el.setAttribute('fill-opacity', '0.85')
- })
- bone.hitboxEls.forEach((el) => {
- el.setAttribute('fill', '#b85a3f')
- el.setAttribute('fill-opacity', '0.4')
+ el.setAttribute('fill-opacity', '0.65')
})
})
return new XMLSerializer().serializeToString(root)
diff --git a/tests/unit/anatomy.horse.test.ts b/tests/unit/anatomy.horse.test.ts
index bb45ba4b..18e73bb9 100644
--- a/tests/unit/anatomy.horse.test.ts
+++ b/tests/unit/anatomy.horse.test.ts
@@ -18,41 +18,55 @@ function loadSvg(path: string): SVGSVGElement {
describe('real Horse.svg', () => {
const map = parseSvgBones(loadSvg(HORSE_PATH))
- it('parses without throwing', () => {
- expect(map.size).toBeGreaterThan(10)
+ it('parses 18 unique annotations', () => {
+ expect(map.size).toBe(18)
})
- it('contains all 5 spine-zone bones', () => {
- const spine = [...map.values()].filter((b) => b.category === 'spine-zone')
+ it('contains 5 zone-colonne annotations (cervical / thoracic / lumbar / sacral / caudal)', () => {
+ const spine = [...map.values()].filter(
+ (b) => b.category === 'zone-colonne',
+ )
expect(spine.length).toBe(5)
})
- it('contains the head zone with opensDetail=head', () => {
- const head = [...map.values()].find((b) => b.category === 'head')
- expect(head?.opensDetail).toBe('head')
+ it('contains exactly one opens-detail trigger pointing at the head SVG', () => {
+ const triggers = [...map.values()].filter((b) => b.opensDetail === 'head')
+ expect(triggers.length).toBe(1)
})
- it('contains the 3 vertebral hinges', () => {
- const charn = [...map.values()].filter((b) => b.category === 'charniere')
- expect(charn.map((b) => b.id).sort()).toEqual(['c7-t1', 'l6-s1', 't18-l1'])
+ it('contains 9 articulations', () => {
+ const arts = [...map.values()].filter(
+ (b) => b.category === 'articulations',
+ )
+ expect(arts.length).toBe(9)
})
- it('contains main joint articulations', () => {
- for (const id of ['epaule', 'coude', 'hanche', 'grasset', 'jarret']) {
- expect(map.get(id)?.category).toBe('articulation')
- }
+ it('contains 3 vertebral hinges', () => {
+ const ch = [...map.values()].filter(
+ (b) => b.category === 'charni-res-vert-brales',
+ )
+ expect(ch.length).toBe(3)
})
})
describe('real Horse_head.svg', () => {
const map = parseSvgBones(loadSvg(HEAD_PATH))
- it('parses without throwing', () => {
- expect(map.size).toBeGreaterThan(5)
+ it('parses 9 unique annotations', () => {
+ expect(map.size).toBe(9)
})
- it('contains cadran-crane categories', () => {
- const cadran = [...map.values()].filter((b) => b.category === 'cadran-crane')
- expect(cadran.length).toBeGreaterThan(0)
+ it('contains 5 cadrans-du-cr-ne annotations', () => {
+ const cadrans = [...map.values()].filter(
+ (b) => b.category === 'cadrans-du-cr-ne',
+ )
+ expect(cadrans.length).toBe(5)
+ })
+
+ it('contains 2 articulations (ATM + SSB equivalents)', () => {
+ const arts = [...map.values()].filter(
+ (b) => b.category === 'articulations',
+ )
+ expect(arts.length).toBe(2)
})
})
diff --git a/tests/unit/anatomy.svgConvention.test.ts b/tests/unit/anatomy.svgConvention.test.ts
index 2f283809..10a5b918 100644
--- a/tests/unit/anatomy.svgConvention.test.ts
+++ b/tests/unit/anatomy.svgConvention.test.ts
@@ -13,26 +13,24 @@ function svgFromString(s: string): SVGSVGElement {
const FIXTURE = `