Skip to content

Commit 0551f15

Browse files
committed
add nondisjunction threshold lines and styling
1 parent d429582 commit 0551f15

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/CentileChart/CentileChart.tsx

+28
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,34 @@ function CentileChart({
667667
})
668668
}
669669

670+
{
671+
// nondisjunction lines uk90->uk-who->uk-who
672+
nondisjunctionThresholds !== null &&
673+
nondisjunctionThresholds.map((dataArray) => {
674+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
675+
return (
676+
<VictoryLine
677+
key={dataArray[0].x}
678+
name={`nondisjunction-${dataArray[0].x}`}
679+
style={styles.nondisjunctionThresholdLine}
680+
data={dataArray}
681+
labelComponent={
682+
<VictoryLabel
683+
textAnchor="start"
684+
angle={-90}
685+
dx={5}
686+
dy={10}
687+
style={styles.nondisjunctionThresholdLabel}
688+
/>
689+
}
690+
/>
691+
);
692+
} else {
693+
return null;
694+
}
695+
})
696+
}
697+
670698
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
671699
{/* If data points are close together, reduce the size of the point */}
672700

src/functions/makeAllStyles.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { AxisStyle, CentileStyle, SDSStyle, ChartStyle, GridlineStyle, Measureme
1919
const black = '#000000';
2020
const white = '#FFFFFF';
2121
const darkGrey = '#808080';
22+
const darkGrey = '#808080';
2223
const midGrey = '#b3b3b3';
2324
const lightGrey = '#d9d9d9';
2425
const lightLightGrey = "#f3f3f3";

0 commit comments

Comments
 (0)