Skip to content

Commit 707e5af

Browse files
committed
add nondisjunction threshold lines and styling
1 parent 9c568f1 commit 707e5af

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
@@ -919,6 +919,34 @@ function CentileChart({
919919
})
920920
}
921921

922+
{
923+
// nondisjunction lines uk90->uk-who->uk-who
924+
nondisjunctionThresholds !== null &&
925+
nondisjunctionThresholds.map((dataArray) => {
926+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
927+
return (
928+
<VictoryLine
929+
key={dataArray[0].x}
930+
name={`nondisjunction-${dataArray[0].x}`}
931+
style={styles.nondisjunctionThresholdLine}
932+
data={dataArray}
933+
labelComponent={
934+
<VictoryLabel
935+
textAnchor="start"
936+
angle={-90}
937+
dx={5}
938+
dy={10}
939+
style={styles.nondisjunctionThresholdLabel}
940+
/>
941+
}
942+
/>
943+
);
944+
} else {
945+
return null;
946+
}
947+
})
948+
}
949+
922950
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
923951
{/* If data points are close together, reduce the size of the point */}
924952

0 commit comments

Comments
 (0)