Skip to content

Populate hydrograph and monthly flow charts based on "mid" or "extremes" mode#124

Draft
cstephen wants to merge 4 commits intomainfrom
mid_extreme_charts
Draft

Populate hydrograph and monthly flow charts based on "mid" or "extremes" mode#124
cstephen wants to merge 4 commits intomainfrom
mid_extreme_charts

Conversation

@cstephen
Copy link
Copy Markdown
Contributor

Xref: ua-snap/data-api#709

This PR works with the aggregate_hydroviz_endpoints branch of the Data API to make the hydrograph and monthly flow charts react to the mid/extreme toggle in the following ways:

  • In "extremes" mode, the hydrography shows the max/mean/min values across all CMIP5 models and scenarios (excluding RCP 2.6). In "mid" mode, it shows the max/mean/min across all CMIP5 models for just the RCP 6.0 scenario.
  • In "extremes" mode, the monthly flow chart shows box plots populated with an array of values across all CMIP5 models and scenarios (excluding RCP 2.6). In "mid" mode, it shows a single mean value for each month (i.e., just a scatter marker, not a boxplot) which represents the mean value across all CMIP5 models for the RCP 6.0 scenario.

Testing is a little tricky since the StatsTable code hasn't been updated to work with the new API response structure in this branch, causing the report page to not to load properly. To run this branch, you'll need to comment out all references to the StatsTable component. I.e., comment out every line like this in Report.vue to test:

<StatsTable ... />

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the hydrology report visualizations to respond to the “mid” vs “extremes” toggle, aligning chart outputs with the updated Data API hydroviz response shape.

Changes:

  • Update hydroviz API request URL to remove the hard-coded model segment.
  • Make Hydrograph use projected[appContext] to render mid vs extremes data.
  • Make Monthly Flow render boxplots for extremes and single-point monthly means for mid.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
webapp/stores/streamSegment.ts Updates hydroviz endpoint URL format to match the new API structure.
webapp/components/Viz/MonthlyFlow.vue Rebuilds monthly flow chart based on app context (extremes boxplots vs mid scatter).
webapp/components/Viz/Hydrograph.vue Switches projected hydrograph data source based on app context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webapp/components/Viz/Hydrograph.vue Outdated
Comment thread webapp/components/Viz/MonthlyFlow.vue Outdated
Comment thread webapp/components/Viz/MonthlyFlow.vue Outdated
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

@cstephen I've opened a new pull request, #130, to work on those changes. Once the pull request is ready, I'll request review from you.

@brucecrevensten brucecrevensten marked this pull request as draft March 27, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants