Skip to content

Commit c02f491

Browse files
committed
add nondisjunction threshold lines and styling
1 parent c10e97d commit c02f491

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
@@ -863,6 +863,34 @@ function CentileChart({
863863
})
864864
}
865865

866+
{
867+
// nondisjunction lines uk90->uk-who->uk-who
868+
nondisjunctionThresholds !== null &&
869+
nondisjunctionThresholds.map((dataArray) => {
870+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
871+
return (
872+
<VictoryLine
873+
key={dataArray[0].x}
874+
name={`nondisjunction-${dataArray[0].x}`}
875+
style={styles.nondisjunctionThresholdLine}
876+
data={dataArray}
877+
labelComponent={
878+
<VictoryLabel
879+
textAnchor="start"
880+
angle={-90}
881+
dx={5}
882+
dy={10}
883+
style={styles.nondisjunctionThresholdLabel}
884+
/>
885+
}
886+
/>
887+
);
888+
} else {
889+
return null;
890+
}
891+
})
892+
}
893+
866894
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
867895
{/* If data points are close together, reduce the size of the point */}
868896

0 commit comments

Comments
 (0)