Skip to content

Commit

Permalink
Merge pull request #103 from rcpch/term-area-shaded-text
Browse files Browse the repository at this point in the history
Adds shaded area text at term, removes old label
  • Loading branch information
dc2007git authored Sep 6, 2024
2 parents ee2e2a2 + 3405df8 commit 375d5c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/CentileChart/CentileChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ const VictoryZoomVoronoiContainer:any = createContainer(
'voronoi',
);

const shadedTermAreaText =
'Babies born in this shaded area\nare term. It is normal for\nbabies to lose weight over\nthe first two weeks of life.\nMedical review should be sought\nif weight has dropped by more\nthan 10% of birth weight or\nweight is still below birth weight\nthree weeks after birth.';

function CentileChart({
chartsVersion,
Expand Down Expand Up @@ -185,13 +183,11 @@ function CentileChart({
x: -0.057494866529774126,
y: domains.y[1],
y0: domains.y[0],
l: shadedTermAreaText,
},
{
x: 0.038329911019849415,
y: domains.y[1],
y0: domains.y[0],
l: shadedTermAreaText,
},
];
}
Expand Down
13 changes: 5 additions & 8 deletions src/functions/tooltips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,6 @@ export function tooltipText(
// l represent labels that represent reference transitions, puberty area or sds labels for the BMI SDS lines
if (l) {

if (x <= 0.038329911019849415 && x >= -0.057494866529774126 && measurementMethod === 'weight' && reference === 'uk-who'){
// 37 weeks gest - 42
if (childName.includes("centileLine")){
// these are the centile labels
return `${addOrdinalSuffix(l)} centile`;
}
return l;
}
// reference transit point or puberty shaded area labels
if (x === 0.0383 && reference === 'uk-who') {
return 'Transit point from\nUK90 to WHO data';
Expand All @@ -120,6 +112,11 @@ export function tooltipText(
return 'If a plot falls here, pubertal assessment will be required\nand mid-parental centile should be assessed.\nIf they are in puberty or completing puberty,\nthey are below the 0.4th centile and should be referred.\nIn most instances a prepubertal girl plotted in this area\nis growing normally, but comparison with the mid-parental\ncentile and growth trajectory will assist the assessment\nof whether further investigation is needed.';
}
}

// Term shaded area text
if (x < 0.038329911019849415 && x > -0.057494866529774126 && reference ==='uk-who' && measurementMethod === 'weight'){
return `${addOrdinalSuffix(l)} centile: \n Babies born in this shaded area\nare term. It is normal for\nbabies to lose weight over\nthe first two weeks of life.\nMedical review should be sought\nif weight has dropped by more\nthan 10% of birth weight or\nweight is still below birth weight\nthree weeks after birth.`;
}

// BMI SDS labels
if (childName.includes("sdsLine")){
Expand Down

0 comments on commit 375d5c9

Please sign in to comment.