-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/awf/cleanup time agg param#212 #231
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ClimateModel } from './climate-model.model'; | ||
import { TimeAggParam } from './time-agg-param.enum'; | ||
|
||
export interface IndicatorQueryParams { | ||
climateModels?: ClimateModel[]; | ||
years?: string[]; | ||
time_aggregation?: TimeAggParam; | ||
agg?: string; | ||
unit?: string; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
import { City } from './city.model'; | ||
import { Indicator } from './indicator.model'; | ||
import { IndicatorQueryParams } from './indicator-query-params.model'; | ||
import { ClimateModel } from './climate-model.model'; | ||
import { Scenario } from './scenario.model'; | ||
|
||
export interface IndicatorQueryOpts { | ||
export interface IndicatorRequestOpts { | ||
indicator: Indicator; | ||
city: City; | ||
scenario: Scenario; | ||
params: { | ||
climateModels?: ClimateModel[]; | ||
years?: string[]; | ||
time_aggregation?: string; | ||
unit?: string; | ||
} | ||
params: IndicatorQueryParams; | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IndicatorQueryParams } from './indicator-query-params.model'; | ||
|
||
export interface ThresholdIndicatorQueryParams extends IndicatorQueryParams { | ||
threshold: Number; | ||
threshold_units: string; | ||
threshold_comparator: string; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
export enum TimeAggParam { | ||
Yearly = 'yearly', | ||
Quarterly = 'quarterly', | ||
Monthly = 'monthly' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ export class ChartService { | |
|
||
private timeOptions = { | ||
'yearly': '%Y', | ||
'daily': '%Y-%m-%d', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should there be a quarterly format added here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, we don't use it but it wouldn't hurt to be thorough There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, can't do this now. It would require additional refactoring. In the quarterly case, we need to convert the keys in the API (e.g. 2010-3) into the start date for a "quarter" which would be July 1, 2010 for 2010-3, and that can't be done with |
||
'monthly': '%Y-%m' | ||
}; | ||
|
||
|
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.
Why is the
data
object removed here? You had asked for it to be added in another PR.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.
I think I had misunderstood what the original problem was based on the comments before, combined with forgetting the details of how
EventEmitter
s work. What's here now is the proper way to return data via event emitters, if you do not need the DOM Event