Skip to content

Commit

Permalink
Avaiable years from API
Browse files Browse the repository at this point in the history
  • Loading branch information
damienallen committed May 25, 2024
1 parent b9e7ad2 commit 7a98265
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/stores.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export class ContoursStore {
public range: RangeSliderValue = [1, 3]
public annualData: AnnualData[] = []

public availableYears: number[] = linspace(2013, 2023, 1)
public year: number = 2023
public selected: FeatureProperties | null = null

Expand Down Expand Up @@ -175,6 +174,10 @@ export class ContoursStore {
this.annualData = value
}

get availableYears() {
return this.annualData?.map((data: AnnualData) => data.year).sort((a, b) => a - b)
}

get thresholds() {
if (this.stats) {
const low = this.stats.mean + this.range[0] * this.stats.st_dev
Expand Down

0 comments on commit 7a98265

Please sign in to comment.