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

chartScaleType defaults to biggerChild #66

Closed dc2007git closed 5 months ago

dc2007git commented 10 months ago

When a centile chart is rendered, the centile lines and axis are dependent on the parameter chartScaleType. This then informs the x-axis label, and whether months as lollipops will show up.

At the moment, every Storybook story (except 'With Premature Female Heights) is automatically rendering with the chartScaleType set to biggerChild, since this is the default. However, this means that the rendering of an appropriate x-label doesn't happen. For example, smallChild is defined as ≤ 4 years old, > 1 year old. But Storybook renders a child who has data plotted between 0-2 years on the biggerChild axis.

This has implications for rendering gradient labels as per Issue #64. If we can't use the chartScaleType as a conditional (because it always defaults to biggerChild), then the gradients can't be conditionally scaled up/down as appropriate and so will keep bugging out

eatyourpeas commented 5 months ago

Fixed and merged in v7.0.0. Documentation updated