Skip to content

Commit 3ac992f

Browse files
committed
add nondisjunction threshold lines and styling
1 parent 895eb59 commit 3ac992f

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

src/CentileChart/CentileChart.tsx

+28
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,34 @@ function CentileChart({
779779
})
780780
}
781781

782+
{
783+
// nondisjunction lines uk90->uk-who->uk-who
784+
nondisjunctionThresholds !== null &&
785+
nondisjunctionThresholds.map((dataArray) => {
786+
if (dataArray[0].x > domains.x[0] && dataArray[1].x < domains.x[1]) {
787+
return (
788+
<VictoryLine
789+
key={dataArray[0].x}
790+
name={`nondisjunction-${dataArray[0].x}`}
791+
style={styles.nondisjunctionThresholdLine}
792+
data={dataArray}
793+
labelComponent={
794+
<VictoryLabel
795+
textAnchor="start"
796+
angle={-90}
797+
dx={5}
798+
dy={10}
799+
style={styles.nondisjunctionThresholdLabel}
800+
/>
801+
}
802+
/>
803+
);
804+
} else {
805+
return null;
806+
}
807+
})
808+
}
809+
782810
{/* create a series for each child measurements data point: a circle for chronological age, a cross for corrected */}
783811
{/* If data points are close together, reduce the size of the point */}
784812

src/functions/makeAllStyles.ts

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

0 commit comments

Comments
 (0)