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

Statistical Fires Widget #3462

Merged
merged 23 commits into from
Jul 20, 2018
Merged

Statistical Fires Widget #3462

merged 23 commits into from
Jul 20, 2018

Conversation

01painadam
Copy link
Contributor

@01painadam 01painadam commented Jun 4, 2018

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:

screen shot 2018-06-05 at 12 28 27

image


Notes

  • Users are able to choose fire-type: ['MODIS', 'VIIRS']
  • Adm0, 1, 2 available
  • polynames available (if we want to use them. GLAD currently doesnt)

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 settings

  • data doesn't have zeroes when there are no alerts. That week/year is just missing.

  • requires a palette

  • there is a bug here where the statistical bounds in the background are not translated correctly, need to investigate

Requirements

Update .env with:

    FIRES_ISO_DATASET=ff289906-aa83-4a89-bba0-562edd8c16c6
    FIRES_ADM1_DATASET=5bc5cd49-706f-409c-b10d-77fdfecb010f
    FIRES_ADM2_DATASET=0f24299d-2aaa-4afc-945c-b614028c12d1

@01painadam 01painadam added WIP Any PR that should not be merged to develop staging Any PR expected to be kept on staging labels Jun 4, 2018
@01painadam 01painadam changed the title Initial commit Statistical Fires Widget Jun 4, 2018
Copy link
Contributor

@edbrett edbrett left a 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';
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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';
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@@ -49,6 +54,22 @@ export const fetchGLADLatest = () => {
return request.get(url, 3600, 'gladRequest');
};

export const fetchFiresAlerts = ({ country, region, subRegion }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Excellent.

@benlaken benlaken added countries dashboard and removed AWAITING APPROVAL WIP Any PR that should not be merged to develop labels Jul 19, 2018
@edbrett edbrett merged commit 0a9a17e into develop Jul 20, 2018
@edbrett edbrett deleted the feature/fires-stats branch July 20, 2018 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging Any PR expected to be kept on staging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants