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

Add Drainage Area Analyze View #3559

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

rajadain
Copy link
Member

@rajadain rajadain commented Aug 2, 2022

Overview

When the area of interest is a Drainage Area, we show this additional analysis that shows the GWLF-E output of the HUC-12 to which the area of interest's centroid belongs. For other areas of interest, this analysis is not shown.

Once the Drexel / ANS API integration is in place, the numbers will be scaled to the land use distribution of the area of interest. See #3558 for details.

Because of the number of analyses, the Drainage Area addition forces the tabs to overflow to a new line. This is less than ideal. However, this is likely the best we can do at this point, for a larger redesign is out of scope. Thankfully, this only happens for Drainage Areas, and other areas of interest are not affected.

Closes #3557

Demo

image

image

Testing Instructions

  • Check out this branch
  • Bundle the scripts
    ./scripts/bundle.sh --debug
    
  • Restart celery
    vagrant ssh worker -c 'sudo service celeryd restart'
    
  • Go to http://localhost:8000/
  • Draw a non-drainage area shape
    • Ensure the analysis does not include a Drainage Area result
  • Go back. Draw a Point-based Drainage Area shape
    • Ensure the analysis does include a Drainage Area result
    • Ensure it has Hydrology and Water Quality options in the dropdown with reasonable (not null) values
    • Ensure the CSV export works for the Hydrology table and both Water Quality tables
  • Go back. Draw a Stream-based Drainage Area shape
    • Ensure it works the same as above
  • Go to Model, select Watershed Multi-Year Model
  • Check the Hydrology and Water Quality tabs
    • Ensure they work the same as before

In order to be compliant with the API exposed by all other
/analyze/ endpoints, the final results should be wrapped in
`survey`. This allows easy use on the front-end.
Previously this was present in the parent ResultView. Now,
as we prepare to reuse the TableView elsewhere, we move the
Download CSV button to be within it so that it is present
in the Drainage Area Analyze view where it will next be used.
So they can be reused in Drainage Area Analysis
When the area of interest is a drainage area, we now set this
new areaOfInterestDrainageArea attribute to true. It is false
by default, and reset to false when the AoI is cleared.
When the area of interest is a Drainage Area,
we show an additional Analyze Tab, which shoes contents
of the GWLF-E Runoff and Water Quality views.

The Drainage Area Result View is made quite akin
to the Analyze Result View, but had to be seprate
because of its custom CSV Export handling.
@rajadain rajadain added the PA DEP Funding Source: Pennsylvania Department of Environment Protection label Aug 2, 2022
@rajadain
Copy link
Member Author

rajadain commented Aug 2, 2022

  • Fixed a comment in 3068c1d
  • Removed unused chart region in 5d224b4
  • Added reference to TODO item in 0eda2dd

Copy link
Contributor

@emilyhu0106 emilyhu0106 left a comment

Choose a reason for hiding this comment

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

All the analysis and download features work well for both point-based and stream-based analysis! Very nice job for finishing the front-end

@rajadain
Copy link
Member Author

rajadain commented Aug 5, 2022

Thanks for the review! After talking with the clients, they no longer want to have a special analysis for Drainage Areas. It is too disruptive a flow, and creates special cases for certain AoIs, which doesn't fit the established patterns of the app. It also runs a model in the Analyze stage which is confusing.

As a result, this feature is being scrapped. We will still keep the Drainage Area drawing based on the Drexel / ANS API (so far), and I will remove the Analyze endpoint added in #3555. Will confirm with clients early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PA DEP Funding Source: Pennsylvania Department of Environment Protection
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Drainage Area Analyze View
2 participants