Skip to content

Commit 2f28cd4

Browse files
committed
add nondisjunction threshold lines and styling
1 parent c8c7e64 commit 2f28cd4

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
@@ -723,6 +723,34 @@ function CentileChart({
723723
})
724724
}
725725

726+
{
727+
// nondisjunction lines uk90->uk-who->uk-who
728+
nondisjunctionThresholds !== null &&
729+
nondisjunctionThresholds.map((dataArray) => {
730+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
731+
return (
732+
<VictoryLine
733+
key={dataArray[0].x}
734+
name={`nondisjunction-${dataArray[0].x}`}
735+
style={styles.nondisjunctionThresholdLine}
736+
data={dataArray}
737+
labelComponent={
738+
<VictoryLabel
739+
textAnchor="start"
740+
angle={-90}
741+
dx={5}
742+
dy={10}
743+
style={styles.nondisjunctionThresholdLabel}
744+
/>
745+
}
746+
/>
747+
);
748+
} else {
749+
return null;
750+
}
751+
})
752+
}
753+
726754
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
727755
{/* If data points are close together, reduce the size of the point */}
728756

0 commit comments

Comments
 (0)