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

Hovering over bone age tooltip causes chart to crash #90

Closed dmc-cambric closed 2 months ago

dmc-cambric commented 2 months ago

Hi team,

Have found a bug when rendering a height chart. When a bone age measurement is present but has a 'null' value comment, the chart throws the following error:

I've fixed this temporarily in our implementation by sending an empty string value to the 'bone_age_text' param of the API.

File: src\functions\tooltips.ts Proposed fix: check bone_age_label is not null before checking length property.

The error: image

Before hovering over bone age: image

After hovering over bone age: image

mbarton commented 2 months ago

Thanks for the contribution @dmc-cambric! Looks great, will release asap

mbarton commented 2 months ago

Released in v7.0.5: