openclimatefix / quartz-frontend

Front End repo for the Nowcasting project.
https://openclimatefix.org/projects/nowcasting/
MIT License
103 stars 16 forks source link

Reformat probabilistic numbers in tooltip #435

Closed rachel-labri-tipton closed 10 months ago

rachel-labri-tipton commented 10 months ago

Pull Request

Description

Updates the formatting for probabilistic numbers in the tooltip. This was discussed here: #384 .

Screenshot 2023-11-15 at 11 31 36

The updated tooltip looks like this. It might be noticeable that the OCF Forecast is now in semi-bold because the textClass applied wasn't working, so I fixed that as well when I set the textClass for the P levels and values.

Screenshot 2023-11-15 at 12 01 40

I updated useFormatChartData so that it returns 3 probabilistic things: PROBABILISTIC_RANGE as an array for the area plotted on the chart and then PROBABILISTIC_UPPER_BOUNDand PROBABILISTIC_LOWER_BOUND as numbers. This seems repetitive, but when it came to the tooltip, it was easy to just have number values for all tooltip labels.

In terms of review, would like to know if all tooltip numbers are still showing correctly.

Fixes #384

How Has This Been Tested?

I ran the code locally.

Checklist:

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nowcasting-app ✅ Ready (Inspect) Visit Preview 1 resolved Nov 24, 2023 8:01am
peterdudfield commented 10 months ago

I wonder if the ttxt should be P90 and P10 not 90% and 10% as this is a bit more recognisable that this is a plevel

rachel-labri-tipton commented 10 months ago

hey @peterdudfield , Thanks for the feedback. I agree that the P makes sense, but we're using OCF instead of P because of the discussion in #384.

If there are no values for the plevels, it'll just return nothing.