Skip to content

Commit db53580

Browse files
authored
Merge pull request #131 from rcpch/midparental-height-labels
mid-parental-height-fixes
2 parents 7ec85e9 + e598c33 commit db53580

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rcpch/digital-growth-charts-react-component-library",
3-
"version": "7.2.1",
3+
"version": "7.2.2",
44
"description": "A React component library for the RCPCH digital growth charts using Rollup, TypeScript and Styled-Components",
55
"main": "build/index.js",
66
"module": "build/esm.index.js",

src/CentileChart/CentileChart.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,6 @@ function CentileChart({
407407
// this function filters the midparental height centile data to only those values
408408
// one month either side of the most recent measurement, or 20 y if no measurements
409409
// supplied.
410-
if (index === 0) {
411-
// neonates - remove
412-
return;
413-
}
414410

415411
const lowerData = reference.lowerParentalCentile;
416412
const midData = reference.midParentalCentile;
@@ -444,6 +440,7 @@ function CentileChart({
444440
// prevents a css `width` infinity error if no data presented to centile line
445441
return;
446442
}
443+
447444
return (
448445
<VictoryLine
449446
name="lowerCentileMPH"

src/functions/getFilteredMidParentalHeightData.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export const getFilteredMidParentalHeightData = (
3535
.x;
3636

3737
if (latestAge < 3 / 12) {
38-
upperLimit = latestAge + 1 / 52;
39-
lowerLimit = latestAge - 1 / 52;
40-
} else if (latestAge >= 3 / 12 && latestAge < 3) {
4138
upperLimit = latestAge + 2 / 52;
4239
lowerLimit = latestAge - 2 / 52;
40+
} else if (latestAge >= 3 / 12 && latestAge < 3) {
41+
upperLimit = latestAge + 4 / 52;
42+
lowerLimit = latestAge - 4 / 52;
4343
} else if (latestAge >= 3 && latestAge < 12) {
4444
upperLimit = latestAge + 2 / 12;
4545
lowerLimit = latestAge - 2 / 12;

src/functions/tooltips.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,23 @@ export function tooltipText(
9696
let returnStringList = [];
9797
if (childName === 'lowerCentileMPH') {
9898
returnStringList.push(
99-
`Midparental Height -2SD: ${Math.round(mid_parental_height_lower_value * 10) / 10} cm`,
99+
`Mid-Parental Height (2 centiles below): ${Math.round(mid_parental_height_lower_value * 10) / 10} cm`,
100100
);
101101
return returnStringList;
102102
}
103103
if (childName === 'centileMPH' || childName === 'areaMPH') {
104104
returnStringList.push(
105-
`Midparental Height: ${Math.round(mid_parental_height * 10) / 10} cm (${addOrdinalSuffix(Math.round(parseFloat(l)))}) centile, SDS: ${Math.round(mid_parental_height_sds * 100) / 100})`,
105+
`Mid-Parental Height: ${Math.round(mid_parental_height * 10) / 10} cm (${addOrdinalSuffix(Math.round(parseFloat(l)))} centile, SDS: ${Math.round(mid_parental_height_sds * 1000) / 1000})`,
106106
);
107107
returnStringList.push(
108-
`Range(+/-2SD): ${Math.round(mid_parental_height_lower_value * 10) / 10} cm - ${Math.round(mid_parental_height_upper_value * 10) / 10} cm`,
108+
`Range(+/-2 centiles): ${Math.round(mid_parental_height_lower_value * 10) / 10} cm - ${Math.round(mid_parental_height_upper_value * 10) / 10} cm`,
109109
);
110110

111111
return returnStringList;
112112
}
113113
if (childName === 'upperCentileMPH') {
114114
returnStringList.push(
115-
`Midparental Height +2SD: ${Math.round(mid_parental_height_upper_value * 10) / 10} cm`,
115+
`Mid-Parental Height (2 centiles above): ${Math.round(mid_parental_height_upper_value * 10) / 10} cm`,
116116
);
117117
return returnStringList;
118118
}

0 commit comments

Comments
 (0)