Skip to content

Commit 1caae2a

Browse files
committed
add nondisjunction threshold lines and styling
1 parent 6f32ef4 commit 1caae2a

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/CentileChart/CentileChart.tsx

+28
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,34 @@ function CentileChart({
835835
})
836836
}
837837

838+
{
839+
// nondisjunction lines uk90->uk-who->uk-who
840+
nondisjunctionThresholds !== null &&
841+
nondisjunctionThresholds.map((dataArray) => {
842+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
843+
return (
844+
<VictoryLine
845+
key={dataArray[0].x}
846+
name={`nondisjunction-${dataArray[0].x}`}
847+
style={styles.nondisjunctionThresholdLine}
848+
data={dataArray}
849+
labelComponent={
850+
<VictoryLabel
851+
textAnchor="start"
852+
angle={-90}
853+
dx={5}
854+
dy={10}
855+
style={styles.nondisjunctionThresholdLabel}
856+
/>
857+
}
858+
/>
859+
);
860+
} else {
861+
return null;
862+
}
863+
})
864+
}
865+
838866
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
839867
{/* If data points are close together, reduce the size of the point */}
840868

src/functions/makeAllStyles.ts

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

0 commit comments

Comments
 (0)