Skip to content

Commit 50ece77

Browse files
committed
add nondisjunction threshold lines and styling
1 parent 341a2b0 commit 50ece77

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/CentileChart/CentileChart.tsx

+28
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,34 @@ function CentileChart({
947947
})
948948
}
949949

950+
{
951+
// nondisjunction lines uk90->uk-who->uk-who
952+
nondisjunctionThresholds !== null &&
953+
nondisjunctionThresholds.map((dataArray) => {
954+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
955+
return (
956+
<VictoryLine
957+
key={dataArray[0].x}
958+
name={`nondisjunction-${dataArray[0].x}`}
959+
style={styles.nondisjunctionThresholdLine}
960+
data={dataArray}
961+
labelComponent={
962+
<VictoryLabel
963+
textAnchor="start"
964+
angle={-90}
965+
dx={5}
966+
dy={10}
967+
style={styles.nondisjunctionThresholdLabel}
968+
/>
969+
}
970+
/>
971+
);
972+
} else {
973+
return null;
974+
}
975+
})
976+
}
977+
950978
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
951979
{/* If data points are close together, reduce the size of the point */}
952980

0 commit comments

Comments
 (0)