Skip to content

Commit ba92d4a

Browse files
committed
add nondisjunction threshold lines and styling
1 parent 201b09f commit ba92d4a

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
@@ -891,6 +891,34 @@ function CentileChart({
891891
})
892892
}
893893

894+
{
895+
// nondisjunction lines uk90->uk-who->uk-who
896+
nondisjunctionThresholds !== null &&
897+
nondisjunctionThresholds.map((dataArray) => {
898+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
899+
return (
900+
<VictoryLine
901+
key={dataArray[0].x}
902+
name={`nondisjunction-${dataArray[0].x}`}
903+
style={styles.nondisjunctionThresholdLine}
904+
data={dataArray}
905+
labelComponent={
906+
<VictoryLabel
907+
textAnchor="start"
908+
angle={-90}
909+
dx={5}
910+
dy={10}
911+
style={styles.nondisjunctionThresholdLabel}
912+
/>
913+
}
914+
/>
915+
);
916+
} else {
917+
return null;
918+
}
919+
})
920+
}
921+
894922
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
895923
{/* If data points are close together, reduce the size of the point */}
896924

0 commit comments

Comments
 (0)