rcpch / digital-growth-charts-react-component-library

A typescript React library for displaying RCPCH Digital Growth Charts from API data
https://growth.rcpch.ac.uk
MIT License
7 stars 9 forks source link

trisomy-21-bmi-rendering-issue-fix #96

Closed eatyourpeas closed 1 month ago

eatyourpeas commented 1 month ago

Overview

Bug identified by @princepsivannhs where the BMI dataset for Trisomy-21 contains values that run into the thousands. This is function of the LMS calculation such that when the value of L is negative (see discussion in the issue #93), z rapidly rises to infinity.

To overcome this, visible data is filtered exclude higher values of y before plotting.

Code changes

getDomainsAndData.ts includes a conditional to filter out values > 500.

Documentation changes (done or required as a result of this PR)

See issue #93 for discussion

Related Issues

Closes #93

Mentions

Thank you to @princepsivannhs for identifying, @statist7 for clarifying the maths and @mbarton to debugging and creating a new story.

mbarton commented 1 month ago

I've run this up locally and it does fix the chart rendering for me but I've added a comment - I'm wondering how resilient this change will be to future chart coordinates updates.

Also @eatyourpeas please add a before and after screenshot for visual changes :)

eatyourpeas commented 1 month ago

of course. Sorry, before and after images were added to the issue, but not the PR, so here it is.

image