-
Notifications
You must be signed in to change notification settings - Fork 91
Urban Mental Health report #2449
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
Open
claire-simpson
wants to merge
15
commits into
natcap:feature/urban-health-model
Choose a base branch
from
claire-simpson:feature/2419-umh-report
base: feature/urban-health-model
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f41d5bc
Merge branch 'main' into feature/2419-umh-report
claire-simpson bdd7853
Merge branch 'feature/urban-health-model' into feature/2419-umh-report
claire-simpson 817d6ff
Add UMH reporter #2419
claire-simpson 5b541d4
Improve about text for several model outputs #2419
claire-simpson 5a1f456
Auto detect continuous or divergent color ramp based on min value for…
claire-simpson 28f45e9
Merge branch 'release/3.19.0' into feature/2419-umh-report
claire-simpson 25f86f8
Improve args descriptions, constrain risk rate to <1, improve layer n…
claire-simpson 456386d
Move lulc pre caption to report_constants #2419
claire-simpson 9c4867a
Refactor RasterPlotConfig to use new func plot_on_axis to enable spec…
claire-simpson 6435ddf
Use LULC pre caption if lulc_base input #2419
claire-simpson c9bc020
Update colorramps; add new SpecialRangeRasterPlotConfig; change how m…
claire-simpson 3a4eafa
Merge branch 'release/3.19.0' into feature/2419-umh-report
claire-simpson f5ee880
Merge branch 'feature/urban-health-model' into feature/2419-umh-report
claire-simpson 5d9128e
Dont use approx stats; fix zonal stats docstring #2419
claire-simpson f3e7cf8
Fix gpkg layer renaming and fix test args after updating zonal stats …
claire-simpson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
src/natcap/invest/reports/templates/models/urban_mental_health.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| {% extends 'base.html' %} | ||
|
|
||
| {% block styles %} | ||
| {{ super() }} | ||
| {% include 'datatable-styles.html' %} | ||
| {% endblock styles %} | ||
|
|
||
| {% block content %} | ||
|
|
||
| {{ super() }} | ||
|
|
||
| {% from 'args-table.html' import args_table %} | ||
| {% from 'caption.html' import caption %} | ||
| {% from 'content-grid.html' import content_grid %} | ||
| {% from 'metadata.html' import list_metadata %} | ||
| {% from 'raster-plot-img.html' import raster_plot_img %} | ||
| {% from 'wide-table.html' import wide_table %} | ||
|
|
||
|
|
||
|
|
||
| <h2 class="section-header">Results</h2> | ||
|
|
||
| {{ accordion_section( | ||
| 'Aggregate Results', | ||
| agg_results_table | safe | ||
| )}} | ||
|
|
||
| {{ accordion_section( | ||
| 'Primary Outputs', | ||
| content_grid([ | ||
| (caption(raster_group_caption, pre_caption=True), 100), | ||
| (raster_plot_img(outputs_img_src, 'Primary Outputs'), 100), | ||
| (caption(outputs_caption, definition_list=True), 100) | ||
| ]) | ||
| )}} | ||
|
|
||
| {{ accordion_section( | ||
| 'Preventable Cases by AOI Vector', | ||
| content_grid( | ||
| [ | ||
| (content_grid([ | ||
| ('<div style="display:flex; justify-content:center;"><div id="cases_map"></div></div>', 100), | ||
| (caption(cases_map_caption, aggregate_map_source_list), 100) | ||
| ]), 50), | ||
|
|
||
| (content_grid([ | ||
| ('<div style="display:flex; justify-content:center;"><div id="cost_map"></div></div>', 100), | ||
| (caption(cost_map_caption, aggregate_map_source_list), 100) | ||
| ]), 50) | ||
| ] if cost_map_json else [ | ||
| (content_grid([ | ||
| ('<div style="display:flex; justify-content:center;"><div id="cases_map"></div></div>', 100), | ||
| (caption(cases_map_caption, aggregate_map_source_list), 100) | ||
| ]), 100) | ||
| ] | ||
| ) | ||
| ) }} | ||
|
|
||
| {% for section in intermediate_raster_sections %} | ||
| {{ accordion_section( | ||
| section['heading'], | ||
| content_grid([ | ||
| (caption(raster_group_caption, pre_caption=True), 100), | ||
| (raster_plot_img(section['img_src'], section['heading']), 100), | ||
| (caption(section['caption'], definition_list=True), 100) | ||
| ]) | ||
| )}} | ||
| {% endfor %} | ||
|
|
||
| {{ accordion_section( | ||
| 'Output Raster Stats', | ||
| content_grid([ | ||
| (stats_table_note, 100), | ||
| (wide_table( | ||
| output_raster_stats_table | safe, | ||
| font_size_px=16 | ||
| ), 100) | ||
| ]) | ||
| )}} | ||
|
|
||
| <h2 class="section-header">Inputs</h2> | ||
|
|
||
| {% if args_dict != None %} | ||
| {{ accordion_section( | ||
| 'Arguments', | ||
| args_table(args_dict) | ||
| )}} | ||
| {% endif %} | ||
|
|
||
| {% set input_items = [ | ||
| (caption(raster_group_caption, pre_caption=True), 100) | ||
| ] %} | ||
|
|
||
| {% if args_dict['lulc_base'] %} | ||
| {% set input_items = input_items + [ | ||
| (caption(lulc_pre_caption, pre_caption=True), 100) | ||
| ] %} | ||
| {% endif %} | ||
|
|
||
| {% set input_items = input_items + [ | ||
| (raster_plot_img(inputs_img_src, 'Raster Inputs'), 100), | ||
| (caption(inputs_caption, definition_list=True), 100) | ||
| ] %} | ||
|
|
||
| {{ accordion_section( | ||
| 'Input Maps', | ||
| content_grid(input_items) | ||
| )}} | ||
|
|
||
| {{ accordion_section( | ||
| 'Input Raster Stats', | ||
| content_grid([ | ||
| (stats_table_note, 100), | ||
| (wide_table( | ||
| input_raster_stats_table | safe, | ||
| font_size_px=16 | ||
| ), 100) | ||
| ]) | ||
| )}} | ||
|
|
||
| <h2 class="section-header">Metadata</h2> | ||
|
|
||
| {{ | ||
| accordion_section( | ||
| 'Output Filenames and Descriptions', | ||
| list_metadata(model_spec_outputs), | ||
| expanded=False | ||
| ) | ||
| }} | ||
|
|
||
| {% endblock content %} | ||
|
|
||
|
|
||
|
|
||
| {% from 'vegalite-plot.html' import embed_vega %} | ||
|
|
||
| {% block scripts %} | ||
| {{ super() }} | ||
| <script src="https://cdn.jsdelivr.net/npm/vega@5"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/vega-lite@5.20.1"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script> | ||
| {% include 'vega-embed-js.html' %} | ||
|
|
||
| {% set chart_spec_id_list = [(cases_map_json, 'cases_map')] %} | ||
| {% if cost_map_json %} | ||
| {% set chart_spec_id_list = chart_spec_id_list + [(cost_map_json, 'cost_map')] %} | ||
| {% endif %} | ||
| {{ embed_vega(chart_spec_id_list) }} | ||
| {% endblock scripts %} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Wanted an extension hook without changing
plot_raster_listor duplicating too much code, but curious what you think of this. It also doesn't touch thenominalplots, so maybe there is a better design here? Curious what you think.