ecoacoustics / web-components

https://oe-web-components.netlify.app/
MIT License
1 stars 0 forks source link

Implement algorithm for axis label rounding #96

Open hudson-newey opened 3 months ago

hudson-newey commented 3 months ago

At the moment, we show axis labels to one decimal place. However, this breaks down when we have intervals such as 0.25.

We should therefore implement an algorithm for axis label rounding.

This is more complex than it seems due to floating point error, and not all decimal places being significant in conveying information. Ideally, we could use the number of decimal places provided by the step, but this has flow on effects to font measuring.