Skip to content

Commit d593658

Browse files
committed
add nondisjunction threshold lines and styling
1 parent f15f4ad commit d593658

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
@@ -807,6 +807,34 @@ function CentileChart({
807807
})
808808
}
809809

810+
{
811+
// nondisjunction lines uk90->uk-who->uk-who
812+
nondisjunctionThresholds !== null &&
813+
nondisjunctionThresholds.map((dataArray) => {
814+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
815+
return (
816+
<VictoryLine
817+
key={dataArray[0].x}
818+
name={`nondisjunction-${dataArray[0].x}`}
819+
style={styles.nondisjunctionThresholdLine}
820+
data={dataArray}
821+
labelComponent={
822+
<VictoryLabel
823+
textAnchor="start"
824+
angle={-90}
825+
dx={5}
826+
dy={10}
827+
style={styles.nondisjunctionThresholdLabel}
828+
/>
829+
}
830+
/>
831+
);
832+
} else {
833+
return null;
834+
}
835+
})
836+
}
837+
810838
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
811839
{/* If data points are close together, reduce the size of the point */}
812840

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)