Skip to content

Commit ee2e2a2

Browse files
authored
Merge pull request #97 from rcpch/fix-reopened-measurement-plot-size-issue-94
Fix-reopened-measurement-plot-size-issue-94 I will merge this now and open a new issue for this
2 parents 72ca41b + e5cb804 commit ee2e2a2

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rcpch/digital-growth-charts-react-component-library",
3-
"version": "7.0.8",
3+
"version": "7.0.9",
44
"description": "A React component library for the RCPCH digital growth charts using Rollup, TypeScript and Styled-Components",
55
"main": "build/index.js",
66
"module": "build/esm.index.js",

src/CentileChart/CentileChart.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -678,11 +678,11 @@ function CentileChart({
678678
};
679679

680680
if (isChartCrowded) {
681-
chronData.size = 1.5;
682-
correctData.size = 1.5;
683-
} else {
684681
chronData.size = 3.5;
685682
correctData.size = 3.5;
683+
} else {
684+
chronData.size = 4.5;
685+
correctData.size = 4.5;
686686
}
687687

688688
return (

src/functions/makeAllStyles.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ This function therefore instantiates defaults where user values have not been pr
1515
This creates a styles object that is passed to the chart.
1616
*/
1717
import { AxisStyle, CentileStyle, SDSStyle, ChartStyle, GridlineStyle, MeasurementStyle } from '../interfaces/StyleObjects';
18-
import { setOpacity } from './setOpacity';
1918

2019
const black = '#000000';
2120
const white = '#FFFFFF';
@@ -241,7 +240,7 @@ function makeAllStyles(
241240
opacity: 0.5
242241
}
243242
},
244-
measurementPoint: {
243+
measurementPoint: { // these are the points on the chart where measurements are plotted: note that the size is dynamically set based on the isCrowded function
245244
data: {
246245
fill: measurementStyle?.measurementFill ?? black,
247246
},
@@ -252,9 +251,9 @@ function makeAllStyles(
252251
strokeWidth: 1.25,
253252
},
254253
},
255-
highlightedMeasurementFill: {
254+
highlightedMeasurementFill: { // these are the points on the chart where measurements are plotted: note that the size is dynamically set based on the isCrowded function
256255
data: {
257-
fill: measurementStyle?.highlightedMeasurementFill ?? black
256+
fill: measurementStyle?.highlightedMeasurementFill ?? black,
258257
}
259258
},
260259
eventTextStyle: {

src/functions/stylesForTheme.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Tanner3AxisStyles, Tanner3ChartStyles, Tanner3GridlineStyles, Tanner3Ce
55
import { traditionalBoyAxisStyles, traditionalBoyChartStyles, traditionalBoyGridlineStyles, traditionalBoyCentileStyles, traditionalBoyMeasurementStyles, traditionalBoySDSStyles } from '../testParameters/styles/traditionalBoysStyles';
66
import { traditionalGirlAxisStyles, traditionalGirlChartStyles, traditionalGirlGridlineStyles, traditionalGirlCentileStyles, traditionalGirlMeasurementStyles, traditionalGirlSDSStyles } from '../testParameters/styles/traditionalGirlsStyles';
77
import { ChartStyle, AxisStyle, GridlineStyle, CentileStyle, SDSStyle, MeasurementStyle } from '../interfaces/StyleObjects';
8-
import { Exception } from 'sass';
98

109
export const stylesForTheme = (theme: 'monochrome' | 'traditional' | 'tanner1' | 'tanner2' | 'tanner3' | 'custom', sex: 'male' | 'female')=>{
1110
// Returns the styles objects for a theme. If custom is selected, monochrome is selected to be customized later

0 commit comments

Comments
 (0)