-
Notifications
You must be signed in to change notification settings - Fork 93
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
Statistical Fires Widget #3462
Statistical Fires Widget #3462
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start! I think we can make the code much simpler, but I am sure you already are doing so.
@@ -0,0 +1,67 @@ | |||
import React, { PureComponent } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is identical, could we import this into from the glads widget?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even better make a new shared component in the /widgets/components
folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we definitely could.
@@ -0,0 +1,296 @@ | |||
import { createSelector } from 'reselect'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much has this file deviated from the GLADs? Could we map the fires data to the same structure in the action and then make this a helper? Or even just reuse it from GLADs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so - I just wanted to start from scratch first to find if there are many deviations from GLAD.
app/javascript/services/alerts.js
Outdated
@@ -49,6 +54,22 @@ export const fetchGLADLatest = () => { | |||
return request.get(url, 3600, 'gladRequest'); | |||
}; | |||
|
|||
export const fetchFiresAlerts = ({ country, region, subRegion }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent.
…feature/refactor-fires-stats
feature/refactor-fires-stats
Overview
Statistical fires widget! 🔥
Does the same as current GLAD widget... but for fire.
For now I've just duplicated the GLAD widget as a starting point. We can likely reduce the code significantly at a later date.
Cannot be implemented until we get the go ahead from Charlie that he's updating daily.
For now, it looks like this:
Notes
Known Issues
IOT, XCA, SPM, NFK, PIS, WLF require blacklisting
reloading the page (e.g. moving between countries) doesn't always trigger the chart to refresh correctly
start dates for each service/location are not the same! We will need a whitelist for which countries/services begin when.
currently no api service to get 'latest' date. Once data is updated daily we should be able to do this using
viirs-active-fires
(minus 1 week to get the last full weeks worth of data)'dataset' selector not appearing in user settingsdata doesn't have zeroes when there are no alerts. That week/year is just missing.requires a palettethere is a bug here where the statistical bounds in the background are not translated correctly, need to investigateRequirements
Update
.env
with: