Skip to content

Commit 375d5c9

Browse files
authored
Merge pull request #103 from rcpch/term-area-shaded-text
Adds shaded area text at term, removes old label
2 parents ee2e2a2 + 3405df8 commit 375d5c9

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/CentileChart/CentileChart.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ const VictoryZoomVoronoiContainer:any = createContainer(
8181
'voronoi',
8282
);
8383

84-
const shadedTermAreaText =
85-
'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.';
8684

8785
function CentileChart({
8886
chartsVersion,
@@ -185,13 +183,11 @@ function CentileChart({
185183
x: -0.057494866529774126,
186184
y: domains.y[1],
187185
y0: domains.y[0],
188-
l: shadedTermAreaText,
189186
},
190187
{
191188
x: 0.038329911019849415,
192189
y: domains.y[1],
193190
y0: domains.y[0],
194-
l: shadedTermAreaText,
195191
},
196192
];
197193
}

src/functions/tooltips.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@ export function tooltipText(
8989
// l represent labels that represent reference transitions, puberty area or sds labels for the BMI SDS lines
9090
if (l) {
9191

92-
if (x <= 0.038329911019849415 && x >= -0.057494866529774126 && measurementMethod === 'weight' && reference === 'uk-who'){
93-
// 37 weeks gest - 42
94-
if (childName.includes("centileLine")){
95-
// these are the centile labels
96-
return `${addOrdinalSuffix(l)} centile`;
97-
}
98-
return l;
99-
}
10092
// reference transit point or puberty shaded area labels
10193
if (x === 0.0383 && reference === 'uk-who') {
10294
return 'Transit point from\nUK90 to WHO data';
@@ -120,6 +112,11 @@ export function tooltipText(
120112
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.';
121113
}
122114
}
115+
116+
// Term shaded area text
117+
if (x < 0.038329911019849415 && x > -0.057494866529774126 && reference ==='uk-who' && measurementMethod === 'weight'){
118+
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.`;
119+
}
123120

124121
// BMI SDS labels
125122
if (childName.includes("sdsLine")){

0 commit comments

Comments
 (0)