Skip to content

Commit 3e55e9d

Browse files
committed
add nondisjunction threshold lines and styling
1 parent cad3f91 commit 3e55e9d

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/CentileChart/CentileChart.tsx

+28
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,34 @@ function CentileChart({
751751
})
752752
}
753753

754+
{
755+
// nondisjunction lines uk90->uk-who->uk-who
756+
nondisjunctionThresholds !== null &&
757+
nondisjunctionThresholds.map((dataArray) => {
758+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
759+
return (
760+
<VictoryLine
761+
key={dataArray[0].x}
762+
name={`nondisjunction-${dataArray[0].x}`}
763+
style={styles.nondisjunctionThresholdLine}
764+
data={dataArray}
765+
labelComponent={
766+
<VictoryLabel
767+
textAnchor="start"
768+
angle={-90}
769+
dx={5}
770+
dy={10}
771+
style={styles.nondisjunctionThresholdLabel}
772+
/>
773+
}
774+
/>
775+
);
776+
} else {
777+
return null;
778+
}
779+
})
780+
}
781+
754782
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
755783
{/* If data points are close together, reduce the size of the point */}
756784

src/functions/makeAllStyles.ts

+2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ 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";
2526
const charcoal = "#4d4d4d";
27+
const charcoal = "#4d4d4d";
2628
const aquaGreen ='#00BDAA'
2729
const orange = '#FF8000'
2830
const purple = '#7159AA'

0 commit comments

Comments
 (0)