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

Uses the API to determine the maximum year and month that we have data for #108

Merged
merged 7 commits into from
Jan 9, 2025

Conversation

BobTorgerson
Copy link
Contributor

This PR uses a new endpoint on the API that allows for this code to dynamically update its maximum year and month based on the data available within our data server. Currently, that maximum is year = 2024 and month = 6, but the next time we update the sea ice data, it will automatically recognize that there is new data to be displayed and adjust the year slider, month selector, and xrange for the charts accordingly.

To test:

Have this version of the API running locally: ua-snap/data-api#508
export VITE_SNAP_API_URL=http://localhost:5000
export VITE_WMS_URL=https://zeus.snap.uaf.edu/rasdaman/ows
npm run dev

Notice that the year slider has a maximum of 2024 and you can't go past the month of June. The charts should also all display properly given the correct range of values.

Closes #84

Copy link
Member

@brucecrevensten brucecrevensten left a comment

Choose a reason for hiding this comment

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

Wrap min/max year stuff up into the Store

src/shared.js Outdated

export let xrange = []

export async function getMaxYearAndMonth() {
Copy link
Member

Choose a reason for hiding this comment

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

I think this logic all belongs in the Store now because it's doing an async request which is exactly what the shared state / action in Stores is for.

@BobTorgerson BobTorgerson merged commit 3e33bc5 into main Jan 9, 2025
@BobTorgerson BobTorgerson deleted the seaice_max_year_and_month branch January 9, 2025 18:21
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.

Dynamically adjust max availabile data date from Rasdaman metadata
2 participants