openclimatefix / quartz-frontend

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

Issue/368 spike shading for graph #372

Closed rachel-labri-tipton closed 1 year ago

rachel-labri-tipton commented 1 year ago

Pull Request

Description

Sees if the Quartz Solar chart library, Recharts, is up to the task of shading probabilistic forecasts. For each forecast, the shading was supposed to capture 110% and 90% of the OCF forecast value with the same timestamp. I think it should be fairly easy to do this with the Recharts library.

Recharts can shade an area between two values input as a range. Here's an example:

Screenshot 2023-06-21 at 12 16 50

To try this out, I added probabilisticRangeData to the use-format-chart-data function which prepares forecast data for the national forecast chart. I added a PROBABILISTIC_RANGE datakey to remix-line.tsx. I added the probabilistic data in the chart as an <Area/> component. Here's how it looks with #7BCDF3:

Screenshot 2023-06-21 at 12 20 48

Fixes #368

How Has This Been Tested?

Code was tested by running locally and looking at the chart.

Checklist:

vercel[bot] commented 1 year 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 💬 Add feedback Jul 13, 2023 9:05am
nowcasting-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 13, 2023 9:05am
peterdudfield commented 1 year ago

Amazing thats really great to test this out. Thank you for doing this

What do you think about merging / not merging?

rachel-labri-tipton commented 1 year ago

hi @peterdudfield, thank you. it was fun to work on this and nice to see it won't look that messy. it's also possible to have a setting like the 4-hour view where this could just be turned on and off.

rachel-labri-tipton commented 1 year ago

hi @peterdudfield, I wanted to share what the tooltip looks like with the plevels added in. Is this what you were envisioning? I also was able to get the dots we were looking at yesterday to show up as yellow.

Screenshot 2023-07-11 at 14 56 50
peterdudfield commented 1 year ago

hi @peterdudfield, I wanted to share what the tooltip looks like with the plevels added in. Is this what you were envisioning? I also was able to get the dots we were looking at yesterday to show up as yellow.

Screenshot 2023-07-11 at 14 56 50

Yea that look good. I wonder if it could be OCF Forecast: XXX {space} P 10%: XXX {space} P 90%: XXXX

rachel-labri-tipton commented 1 year ago

hey @peterdudfield, just pushed a few changes and this should be ready for dev?

Screenshot 2023-07-13 at 11 05 52