Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat probabilistic numbers in tooltip #435

Merged
merged 3 commits into from
Nov 24, 2023

Conversation

rachel-labri-tipton
Copy link
Contributor

@rachel-labri-tipton rachel-labri-tipton commented Nov 15, 2023

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:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

Copy link

vercel bot commented Nov 15, 2023

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

Copy link
Contributor

@peterdudfield peterdudfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me,
The numbers look correct.

Just want to double check something, if there are no PLevels now, does the UI fail?

@peterdudfield
Copy link
Contributor

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
Copy link
Contributor Author

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.

Copy link
Contributor

@braddf braddf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of tiny things but then good to merge @rachel-labri-tipton, nice work 😊

apps/nowcasting-app/components/charts/remix-line.tsx Outdated Show resolved Hide resolved
apps/nowcasting-app/components/charts/remix-line.tsx Outdated Show resolved Hide resolved
@braddf braddf merged commit 005c50b into development Nov 24, 2023
@peterdudfield peterdudfield deleted the issue/384-probabilistic-tooltip-spacing branch February 5, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants